Skip to content

Commit e683e35

Browse files
author
Benjamin Perez
committed
Updated help box for license request
1 parent aaf27e3 commit e683e35

File tree

7 files changed

+56
-30
lines changed

7 files changed

+56
-30
lines changed

portal-ui/src/common/HelpBox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const styles = (theme: Theme) =>
5252
interface IHelpBox {
5353
classes: any;
5454
iconComponent: any;
55-
title: string;
55+
title: string | React.ReactNode;
5656
help: any;
5757
}
5858

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ const HealthInfo = ({ classes }: IHealthInfo) => {
257257
<Fragment>
258258
<PageHeader label="Health" />
259259
<PageLayout>
260-
{!registeredCluster && <RegisterCluster />}
260+
{!registeredCluster && <RegisterCluster compactMode />}
261261
<Grid item xs={12} className={classes.boxy}>
262262
<TestWrapper title={title} advancedVisible={false}>
263263
<Grid container className={classes.buttons}>
@@ -325,7 +325,7 @@ const HealthInfo = ({ classes }: IHealthInfo) => {
325325
</Grid>
326326
</TestWrapper>
327327
</Grid>
328-
{!diagStarted && (
328+
{!diagStarted && registeredCluster && (
329329
<Fragment>
330330
<br />
331331
<HelpBox

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ const Speedtest = () => {
206206
<Fragment>
207207
<PageHeader label="Performance" />
208208
<PageLayout>
209-
{plan !== "STANDARD" && plan !== "ENTERPRISE" && <RegisterCluster />}
209+
{!registeredCluster && <RegisterCluster compactMode />}
210210
{!distributedSetup ? (
211211
<DistributedOnly
212212
iconComponent={<SpeedtestIcon />}
@@ -311,7 +311,7 @@ const Speedtest = () => {
311311
</Grid>
312312
</Grid>
313313

314-
{!start && !currStatus && (
314+
{!start && !currStatus && registeredCluster && (
315315
<Fragment>
316316
<br />
317317
<HelpBox

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ const Profile = ({ classes }: IProfileProps) => {
144144
<Fragment>
145145
<PageHeader label="Profile" />
146146
<PageLayout>
147-
{plan !== "STANDARD" && plan !== "ENTERPRISE" && <RegisterCluster />}
147+
{plan !== "STANDARD" && plan !== "ENTERPRISE" && <RegisterCluster compactMode />}
148148
<Grid item xs={12} className={classes.boxy}>
149149
<Grid item xs={12} className={classes.dropdown}>
150150
<Grid

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is part of MinIO Console Server
2-
// Copyright (c) 2021 MinIO, Inc.
2+
// Copyright (c) 2022 MinIO, Inc.
33
//
44
// This program is free software: you can redistribute it and/or modify
55
// it under the terms of the GNU Affero General Public License as published by

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

Lines changed: 48 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,48 @@
1414
// You should have received a copy of the GNU Affero General Public License
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

17-
import React from "react";
17+
import React, { Fragment } from "react";
1818
import Grid from "@mui/material/Grid";
1919
import { Box, Button } from "@mui/material";
2020
import { useNavigate } from "react-router-dom";
21+
import WarnIcon from "../../../icons/WarnIcon";
22+
import HelpBox from "../../../common/HelpBox";
2123

22-
const RegisterCluster = () => {
24+
interface IRegisterCluster {
25+
compactMode?: boolean;
26+
}
27+
28+
const RegisterCluster = ({ compactMode = false }: IRegisterCluster) => {
2329
const navigate = useNavigate();
2430

31+
const redirectButton = (<Button
32+
type="submit"
33+
variant="contained"
34+
color="primary"
35+
onClick={() => navigate("/support/register")}
36+
>
37+
Register your Cluster
38+
</Button>);
39+
40+
const registerMessage = "Use your MinIO Subscription Network login credentials to register this cluster.";
41+
42+
if (compactMode) {
43+
return (
44+
<Fragment>
45+
<HelpBox
46+
title={
47+
<div style={{ display: "flex", justifyContent: "space-between", alignItems: "center", flexGrow: 1 }}>
48+
<span>{registerMessage}</span> {redirectButton}
49+
</div>
50+
}
51+
iconComponent={<WarnIcon />}
52+
help={<Fragment />}
53+
/>
54+
<br />
55+
</Fragment>
56+
);
57+
}
58+
2559
return (
2660
<Box
2761
sx={{
@@ -32,9 +66,9 @@ const RegisterCluster = () => {
3266
justifyContent: "center",
3367
flexFlow: {
3468
sm: "row",
35-
xs: "column",
69+
xs: "column"
3670
},
37-
marginBottom: "15px",
71+
marginBottom: "15px"
3872
}}
3973
>
4074
<Grid container>
@@ -51,8 +85,8 @@ const RegisterCluster = () => {
5185
width: "83px",
5286
height: "14px",
5387
marginLeft: "5px",
54-
marginRight: "5px",
55-
},
88+
marginRight: "5px"
89+
}
5690
}}
5791
>
5892
Register your cluster
@@ -64,15 +98,15 @@ const RegisterCluster = () => {
6498
display: "flex",
6599
flexFlow: {
66100
xs: "column",
67-
md: "row",
68-
},
101+
md: "row"
102+
}
69103
}}
70104
>
71105
<Box
72106
sx={{
73107
display: "flex",
74108
flexFlow: "column",
75-
flex: "2",
109+
flex: "2"
76110
}}
77111
>
78112
<Box
@@ -81,32 +115,24 @@ const RegisterCluster = () => {
81115
display: "flex",
82116
flexFlow: "column",
83117
marginTop: "15px",
84-
marginBottom: "15px",
118+
marginBottom: "15px"
85119
}}
86120
>
87-
Use your MinIO Subscription Network login credentials to
88-
register this cluster.
121+
{registerMessage}
89122
</Box>
90123
<Box
91124
sx={{
92-
flex: "1",
125+
flex: "1"
93126
}}
94127
>
95128
<Box
96129
sx={{
97130
display: "flex",
98131
alignItems: "center",
99-
justifyContent: "flex-end",
132+
justifyContent: "flex-end"
100133
}}
101134
>
102-
<Button
103-
type="submit"
104-
variant="contained"
105-
color="primary"
106-
onClick={() => navigate("/support/register")}
107-
>
108-
Register your Cluster
109-
</Button>
135+
{redirectButton}
110136
</Box>
111137
</Box>
112138
</Box>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ const Inspect = ({ classes }: { classes: any }) => {
202202
<Fragment>
203203
<PageHeader label={"Inspect"} />
204204
<PageLayout>
205-
{plan !== "STANDARD" && plan !== "ENTERPRISE" && <RegisterCluster />}
205+
{plan !== "STANDARD" && plan !== "ENTERPRISE" && <RegisterCluster compactMode />}
206206
{!distributedSetup ? (
207207
<DistributedOnly
208208
iconComponent={<InspectMenuIcon />}

0 commit comments

Comments
 (0)