-
Notifications
You must be signed in to change notification settings - Fork 2
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(18222): Show layers starting with key words at the top in mcda dropdown #756
feat(18222): Show layers starting with key words at the top in mcda dropdown #756
Conversation
WalkthroughThe recent updates focus on enhancing the sorting logic within the Changes
Sequence Diagram(s) (Beta)sequenceDiagram
participant User
participant MCDAForm
participant SortingUtils
User->>MCDAForm: Enter search term
MCDAForm->>SortingUtils: Call sortByWordOccurence
SortingUtils-->>MCDAForm: Return sorted results
MCDAForm-->>User: Display sorted search results
Poem
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
|
Bundle size diff
|
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.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Files ignored due to path filters (2)
pnpm-lock.yaml
is excluded by!pnpm-lock.yaml
src/features/mcda/components/MCDAForm/utils/__snapshots__/sorting.test.ts.snap
is excluded by!**/*.snap
,!**/*.snap
Files selected for processing (4)
- package.json (1 hunks)
- src/features/mcda/components/MCDAForm/index.tsx (4 hunks)
- src/features/mcda/components/MCDAForm/utils/sorting.test.ts (1 hunks)
- src/features/mcda/components/MCDAForm/utils/sorting.tsx (1 hunks)
Additional comments not posted (5)
src/features/mcda/components/MCDAForm/utils/sorting.tsx (1)
3-7
: The implementation ofsortByAlphabet
looks correct and efficient for case-insensitive alphabetical sorting.src/features/mcda/components/MCDAForm/utils/sorting.test.ts (2)
5-17
: The test suite forsortByWordOccurence
is well-constructed and effectively checks the functionality using snapshots.
19-31
: The test suite forsortByAlphabet
correctly verifies the alphabetical sorting functionality using snapshots.src/features/mcda/components/MCDAForm/index.tsx (1)
16-16
: The integration ofsortByAlphabet
andsortByWordOccurence
within theMCDAForm
component is correctly implemented. ThesortSearchResults
function effectively combines these methods based on the search input.Also applies to: 96-122
package.json (1)
89-89
: The update of@konturio/ui-kit
from5.1.12
to5.2.0
is noted and appears appropriate as a minor version increment.
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Files ignored due to path filters (1)
src/utils/common/__snapshots__/sorting.test.ts.snap
is excluded by!**/*.snap
,!**/*.snap
Files selected for processing (3)
- src/features/mcda/components/MCDAForm/index.tsx (4 hunks)
- src/utils/common/sorting.test.ts (1 hunks)
- src/utils/common/sorting.ts (2 hunks)
Additional comments not posted (5)
src/utils/common/sorting.test.ts (2)
5-17
: The test suite forsortByWordOccurence
is well-structured and effectively checks the functionality of sorting based on word occurrence.
19-31
: The test suite forsortByAlphabet
is correctly implemented and ensures that items are sorted alphabetically, ignoring case.src/utils/common/sorting.ts (2)
14-21
: The implementation ofsortByAlphabet
useslocaleCompare
effectively for case-insensitive alphabetical sorting.
23-42
: The implementation ofsortByWordOccurence
is robust, using regular expressions to ensure that the word occurs at a word boundary and handling cases where the word is not found.src/features/mcda/components/MCDAForm/index.tsx (1)
Line range hint
13-107
: The integration ofsortByAlphabet
andsortByWordOccurence
functions in theMCDAForm
component is done correctly. ThesortDropdownItems
function is well-implemented, using the sorting functions based on the context (search term presence).
…ropdown (#756) * feat(18222): add sorting functions for MCDAForm dropdown * ui-kit -> v5.2.0 * feat(18222): sort Multiselect items by search value * chore: rename sortSearchResults -> sortDropdownItems * chore: moved sortByAlphabet and sortByWordOccurence to utils/common * chore(18222): refactor sortByAlphabet and sortByWordOccurence to work with generic type * fix(18222): fix alphabetic sorting
https://kontur.fibery.io/Tasks/Task/Show-layers-starting-with-key-words-at-the-top-in-MCDA-dropdown-18222
Summary by CodeRabbit
New Features
Refactor
Tests
Chores
@konturio/ui-kit
version from5.1.12
to5.2.0
.