mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 07:26:45 +00:00
Review fixes
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
const TABLE_PREFERENCES_KEY = "userTablePreferences";
|
const TABLE_PREFERENCES_KEY = "userTablePreferences";
|
||||||
|
|
||||||
|
export enum PreferenceKey {
|
||||||
|
PerPage = "perPage"
|
||||||
|
}
|
||||||
|
|
||||||
interface TableSpecificPreferences {
|
interface TableSpecificPreferences {
|
||||||
[preferenceKey: string]: any;
|
[preferenceKey: string]: any;
|
||||||
}
|
}
|
||||||
@@ -33,7 +37,7 @@ const saveAllTablePreferences = (preferences: UserTablePreferences): void => {
|
|||||||
// Retrieves a specific preference for a given table
|
// Retrieves a specific preference for a given table
|
||||||
export const getUserTablePreference = <T>(
|
export const getUserTablePreference = <T>(
|
||||||
tableName: string,
|
tableName: string,
|
||||||
preferenceKey: string,
|
preferenceKey: PreferenceKey,
|
||||||
defaultValue: T
|
defaultValue: T
|
||||||
): T => {
|
): T => {
|
||||||
const preferences = getAllTablePreferences();
|
const preferences = getAllTablePreferences();
|
||||||
@@ -55,7 +59,7 @@ export const getUserTablePreference = <T>(
|
|||||||
// Sets a specific preference for a given table and saves it to localStorage
|
// Sets a specific preference for a given table and saves it to localStorage
|
||||||
export const setUserTablePreference = (
|
export const setUserTablePreference = (
|
||||||
tableName: string,
|
tableName: string,
|
||||||
preferenceKey: string,
|
preferenceKey: PreferenceKey,
|
||||||
value: any
|
value: any
|
||||||
): void => {
|
): void => {
|
||||||
const preferences = getAllTablePreferences();
|
const preferences = getAllTablePreferences();
|
||||||
|
|||||||
@@ -43,7 +43,11 @@ import {
|
|||||||
useSubscription,
|
useSubscription,
|
||||||
useWorkspace
|
useWorkspace
|
||||||
} from "@app/context";
|
} from "@app/context";
|
||||||
import { getUserTablePreference, setUserTablePreference } from "@app/helpers/userTablePreferences";
|
import {
|
||||||
|
getUserTablePreference,
|
||||||
|
PreferenceKey,
|
||||||
|
setUserTablePreference
|
||||||
|
} from "@app/helpers/userTablePreferences";
|
||||||
import { usePagination, usePopUp, useResetPageHelper } from "@app/hooks";
|
import { usePagination, usePopUp, useResetPageHelper } from "@app/hooks";
|
||||||
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
||||||
import { useGetKmipClientsByProjectId } from "@app/hooks/api/kmip";
|
import { useGetKmipClientsByProjectId } from "@app/hooks/api/kmip";
|
||||||
@@ -73,12 +77,12 @@ export const KmipClientTable = () => {
|
|||||||
page,
|
page,
|
||||||
setPerPage
|
setPerPage
|
||||||
} = usePagination(KmipClientOrderBy.Name, {
|
} = usePagination(KmipClientOrderBy.Name, {
|
||||||
initPerPage: getUserTablePreference("kmipClientTable", "perPage", 20)
|
initPerPage: getUserTablePreference("kmipClientTable", PreferenceKey.PerPage, 20)
|
||||||
});
|
});
|
||||||
|
|
||||||
const handlePerPageChange = (newPerPage: number) => {
|
const handlePerPageChange = (newPerPage: number) => {
|
||||||
setPerPage(newPerPage);
|
setPerPage(newPerPage);
|
||||||
setUserTablePreference("kmipClientTable", "perPage", newPerPage);
|
setUserTablePreference("kmipClientTable", PreferenceKey.PerPage, newPerPage);
|
||||||
};
|
};
|
||||||
|
|
||||||
const { data, isPending, isFetching } = useGetKmipClientsByProjectId({
|
const { data, isPending, isFetching } = useGetKmipClientsByProjectId({
|
||||||
|
|||||||
@@ -53,7 +53,11 @@ import {
|
|||||||
useWorkspace
|
useWorkspace
|
||||||
} from "@app/context";
|
} from "@app/context";
|
||||||
import { kmsKeyUsageOptions } from "@app/helpers/kms";
|
import { kmsKeyUsageOptions } from "@app/helpers/kms";
|
||||||
import { getUserTablePreference, setUserTablePreference } from "@app/helpers/userTablePreferences";
|
import {
|
||||||
|
getUserTablePreference,
|
||||||
|
PreferenceKey,
|
||||||
|
setUserTablePreference
|
||||||
|
} from "@app/helpers/userTablePreferences";
|
||||||
import { usePagination, usePopUp, useResetPageHelper, useTimedReset } from "@app/hooks";
|
import { usePagination, usePopUp, useResetPageHelper, useTimedReset } from "@app/hooks";
|
||||||
import { useGetCmeksByProjectId, useUpdateCmek } from "@app/hooks/api/cmeks";
|
import { useGetCmeksByProjectId, useUpdateCmek } from "@app/hooks/api/cmeks";
|
||||||
import { CmekOrderBy, KmsKeyUsage, TCmek } from "@app/hooks/api/cmeks/types";
|
import { CmekOrderBy, KmsKeyUsage, TCmek } from "@app/hooks/api/cmeks/types";
|
||||||
@@ -102,12 +106,12 @@ export const CmekTable = () => {
|
|||||||
page,
|
page,
|
||||||
setPerPage
|
setPerPage
|
||||||
} = usePagination(CmekOrderBy.Name, {
|
} = usePagination(CmekOrderBy.Name, {
|
||||||
initPerPage: getUserTablePreference("cmekClientTable", "perPage", 20)
|
initPerPage: getUserTablePreference("cmekClientTable", PreferenceKey.PerPage, 20)
|
||||||
});
|
});
|
||||||
|
|
||||||
const handlePerPageChange = (newPerPage: number) => {
|
const handlePerPageChange = (newPerPage: number) => {
|
||||||
setPerPage(newPerPage);
|
setPerPage(newPerPage);
|
||||||
setUserTablePreference("cmekClientTable", "perPage", newPerPage);
|
setUserTablePreference("cmekClientTable", PreferenceKey.PerPage, newPerPage);
|
||||||
};
|
};
|
||||||
|
|
||||||
const { data, isPending, isFetching } = useGetCmeksByProjectId({
|
const { data, isPending, isFetching } = useGetCmeksByProjectId({
|
||||||
|
|||||||
+7
-3
@@ -34,7 +34,11 @@ import {
|
|||||||
Tr
|
Tr
|
||||||
} from "@app/components/v2";
|
} from "@app/components/v2";
|
||||||
import { OrgPermissionGroupActions, OrgPermissionSubjects, useOrganization } from "@app/context";
|
import { OrgPermissionGroupActions, OrgPermissionSubjects, useOrganization } from "@app/context";
|
||||||
import { getUserTablePreference, setUserTablePreference } from "@app/helpers/userTablePreferences";
|
import {
|
||||||
|
getUserTablePreference,
|
||||||
|
PreferenceKey,
|
||||||
|
setUserTablePreference
|
||||||
|
} from "@app/helpers/userTablePreferences";
|
||||||
import { usePagination, useResetPageHelper } from "@app/hooks";
|
import { usePagination, useResetPageHelper } from "@app/hooks";
|
||||||
import { useGetOrganizationGroups, useGetOrgRoles, useUpdateGroup } from "@app/hooks/api";
|
import { useGetOrganizationGroups, useGetOrgRoles, useUpdateGroup } from "@app/hooks/api";
|
||||||
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
||||||
@@ -105,12 +109,12 @@ export const OrgGroupsTable = ({ handlePopUpOpen }: Props) => {
|
|||||||
setOrderDirection,
|
setOrderDirection,
|
||||||
toggleOrderDirection
|
toggleOrderDirection
|
||||||
} = usePagination<GroupsOrderBy>(GroupsOrderBy.Name, {
|
} = usePagination<GroupsOrderBy>(GroupsOrderBy.Name, {
|
||||||
initPerPage: getUserTablePreference("orgGroupsTable", "perPage", 20)
|
initPerPage: getUserTablePreference("orgGroupsTable", PreferenceKey.PerPage, 20)
|
||||||
});
|
});
|
||||||
|
|
||||||
const handlePerPageChange = (newPerPage: number) => {
|
const handlePerPageChange = (newPerPage: number) => {
|
||||||
setPerPage(newPerPage);
|
setPerPage(newPerPage);
|
||||||
setUserTablePreference("orgGroupsTable", "perPage", newPerPage);
|
setUserTablePreference("orgGroupsTable", PreferenceKey.PerPage, newPerPage);
|
||||||
};
|
};
|
||||||
|
|
||||||
const filteredGroups = useMemo(() => {
|
const filteredGroups = useMemo(() => {
|
||||||
|
|||||||
+7
-3
@@ -42,7 +42,11 @@ import {
|
|||||||
Tr
|
Tr
|
||||||
} from "@app/components/v2";
|
} from "@app/components/v2";
|
||||||
import { OrgPermissionIdentityActions, OrgPermissionSubjects, useOrganization } from "@app/context";
|
import { OrgPermissionIdentityActions, OrgPermissionSubjects, useOrganization } from "@app/context";
|
||||||
import { getUserTablePreference, setUserTablePreference } from "@app/helpers/userTablePreferences";
|
import {
|
||||||
|
getUserTablePreference,
|
||||||
|
PreferenceKey,
|
||||||
|
setUserTablePreference
|
||||||
|
} from "@app/helpers/userTablePreferences";
|
||||||
import { usePagination, useResetPageHelper } from "@app/hooks";
|
import { usePagination, useResetPageHelper } from "@app/hooks";
|
||||||
import { useGetOrgRoles, useSearchIdentities, useUpdateIdentity } from "@app/hooks/api";
|
import { useGetOrgRoles, useSearchIdentities, useUpdateIdentity } from "@app/hooks/api";
|
||||||
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
||||||
@@ -78,12 +82,12 @@ export const IdentityTable = ({ handlePopUpOpen }: Props) => {
|
|||||||
page,
|
page,
|
||||||
setPerPage
|
setPerPage
|
||||||
} = usePagination<OrgIdentityOrderBy>(OrgIdentityOrderBy.Name, {
|
} = usePagination<OrgIdentityOrderBy>(OrgIdentityOrderBy.Name, {
|
||||||
initPerPage: getUserTablePreference("identityTable", "perPage", 20)
|
initPerPage: getUserTablePreference("identityTable", PreferenceKey.PerPage, 20)
|
||||||
});
|
});
|
||||||
|
|
||||||
const handlePerPageChange = (newPerPage: number) => {
|
const handlePerPageChange = (newPerPage: number) => {
|
||||||
setPerPage(newPerPage);
|
setPerPage(newPerPage);
|
||||||
setUserTablePreference("identityTable", "perPage", newPerPage);
|
setUserTablePreference("identityTable", PreferenceKey.PerPage, newPerPage);
|
||||||
};
|
};
|
||||||
|
|
||||||
const [filteredRoles, setFilteredRoles] = useState<string[]>([]);
|
const [filteredRoles, setFilteredRoles] = useState<string[]>([]);
|
||||||
|
|||||||
+7
-3
@@ -42,7 +42,11 @@ import {
|
|||||||
useSubscription,
|
useSubscription,
|
||||||
useUser
|
useUser
|
||||||
} from "@app/context";
|
} from "@app/context";
|
||||||
import { getUserTablePreference, setUserTablePreference } from "@app/helpers/userTablePreferences";
|
import {
|
||||||
|
getUserTablePreference,
|
||||||
|
PreferenceKey,
|
||||||
|
setUserTablePreference
|
||||||
|
} from "@app/helpers/userTablePreferences";
|
||||||
import { usePagination, useResetPageHelper } from "@app/hooks";
|
import { usePagination, useResetPageHelper } from "@app/hooks";
|
||||||
import {
|
import {
|
||||||
useFetchServerStatus,
|
useFetchServerStatus,
|
||||||
@@ -172,12 +176,12 @@ export const OrgMembersTable = ({ handlePopUpOpen, setCompleteInviteLinks }: Pro
|
|||||||
setOrderDirection,
|
setOrderDirection,
|
||||||
toggleOrderDirection
|
toggleOrderDirection
|
||||||
} = usePagination<OrgMembersOrderBy>(OrgMembersOrderBy.Name, {
|
} = usePagination<OrgMembersOrderBy>(OrgMembersOrderBy.Name, {
|
||||||
initPerPage: getUserTablePreference("orgMembersTable", "perPage", 20)
|
initPerPage: getUserTablePreference("orgMembersTable", PreferenceKey.PerPage, 20)
|
||||||
});
|
});
|
||||||
|
|
||||||
const handlePerPageChange = (newPerPage: number) => {
|
const handlePerPageChange = (newPerPage: number) => {
|
||||||
setPerPage(newPerPage);
|
setPerPage(newPerPage);
|
||||||
setUserTablePreference("orgMembersTable", "perPage", newPerPage);
|
setUserTablePreference("orgMembersTable", PreferenceKey.PerPage, newPerPage);
|
||||||
};
|
};
|
||||||
|
|
||||||
const filteredUsers = useMemo(
|
const filteredUsers = useMemo(
|
||||||
|
|||||||
+7
-3
@@ -30,7 +30,11 @@ import {
|
|||||||
Tr
|
Tr
|
||||||
} from "@app/components/v2";
|
} from "@app/components/v2";
|
||||||
import { APP_CONNECTION_MAP, getAppConnectionMethodDetails } from "@app/helpers/appConnections";
|
import { APP_CONNECTION_MAP, getAppConnectionMethodDetails } from "@app/helpers/appConnections";
|
||||||
import { getUserTablePreference, setUserTablePreference } from "@app/helpers/userTablePreferences";
|
import {
|
||||||
|
getUserTablePreference,
|
||||||
|
PreferenceKey,
|
||||||
|
setUserTablePreference
|
||||||
|
} from "@app/helpers/userTablePreferences";
|
||||||
import { usePagination, usePopUp, useResetPageHelper } from "@app/hooks";
|
import { usePagination, usePopUp, useResetPageHelper } from "@app/hooks";
|
||||||
import { TAppConnection, useListAppConnections } from "@app/hooks/api/appConnections";
|
import { TAppConnection, useListAppConnections } from "@app/hooks/api/appConnections";
|
||||||
import { AppConnection } from "@app/hooks/api/appConnections/enums";
|
import { AppConnection } from "@app/hooks/api/appConnections/enums";
|
||||||
@@ -78,12 +82,12 @@ export const AppConnectionsTable = () => {
|
|||||||
setOrderDirection,
|
setOrderDirection,
|
||||||
setOrderBy
|
setOrderBy
|
||||||
} = usePagination<AppConnectionsOrderBy>(AppConnectionsOrderBy.App, {
|
} = usePagination<AppConnectionsOrderBy>(AppConnectionsOrderBy.App, {
|
||||||
initPerPage: getUserTablePreference("appConnectionsTable", "perPage", 20)
|
initPerPage: getUserTablePreference("appConnectionsTable", PreferenceKey.PerPage, 20)
|
||||||
});
|
});
|
||||||
|
|
||||||
const handlePerPageChange = (newPerPage: number) => {
|
const handlePerPageChange = (newPerPage: number) => {
|
||||||
setPerPage(newPerPage);
|
setPerPage(newPerPage);
|
||||||
setUserTablePreference("appConnectionsTable", "perPage", newPerPage);
|
setUserTablePreference("appConnectionsTable", PreferenceKey.PerPage, newPerPage);
|
||||||
};
|
};
|
||||||
|
|
||||||
const filteredAppConnections = useMemo(
|
const filteredAppConnections = useMemo(
|
||||||
|
|||||||
+7
-3
@@ -25,7 +25,11 @@ import {
|
|||||||
Tr
|
Tr
|
||||||
} from "@app/components/v2";
|
} from "@app/components/v2";
|
||||||
import { OrgPermissionGroupActions, OrgPermissionSubjects, useOrganization } from "@app/context";
|
import { OrgPermissionGroupActions, OrgPermissionSubjects, useOrganization } from "@app/context";
|
||||||
import { getUserTablePreference, setUserTablePreference } from "@app/helpers/userTablePreferences";
|
import {
|
||||||
|
getUserTablePreference,
|
||||||
|
PreferenceKey,
|
||||||
|
setUserTablePreference
|
||||||
|
} from "@app/helpers/userTablePreferences";
|
||||||
import { usePagination, useResetPageHelper } from "@app/hooks";
|
import { usePagination, useResetPageHelper } from "@app/hooks";
|
||||||
import { useListGroupUsers, useOidcManageGroupMembershipsEnabled } from "@app/hooks/api";
|
import { useListGroupUsers, useOidcManageGroupMembershipsEnabled } from "@app/hooks/api";
|
||||||
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
||||||
@@ -59,12 +63,12 @@ export const GroupMembersTable = ({ groupId, groupSlug, handlePopUpOpen }: Props
|
|||||||
orderDirection,
|
orderDirection,
|
||||||
toggleOrderDirection
|
toggleOrderDirection
|
||||||
} = usePagination(GroupMembersOrderBy.Name, {
|
} = usePagination(GroupMembersOrderBy.Name, {
|
||||||
initPerPage: getUserTablePreference("groupMembersTable", "perPage", 20)
|
initPerPage: getUserTablePreference("groupMembersTable", PreferenceKey.PerPage, 20)
|
||||||
});
|
});
|
||||||
|
|
||||||
const handlePerPageChange = (newPerPage: number) => {
|
const handlePerPageChange = (newPerPage: number) => {
|
||||||
setPerPage(newPerPage);
|
setPerPage(newPerPage);
|
||||||
setUserTablePreference("groupMembersTable", "perPage", newPerPage);
|
setUserTablePreference("groupMembersTable", PreferenceKey.PerPage, newPerPage);
|
||||||
};
|
};
|
||||||
|
|
||||||
const { currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
|
|||||||
+7
-3
@@ -21,7 +21,11 @@ import {
|
|||||||
THead,
|
THead,
|
||||||
Tr
|
Tr
|
||||||
} from "@app/components/v2";
|
} from "@app/components/v2";
|
||||||
import { getUserTablePreference, setUserTablePreference } from "@app/helpers/userTablePreferences";
|
import {
|
||||||
|
getUserTablePreference,
|
||||||
|
PreferenceKey,
|
||||||
|
setUserTablePreference
|
||||||
|
} from "@app/helpers/userTablePreferences";
|
||||||
import { usePagination, useResetPageHelper } from "@app/hooks";
|
import { usePagination, useResetPageHelper } from "@app/hooks";
|
||||||
import { useGetIdentityProjectMemberships } from "@app/hooks/api";
|
import { useGetIdentityProjectMemberships } from "@app/hooks/api";
|
||||||
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
||||||
@@ -55,12 +59,12 @@ export const IdentityProjectsTable = ({ identityId, handlePopUpOpen }: Props) =>
|
|||||||
orderDirection,
|
orderDirection,
|
||||||
toggleOrderDirection
|
toggleOrderDirection
|
||||||
} = usePagination(IdentityProjectsOrderBy.Name, {
|
} = usePagination(IdentityProjectsOrderBy.Name, {
|
||||||
initPerPage: getUserTablePreference("identityProjectsTable", "perPage", 20)
|
initPerPage: getUserTablePreference("identityProjectsTable", PreferenceKey.PerPage, 20)
|
||||||
});
|
});
|
||||||
|
|
||||||
const handlePerPageChange = (newPerPage: number) => {
|
const handlePerPageChange = (newPerPage: number) => {
|
||||||
setPerPage(newPerPage);
|
setPerPage(newPerPage);
|
||||||
setUserTablePreference("identityProjectsTable", "perPage", newPerPage);
|
setUserTablePreference("identityProjectsTable", PreferenceKey.PerPage, newPerPage);
|
||||||
};
|
};
|
||||||
|
|
||||||
const filteredProjectMemberships = useMemo(
|
const filteredProjectMemberships = useMemo(
|
||||||
|
|||||||
+7
-3
@@ -28,7 +28,11 @@ import {
|
|||||||
} from "@app/components/v2";
|
} from "@app/components/v2";
|
||||||
import { OrgPermissionActions, OrgPermissionSubjects } from "@app/context";
|
import { OrgPermissionActions, OrgPermissionSubjects } from "@app/context";
|
||||||
import { getProjectHomePage } from "@app/helpers/project";
|
import { getProjectHomePage } from "@app/helpers/project";
|
||||||
import { getUserTablePreference, setUserTablePreference } from "@app/helpers/userTablePreferences";
|
import {
|
||||||
|
getUserTablePreference,
|
||||||
|
PreferenceKey,
|
||||||
|
setUserTablePreference
|
||||||
|
} from "@app/helpers/userTablePreferences";
|
||||||
import { useDebounce, usePagination, usePopUp, useResetPageHelper } from "@app/hooks";
|
import { useDebounce, usePagination, usePopUp, useResetPageHelper } from "@app/hooks";
|
||||||
import { useRequestProjectAccess, useSearchProjects } from "@app/hooks/api";
|
import { useRequestProjectAccess, useSearchProjects } from "@app/hooks/api";
|
||||||
import { ProjectType, Workspace } from "@app/hooks/api/workspace/types";
|
import { ProjectType, Workspace } from "@app/hooks/api/workspace/types";
|
||||||
@@ -106,12 +110,12 @@ export const AllProjectView = ({
|
|||||||
toggleOrderDirection,
|
toggleOrderDirection,
|
||||||
orderDirection
|
orderDirection
|
||||||
} = usePagination("name", {
|
} = usePagination("name", {
|
||||||
initPerPage: getUserTablePreference("allProjectsTable", "perPage", 50)
|
initPerPage: getUserTablePreference("allProjectsTable", PreferenceKey.PerPage, 50)
|
||||||
});
|
});
|
||||||
|
|
||||||
const handlePerPageChange = (newPerPage: number) => {
|
const handlePerPageChange = (newPerPage: number) => {
|
||||||
setPerPage(newPerPage);
|
setPerPage(newPerPage);
|
||||||
setUserTablePreference("allProjectsTable", "perPage", newPerPage);
|
setUserTablePreference("allProjectsTable", PreferenceKey.PerPage, newPerPage);
|
||||||
};
|
};
|
||||||
|
|
||||||
const { popUp, handlePopUpToggle, handlePopUpOpen } = usePopUp([
|
const { popUp, handlePopUpToggle, handlePopUpOpen } = usePopUp([
|
||||||
|
|||||||
+7
-3
@@ -19,7 +19,11 @@ import { OrgPermissionCan } from "@app/components/permissions";
|
|||||||
import { Button, IconButton, Input, Pagination, Skeleton, Tooltip } from "@app/components/v2";
|
import { Button, IconButton, Input, Pagination, Skeleton, Tooltip } from "@app/components/v2";
|
||||||
import { OrgPermissionActions, OrgPermissionSubjects, useOrganization } from "@app/context";
|
import { OrgPermissionActions, OrgPermissionSubjects, useOrganization } from "@app/context";
|
||||||
import { getProjectHomePage } from "@app/helpers/project";
|
import { getProjectHomePage } from "@app/helpers/project";
|
||||||
import { getUserTablePreference, setUserTablePreference } from "@app/helpers/userTablePreferences";
|
import {
|
||||||
|
getUserTablePreference,
|
||||||
|
PreferenceKey,
|
||||||
|
setUserTablePreference
|
||||||
|
} from "@app/helpers/userTablePreferences";
|
||||||
import { usePagination, useResetPageHelper } from "@app/hooks";
|
import { usePagination, useResetPageHelper } from "@app/hooks";
|
||||||
import { useGetUserWorkspaces } from "@app/hooks/api";
|
import { useGetUserWorkspaces } from "@app/hooks/api";
|
||||||
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
||||||
@@ -65,12 +69,12 @@ export const MyProjectView = ({
|
|||||||
toggleOrderDirection,
|
toggleOrderDirection,
|
||||||
orderDirection
|
orderDirection
|
||||||
} = usePagination(ProjectOrderBy.Name, {
|
} = usePagination(ProjectOrderBy.Name, {
|
||||||
initPerPage: getUserTablePreference("myProjectsTable", "perPage", 20)
|
initPerPage: getUserTablePreference("myProjectsTable", PreferenceKey.PerPage, 24)
|
||||||
});
|
});
|
||||||
|
|
||||||
const handlePerPageChange = (newPerPage: number) => {
|
const handlePerPageChange = (newPerPage: number) => {
|
||||||
setPerPage(newPerPage);
|
setPerPage(newPerPage);
|
||||||
setUserTablePreference("myProjectsTable", "perPage", newPerPage);
|
setUserTablePreference("myProjectsTable", PreferenceKey.PerPage, newPerPage);
|
||||||
};
|
};
|
||||||
|
|
||||||
const { data: projectFavorites, isPending: isProjectFavoritesLoading } =
|
const { data: projectFavorites, isPending: isProjectFavoritesLoading } =
|
||||||
|
|||||||
@@ -13,7 +13,11 @@ import {
|
|||||||
useOrganization,
|
useOrganization,
|
||||||
useServerConfig
|
useServerConfig
|
||||||
} from "@app/context";
|
} from "@app/context";
|
||||||
import { getUserTablePreference, setUserTablePreference } from "@app/helpers/userTablePreferences";
|
import {
|
||||||
|
getUserTablePreference,
|
||||||
|
PreferenceKey,
|
||||||
|
setUserTablePreference
|
||||||
|
} from "@app/helpers/userTablePreferences";
|
||||||
import { withPermission } from "@app/hoc";
|
import { withPermission } from "@app/hoc";
|
||||||
import { usePagination, usePopUp } from "@app/hooks";
|
import { usePagination, usePopUp } from "@app/hooks";
|
||||||
import {
|
import {
|
||||||
@@ -48,12 +52,12 @@ export const SecretScanningPage = withPermission(
|
|||||||
|
|
||||||
const { offset, limit, orderBy, setPage, perPage, page, setPerPage } = usePagination(
|
const { offset, limit, orderBy, setPage, perPage, page, setPerPage } = usePagination(
|
||||||
SecretScanningOrderBy.CreatedAt,
|
SecretScanningOrderBy.CreatedAt,
|
||||||
{ initPerPage: getUserTablePreference("secretScanningTable", "perPage", 20) }
|
{ initPerPage: getUserTablePreference("secretScanningTable", PreferenceKey.PerPage, 20) }
|
||||||
);
|
);
|
||||||
|
|
||||||
const handlePerPageChange = (newPerPage: number) => {
|
const handlePerPageChange = (newPerPage: number) => {
|
||||||
setPerPage(newPerPage);
|
setPerPage(newPerPage);
|
||||||
setUserTablePreference("secretScanningTable", "perPage", newPerPage);
|
setUserTablePreference("secretScanningTable", PreferenceKey.PerPage, newPerPage);
|
||||||
};
|
};
|
||||||
|
|
||||||
const repositoryNames = watch("repositoryNames");
|
const repositoryNames = watch("repositoryNames");
|
||||||
@@ -184,7 +188,7 @@ export const SecretScanningPage = withPermission(
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-8 space-y-3">
|
<div className="mt-8 space-y-2">
|
||||||
{integrationEnabled && (
|
{integrationEnabled && (
|
||||||
<div className="flex w-full items-center justify-end">
|
<div className="flex w-full items-center justify-end">
|
||||||
<SecretScanningFilter
|
<SecretScanningFilter
|
||||||
@@ -195,7 +199,7 @@ export const SecretScanningPage = withPermission(
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<SecretScanningLogsTable gitRisks={risksData?.risks} isPending={isPending} />
|
<SecretScanningLogsTable gitRisks={risksData?.risks} isPending={isPending} />
|
||||||
{!isPending && risksData?.totalCount !== undefined && (
|
{!isPending && risksData?.totalCount !== undefined && risksData.totalCount >= 10 && (
|
||||||
<Pagination
|
<Pagination
|
||||||
className="rounded-md"
|
className="rounded-md"
|
||||||
count={risksData.totalCount}
|
count={risksData.totalCount}
|
||||||
|
|||||||
+7
-3
@@ -20,7 +20,11 @@ import {
|
|||||||
THead,
|
THead,
|
||||||
Tr
|
Tr
|
||||||
} from "@app/components/v2";
|
} from "@app/components/v2";
|
||||||
import { getUserTablePreference, setUserTablePreference } from "@app/helpers/userTablePreferences";
|
import {
|
||||||
|
getUserTablePreference,
|
||||||
|
PreferenceKey,
|
||||||
|
setUserTablePreference
|
||||||
|
} from "@app/helpers/userTablePreferences";
|
||||||
import { usePagination, useResetPageHelper } from "@app/hooks";
|
import { usePagination, useResetPageHelper } from "@app/hooks";
|
||||||
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
||||||
import { OrgUser } from "@app/hooks/api/types";
|
import { OrgUser } from "@app/hooks/api/types";
|
||||||
@@ -54,12 +58,12 @@ export const UserGroupsTable = ({ handlePopUpOpen, orgMembership }: Props) => {
|
|||||||
orderDirection,
|
orderDirection,
|
||||||
toggleOrderDirection
|
toggleOrderDirection
|
||||||
} = usePagination(UserGroupsOrderBy.Name, {
|
} = usePagination(UserGroupsOrderBy.Name, {
|
||||||
initPerPage: getUserTablePreference("userGroupsTable", "perPage", 20)
|
initPerPage: getUserTablePreference("userGroupsTable", PreferenceKey.PerPage, 10)
|
||||||
});
|
});
|
||||||
|
|
||||||
const handlePerPageChange = (newPerPage: number) => {
|
const handlePerPageChange = (newPerPage: number) => {
|
||||||
setPerPage(newPerPage);
|
setPerPage(newPerPage);
|
||||||
setUserTablePreference("userGroupsTable", "perPage", newPerPage);
|
setUserTablePreference("userGroupsTable", PreferenceKey.PerPage, newPerPage);
|
||||||
};
|
};
|
||||||
|
|
||||||
const filteredGroupMemberships = useMemo(
|
const filteredGroupMemberships = useMemo(
|
||||||
|
|||||||
+7
-3
@@ -22,7 +22,11 @@ import {
|
|||||||
Tr
|
Tr
|
||||||
} from "@app/components/v2";
|
} from "@app/components/v2";
|
||||||
import { useOrganization } from "@app/context";
|
import { useOrganization } from "@app/context";
|
||||||
import { getUserTablePreference, setUserTablePreference } from "@app/helpers/userTablePreferences";
|
import {
|
||||||
|
getUserTablePreference,
|
||||||
|
PreferenceKey,
|
||||||
|
setUserTablePreference
|
||||||
|
} from "@app/helpers/userTablePreferences";
|
||||||
import { usePagination, useResetPageHelper } from "@app/hooks";
|
import { usePagination, useResetPageHelper } from "@app/hooks";
|
||||||
import { useGetOrgMembershipProjectMemberships } from "@app/hooks/api";
|
import { useGetOrgMembershipProjectMemberships } from "@app/hooks/api";
|
||||||
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
||||||
@@ -56,12 +60,12 @@ export const UserProjectsTable = ({ membershipId, handlePopUpOpen }: Props) => {
|
|||||||
orderDirection,
|
orderDirection,
|
||||||
toggleOrderDirection
|
toggleOrderDirection
|
||||||
} = usePagination(UserProjectsOrderBy.Name, {
|
} = usePagination(UserProjectsOrderBy.Name, {
|
||||||
initPerPage: getUserTablePreference("userProjectsTable", "perPage", 20)
|
initPerPage: getUserTablePreference("userProjectsTable", PreferenceKey.PerPage, 10)
|
||||||
});
|
});
|
||||||
|
|
||||||
const handlePerPageChange = (newPerPage: number) => {
|
const handlePerPageChange = (newPerPage: number) => {
|
||||||
setPerPage(newPerPage);
|
setPerPage(newPerPage);
|
||||||
setUserTablePreference("userProjectsTable", "perPage", newPerPage);
|
setUserTablePreference("userProjectsTable", PreferenceKey.PerPage, newPerPage);
|
||||||
};
|
};
|
||||||
|
|
||||||
const { data: projectMemberships = [], isPending } = useGetOrgMembershipProjectMemberships(
|
const { data: projectMemberships = [], isPending } = useGetOrgMembershipProjectMemberships(
|
||||||
|
|||||||
+7
-3
@@ -27,7 +27,11 @@ import {
|
|||||||
Tr
|
Tr
|
||||||
} from "@app/components/v2";
|
} from "@app/components/v2";
|
||||||
import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";
|
import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";
|
||||||
import { getUserTablePreference, setUserTablePreference } from "@app/helpers/userTablePreferences";
|
import {
|
||||||
|
getUserTablePreference,
|
||||||
|
PreferenceKey,
|
||||||
|
setUserTablePreference
|
||||||
|
} from "@app/helpers/userTablePreferences";
|
||||||
import { usePagination, useResetPageHelper } from "@app/hooks";
|
import { usePagination, useResetPageHelper } from "@app/hooks";
|
||||||
import { useListWorkspaceGroups } from "@app/hooks/api";
|
import { useListWorkspaceGroups } from "@app/hooks/api";
|
||||||
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
||||||
@@ -64,12 +68,12 @@ export const GroupTable = ({ handlePopUpOpen }: Props) => {
|
|||||||
orderBy,
|
orderBy,
|
||||||
toggleOrderDirection
|
toggleOrderDirection
|
||||||
} = usePagination(GroupsOrderBy.Name, {
|
} = usePagination(GroupsOrderBy.Name, {
|
||||||
initPerPage: getUserTablePreference("projectGroupsTable", "perPage", 20)
|
initPerPage: getUserTablePreference("projectGroupsTable", PreferenceKey.PerPage, 20)
|
||||||
});
|
});
|
||||||
|
|
||||||
const handlePerPageChange = (newPerPage: number) => {
|
const handlePerPageChange = (newPerPage: number) => {
|
||||||
setPerPage(newPerPage);
|
setPerPage(newPerPage);
|
||||||
setUserTablePreference("projectGroupsTable", "perPage", newPerPage);
|
setUserTablePreference("projectGroupsTable", PreferenceKey.PerPage, newPerPage);
|
||||||
};
|
};
|
||||||
|
|
||||||
const { data: groupMemberships = [], isPending } = useListWorkspaceGroups(
|
const { data: groupMemberships = [], isPending } = useListWorkspaceGroups(
|
||||||
|
|||||||
@@ -42,7 +42,11 @@ import {
|
|||||||
} from "@app/components/v2";
|
} from "@app/components/v2";
|
||||||
import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";
|
import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";
|
||||||
import { formatProjectRoleName } from "@app/helpers/roles";
|
import { formatProjectRoleName } from "@app/helpers/roles";
|
||||||
import { getUserTablePreference, setUserTablePreference } from "@app/helpers/userTablePreferences";
|
import {
|
||||||
|
getUserTablePreference,
|
||||||
|
PreferenceKey,
|
||||||
|
setUserTablePreference
|
||||||
|
} from "@app/helpers/userTablePreferences";
|
||||||
import { withProjectPermission } from "@app/hoc";
|
import { withProjectPermission } from "@app/hoc";
|
||||||
import { usePagination, useResetPageHelper } from "@app/hooks";
|
import { usePagination, useResetPageHelper } from "@app/hooks";
|
||||||
import { useDeleteIdentityFromWorkspace, useGetWorkspaceIdentityMemberships } from "@app/hooks/api";
|
import { useDeleteIdentityFromWorkspace, useGetWorkspaceIdentityMemberships } from "@app/hooks/api";
|
||||||
@@ -74,12 +78,12 @@ export const IdentityTab = withProjectPermission(
|
|||||||
page,
|
page,
|
||||||
setPerPage
|
setPerPage
|
||||||
} = usePagination(ProjectIdentityOrderBy.Name, {
|
} = usePagination(ProjectIdentityOrderBy.Name, {
|
||||||
initPerPage: getUserTablePreference("projectIdentityTable", "perPage", 20)
|
initPerPage: getUserTablePreference("projectIdentityTable", PreferenceKey.PerPage, 20)
|
||||||
});
|
});
|
||||||
|
|
||||||
const handlePerPageChange = (newPerPage: number) => {
|
const handlePerPageChange = (newPerPage: number) => {
|
||||||
setPerPage(newPerPage);
|
setPerPage(newPerPage);
|
||||||
setUserTablePreference("projectIdentityTable", "perPage", newPerPage);
|
setUserTablePreference("projectIdentityTable", PreferenceKey.PerPage, newPerPage);
|
||||||
};
|
};
|
||||||
|
|
||||||
const workspaceId = currentWorkspace?.id ?? "";
|
const workspaceId = currentWorkspace?.id ?? "";
|
||||||
|
|||||||
+7
-3
@@ -51,7 +51,11 @@ import {
|
|||||||
useWorkspace
|
useWorkspace
|
||||||
} from "@app/context";
|
} from "@app/context";
|
||||||
import { formatProjectRoleName } from "@app/helpers/roles";
|
import { formatProjectRoleName } from "@app/helpers/roles";
|
||||||
import { getUserTablePreference, setUserTablePreference } from "@app/helpers/userTablePreferences";
|
import {
|
||||||
|
getUserTablePreference,
|
||||||
|
PreferenceKey,
|
||||||
|
setUserTablePreference
|
||||||
|
} from "@app/helpers/userTablePreferences";
|
||||||
import { usePagination, useResetPageHelper } from "@app/hooks";
|
import { usePagination, useResetPageHelper } from "@app/hooks";
|
||||||
import { useGetProjectRoles, useGetWorkspaceUsers } from "@app/hooks/api";
|
import { useGetProjectRoles, useGetWorkspaceUsers } from "@app/hooks/api";
|
||||||
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
||||||
@@ -102,12 +106,12 @@ export const MembersTable = ({ handlePopUpOpen }: Props) => {
|
|||||||
setOrderDirection,
|
setOrderDirection,
|
||||||
toggleOrderDirection
|
toggleOrderDirection
|
||||||
} = usePagination<MembersOrderBy>(MembersOrderBy.Name, {
|
} = usePagination<MembersOrderBy>(MembersOrderBy.Name, {
|
||||||
initPerPage: getUserTablePreference("projectMembersTable", "perPage", 20)
|
initPerPage: getUserTablePreference("projectMembersTable", PreferenceKey.PerPage, 20)
|
||||||
});
|
});
|
||||||
|
|
||||||
const handlePerPageChange = (newPerPage: number) => {
|
const handlePerPageChange = (newPerPage: number) => {
|
||||||
setPerPage(newPerPage);
|
setPerPage(newPerPage);
|
||||||
setUserTablePreference("projectMembersTable", "perPage", newPerPage);
|
setUserTablePreference("projectMembersTable", PreferenceKey.PerPage, newPerPage);
|
||||||
};
|
};
|
||||||
|
|
||||||
const { data: members = [], isPending: isMembersLoading } = useGetWorkspaceUsers(
|
const { data: members = [], isPending: isMembersLoading } = useGetWorkspaceUsers(
|
||||||
|
|||||||
+7
-3
@@ -32,7 +32,11 @@ import {
|
|||||||
Tooltip,
|
Tooltip,
|
||||||
Tr
|
Tr
|
||||||
} from "@app/components/v2";
|
} from "@app/components/v2";
|
||||||
import { getUserTablePreference, setUserTablePreference } from "@app/helpers/userTablePreferences";
|
import {
|
||||||
|
getUserTablePreference,
|
||||||
|
PreferenceKey,
|
||||||
|
setUserTablePreference
|
||||||
|
} from "@app/helpers/userTablePreferences";
|
||||||
import { usePagination, useResetPageHelper } from "@app/hooks";
|
import { usePagination, useResetPageHelper } from "@app/hooks";
|
||||||
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
||||||
import { useSyncIntegration } from "@app/hooks/api/integrations/queries";
|
import { useSyncIntegration } from "@app/hooks/api/integrations/queries";
|
||||||
@@ -112,12 +116,12 @@ export const IntegrationsTable = ({
|
|||||||
setOrderDirection,
|
setOrderDirection,
|
||||||
setOrderBy
|
setOrderBy
|
||||||
} = usePagination<IntegrationsOrderBy>(IntegrationsOrderBy.App, {
|
} = usePagination<IntegrationsOrderBy>(IntegrationsOrderBy.App, {
|
||||||
initPerPage: getUserTablePreference("integrationsTable", "perPage", 20)
|
initPerPage: getUserTablePreference("integrationsTable", PreferenceKey.PerPage, 20)
|
||||||
});
|
});
|
||||||
|
|
||||||
const handlePerPageChange = (newPerPage: number) => {
|
const handlePerPageChange = (newPerPage: number) => {
|
||||||
setPerPage(newPerPage);
|
setPerPage(newPerPage);
|
||||||
setUserTablePreference("integrationsTable", "perPage", newPerPage);
|
setUserTablePreference("integrationsTable", PreferenceKey.PerPage, newPerPage);
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
+7
-3
@@ -38,7 +38,11 @@ import {
|
|||||||
} from "@app/components/v2";
|
} from "@app/components/v2";
|
||||||
import { useWorkspace } from "@app/context";
|
import { useWorkspace } from "@app/context";
|
||||||
import { SECRET_SYNC_MAP } from "@app/helpers/secretSyncs";
|
import { SECRET_SYNC_MAP } from "@app/helpers/secretSyncs";
|
||||||
import { getUserTablePreference, setUserTablePreference } from "@app/helpers/userTablePreferences";
|
import {
|
||||||
|
getUserTablePreference,
|
||||||
|
PreferenceKey,
|
||||||
|
setUserTablePreference
|
||||||
|
} from "@app/helpers/userTablePreferences";
|
||||||
import { usePagination, usePopUp, useResetPageHelper } from "@app/hooks";
|
import { usePagination, usePopUp, useResetPageHelper } from "@app/hooks";
|
||||||
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
||||||
import {
|
import {
|
||||||
@@ -121,12 +125,12 @@ export const SecretSyncsTable = ({ secretSyncs }: Props) => {
|
|||||||
setOrderDirection,
|
setOrderDirection,
|
||||||
setOrderBy
|
setOrderBy
|
||||||
} = usePagination<SecretSyncsOrderBy>(SecretSyncsOrderBy.Name, {
|
} = usePagination<SecretSyncsOrderBy>(SecretSyncsOrderBy.Name, {
|
||||||
initPerPage: getUserTablePreference("secretSyncTable", "perPage", 20)
|
initPerPage: getUserTablePreference("secretSyncTable", PreferenceKey.PerPage, 20)
|
||||||
});
|
});
|
||||||
|
|
||||||
const handlePerPageChange = (newPerPage: number) => {
|
const handlePerPageChange = (newPerPage: number) => {
|
||||||
setPerPage(newPerPage);
|
setPerPage(newPerPage);
|
||||||
setUserTablePreference("secretSyncTable", "perPage", newPerPage);
|
setUserTablePreference("secretSyncTable", PreferenceKey.PerPage, newPerPage);
|
||||||
};
|
};
|
||||||
|
|
||||||
const filteredSecretSyncs = useMemo(
|
const filteredSecretSyncs = useMemo(
|
||||||
|
|||||||
@@ -64,7 +64,11 @@ import {
|
|||||||
useWorkspace
|
useWorkspace
|
||||||
} from "@app/context";
|
} from "@app/context";
|
||||||
import { ProjectPermissionSecretRotationActions } from "@app/context/ProjectPermissionContext/types";
|
import { ProjectPermissionSecretRotationActions } from "@app/context/ProjectPermissionContext/types";
|
||||||
import { getUserTablePreference, setUserTablePreference } from "@app/helpers/userTablePreferences";
|
import {
|
||||||
|
getUserTablePreference,
|
||||||
|
PreferenceKey,
|
||||||
|
setUserTablePreference
|
||||||
|
} from "@app/helpers/userTablePreferences";
|
||||||
import { useDebounce, usePagination, usePopUp, useResetPageHelper } from "@app/hooks";
|
import { useDebounce, usePagination, usePopUp, useResetPageHelper } from "@app/hooks";
|
||||||
import {
|
import {
|
||||||
useCreateFolder,
|
useCreateFolder,
|
||||||
@@ -182,12 +186,12 @@ export const OverviewPage = () => {
|
|||||||
setPerPage,
|
setPerPage,
|
||||||
orderBy
|
orderBy
|
||||||
} = usePagination<DashboardSecretsOrderBy>(DashboardSecretsOrderBy.Name, {
|
} = usePagination<DashboardSecretsOrderBy>(DashboardSecretsOrderBy.Name, {
|
||||||
initPerPage: getUserTablePreference("secretOverviewTable", "perPage", 100)
|
initPerPage: getUserTablePreference("secretOverviewTable", PreferenceKey.PerPage, 100)
|
||||||
});
|
});
|
||||||
|
|
||||||
const handlePerPageChange = (newPerPage: number) => {
|
const handlePerPageChange = (newPerPage: number) => {
|
||||||
setPerPage(newPerPage);
|
setPerPage(newPerPage);
|
||||||
setUserTablePreference("secretOverviewTable", "perPage", newPerPage);
|
setUserTablePreference("secretOverviewTable", PreferenceKey.PerPage, newPerPage);
|
||||||
};
|
};
|
||||||
|
|
||||||
const resetSelectedEntries = useCallback(() => {
|
const resetSelectedEntries = useCallback(() => {
|
||||||
|
|||||||
@@ -29,7 +29,11 @@ import {
|
|||||||
ProjectPermissionSecretActions,
|
ProjectPermissionSecretActions,
|
||||||
ProjectPermissionSecretRotationActions
|
ProjectPermissionSecretRotationActions
|
||||||
} from "@app/context/ProjectPermissionContext/types";
|
} from "@app/context/ProjectPermissionContext/types";
|
||||||
import { getUserTablePreference, setUserTablePreference } from "@app/helpers/userTablePreferences";
|
import {
|
||||||
|
getUserTablePreference,
|
||||||
|
PreferenceKey,
|
||||||
|
setUserTablePreference
|
||||||
|
} from "@app/helpers/userTablePreferences";
|
||||||
import { useDebounce, usePagination, usePopUp, useResetPageHelper } from "@app/hooks";
|
import { useDebounce, usePagination, usePopUp, useResetPageHelper } from "@app/hooks";
|
||||||
import {
|
import {
|
||||||
useGetImportedSecretsSingleEnv,
|
useGetImportedSecretsSingleEnv,
|
||||||
@@ -100,12 +104,12 @@ const Page = () => {
|
|||||||
setPerPage,
|
setPerPage,
|
||||||
orderBy
|
orderBy
|
||||||
} = usePagination<DashboardSecretsOrderBy>(DashboardSecretsOrderBy.Name, {
|
} = usePagination<DashboardSecretsOrderBy>(DashboardSecretsOrderBy.Name, {
|
||||||
initPerPage: getUserTablePreference("secretDashboardTable", "perPage", 100)
|
initPerPage: getUserTablePreference("secretDashboardTable", PreferenceKey.PerPage, 100)
|
||||||
});
|
});
|
||||||
|
|
||||||
const handlePerPageChange = (newPerPage: number) => {
|
const handlePerPageChange = (newPerPage: number) => {
|
||||||
setPerPage(newPerPage);
|
setPerPage(newPerPage);
|
||||||
setUserTablePreference("secretDashboardTable", "perPage", newPerPage);
|
setUserTablePreference("secretDashboardTable", PreferenceKey.PerPage, newPerPage);
|
||||||
};
|
};
|
||||||
|
|
||||||
const [snapshotId, setSnapshotId] = useState<string | null>(null);
|
const [snapshotId, setSnapshotId] = useState<string | null>(null);
|
||||||
|
|||||||
+7
-3
@@ -25,7 +25,11 @@ import {
|
|||||||
Tr
|
Tr
|
||||||
} from "@app/components/v2";
|
} from "@app/components/v2";
|
||||||
import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";
|
import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";
|
||||||
import { getUserTablePreference, setUserTablePreference } from "@app/helpers/userTablePreferences";
|
import {
|
||||||
|
getUserTablePreference,
|
||||||
|
PreferenceKey,
|
||||||
|
setUserTablePreference
|
||||||
|
} from "@app/helpers/userTablePreferences";
|
||||||
import { usePagination, useResetPageHelper } from "@app/hooks";
|
import { usePagination, useResetPageHelper } from "@app/hooks";
|
||||||
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
||||||
import { useGetWsTags } from "@app/hooks/api/tags";
|
import { useGetWsTags } from "@app/hooks/api/tags";
|
||||||
@@ -63,12 +67,12 @@ export const SecretTagsTable = ({ handlePopUpOpen }: Props) => {
|
|||||||
orderDirection,
|
orderDirection,
|
||||||
toggleOrderDirection
|
toggleOrderDirection
|
||||||
} = usePagination(TagsOrderBy.Slug, {
|
} = usePagination(TagsOrderBy.Slug, {
|
||||||
initPerPage: getUserTablePreference("secretTagsTable", "perPage", 20)
|
initPerPage: getUserTablePreference("secretTagsTable", PreferenceKey.PerPage, 20)
|
||||||
});
|
});
|
||||||
|
|
||||||
const handlePerPageChange = (newPerPage: number) => {
|
const handlePerPageChange = (newPerPage: number) => {
|
||||||
setPerPage(newPerPage);
|
setPerPage(newPerPage);
|
||||||
setUserTablePreference("secretTagsTable", "perPage", newPerPage);
|
setUserTablePreference("secretTagsTable", PreferenceKey.PerPage, newPerPage);
|
||||||
};
|
};
|
||||||
|
|
||||||
const filteredTags = useMemo(
|
const filteredTags = useMemo(
|
||||||
|
|||||||
Reference in New Issue
Block a user