-
Notifications
You must be signed in to change notification settings - Fork 75
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
feat: support code lists search in library #14319
Conversation
a136a1d
to
94eabc8
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #14319 +/- ##
=======================================
Coverage 95.66% 95.66%
=======================================
Files 1887 1886 -1
Lines 24537 24549 +12
Branches 2818 2818
=======================================
+ Hits 23473 23485 +12
Misses 804 804
Partials 260 260 ☔ View full report in Codecov by Sentry. |
34d248a
to
ea39100
Compare
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.
Fin og konsentrert PR, men jeg har noen spørsmål til valgene du har tatt i koden, spesielt rundt bruken av regulære uttrykk.
Videre lurer jeg på om du har vurdert å gradere resultatene etter hvor godt de matcher søkeordet, i stedet for å bare filtrere ut alt som ikke matcher eksakt? Som bruker ville jeg i hvert fall opplevd det som en feil dersom jeg søkte etter "biler motorsykler" og listen med navnet "biler_og_motorsykler" ikke dukket opp. Samtidig, hvis jeg søkte etter bare "motorsykler", ville jeg forventet at listen med navnet "motorsykler" kom foran "biler_og_motorsykler" i resultatlisten. Jeg sier ikke at dette er ting vi må løse i denne PR-en, men det er i hvert fall noe vi bør tenke på når vi starter å implementere søk.
En komplett søkefunksjon kan altså bli ganske omfattende, men det finnes eksterne biblioteker vi kan bruke for å spare oss for arbeid. (Jeg har faktisk laget et selv, men det er ikke akkurat etablert eller mye brukt, så det strider mot våre egne prinsipper å ta det i bruk.)
...bs/studio-content-library/src/ContentLibrary/LibraryBody/pages/CodeListPage/CodeListPage.tsx
Outdated
Show resolved
Hide resolved
...bs/studio-content-library/src/ContentLibrary/LibraryBody/pages/CodeListPage/CodeListPage.tsx
Outdated
Show resolved
Hide resolved
...bs/studio-content-library/src/ContentLibrary/LibraryBody/pages/CodeListPage/CodeListPage.tsx
Outdated
Show resolved
Hide resolved
...bs/studio-content-library/src/ContentLibrary/LibraryBody/pages/CodeListPage/CodeListPage.tsx
Outdated
Show resolved
Hide resolved
...rc/ContentLibrary/LibraryBody/pages/CodeListPage/CodeListsActionsBar/CodeListsActionsBar.tsx
Outdated
Show resolved
Hide resolved
Veldig gode poenger. Har ikke tenkt på at det. Men samtidig vet jeg ikke om jeg hadde forventet det av et søkefelt i en applikasjon som ikke er en søkemotor, men hadde absolutt blitt glad om det funket. Tenker jo kanskje uansett at det er fordelaktig for de som har et par kodelister, at det er mulig å gjøre enkle søk fremfor ingen søk 🤷 |
Hvis man bare har et par kodelister, er det vel ikke nødvendig å søke? Dette er vel funksjonalitet som først og fremst er aktuell for brukere med mange kodelister? |
Ja, det var dårlig ordlegging av meg, mente ikke "et par" som et faktisk par, men mange. |
Enig med dere her! dette blir jo som sagt mest relevant om man har mange kodelister, og da vil nok et enkelt søk hjelpe masse i første omgang! |
ea39100
to
b72641b
Compare
Warning Rate limit exceeded@standeren has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 1 minutes and 7 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis pull request introduces a new search functionality for the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
...bs/studio-content-library/src/ContentLibrary/LibraryBody/pages/CodeListPage/CodeListPage.tsx
Outdated
Show resolved
Hide resolved
...rc/ContentLibrary/LibraryBody/pages/CodeListPage/CodeListsActionsBar/CodeListsActionsBar.tsx
Outdated
Show resolved
Hide resolved
...rc/ContentLibrary/LibraryBody/pages/CodeListPage/CodeListsActionsBar/CodeListsActionsBar.tsx
Outdated
Show resolved
Hide resolved
...nt-library/src/ContentLibrary/LibraryBody/pages/CodeListPage/utils/codeListPageUtils.test.ts
Outdated
Show resolved
Hide resolved
...content-library/src/ContentLibrary/LibraryBody/pages/CodeListPage/utils/codeListPageUtils.ts
Outdated
Show resolved
Hide resolved
...libs/studio-content-library/src/ContentLibrary/LibraryBody/pages/CodeListPage/utils/index.ts
Outdated
Show resolved
Hide resolved
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.
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.
Godt poeng!
Ser at Designsystemet ikke sier så mye om det, så vi kan godt beholde det.
Description
Add functionality to search for code lists in library. The filter method iterates over the verbose codeList object (which also contains the actual code lists) due to enable automatic update of the search result if changing the id of a code list. This is also the reason for needing to keep the search pattern in a state; to be able to use the original search pattern on the new code lists object.
The search is case-insensitive
Skjermopptak.2024-12-19.kl.15.31.26.mov
Related Issue(s)
Verification
Summary by CodeRabbit
New Features
Documentation
Tests