From 5c3a031133722e2007412435ffc5496e81a856ad Mon Sep 17 00:00:00 2001 From: Jean-Baptiste WATENBERG Date: Wed, 22 Jun 2022 22:47:55 +0200 Subject: [PATCH] ZKUI-184: UI, UX and style review --- package-lock.json | 10 +- package.json | 2 +- src/js/IAMClient.ts | 18 + src/react/account/AccountContent.tsx | 11 +- src/react/account/AccountCreateUser.tsx | 3 +- src/react/account/AccountPoliciesList.tsx | 14 +- src/react/account/AccountUserList.tsx | 27 ++ .../AttachmentConfirmationModal.tsx | 361 ++++++++++----- .../account/iamAttachment/AttachmentTable.tsx | 416 ++++++++++++------ .../account/iamAttachment/AttachmentTabs.tsx | 222 +++++++++- .../account/iamAttachment/AttachmentTypes.ts | 2 +- .../account/iamAttachment/Attachments.tsx | 84 +++- src/react/queries.ts | 48 +- tsconfig.json | 2 +- 14 files changed, 916 insertions(+), 304 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7db0419bd..803dc7739 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@hapi/joi": "^17.1.1", "@hapi/joi-date": "^2.0.1", "@hookform/resolvers": "^2.8.8", - "@scality/core-ui": "github:scality/core-ui.git#v0.38.11", + "@scality/core-ui": "github:scality/core-ui.git#v0.39.0", "@types/react-table": "^7.7.10", "@types/react-virtualized": "^9.21.20", "@types/react-window": "^1.8.5", @@ -3139,8 +3139,8 @@ } }, "node_modules/@scality/core-ui": { - "version": "0.38.11", - "resolved": "git+ssh://git@github.com/scality/core-ui.git#1b602bb094453d70193c1b1a87e49e9a9917ea30", + "version": "0.39.0", + "resolved": "git+ssh://git@github.com/scality/core-ui.git#d6d7fbe5c09f5e7c511e9355a1390712f2ada9e5", "license": "SEE LICENSE IN LICENSE", "dependencies": { "@floating-ui/dom": "^0.1.10" @@ -25853,8 +25853,8 @@ } }, "@scality/core-ui": { - "version": "git+ssh://git@github.com/scality/core-ui.git#1b602bb094453d70193c1b1a87e49e9a9917ea30", - "from": "@scality/core-ui@github:scality/core-ui.git#v0.38.11", + "version": "git+ssh://git@github.com/scality/core-ui.git#d6d7fbe5c09f5e7c511e9355a1390712f2ada9e5", + "from": "@scality/core-ui@github:scality/core-ui.git#v0.39.0", "requires": { "@floating-ui/dom": "^0.1.10" } diff --git a/package.json b/package.json index 52984b410..b73121ddf 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "@hapi/joi": "^17.1.1", "@hapi/joi-date": "^2.0.1", "@hookform/resolvers": "^2.8.8", - "@scality/core-ui": "github:scality/core-ui.git#v0.38.11", + "@scality/core-ui": "github:scality/core-ui.git#v0.39.0", "@types/react-table": "^7.7.10", "@types/react-virtualized": "^9.21.20", "@types/react-window": "^1.8.5", diff --git a/src/js/IAMClient.ts b/src/js/IAMClient.ts index 6925555ea..f869e8143 100644 --- a/src/js/IAMClient.ts +++ b/src/js/IAMClient.ts @@ -321,6 +321,24 @@ export default class IAMClient implements IAMClientInterface { }) .promise(); } + + listGroups(maxItems?: number, marker?: string) { + return notFalsyTypeGuard(this.client) + .listGroups({ + MaxItems: maxItems, + Marker: marker, + }) + .promise(); + } + + listRoles(maxItems?: number, marker?: string) { + return notFalsyTypeGuard(this.client) + .listRoles({ + MaxItems: maxItems, + Marker: marker, + }) + .promise(); + } } // OFFLINE // export default class IAMClient { // constructor() { diff --git a/src/react/account/AccountContent.tsx b/src/react/account/AccountContent.tsx index 28c9ae449..9a7b75b45 100644 --- a/src/react/account/AccountContent.tsx +++ b/src/react/account/AccountContent.tsx @@ -10,8 +10,7 @@ import CreateWorkflow from '../workflow/CreateWorkflow'; import Workflows from '../workflow/Workflows'; import { useCurrentAccount } from '../DataServiceRoleProvider'; import CreateAccountPolicy from './CreateAccountPolicy'; -import AttachmentTabs from './iamAttachment/AttachmentTabs'; -import AttachmentConfirmationModal from './iamAttachment/AttachmentConfirmationModal'; +import Attachments from './iamAttachment/Attachments'; function AccountContent() { const { path } = useRouteMatch(); @@ -33,11 +32,11 @@ function AccountContent() { - {/* - - */} + + + - + diff --git a/src/react/account/AccountCreateUser.tsx b/src/react/account/AccountCreateUser.tsx index 614672938..e5941b89b 100644 --- a/src/react/account/AccountCreateUser.tsx +++ b/src/react/account/AccountCreateUser.tsx @@ -132,8 +132,7 @@ const AccountCreateUser = () => { diff --git a/src/react/account/AccountPoliciesList.tsx b/src/react/account/AccountPoliciesList.tsx index cf80cd9a7..8f7ad3510 100644 --- a/src/react/account/AccountPoliciesList.tsx +++ b/src/react/account/AccountPoliciesList.tsx @@ -256,13 +256,6 @@ const AccountPoliciesList = ({ accountName }: { accountName: string }) => { }; const columns = [ - { - Header: 'Policy Path', - accessor: 'policyPath', - cellStyle: { - minWidth: '10rem', - }, - }, { Header: 'Policy Name', accessor: 'policyName', @@ -271,6 +264,13 @@ const AccountPoliciesList = ({ accountName }: { accountName: string }) => { }, Cell: (value) => , }, + { + Header: 'Policy Path', + accessor: 'policyPath', + cellStyle: { + minWidth: '10rem', + }, + }, { Header: 'Last Modified', accessor: 'modifiedOn', diff --git a/src/react/account/AccountUserList.tsx b/src/react/account/AccountUserList.tsx index 6035fa1ba..a072b5a26 100644 --- a/src/react/account/AccountUserList.tsx +++ b/src/react/account/AccountUserList.tsx @@ -124,6 +124,32 @@ const EditButton = ({ userName }: { userName: string }) => { ); }; +const AttachButton = ({ + userName, + accountName, +}: { + userName: string; + accountName: string; +}) => { + const history = useHistory(); + return ( + +