Skip to content

Commit 0eebfe3

Browse files
committed
chores: icon added in container registry dropdown
1 parent d751fa4 commit 0eebfe3

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

src/Common/Constants.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17+
import { getContainerRegistryIcon } from './Helper'
1718
import { RegistryTypeDetailType } from './Types'
1819

1920
export const FALLBACK_REQUEST_TIMEOUT = 60000
@@ -207,6 +208,7 @@ export const REGISTRY_TYPE_MAP: Record<string, RegistryTypeDetailType> = {
207208
defaultValue: '',
208209
placeholder: '',
209210
},
211+
startIcon: getContainerRegistryIcon('ecr'),
210212
},
211213
'docker-hub': {
212214
value: 'docker-hub',
@@ -230,6 +232,7 @@ export const REGISTRY_TYPE_MAP: Record<string, RegistryTypeDetailType> = {
230232
defaultValue: '',
231233
placeholder: '',
232234
},
235+
startIcon: getContainerRegistryIcon('docker-hub'),
233236
},
234237
acr: {
235238
value: 'acr',
@@ -254,6 +257,7 @@ export const REGISTRY_TYPE_MAP: Record<string, RegistryTypeDetailType> = {
254257
defaultValue: '',
255258
placeholder: '',
256259
},
260+
startIcon: getContainerRegistryIcon('acr'),
257261
},
258262
'artifact-registry': {
259263
value: 'artifact-registry',
@@ -277,6 +281,7 @@ export const REGISTRY_TYPE_MAP: Record<string, RegistryTypeDetailType> = {
277281
defaultValue: '',
278282
placeholder: 'Paste json file content here',
279283
},
284+
startIcon: getContainerRegistryIcon('artifact-registry'),
280285
},
281286
gcr: {
282287
value: 'gcr',
@@ -300,6 +305,7 @@ export const REGISTRY_TYPE_MAP: Record<string, RegistryTypeDetailType> = {
300305
defaultValue: '',
301306
placeholder: 'Paste json file content here',
302307
},
308+
startIcon: getContainerRegistryIcon('gcr'),
303309
},
304310
quay: {
305311
value: 'quay',
@@ -323,6 +329,7 @@ export const REGISTRY_TYPE_MAP: Record<string, RegistryTypeDetailType> = {
323329
defaultValue: '',
324330
placeholder: '',
325331
},
332+
startIcon: getContainerRegistryIcon('quay'),
326333
},
327334
other: {
328335
value: 'other',
@@ -346,6 +353,7 @@ export const REGISTRY_TYPE_MAP: Record<string, RegistryTypeDetailType> = {
346353
defaultValue: '',
347354
placeholder: '',
348355
},
356+
startIcon: getContainerRegistryIcon('other'),
349357
},
350358
}
351359

src/Common/Helper.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,3 +1045,7 @@ export function asyncWrap(promise): any[] {
10451045
}
10461046

10471047
export const prefixZeroIfSingleDigit = (value: number = 0) => (value > 0 && value < 10 ? `0${value}` : value)
1048+
1049+
export const getContainerRegistryIcon = (registryValue: string) => (
1050+
<div className={`dc__registry-icon dc__git-logo mr-5 ${registryValue}`} />
1051+
)

src/Common/Types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import React, { ReactNode, CSSProperties } from 'react'
17+
import React, { ReactNode, CSSProperties, ReactElement } from 'react'
1818
import { Placement } from 'tippy.js'
1919
import { ImageComment, ReleaseTag } from './ImageTags.Types'
2020
import { ACTION_STATE, DEPLOYMENT_WINDOW_TYPE, DockerConfigOverrideType, SortingOrder, TaskErrorObj } from '.'
@@ -725,6 +725,7 @@ export interface RegistryTypeDetailType {
725725
registryURL: InputDetailType
726726
id: InputDetailType
727727
password: InputDetailType
728+
startIcon: ReactElement
728729
}
729730

730731
export interface UseSearchString {

src/Shared/Components/BulkSelection/BulkSelectionProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const BulkSelectionContext = createContext<UseBulkSelectionReturnType<any>>({
3737
selectedIdentifiers: {},
3838
handleBulkSelection: noop,
3939
isChecked: false,
40-
checkboxValue: CHECKBOX_VALUE.CHECKED,
40+
checkboxValue: CHECKBOX_VALUE?.CHECKED,
4141
isBulkSelectionApplied: false,
4242
getSelectedIdentifiersCount: noop,
4343
})

0 commit comments

Comments
 (0)