mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-17 04:33:01 +00:00
Review fixes
This commit is contained in:
+7
-3
@@ -34,7 +34,11 @@ import {
|
||||
Tr
|
||||
} from "@app/components/v2";
|
||||
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 { useGetOrganizationGroups, useGetOrgRoles, useUpdateGroup } from "@app/hooks/api";
|
||||
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
||||
@@ -105,12 +109,12 @@ export const OrgGroupsTable = ({ handlePopUpOpen }: Props) => {
|
||||
setOrderDirection,
|
||||
toggleOrderDirection
|
||||
} = usePagination<GroupsOrderBy>(GroupsOrderBy.Name, {
|
||||
initPerPage: getUserTablePreference("orgGroupsTable", "perPage", 20)
|
||||
initPerPage: getUserTablePreference("orgGroupsTable", PreferenceKey.PerPage, 20)
|
||||
});
|
||||
|
||||
const handlePerPageChange = (newPerPage: number) => {
|
||||
setPerPage(newPerPage);
|
||||
setUserTablePreference("orgGroupsTable", "perPage", newPerPage);
|
||||
setUserTablePreference("orgGroupsTable", PreferenceKey.PerPage, newPerPage);
|
||||
};
|
||||
|
||||
const filteredGroups = useMemo(() => {
|
||||
|
||||
+7
-3
@@ -42,7 +42,11 @@ import {
|
||||
Tr
|
||||
} from "@app/components/v2";
|
||||
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 { useGetOrgRoles, useSearchIdentities, useUpdateIdentity } from "@app/hooks/api";
|
||||
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
||||
@@ -78,12 +82,12 @@ export const IdentityTable = ({ handlePopUpOpen }: Props) => {
|
||||
page,
|
||||
setPerPage
|
||||
} = usePagination<OrgIdentityOrderBy>(OrgIdentityOrderBy.Name, {
|
||||
initPerPage: getUserTablePreference("identityTable", "perPage", 20)
|
||||
initPerPage: getUserTablePreference("identityTable", PreferenceKey.PerPage, 20)
|
||||
});
|
||||
|
||||
const handlePerPageChange = (newPerPage: number) => {
|
||||
setPerPage(newPerPage);
|
||||
setUserTablePreference("identityTable", "perPage", newPerPage);
|
||||
setUserTablePreference("identityTable", PreferenceKey.PerPage, newPerPage);
|
||||
};
|
||||
|
||||
const [filteredRoles, setFilteredRoles] = useState<string[]>([]);
|
||||
|
||||
+7
-3
@@ -42,7 +42,11 @@ import {
|
||||
useSubscription,
|
||||
useUser
|
||||
} 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 {
|
||||
useFetchServerStatus,
|
||||
@@ -172,12 +176,12 @@ export const OrgMembersTable = ({ handlePopUpOpen, setCompleteInviteLinks }: Pro
|
||||
setOrderDirection,
|
||||
toggleOrderDirection
|
||||
} = usePagination<OrgMembersOrderBy>(OrgMembersOrderBy.Name, {
|
||||
initPerPage: getUserTablePreference("orgMembersTable", "perPage", 20)
|
||||
initPerPage: getUserTablePreference("orgMembersTable", PreferenceKey.PerPage, 20)
|
||||
});
|
||||
|
||||
const handlePerPageChange = (newPerPage: number) => {
|
||||
setPerPage(newPerPage);
|
||||
setUserTablePreference("orgMembersTable", "perPage", newPerPage);
|
||||
setUserTablePreference("orgMembersTable", PreferenceKey.PerPage, newPerPage);
|
||||
};
|
||||
|
||||
const filteredUsers = useMemo(
|
||||
|
||||
+7
-3
@@ -30,7 +30,11 @@ import {
|
||||
Tr
|
||||
} from "@app/components/v2";
|
||||
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 { TAppConnection, useListAppConnections } from "@app/hooks/api/appConnections";
|
||||
import { AppConnection } from "@app/hooks/api/appConnections/enums";
|
||||
@@ -78,12 +82,12 @@ export const AppConnectionsTable = () => {
|
||||
setOrderDirection,
|
||||
setOrderBy
|
||||
} = usePagination<AppConnectionsOrderBy>(AppConnectionsOrderBy.App, {
|
||||
initPerPage: getUserTablePreference("appConnectionsTable", "perPage", 20)
|
||||
initPerPage: getUserTablePreference("appConnectionsTable", PreferenceKey.PerPage, 20)
|
||||
});
|
||||
|
||||
const handlePerPageChange = (newPerPage: number) => {
|
||||
setPerPage(newPerPage);
|
||||
setUserTablePreference("appConnectionsTable", "perPage", newPerPage);
|
||||
setUserTablePreference("appConnectionsTable", PreferenceKey.PerPage, newPerPage);
|
||||
};
|
||||
|
||||
const filteredAppConnections = useMemo(
|
||||
|
||||
+7
-3
@@ -25,7 +25,11 @@ import {
|
||||
Tr
|
||||
} from "@app/components/v2";
|
||||
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 { useListGroupUsers, useOidcManageGroupMembershipsEnabled } from "@app/hooks/api";
|
||||
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
||||
@@ -59,12 +63,12 @@ export const GroupMembersTable = ({ groupId, groupSlug, handlePopUpOpen }: Props
|
||||
orderDirection,
|
||||
toggleOrderDirection
|
||||
} = usePagination(GroupMembersOrderBy.Name, {
|
||||
initPerPage: getUserTablePreference("groupMembersTable", "perPage", 20)
|
||||
initPerPage: getUserTablePreference("groupMembersTable", PreferenceKey.PerPage, 20)
|
||||
});
|
||||
|
||||
const handlePerPageChange = (newPerPage: number) => {
|
||||
setPerPage(newPerPage);
|
||||
setUserTablePreference("groupMembersTable", "perPage", newPerPage);
|
||||
setUserTablePreference("groupMembersTable", PreferenceKey.PerPage, newPerPage);
|
||||
};
|
||||
|
||||
const { currentOrg } = useOrganization();
|
||||
|
||||
+7
-3
@@ -21,7 +21,11 @@ import {
|
||||
THead,
|
||||
Tr
|
||||
} 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 { useGetIdentityProjectMemberships } from "@app/hooks/api";
|
||||
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
||||
@@ -55,12 +59,12 @@ export const IdentityProjectsTable = ({ identityId, handlePopUpOpen }: Props) =>
|
||||
orderDirection,
|
||||
toggleOrderDirection
|
||||
} = usePagination(IdentityProjectsOrderBy.Name, {
|
||||
initPerPage: getUserTablePreference("identityProjectsTable", "perPage", 20)
|
||||
initPerPage: getUserTablePreference("identityProjectsTable", PreferenceKey.PerPage, 20)
|
||||
});
|
||||
|
||||
const handlePerPageChange = (newPerPage: number) => {
|
||||
setPerPage(newPerPage);
|
||||
setUserTablePreference("identityProjectsTable", "perPage", newPerPage);
|
||||
setUserTablePreference("identityProjectsTable", PreferenceKey.PerPage, newPerPage);
|
||||
};
|
||||
|
||||
const filteredProjectMemberships = useMemo(
|
||||
|
||||
+7
-3
@@ -28,7 +28,11 @@ import {
|
||||
} from "@app/components/v2";
|
||||
import { OrgPermissionActions, OrgPermissionSubjects } from "@app/context";
|
||||
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 { useRequestProjectAccess, useSearchProjects } from "@app/hooks/api";
|
||||
import { ProjectType, Workspace } from "@app/hooks/api/workspace/types";
|
||||
@@ -106,12 +110,12 @@ export const AllProjectView = ({
|
||||
toggleOrderDirection,
|
||||
orderDirection
|
||||
} = usePagination("name", {
|
||||
initPerPage: getUserTablePreference("allProjectsTable", "perPage", 50)
|
||||
initPerPage: getUserTablePreference("allProjectsTable", PreferenceKey.PerPage, 50)
|
||||
});
|
||||
|
||||
const handlePerPageChange = (newPerPage: number) => {
|
||||
setPerPage(newPerPage);
|
||||
setUserTablePreference("allProjectsTable", "perPage", newPerPage);
|
||||
setUserTablePreference("allProjectsTable", PreferenceKey.PerPage, newPerPage);
|
||||
};
|
||||
|
||||
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 { OrgPermissionActions, OrgPermissionSubjects, useOrganization } from "@app/context";
|
||||
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 { useGetUserWorkspaces } from "@app/hooks/api";
|
||||
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
||||
@@ -65,12 +69,12 @@ export const MyProjectView = ({
|
||||
toggleOrderDirection,
|
||||
orderDirection
|
||||
} = usePagination(ProjectOrderBy.Name, {
|
||||
initPerPage: getUserTablePreference("myProjectsTable", "perPage", 20)
|
||||
initPerPage: getUserTablePreference("myProjectsTable", PreferenceKey.PerPage, 24)
|
||||
});
|
||||
|
||||
const handlePerPageChange = (newPerPage: number) => {
|
||||
setPerPage(newPerPage);
|
||||
setUserTablePreference("myProjectsTable", "perPage", newPerPage);
|
||||
setUserTablePreference("myProjectsTable", PreferenceKey.PerPage, newPerPage);
|
||||
};
|
||||
|
||||
const { data: projectFavorites, isPending: isProjectFavoritesLoading } =
|
||||
|
||||
@@ -13,7 +13,11 @@ import {
|
||||
useOrganization,
|
||||
useServerConfig
|
||||
} from "@app/context";
|
||||
import { getUserTablePreference, setUserTablePreference } from "@app/helpers/userTablePreferences";
|
||||
import {
|
||||
getUserTablePreference,
|
||||
PreferenceKey,
|
||||
setUserTablePreference
|
||||
} from "@app/helpers/userTablePreferences";
|
||||
import { withPermission } from "@app/hoc";
|
||||
import { usePagination, usePopUp } from "@app/hooks";
|
||||
import {
|
||||
@@ -48,12 +52,12 @@ export const SecretScanningPage = withPermission(
|
||||
|
||||
const { offset, limit, orderBy, setPage, perPage, page, setPerPage } = usePagination(
|
||||
SecretScanningOrderBy.CreatedAt,
|
||||
{ initPerPage: getUserTablePreference("secretScanningTable", "perPage", 20) }
|
||||
{ initPerPage: getUserTablePreference("secretScanningTable", PreferenceKey.PerPage, 20) }
|
||||
);
|
||||
|
||||
const handlePerPageChange = (newPerPage: number) => {
|
||||
setPerPage(newPerPage);
|
||||
setUserTablePreference("secretScanningTable", "perPage", newPerPage);
|
||||
setUserTablePreference("secretScanningTable", PreferenceKey.PerPage, newPerPage);
|
||||
};
|
||||
|
||||
const repositoryNames = watch("repositoryNames");
|
||||
@@ -184,7 +188,7 @@ export const SecretScanningPage = withPermission(
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="mt-8 space-y-3">
|
||||
<div className="mt-8 space-y-2">
|
||||
{integrationEnabled && (
|
||||
<div className="flex w-full items-center justify-end">
|
||||
<SecretScanningFilter
|
||||
@@ -195,7 +199,7 @@ export const SecretScanningPage = withPermission(
|
||||
</div>
|
||||
)}
|
||||
<SecretScanningLogsTable gitRisks={risksData?.risks} isPending={isPending} />
|
||||
{!isPending && risksData?.totalCount !== undefined && (
|
||||
{!isPending && risksData?.totalCount !== undefined && risksData.totalCount >= 10 && (
|
||||
<Pagination
|
||||
className="rounded-md"
|
||||
count={risksData.totalCount}
|
||||
|
||||
+7
-3
@@ -20,7 +20,11 @@ import {
|
||||
THead,
|
||||
Tr
|
||||
} 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 { OrderByDirection } from "@app/hooks/api/generic/types";
|
||||
import { OrgUser } from "@app/hooks/api/types";
|
||||
@@ -54,12 +58,12 @@ export const UserGroupsTable = ({ handlePopUpOpen, orgMembership }: Props) => {
|
||||
orderDirection,
|
||||
toggleOrderDirection
|
||||
} = usePagination(UserGroupsOrderBy.Name, {
|
||||
initPerPage: getUserTablePreference("userGroupsTable", "perPage", 20)
|
||||
initPerPage: getUserTablePreference("userGroupsTable", PreferenceKey.PerPage, 10)
|
||||
});
|
||||
|
||||
const handlePerPageChange = (newPerPage: number) => {
|
||||
setPerPage(newPerPage);
|
||||
setUserTablePreference("userGroupsTable", "perPage", newPerPage);
|
||||
setUserTablePreference("userGroupsTable", PreferenceKey.PerPage, newPerPage);
|
||||
};
|
||||
|
||||
const filteredGroupMemberships = useMemo(
|
||||
|
||||
+7
-3
@@ -22,7 +22,11 @@ import {
|
||||
Tr
|
||||
} from "@app/components/v2";
|
||||
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 { useGetOrgMembershipProjectMemberships } from "@app/hooks/api";
|
||||
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
||||
@@ -56,12 +60,12 @@ export const UserProjectsTable = ({ membershipId, handlePopUpOpen }: Props) => {
|
||||
orderDirection,
|
||||
toggleOrderDirection
|
||||
} = usePagination(UserProjectsOrderBy.Name, {
|
||||
initPerPage: getUserTablePreference("userProjectsTable", "perPage", 20)
|
||||
initPerPage: getUserTablePreference("userProjectsTable", PreferenceKey.PerPage, 10)
|
||||
});
|
||||
|
||||
const handlePerPageChange = (newPerPage: number) => {
|
||||
setPerPage(newPerPage);
|
||||
setUserTablePreference("userProjectsTable", "perPage", newPerPage);
|
||||
setUserTablePreference("userProjectsTable", PreferenceKey.PerPage, newPerPage);
|
||||
};
|
||||
|
||||
const { data: projectMemberships = [], isPending } = useGetOrgMembershipProjectMemberships(
|
||||
|
||||
Reference in New Issue
Block a user