Skip to content

Commit

Permalink
feat: search image with full name in Environment page (#2744)
Browse files Browse the repository at this point in the history
**Changes:**

This PR enhances the image filtering functionality in the ImageList component:

1. Adds a `fullName` property to the image data object, populated with the result of `getImageFullName(image)`.
2. Extends the filtering logic to include a `fullNameMatch` check, allowing users to search for images based on their full names.

**Rationale:**

Including the full name in the search criteria provides users with more flexibility when filtering images, improving the overall user experience and making it easier to find specific images.

**Effects:**

- Users can now search for images using their full names, in addition to existing criteria.
- Developers working on the ImageList component should be aware of the new `fullName` property and its inclusion in the filtering logic.

**Checklist:**

- [ ] Documentation: Update user guide to reflect new search capabilities
- [ ] Test case: Verify that searching by full image name returns expected results
  • Loading branch information
agatha197 committed Oct 11, 2024
1 parent a3a8ce3 commit 608d821
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion react/src/components/ImageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ const ImageList: React.FC<{ style?: React.CSSProperties }> = ({ style }) => {
isCustomized: image?.tag
? image.tag.indexOf('customized') !== -1
: false,
fullName: getImageFullName(image) || '',
};
});
// eslint-disable-next-line react-hooks/exhaustive-deps
Expand Down Expand Up @@ -378,13 +379,15 @@ const ImageList: React.FC<{ style?: React.CSSProperties }> = ({ style }) => {
: false;
const langMatch = regExp.test(curFilterValues.lang);
const namespaceMatch = regExp.test(curFilterValues.namespace);
const fullNameMatch = regExp.test(curFilterValues.fullName);
return (
baseVersionMatch ||
baseImagesMatch ||
constraintsMatch ||
langMatch ||
namespaceMatch ||
customizedMatch
customizedMatch ||
fullNameMatch
);
});
});
Expand Down

0 comments on commit 608d821

Please sign in to comment.