-
-
Notifications
You must be signed in to change notification settings - Fork 826
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Implemented orglist sorting functionality (#1076)
* feat: Implemented orglist sorting functionality Changes Made: - Added a new state variable, `sortingOption`, to manage the current sorting preference. Default is set to 'latest'. - Introduced a sorting mechanism using the `sortOrgs` function that sorts organizations based on creation date. - Updated the `useEffect` hook to apply sorting when either `orgsData` or `sortingOption` changes. - Added two sorting options - latest first and oldest first - Also added the relevant tests for the correct functionality of the changes. Fixes issue #1072 Signed-off-by: Akhilender <akhilenderb9@gmail.com> * fix: Removed redundancy - Removed the new interface instead imported the existing interface. - Added cleanup function in tests. Signed-off-by: Akhilender <akhilenderb9@gmail.com> * fix: Highlighted the selected option - Ensured that the selected option is highlighted in the sort dropdown. - Made changes to ensure proper translation. - Changed the variant from "outline success" to "success" when the option is selected, making it feasible for the user to know that the option is applied. Signed-off-by: Akhilender <akhilenderb9@gmail.com> * Removed redundant code - Removed extra state variable and combined the two state variables into one as they perform same functionality. Signed-off-by: Akhilender <akhilenderb9@gmail.com> * fixed the failing test Signed-off-by: Akhilender <akhilenderb9@gmail.com> * Update en.json - Changed the sort option titles - Latest first to Latest - Oldest first to Earliest * fix: Translations modified - Ensured correct translations for oldest first to earliest and latest first to latest in all languages Signed-off-by: Akhilender <akhilenderb9@gmail.com> * fixed the failing test Signed-off-by: Akhilender <akhilenderb9@gmail.com> * feat: Implement server-side sorting for organizations Instead of handling sorting on the client side the GraphQL query for fetching organizations (`ORGANIZATION_CONNECTION_LIST`) has been enhanced to support ordering based on the `createdAt` field. - Modified the GraphQL query in `ORGANIZATION_CONNECTION_LIST` to include the `orderBy` parameter. - Updated the `handleSorting` function to trigger a server-side refetch with the appropriate sorting order. - Removed the client-side sorting logic in the `sortOrgs` function, as sorting is now handled on the server. - Corrected the graphql schema for OrganizationOrderByInput enum Signed-off-by: Akhilender <akhilenderb9@gmail.com> * Fix: fixed the failing test Signed-off-by: Akhilender <akhilenderb9@gmail.com> * fix: Changed oldest to earliest - Altered the oldest key to earliest to avoid confusion Signed-off-by: Akhilender <akhilenderb9@gmail.com> --------- Signed-off-by: Akhilender <akhilenderb9@gmail.com>
- Loading branch information
1 parent
767a673
commit bf8d298
Showing
10 changed files
with
114 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters