Skip to content

Commit 6b11d40

Browse files
authored
Add Tenant page refactor (#617)
Refactored add tenant page to be working with reducers & settings styles
1 parent 8958cbe commit 6b11d40

File tree

23 files changed

+5294
-3340
lines changed

23 files changed

+5294
-3340
lines changed

pkg/acl/endpoints.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ var (
3232
bucketsDetail = "/buckets/:bucketName"
3333
serviceAccounts = "/account"
3434
tenants = "/tenants"
35-
addTenant = "/add-tenant"
3635
tenantsDetail = "/namespaces/:tenantNamespace/tenants/:tenantName"
3736
remoteBuckets = "/remote-buckets"
3837
replication = "/replication"
@@ -282,7 +281,6 @@ var endpointRules = map[string]ConfigurationActionSet{
282281
var operatorRules = map[string]ConfigurationActionSet{
283282
tenants: tenantsActionSet,
284283
tenantsDetail: tenantsActionSet,
285-
addTenant: tenantsActionSet,
286284
license: licenseActionSet,
287285
}
288286

pkg/acl/endpoints_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func TestOperatorOnlyEndpoints(t *testing.T) {
116116
"admin:*",
117117
},
118118
},
119-
want: 4,
119+
want: 3,
120120
},
121121
{
122122
name: "Operator Only - all s3 endpoints",
@@ -125,7 +125,7 @@ func TestOperatorOnlyEndpoints(t *testing.T) {
125125
"s3:*",
126126
},
127127
},
128-
want: 4,
128+
want: 3,
129129
},
130130
{
131131
name: "Operator Only - all admin and s3 endpoints",
@@ -135,14 +135,14 @@ func TestOperatorOnlyEndpoints(t *testing.T) {
135135
"s3:*",
136136
},
137137
},
138-
want: 4,
138+
want: 3,
139139
},
140140
{
141141
name: "Operator Only - default endpoints",
142142
args: args{
143143
[]string{},
144144
},
145-
want: 4,
145+
want: 3,
146146
},
147147
}
148148

portal-ui/bindata_assetfs.go

Lines changed: 284 additions & 337 deletions
Large diffs are not rendered by default.

portal-ui/src/screens/Console/Common/FormComponents/common/styleLibrary.ts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,3 +452,55 @@ export const snackBarCommon = {
452452
maxWidth: "calc(100% - 140px)",
453453
},
454454
};
455+
456+
export const wizardCommon = {
457+
multiContainer: {
458+
display: "flex" as const,
459+
alignItems: "center" as const,
460+
justifyContent: "flex-start" as const,
461+
},
462+
sizeFactorContainer: {
463+
marginLeft: 8,
464+
alignSelf: "flex-start" as const,
465+
},
466+
headerElement: {
467+
position: "sticky" as const,
468+
top: 0,
469+
paddingTop: 5,
470+
marginBottom: 10,
471+
zIndex: 500,
472+
backgroundColor: "#fff",
473+
},
474+
tableTitle: {
475+
fontWeight: 700,
476+
width: "30%",
477+
},
478+
poolError: {
479+
color: "#dc1f2e",
480+
fontSize: "0.75rem",
481+
paddingLeft: 120,
482+
},
483+
error: {
484+
color: "#dc1f2e",
485+
fontSize: "0.75rem",
486+
},
487+
h3Section: {
488+
marginTop: 0,
489+
},
490+
descriptionText: {
491+
fontSize: 13,
492+
color: "#777777",
493+
},
494+
container: {
495+
padding: "77px 0 0 0",
496+
"& h6": {
497+
color: "#777777",
498+
fontSize: 14,
499+
},
500+
"& p": {
501+
"& span:not(*[class*='smallUnit'])": {
502+
fontSize: 16,
503+
},
504+
},
505+
},
506+
};

portal-ui/src/screens/Console/Common/GenericWizard/GenericWizard.tsx

Lines changed: 39 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,31 @@ import React, { useState } from "react";
1818
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
1919
import { IWizardMain } from "./types";
2020
import WizardPage from "./WizardPage";
21-
import { Grid, Paper } from "@material-ui/core";
21+
import { Grid } from "@material-ui/core";
2222

2323
const styles = (theme: Theme) =>
2424
createStyles({
2525
wizardMain: {
2626
display: "flex",
2727
width: "100%",
28+
height: "100%",
2829
flexGrow: 1,
2930
},
3031
wizFromContainer: {
31-
marginTop: "32px",
32+
height: "calc(100vh - 365px)",
33+
minHeight: 450,
34+
padding: "0 30px",
3235
},
3336
wizardSteps: {
3437
minWidth: 180,
3538
marginRight: 10,
39+
borderRight: "#eaeaea 1px solid",
40+
display: "flex",
41+
flexGrow: 1,
42+
flexDirection: "column",
43+
height: "100%",
3644
"& ul": {
37-
padding: "0px 15px 0 30px",
45+
padding: "0 15px 0 40px",
3846
marginTop: "0px",
3947

4048
"& li": {
@@ -56,15 +64,14 @@ const styles = (theme: Theme) =>
5664
boxShadow: "none",
5765
},
5866
},
59-
paddedGridItem: {
60-
padding: "0px 10px 0px 10px",
67+
paddedContentGrid: {
68+
padding: "0 10px",
6169
},
62-
menuPaper: {
63-
padding: "20px",
64-
},
65-
paperContainer: {
66-
padding: "10px",
67-
maxWidth: "900px",
70+
stepsLabel: {
71+
fontSize: 20,
72+
color: "#393939",
73+
fontWeight: 600,
74+
margin: "15px 12px",
6875
},
6976
});
7077

@@ -114,34 +121,25 @@ const GenericWizard = ({ classes, wizardSteps }: IWizardMain) => {
114121

115122
return (
116123
<Grid container className={classes.wizFromContainer}>
117-
<Grid
118-
item
119-
xs={12}
120-
sm={3}
121-
md={3}
122-
lg={3}
123-
xl={2}
124-
className={classes.paddedGridItem}
125-
>
126-
<Paper className={classes.menuPaper}>
127-
<div className={classes.wizardSteps}>
128-
<ul>
129-
{wizardSteps.map((step, index) => {
130-
return (
131-
<li key={`wizard-${index.toString()}`}>
132-
<button
133-
onClick={() => pageChange(index)}
134-
disabled={index > currentStep}
135-
className={classes.buttonList}
136-
>
137-
{step.label}
138-
</button>
139-
</li>
140-
);
141-
})}
142-
</ul>
143-
</div>
144-
</Paper>
124+
<Grid item xs={12} sm={3} md={3} lg={3} xl={2}>
125+
<div className={classes.wizardSteps}>
126+
<span className={classes.stepsLabel}>Steps</span>
127+
<ul>
128+
{wizardSteps.map((step, index) => {
129+
return (
130+
<li key={`wizard-${index.toString()}`}>
131+
<button
132+
onClick={() => pageChange(index)}
133+
disabled={index > currentStep}
134+
className={classes.buttonList}
135+
>
136+
{step.label}
137+
</button>
138+
</li>
139+
);
140+
})}
141+
</ul>
142+
</div>
145143
</Grid>
146144
<Grid
147145
item
@@ -150,11 +148,9 @@ const GenericWizard = ({ classes, wizardSteps }: IWizardMain) => {
150148
md={9}
151149
lg={9}
152150
xl={10}
153-
className={classes.paddedGridItem}
151+
className={classes.paddedContentGrid}
154152
>
155-
<Paper className={classes.paperContainer}>
156-
<WizardPage page={wizardSteps[currentStep]} pageChange={pageChange} />
157-
</Paper>
153+
<WizardPage page={wizardSteps[currentStep]} pageChange={pageChange} />
158154
</Grid>
159155
</Grid>
160156
);

portal-ui/src/screens/Console/Common/GenericWizard/WizardPage.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,14 @@ const styles = (theme: Theme) =>
2828
wizardComponent: {
2929
overflowY: "auto",
3030
marginBottom: 10,
31+
height: "calc(100vh - 435px)",
3132
},
3233
buttonsContainer: {
3334
display: "flex",
3435
flexDirection: "row",
3536
justifyContent: "flex-end" as const,
37+
padding: "10px 0",
38+
borderTop: "#EAEAEA 1px solid",
3639
"& button": {
3740
marginLeft: 10,
3841
},

portal-ui/src/screens/Console/Console.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import Users from "./Users/Users";
4545
import Groups from "./Groups/Groups";
4646
import ConfigurationMain from "./Configurations/ConfigurationMain";
4747
import WebhookPanel from "./Configurations/ConfigurationPanels/WebhookPanel";
48-
import ListTenants from "./Tenants/ListTenants/ListTenants";
48+
import TenantsMain from "./Tenants/TenantsMain";
4949
import TenantDetails from "./Tenants/TenantDetails/TenantDetails";
5050
import ObjectBrowser from "./ObjectBrowser/ObjectBrowser";
5151
import ObjectRouting from "./Buckets/ListBuckets/Objects/ListObjects/ObjectRouting";
@@ -55,7 +55,6 @@ import LogsMain from "./Logs/LogsMain";
5555
import Heal from "./Heal/Heal";
5656
import Watch from "./Watch/Watch";
5757
import HealthInfo from "./HealthInfo/HealthInfo";
58-
import AddTenant from "./Tenants/ListTenants/AddTenant";
5958

6059
const drawerWidth = 245;
6160

@@ -291,13 +290,9 @@ const Console = ({
291290
path: "/webhook/audit",
292291
},
293292
{
294-
component: ListTenants,
293+
component: TenantsMain,
295294
path: "/tenants",
296295
},
297-
{
298-
component: AddTenant,
299-
path: "/add-tenant",
300-
},
301296
{
302297
component: TenantDetails,
303298
path: "/namespaces/:tenantNamespace/tenants/:tenantName",

0 commit comments

Comments
 (0)