Skip to content

Commit

Permalink
fix: use id as a key of Image
Browse files Browse the repository at this point in the history
  • Loading branch information
yomybaby committed Sep 11, 2024
1 parent 9d0dd72 commit 2023cd5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions react/src/components/ImageEnvironmentSelectFormItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ const ImageEnvironmentSelectFormItems: React.FC<
graphql`
query ImageEnvironmentSelectFormItemsQuery($installed: Boolean) {
images(is_installed: $installed) {
id
name
humanized_name
tag
Expand Down Expand Up @@ -562,7 +563,7 @@ const ImageEnvironmentSelectFormItems: React.FC<
}
>
{_.map(
_.uniqBy(selectedEnvironmentGroup?.images, 'digest'),
_.uniqBy(selectedEnvironmentGroup?.images, 'id'),

(image) => {
const [version, tag, ...requirements] = image?.tag?.split(
Expand Down Expand Up @@ -658,7 +659,7 @@ const ImageEnvironmentSelectFormItems: React.FC<
}
return (
<Select.Option
key={image?.digest}
key={image?.id}
value={getImageFullName(image)}
filterValue={[
version,
Expand Down
1 change: 1 addition & 0 deletions react/src/components/ResourceAllocationFormItems.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ describe('getAllocatablePresetNames', () => {
};

const image_has_cuda_shares_min1_max1: Image = {
id: 'id1',
name: 'image1',
digest: 'digest1',
architecture: 'arm64',
Expand Down

0 comments on commit 2023cd5

Please sign in to comment.