Skip to content

Commit 57660f8

Browse files
committed
feat: rename credentialType key to registryCredentialsType
1 parent 0fd7b03 commit 57660f8

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/components/dockerRegistry/Docker.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ import {
5353
RegistryIcon,
5454
ComponentSizeType,
5555
PasswordField,
56-
OtherRegistryAuthenticationType,
56+
RegistryCredentialsType,
5757
} from '@devtron-labs/devtron-fe-common-lib'
5858
import Tippy from '@tippyjs/react'
5959
import { useHistory, useParams, useRouteMatch } from 'react-router-dom'
@@ -261,7 +261,7 @@ const CollapsedList = ({
261261
repositoryList = [],
262262
disabledFields = [],
263263
ociRegistryConfig,
264-
credentialsType,
264+
registryCredentialsType,
265265
...rest
266266
}) => {
267267
const [collapsed, toggleCollapse] = useState(true)
@@ -341,7 +341,7 @@ const CollapsedList = ({
341341
isPublic,
342342
disabledFields,
343343
ociRegistryConfig,
344-
credentialsType,
344+
registryCredentialsType,
345345
}}
346346
/>
347347
)}
@@ -381,7 +381,7 @@ const DockerForm = ({
381381
: {
382382
CONTAINER: OCIRegistryConfigConstants.PULL_PUSH,
383383
},
384-
credentialsType: authCredentialsType,
384+
registryCredentialsType,
385385
...rest
386386
}) => {
387387
const re = PATTERNS.APP_NAME
@@ -544,8 +544,8 @@ const DockerForm = ({
544544
const [registryStorageType, setRegistryStorageType] = useState<string>(
545545
isPublic ? RegistryStorageType.OCI_PUBLIC : RegistryStorageType.OCI_PRIVATE,
546546
)
547-
const [authenticationType, setAuthenticationType] = useState<OtherRegistryAuthenticationType>(
548-
id && authCredentialsType ? authCredentialsType : OtherRegistryAuthenticationType.USERNAME_PASSWORD,
547+
const [authenticationType, setAuthenticationType] = useState<RegistryCredentialsType>(
548+
id && registryCredentialsType ? registryCredentialsType : RegistryCredentialsType.USERNAME_PASSWORD,
549549
)
550550

551551
const InitialValueOfIsContainerStore: boolean =
@@ -721,7 +721,7 @@ const DockerForm = ({
721721
}
722722

723723
const handleChangeOtherRegistryAuthType = (e) => {
724-
const updatedAuthType = e.target.value as OtherRegistryAuthenticationType
724+
const updatedAuthType = e.target.value as RegistryCredentialsType
725725
setAuthenticationType(updatedAuthType)
726726
}
727727

@@ -818,7 +818,7 @@ const DockerForm = ({
818818
...(registryStorageType !== RegistryStorageType.OCI_PUBLIC &&
819819
selectedDockerRegistryType.value === RegistryType.OTHER
820820
? {
821-
...(authenticationType === OtherRegistryAuthenticationType.USERNAME_PASSWORD
821+
...(authenticationType === RegistryCredentialsType.USERNAME_PASSWORD
822822
? {
823823
username: trimmedUsername,
824824
password: parsePassword(customState.password.value),
@@ -857,7 +857,7 @@ const DockerForm = ({
857857
sshConnectionType,
858858
),
859859
...(AuthenticationTypeRadio && selectedDockerRegistryType.value === RegistryType.OTHER
860-
? { credentialsType: authenticationType }
860+
? { registryCredentialsType: authenticationType }
861861
: {}),
862862
}
863863
}
@@ -1023,7 +1023,7 @@ const DockerForm = ({
10231023
let error = false
10241024
if (
10251025
registryStorageType === RegistryStorageType.OCI_PRIVATE &&
1026-
authenticationType === OtherRegistryAuthenticationType.USERNAME_PASSWORD &&
1026+
authenticationType === RegistryCredentialsType.USERNAME_PASSWORD &&
10271027
(!customState.username.value || !(customState.password.value || id))
10281028
) {
10291029
setCustomState((st) => ({
@@ -1629,7 +1629,7 @@ const DockerForm = ({
16291629

16301630
const isUserNamePasswordRequired =
16311631
selectedDockerRegistryType.value === RegistryType.OTHER
1632-
? authenticationType === OtherRegistryAuthenticationType.USERNAME_PASSWORD
1632+
? authenticationType === RegistryCredentialsType.USERNAME_PASSWORD
16331633
: true
16341634

16351635
return (

src/config/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
ToastManager,
2222
ROUTES as COMMON_ROUTES,
2323
EnvResourceType,
24-
OtherRegistryAuthenticationType,
24+
RegistryCredentialsType,
2525
} from '@devtron-labs/devtron-fe-common-lib'
2626
export const DEFAULT_STATUS = 'checking'
2727
export const DEFAULT_STATUS_TEXT = 'Checking Status'
@@ -544,7 +544,7 @@ export interface RegistryPayloadType {
544544
sshAuthKey: string
545545
}
546546
}
547-
credentialsType?: OtherRegistryAuthenticationType
547+
registryCredentialsType?: RegistryCredentialsType
548548
}
549549

550550
export interface RegistryPayloadWithSelectType extends RegistryPayloadType, SelectPickerOptionType {}

0 commit comments

Comments
 (0)