feat: apply full width automatically for DataTable (#18357)
* feat: apply full width automatically for DataTable * change implementation * load all columns of insights routing table at the same time * update team member list * sticky columns for >= sm * fix type error --------- Co-authored-by: Udit Takkar <[email protected]>
This commit is contained in:
1 parent
c10c87c98e
commit
c415b2d7f5
11 files changed
+230
-64
No files matched your search
@@ -118,7 +118,7 @@ function UserListTableContent() {
|
||||
const { data: session } = useSession();
|
||||
const { isPlatformUser } = useGetUserAttributes();
|
||||
const { data: org } = trpc.viewer.organizations.listCurrent.useQuery();
|
||||
const { data: attributes } = trpc.viewer.attributes.list.useQuery();
|
||||
const { data: attributes, isSuccess: isSuccessAttributes } = trpc.viewer.attributes.list.useQuery();
|
||||
const { data: teams } = trpc.viewer.organizations.getTeams.useQuery();
|
||||
const { data: facetedTeamValues } = trpc.viewer.organizations.getFacetedValues.useQuery();
|
||||
|
||||
@@ -163,7 +163,6 @@ function UserListTableContent() {
|
||||
|
||||
//we must flatten the array of arrays from the useInfiniteQuery hook
|
||||
const flatData = useMemo(() => data?.pages?.flatMap((page) => page.rows) ?? [], [data]) as UserTableUser[];
|
||||
const totalFetched = flatData.length;
|
||||
|
||||
const memorisedColumns = useMemo(() => {
|
||||
const permissions = {
|
||||
@@ -543,6 +542,11 @@ function UserListTableContent() {
|
||||
}
|
||||
};
|
||||
|
||||
if (!isSuccessAttributes) {
|
||||
// do not render the table until the attributes are fetched
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<DataTable
|
||||
|
||||
Reference in new issue
Block a user