Skip to content

Commit

Permalink
ZKUI-184: UI, UX and style review
Browse files Browse the repository at this point in the history
  • Loading branch information
JBWatenbergScality committed Jun 27, 2022
1 parent fe10d22 commit 5c3a031
Show file tree
Hide file tree
Showing 14 changed files with 916 additions and 304 deletions.
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
18 changes: 18 additions & 0 deletions src/js/IAMClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
11 changes: 5 additions & 6 deletions src/react/account/AccountContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -33,11 +32,11 @@ function AccountContent() {
<Route path={`${path}/users/:IAMUserName/access-keys`}>
<AccountUserAccessKeys />
</Route>
{/* <Route path={`${path}/users/:IAMUserName/attachments`}>
<AttachmentTabs />
</Route> */}
<Route path={`${path}/users/:IAMUserName/attachments`}>
<Attachments />
</Route>
<Route path={`${path}/policies/:policyArn/attachments`}>
<AttachmentConfirmationModal />
<Attachments />
</Route>
<Route path={`${path}/workflows/create-workflow`}>
<CreateWorkflow />
Expand Down
3 changes: 1 addition & 2 deletions src/react/account/AccountCreateUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ const AccountCreateUser = () => {
<F.Input
type="text"
id="name"
{...register('name')}
onChange={clearServerError}
{...register('name', { onChange: clearServerError })}
autoComplete="new-password"
/>
<F.ErrorInput id="error-name" hasError={errors.name}>
Expand Down
14 changes: 7 additions & 7 deletions src/react/account/AccountPoliciesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,6 @@ const AccountPoliciesList = ({ accountName }: { accountName: string }) => {
};

const columns = [
{
Header: 'Policy Path',
accessor: 'policyPath',
cellStyle: {
minWidth: '10rem',
},
},
{
Header: 'Policy Name',
accessor: 'policyName',
Expand All @@ -271,6 +264,13 @@ const AccountPoliciesList = ({ accountName }: { accountName: string }) => {
},
Cell: (value) => <AccessPolicyNameCell rowValues={value.row.original} />,
},
{
Header: 'Policy Path',
accessor: 'policyPath',
cellStyle: {
minWidth: '10rem',
},
},
{
Header: 'Last Modified',
accessor: 'modifiedOn',
Expand Down
27 changes: 27 additions & 0 deletions src/react/account/AccountUserList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,32 @@ const EditButton = ({ userName }: { userName: string }) => {
);
};

const AttachButton = ({
userName,
accountName,
}: {
userName: string;
accountName: string;
}) => {
const history = useHistory();
return (
<SpacedBox ml={12}>
<Button
style={{ height: spacing.sp24 }}
variant="secondary"
label="Attach"
icon={<i className="fas fa-link"></i>}
onClick={() =>
history.push(
`/accounts/${accountName}/users/${userName}/attachments`,
)
}
aria-label={`Attach ${userName}`}
/>
</SpacedBox>
);
};

const ActionButtons = ({
rowValues,
accountName,
Expand All @@ -134,6 +160,7 @@ const ActionButtons = ({
const { arn, userName } = rowValues;
return (
<Box display={'flex'}>
<AttachButton userName={userName} accountName={accountName || ''} />
<EditButton userName={userName} />
<CopyButton text={arn} labelName={'ARN'} />
<DeleteUserAction userName={userName} accountName={accountName} />
Expand Down
Loading

0 comments on commit 5c3a031

Please sign in to comment.