From 84ca78331a1371c7d01a128a33e3f8c14ce7ad47 Mon Sep 17 00:00:00 2001 From: Scott Wilson Date: Thu, 11 Dec 2025 15:05:02 -0800 Subject: [PATCH] improvements: address feedback --- .../v1/user-additional-privilege-router.ts | 1 + .../src/components/v3/generic/Alert/Alert.tsx | 5 ++-- .../IdentityAuthFieldDisplay.tsx | 2 +- .../IdentityDetailsByIDPage.tsx | 22 +++++++++++------- .../ProjectIdentityDetailsSection.tsx | 23 ++++++++++++------- .../ProjectMemberDetailsSection.tsx | 10 ++++---- 6 files changed, 38 insertions(+), 25 deletions(-) diff --git a/backend/src/ee/routes/v1/user-additional-privilege-router.ts b/backend/src/ee/routes/v1/user-additional-privilege-router.ts index 926b22231..debaa12cf 100644 --- a/backend/src/ee/routes/v1/user-additional-privilege-router.ts +++ b/backend/src/ee/routes/v1/user-additional-privilege-router.ts @@ -142,6 +142,7 @@ export const registerUserAdditionalPrivilegeRouter = async (server: FastifyZodPr data: { ...req.body, ...req.body.type, + name: req.body.slug, permissions: req.body.permissions ? // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore-error this is valid ts diff --git a/frontend/src/components/v3/generic/Alert/Alert.tsx b/frontend/src/components/v3/generic/Alert/Alert.tsx index a5de2cb91..2e8190df1 100644 --- a/frontend/src/components/v3/generic/Alert/Alert.tsx +++ b/frontend/src/components/v3/generic/Alert/Alert.tsx @@ -11,8 +11,9 @@ const alertVariants = cva( variants: { variant: { default: "bg-container text-card-foreground", - info: "bg-info/10 text-info border-info/20", - org: "bg-org/10 text-org border-org/20" + info: "bg-info/5 text-info border-info/20", + org: "bg-org/5 text-org border-org/20", + "sub-org": "bg-sub-org/5 text-sub-org border-sub-org/20" } }, defaultVariants: { diff --git a/frontend/src/pages/organization/IdentityDetailsByIDPage/components/ViewIdentityAuth/IdentityAuthFieldDisplay.tsx b/frontend/src/pages/organization/IdentityDetailsByIDPage/components/ViewIdentityAuth/IdentityAuthFieldDisplay.tsx index 5075d9643..ba5036d74 100644 --- a/frontend/src/pages/organization/IdentityDetailsByIDPage/components/ViewIdentityAuth/IdentityAuthFieldDisplay.tsx +++ b/frontend/src/pages/organization/IdentityDetailsByIDPage/components/ViewIdentityAuth/IdentityAuthFieldDisplay.tsx @@ -16,7 +16,7 @@ export const IdentityAuthFieldDisplay = ({ label, children, className }: Props) {children ? (

{children}

) : ( -

Not set

+

Not set

)} diff --git a/frontend/src/pages/project/IdentityDetailsByIDPage/IdentityDetailsByIDPage.tsx b/frontend/src/pages/project/IdentityDetailsByIDPage/IdentityDetailsByIDPage.tsx index 414ab5b58..483831d9c 100644 --- a/frontend/src/pages/project/IdentityDetailsByIDPage/IdentityDetailsByIDPage.tsx +++ b/frontend/src/pages/project/IdentityDetailsByIDPage/IdentityDetailsByIDPage.tsx @@ -16,6 +16,7 @@ import { } from "@app/components/v2"; import { OrgIcon, + SubOrgIcon, UnstableAlert, UnstableAlertDescription, UnstableAlertTitle, @@ -164,6 +165,10 @@ const Page = () => { return ; } + const isOrgIdentity = !isProjectIdentity; + const isSubOrgIdentity = + isOrgIdentity && currentOrg.rootOrgId !== identityMembershipDetails?.identity.orgId; + return (
{identityMembershipDetails ? ( @@ -255,7 +260,8 @@ const Page = () => {
@@ -274,15 +280,15 @@ const Page = () => { - - + + {isSubOrgIdentity ? : } - Machine identity managed by organization + Machine identity managed by {isSubOrgIdentity ? "sub-" : ""}organization

- This machine identity's authentication methods are controlled by your - organization.
To make changes,{" "} + This machine identity's authentication methods are managed by your + {isSubOrgIdentity ? "sub-" : ""}organization.
To make changes,{" "} { className="inline-block cursor-pointer text-foreground underline underline-offset-2" params={{ identityId, - orgId: currentOrg.id + orgId: identityMembershipDetails.identity.orgId }} > - go to organization access control + go to {isSubOrgIdentity ? "sub-" : ""}organization access control ) : null } diff --git a/frontend/src/pages/project/IdentityDetailsByIDPage/components/ProjectIdentityDetailsSection.tsx b/frontend/src/pages/project/IdentityDetailsByIDPage/components/ProjectIdentityDetailsSection.tsx index f33675e8e..34df3888b 100644 --- a/frontend/src/pages/project/IdentityDetailsByIDPage/components/ProjectIdentityDetailsSection.tsx +++ b/frontend/src/pages/project/IdentityDetailsByIDPage/components/ProjectIdentityDetailsSection.tsx @@ -12,6 +12,7 @@ import { DetailValue, OrgIcon, ProjectIcon, + SubOrgIcon, UnstableButtonGroup, UnstableCard, UnstableCardAction, @@ -30,10 +31,16 @@ import { ProjectIdentityModal } from "@app/pages/project/AccessControlPage/compo type Props = { identity: TProjectIdentity; isOrgIdentity?: boolean; + isSubOrgIdentity?: boolean; membership: IdentityProjectMembershipV1; }; -export const ProjectIdentityDetailsSection = ({ identity, isOrgIdentity, membership }: Props) => { +export const ProjectIdentityDetailsSection = ({ + identity, + isOrgIdentity, + isSubOrgIdentity, + membership +}: Props) => { // eslint-disable-next-line @typescript-eslint/naming-convention,@typescript-eslint/no-unused-vars const [_, isCopyingId, setCopyTextId] = useTimedReset({ initialState: "Copy ID to clipboard" @@ -90,7 +97,7 @@ export const ProjectIdentityDetailsSection = ({ identity, isOrgIdentity, members variant="ghost" size="xs" > - {/* TODO(scott): color this should be a button variant */} + {/* TODO(scott): color this should be a button variant and create re-usable copy button */} {isCopyingId ? : } @@ -100,9 +107,9 @@ export const ProjectIdentityDetailsSection = ({ identity, isOrgIdentity, members Managed by {isOrgIdentity ? ( - - - Organization + + {isSubOrgIdentity ? : } + {isSubOrgIdentity ? "Sub-" : ""}Organization ) : ( @@ -127,7 +134,7 @@ export const ProjectIdentityDetailsSection = ({ identity, isOrgIdentity, members )) ) : ( - No metadata + No metadata )} @@ -143,7 +150,7 @@ export const ProjectIdentityDetailsSection = ({ identity, isOrgIdentity, members {membership.lastLoginAuthMethod ? ( identityAuthToNameMap[membership.lastLoginAuthMethod] ) : ( - N/A + N/A )} @@ -153,7 +160,7 @@ export const ProjectIdentityDetailsSection = ({ identity, isOrgIdentity, members {membership.lastLoginTime ? ( format(membership.lastLoginTime, "PPpp") ) : ( - N/A + N/A )} diff --git a/frontend/src/pages/project/MemberDetailsByIDPage/components/ProjectMemberDetailsSection.tsx b/frontend/src/pages/project/MemberDetailsByIDPage/components/ProjectMemberDetailsSection.tsx index 78b3dc5ce..09cd3593d 100644 --- a/frontend/src/pages/project/MemberDetailsByIDPage/components/ProjectMemberDetailsSection.tsx +++ b/frontend/src/pages/project/MemberDetailsByIDPage/components/ProjectMemberDetailsSection.tsx @@ -48,7 +48,7 @@ export const ProjectMemberDetailsSection = ({ membership }: Props) => { Name - {name || Not set} + {name || Not set} ID @@ -63,7 +63,7 @@ export const ProjectMemberDetailsSection = ({ membership }: Props) => { variant="ghost" size="xs" > - {/* TODO(scott): color this should be a button variant */} + {/* TODO(scott): color this should be a button variant and create re-usable copy button */} {isCopyingId ? : } @@ -82,7 +82,7 @@ export const ProjectMemberDetailsSection = ({ membership }: Props) => { variant="ghost" size="xs" > - {/* TODO(scott): color this should be a button variant */} + {/* TODO(scott): color this should be a button variant and create re-usable copy button */} {isCopyingEmail ? : } @@ -91,9 +91,7 @@ export const ProjectMemberDetailsSection = ({ membership }: Props) => { {username !== email && ( Username - - {email || Not set} - + {username || Not set} )}