mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-13 14:29:35 +00:00
Update rendering custo role slugs in ST V3 table / modal
This commit is contained in:
@@ -47,6 +47,10 @@ export type ServiceTokenDataV3 = {
|
||||
_id: string;
|
||||
name: string;
|
||||
role: string;
|
||||
customRole?: {
|
||||
name: string;
|
||||
slug: string;
|
||||
};
|
||||
workspace: string;
|
||||
isActive: boolean;
|
||||
refreshTokenLastUsed?: string;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { motion } from "framer-motion";
|
||||
|
||||
import { Tab, TabList, TabPanel, Tabs } from "@app/components/v2";
|
||||
import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";
|
||||
import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";
|
||||
import { withProjectPermission } from "@app/hoc";
|
||||
|
||||
import { MemberListTab } from "./components/MemberListTab";
|
||||
|
||||
@@ -74,6 +74,7 @@ export const MemberListTab = () => {
|
||||
orgId,
|
||||
workspaceId
|
||||
});
|
||||
|
||||
const { data: wsKey } = useGetUserWsKey(workspaceId);
|
||||
const { data: members, isLoading: isMembersLoading } = useGetWorkspaceUsers(workspaceId);
|
||||
const { data: orgUsers } = useGetOrgUsers(orgId);
|
||||
|
||||
+5
-1
@@ -151,6 +151,10 @@ export const AddServiceTokenV3Modal = ({
|
||||
serviceTokenDataId: string;
|
||||
name: string;
|
||||
role: string;
|
||||
customRole: {
|
||||
name: string;
|
||||
slug: string;
|
||||
};
|
||||
trustedIps: ServiceTokenV3TrustedIp[];
|
||||
accessTokenTTL: number;
|
||||
isRefreshTokenRotationEnabled: boolean;
|
||||
@@ -161,7 +165,7 @@ export const AddServiceTokenV3Modal = ({
|
||||
if (serviceTokenData) {
|
||||
reset({
|
||||
name: serviceTokenData.name,
|
||||
role: serviceTokenData.role,
|
||||
role: serviceTokenData?.customRole?.slug ?? serviceTokenData.role,
|
||||
trustedIps: serviceTokenData.trustedIps.map(({
|
||||
ipAddress,
|
||||
prefix
|
||||
|
||||
+8
-2
@@ -32,6 +32,10 @@ type Props = {
|
||||
serviceTokenDataId?: string;
|
||||
name?: string;
|
||||
role?: string;
|
||||
customRole?: {
|
||||
name: string;
|
||||
slug: string;
|
||||
};
|
||||
trustedIps?: ServiceTokenV3TrustedIp[];
|
||||
accessTokenTTL?: number;
|
||||
isRefreshTokenRotationEnabled?: boolean;
|
||||
@@ -46,7 +50,7 @@ export const ServiceTokenV3Table = ({
|
||||
const { currentWorkspace } = useWorkspace();
|
||||
const { data, isLoading } = useGetWorkspaceServiceTokenDataV3(currentWorkspace?._id || "");
|
||||
const { mutateAsync: updateMutateAsync } = useUpdateServiceTokenV3();
|
||||
|
||||
|
||||
const handleToggleServiceTokenDataStatus = async ({
|
||||
serviceTokenDataId,
|
||||
isActive
|
||||
@@ -98,6 +102,7 @@ export const ServiceTokenV3Table = ({
|
||||
name,
|
||||
isActive,
|
||||
role,
|
||||
customRole,
|
||||
trustedIps,
|
||||
createdAt,
|
||||
expiresAt,
|
||||
@@ -127,7 +132,7 @@ export const ServiceTokenV3Table = ({
|
||||
)}
|
||||
</ProjectPermissionCan>
|
||||
</Td>
|
||||
<Td>{role}</Td>
|
||||
<Td>{customRole?.slug ?? role}</Td>
|
||||
<Td>
|
||||
{trustedIps.map(({
|
||||
_id: trustedIpId,
|
||||
@@ -156,6 +161,7 @@ export const ServiceTokenV3Table = ({
|
||||
serviceTokenDataId: _id,
|
||||
name,
|
||||
role,
|
||||
customRole,
|
||||
trustedIps,
|
||||
accessTokenTTL,
|
||||
isRefreshTokenRotationEnabled
|
||||
|
||||
Reference in New Issue
Block a user