Skip to content

Commit

Permalink
fix: update isCreateView logic to use isNullOrUndefined for better cl…
Browse files Browse the repository at this point in the history
…arity
  • Loading branch information
AbhishekA1509 committed Jan 30, 2025
1 parent 679dbba commit 7f3a3c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import {
FloatingVariablesSuggestions,
UseFormErrorHandler,
UseFormSubmitHandler,
isNullOrUndefined,
} from '@devtron-labs/devtron-fe-common-lib'

import { URLS } from '@Config/routes'
Expand Down Expand Up @@ -854,7 +855,7 @@ export const ConfigMapSecretContainer = ({
/>
) : (
<ConfigMapSecretForm
isCreateView={!id}
isCreateView={isNullOrUndefined(id)}
cmSecretStateLabel={cmSecretStateLabel}
componentType={componentType}
configMapSecretData={configMapSecretData}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
getConfigMapSecretPayload,
getConfigMapSecretReadOnlyValues,
ConfigMapSecretReadyOnly,
isNullOrUndefined,
} from '@devtron-labs/devtron-fe-common-lib'

import { CompareConfigView, CompareConfigViewProps, NoPublishedVersionEmptyState } from '@Pages/Applications'
Expand Down Expand Up @@ -227,7 +228,7 @@ export const ConfigMapSecretProtected = ({
<ConfigMapSecretForm
configMapSecretData={configMapSecretData}
inheritedConfigMapSecretData={inheritedConfigMapSecretData}
isCreateView={!id}
isCreateView={isNullOrUndefined(id)}
componentType={componentType}
cmSecretStateLabel={
selectedProtectionViewTab === ProtectConfigTabsType.EDIT_DRAFT &&
Expand Down

0 comments on commit 7f3a3c2

Please sign in to comment.