fix: bug fixes (#1000)

* sort by groups first

* add scroll area

* fix group members pagination

* move pagination to the right
This commit is contained in:
Philip Okugbe
2025-04-08 13:34:00 +01:00
committed by GitHub
parent 651e5f6153
commit 1eaba6e77f
5 changed files with 99 additions and 90 deletions

View File

@ -21,7 +21,7 @@ export default function Paginate({
}
return (
<Group mt="md">
<Group mt="md" justify="flex-end">
<Button
variant="default"
size="compact-sm"

View File

@ -33,7 +33,7 @@ export async function getGroupMembers(
groupId: string,
params?: QueryParams,
): Promise<IPagination<IUser>> {
const req = await api.post("/groups/members", { groupId, params });
const req = await api.post("/groups/members", { groupId, ...params });
return req.data;
}

View File

@ -1,4 +1,11 @@
import { Group, Table, Text, Menu, ActionIcon } from "@mantine/core";
import {
Group,
Table,
Text,
Menu,
ActionIcon,
ScrollArea,
} from "@mantine/core";
import React from "react";
import { IconDots } from "@tabler/icons-react";
import { modals } from "@mantine/modals";
@ -106,6 +113,7 @@ export default function SpaceMembersList({
return (
<>
<SearchInput onSearch={handleSearch} />
<ScrollArea h={400}>
<Table.ScrollContainer minWidth={500}>
<Table highlightOnHover verticalSpacing={8}>
<Table.Thead>
@ -193,6 +201,7 @@ export default function SpaceMembersList({
</Table.Tbody>
</Table>
</Table.ScrollContainer>
</ScrollArea>
{data?.items.length > 0 && (
<Paginate

View File

@ -17,7 +17,6 @@ import Paginate from "@/components/common/paginate.tsx";
import { SearchInput } from "@/components/common/search-input.tsx";
import NoTableResults from "@/components/common/no-table-results.tsx";
import { usePaginateAndSearch } from "@/hooks/use-paginate-and-search.tsx";
import InviteActionMenu from "@/features/workspace/components/members/components/invite-action-menu.tsx";
import MemberActionMenu from "@/features/workspace/components/members/components/members-action-menu.tsx";
export default function WorkspaceMembersTable() {

View File

@ -114,6 +114,7 @@ export class SpaceMemberRepo {
])
.select((eb) => this.groupRepo.withMemberCount(eb))
.where('spaceId', '=', spaceId)
.orderBy((eb) => eb('groups.id', 'is not', null), 'desc')
.orderBy('spaceMembers.createdAt', 'asc');
if (pagination.query) {