From a85c59e3e2ac8d13b66573b68fd19b0e407a4644 Mon Sep 17 00:00:00 2001 From: Daniel Hougaard <62331820+DanielHougaard@users.noreply.github.com> Date: Mon, 22 Apr 2024 22:00:37 +0200 Subject: [PATCH 1/3] Fix: Improve user experience for machine identities --- .../IdentitySection/IdentityTable.tsx | 132 +++++++++++------- 1 file changed, 82 insertions(+), 50 deletions(-) diff --git a/frontend/src/views/Org/MembersPage/components/OrgIdentityTab/components/IdentitySection/IdentityTable.tsx b/frontend/src/views/Org/MembersPage/components/OrgIdentityTab/components/IdentitySection/IdentityTable.tsx index 804c2d054..ac1cf31c3 100644 --- a/frontend/src/views/Org/MembersPage/components/OrgIdentityTab/components/IdentitySection/IdentityTable.tsx +++ b/frontend/src/views/Org/MembersPage/components/OrgIdentityTab/components/IdentitySection/IdentityTable.tsx @@ -1,9 +1,22 @@ -import { faKey, faLock, faPencil, faServer, faXmark } from "@fortawesome/free-solid-svg-icons"; +import { + faCopy, + faEllipsis, + faKey, + faLock, + faPencil, + faServer, + faXmark +} from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { twMerge } from "tailwind-merge"; import { createNotification } from "@app/components/notifications"; import { OrgPermissionCan } from "@app/components/permissions"; import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuTrigger, EmptyState, IconButton, Select, @@ -44,7 +57,6 @@ type Props = { }; export const IdentityTable = ({ handlePopUpOpen }: Props) => { - const { currentOrg } = useOrganization(); const orgId = currentOrg?.id || ""; @@ -83,7 +95,6 @@ export const IdentityTable = ({ handlePopUpOpen }: Props) => { Name - ID Role Auth Method @@ -98,7 +109,6 @@ export const IdentityTable = ({ handlePopUpOpen }: Props) => { return ( {name} - {id} { {authMethod ? identityAuthToNameMap[authMethod] : "Not configured"} -
+
{authMethod === IdentityAuthMethod.UNIVERSAL_AUTH && ( { colorSchema="primary" variant="plain" ariaLabel="update" - // isDisabled={!isAllowed} > @@ -168,7 +177,6 @@ export const IdentityTable = ({ handlePopUpOpen }: Props) => { colorSchema="primary" variant="plain" ariaLabel="update" - className="ml-4" isDisabled={!isAllowed} > @@ -176,54 +184,78 @@ export const IdentityTable = ({ handlePopUpOpen }: Props) => { )} - - {(isAllowed) => ( - { - handlePopUpOpen("identity", { - identityId: id, - name, - role, - customRole - }); - }} - size="lg" - colorSchema="primary" - variant="plain" - ariaLabel="update" - className="ml-4" - isDisabled={!isAllowed} + + + +
+ +
+
+
+ + - -
- )} -
- - {(isAllowed) => ( - ( + { + if (!isAllowed) return; + handlePopUpOpen("identity", { + identityId: id, + name, + role, + customRole + }); + }} + disabled={!isAllowed} + icon={} + > + Update identity + + )} + + + {(isAllowed) => ( + { + if (!isAllowed) return; + handlePopUpOpen("deleteIdentity", { + identityId: id, + name + }); + }} + icon={} + > + Delete identity + + )} + + { - handlePopUpOpen("deleteIdentity", { - identityId: id, - name + navigator.clipboard.writeText(id); + createNotification({ + text: "Copied identity internal ID to clipboard", + type: "success" }); }} - size="lg" - colorSchema="danger" - variant="plain" - ariaLabel="update" - className="ml-4" - isDisabled={!isAllowed} + icon={} > - - - )} - + Copy internal ID + + +
From fdf5fcad0a26eb51ca6221044b12baf951b0be84 Mon Sep 17 00:00:00 2001 From: Daniel Hougaard <62331820+DanielHougaard@users.noreply.github.com> Date: Mon, 22 Apr 2024 23:09:46 +0200 Subject: [PATCH 2/3] Update IdentityTable.tsx --- .../components/IdentitySection/IdentityTable.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/views/Org/MembersPage/components/OrgIdentityTab/components/IdentitySection/IdentityTable.tsx b/frontend/src/views/Org/MembersPage/components/OrgIdentityTab/components/IdentitySection/IdentityTable.tsx index ac1cf31c3..f621e3e18 100644 --- a/frontend/src/views/Org/MembersPage/components/OrgIdentityTab/components/IdentitySection/IdentityTable.tsx +++ b/frontend/src/views/Org/MembersPage/components/OrgIdentityTab/components/IdentitySection/IdentityTable.tsx @@ -185,13 +185,13 @@ export const IdentityTable = ({ handlePopUpOpen }: Props) => { )} - - -
+ +
+ -
-
- + +
+
Date: Wed, 8 May 2024 09:20:30 -0700 Subject: [PATCH 3/3] Update IdentityTable.tsx --- .../OrgIdentityTab/components/IdentitySection/IdentityTable.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/views/Org/MembersPage/components/OrgIdentityTab/components/IdentitySection/IdentityTable.tsx b/frontend/src/views/Org/MembersPage/components/OrgIdentityTab/components/IdentitySection/IdentityTable.tsx index f621e3e18..fa8529371 100644 --- a/frontend/src/views/Org/MembersPage/components/OrgIdentityTab/components/IdentitySection/IdentityTable.tsx +++ b/frontend/src/views/Org/MembersPage/components/OrgIdentityTab/components/IdentitySection/IdentityTable.tsx @@ -252,7 +252,7 @@ export const IdentityTable = ({ handlePopUpOpen }: Props) => { }} icon={} > - Copy internal ID + Copy Identity ID