From 9a8dff91bdfc6f5bf4035608e5ca52b9af661a4a Mon Sep 17 00:00:00 2001 From: Scott Wilson Date: Fri, 28 Nov 2025 10:37:39 -0800 Subject: [PATCH 1/3] improvement: update project identity creation flow --- .../IdentitySection/IdentitySection.tsx | 6 +- .../components/IdentityTab/IdentityTab.tsx | 140 ++++++++++++------ .../components/ProjectLinkIdentityModal.tsx | 13 +- 3 files changed, 103 insertions(+), 56 deletions(-) diff --git a/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/IdentitySection.tsx b/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/IdentitySection.tsx index 3d503d372..c71dc8055 100644 --- a/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/IdentitySection.tsx +++ b/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/IdentitySection.tsx @@ -203,7 +203,11 @@ export const IdentitySection = withPermission( > { const { currentProject, projectId } = useProject(); const navigate = useNavigate(); const { isSubOrganization, currentOrg } = useOrganization(); - const [wizardStep, setWizardStep] = useState(WizardSteps.SelectAction); + const [addMachineIdentityType, setAddMachineIdentityType] = useState< + "create-new" | "assign-existing" + >("create-new"); const { offset, @@ -510,16 +505,87 @@ export const IdentityTab = withProjectPermission( isOpen={popUp.createIdentity.isOpen} onOpenChange={(open) => { handlePopUpToggle("createIdentity", open); - if (!open) setWizardStep(WizardSteps.SelectAction); }} > - - {wizardStep === WizardSteps.SelectAction && ( +
+
+ + +
+ +

+ You can add machine identities to your project in one of two ways: +

+
    +
  • + Create New - + Create a dedicated machine identity managed at the project-level. +

    + This method is recommended for autonomous teams that need to manage + machine identity authentication. +

    +
  • +
  • + Assign Existing{" "} + - Assign an existing machine identity from your organization. +

    + This method is recommended for organizations that need to maintain + centralized control. +

    +
  • +
+ + } + > + +
+
+ {/*

+ {addType === "create-new" ? ( + <> + + + ) : ( + <> + + + )} +

*/} + {/* {addType === WizardSteps.SelectAction && ( setWizardStep(WizardSteps.ProjectIdentity)} + onClick={() => setAddType(WizardSteps.ProjectIdentity)} onKeyDown={(e) => { if (e.key === "Enter") { - setWizardStep(WizardSteps.ProjectIdentity); + setAddType(WizardSteps.ProjectIdentity); } }} > @@ -551,10 +617,10 @@ export const IdentityTab = withProjectPermission( className="mt-4 cursor-pointer rounded-md border border-mineshaft-600 p-4 transition-all hover:bg-mineshaft-700" role="button" tabIndex={0} - onClick={() => setWizardStep(WizardSteps.LinkIdentity)} + onClick={() => setAddType(WizardSteps.LinkIdentity)} onKeyDown={(e) => { if (e.key === "Enter") { - setWizardStep(WizardSteps.LinkIdentity); + setAddType(WizardSteps.LinkIdentity); } }} > @@ -568,35 +634,17 @@ export const IdentityTab = withProjectPermission( - )} - {wizardStep === WizardSteps.ProjectIdentity && ( - - { - handlePopUpClose("createIdentity"); - setWizardStep(WizardSteps.SelectAction); - }} - /> - - )} - {wizardStep === WizardSteps.LinkIdentity && ( - - - - )} -
+ )} */} + {addMachineIdentityType === "create-new" && ( + { + handlePopUpClose("createIdentity"); + }} + /> + )} + {addMachineIdentityType === "assign-existing" && ( + + )}
{ handlePopUpToggle("createIdentity", false); }; - if (isMembershipsLoading || isRolesLoading) - return ( -
- -
- ); - return (
{ ({ @@ -142,6 +136,7 @@ export const ProjectLinkIdentityModal = ({ handlePopUpToggle }: Props) => { > { isLoading={isSubmitting} isDisabled={isSubmitting} > - Link + Assign to Project @@ -574,14 +583,14 @@ export const IdentityTab = withProjectPermission( - {addMachineIdentityType === "create-new" && ( + {addMachineIdentityType === AddIdentityType.CreateNew && ( { handlePopUpClose("createIdentity"); }} /> )} - {addMachineIdentityType === "assign-existing" && ( + {addMachineIdentityType === AddIdentityType.AssignExisting && ( )}