-
Notifications
You must be signed in to change notification settings - Fork 45
feat(DataMapper): Search in function list #2449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2449 +/- ##
==========================================
+ Coverage 81.96% 82.17% +0.20%
==========================================
Files 471 474 +3
Lines 15067 15205 +138
Branches 3335 3363 +28
==========================================
+ Hits 12350 12494 +144
+ Misses 2715 2544 -171
- Partials 2 167 +165 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| const searchInputRef = useRef<HTMLInputElement>(null); | ||
| const [searchValue, setSearchValue] = useState(''); | ||
| const focusOnSearchInput = useCallback(() => { | ||
| searchInputRef.current?.focus(); | ||
| }, []); | ||
| const handleOnSearchChange = useCallback((_event: unknown, value: string) => { | ||
| setSearchValue(value); | ||
| }, []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you see similarities with the Catalog search? I wonder if we could have a custom hook to handle search so we have this logic only once 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked and it doesn't seem like there are too many similarities in the way the search is handled in these two cases for the creation of custom hook to be of interest.
| ) | ||
| .map((func, index) => ( | ||
| <DraggableContainer | ||
| key={index} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please let's avoid using index if possible, I think it would be better to use the value + func.name as the key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, updated.
| label={value} | ||
| hidden={ | ||
| !functionDefinitions[value as FunctionGroup].some((func) => | ||
| func.displayName.toLocaleLowerCase().includes(searchValue.toLocaleLowerCase()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we transform the searchValue to lowercase once and then use it? This way we would save some work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the hint, updated.
|
fixes #1800
vokoscreenNG-2025-08-14_13-57-32.mp4