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
Server Sorting: Sort servers from A-Z or Z-A. #4951
base: develop
Are you sure you want to change the base?
Conversation
Be able to sort servers from A-Z or Z-A which makes navigating servers easier.
IF this is a PR for the current releases then it is the wrong branch develop is v2, 1.0-develop are the current releases |
@@ -13,20 +13,43 @@ import useSWR from 'swr'; | |||
import { PaginatedResult } from '@/api/http'; | |||
import Pagination from '@/components/elements/Pagination'; | |||
import { useLocation } from 'react-router-dom'; | |||
import Select from '../elements/Select'; |
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.
You should be using proper paths, e.g.
import Select from '@/components/elements/Select';
const uuid = useStoreState(state => state.user.data!.uuid); | ||
const rootAdmin = useStoreState(state => state.user.data!.rootAdmin); | ||
const uuid = useStoreState((state) => state.user.data!.uuid); | ||
const rootAdmin = useStoreState((state) => state.user.data!.rootAdmin); |
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.
Should be reverted I believe, just use prettier
/> | ||
<div css={tw`mx-3`}> |
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.
Shouldn't it be ml-3
? How does it currently look?
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.
Looks fine.
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.
Need a screenshot. Because the switch doesn't have a margin right (without your PR) and you added it to your element
|
That's what I wanted to say, but the PR is for sorting servers, not files |
Ah, that's my bad. Then nevermind my comment. |
Isn't sorting server-side? |
There's no sorting in the server list. Well there is, just that it is hardcoded |
Althougjh I don't really like to have this. The current order system will be just messed up |
No, I mean that most sorting in the api is done via query parameters and done serverside. this code would need to add sorting options to do this correctly. Notice here in the application side. This is how sorting is handled, and any pr that adds new sorting options should do the same, or else you will end up with local sorts, which will miss items on the next pages that should now be front and center. |
Is this mergable? Or it needs improvements |
No. As I said, sorting is supposed to be server-side. Refer to my previous comment |
Be able to sort servers from A-Z or Z-A which makes navigating servers easier.