Skip to content

Commit 1d69024

Browse files
authored
Add Help Box to multiple Screens (#1129)
1 parent 67082e1 commit 1d69024

File tree

9 files changed

+445
-237
lines changed

9 files changed

+445
-237
lines changed

portal-ui/src/common/HelpBox.tsx

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// This file is part of MinIO Console Server
2+
// Copyright (c) 2021 MinIO, Inc.
3+
//
4+
// This program is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU Affero General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU Affero General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU Affero General Public License
15+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
17+
import React, { Component } from "react";
18+
import Grid from "@material-ui/core/Grid";
19+
import { createStyles } from "@material-ui/core";
20+
import { Theme, withStyles } from "@material-ui/core/styles";
21+
22+
const styles = (theme: Theme) =>
23+
createStyles({
24+
root: {
25+
border: "1px solid rgb(234, 237, 238)",
26+
borderRadius: 5,
27+
marginTop: 10,
28+
marginBottom: 10,
29+
backgroundColor: "#fbfafa",
30+
},
31+
icon: {
32+
textAlign: "center",
33+
padding: 30,
34+
fontSize: 64,
35+
"& .MuiSvgIcon-root": {
36+
fontSize: 64,
37+
},
38+
},
39+
iconSize: {
40+
fontSize: 64,
41+
},
42+
helpText: { padding: 30, paddingLeft: 0, fontSize: 16 },
43+
});
44+
45+
interface IHelpBox {
46+
classes: any;
47+
iconComponent: any;
48+
help: any;
49+
}
50+
51+
const HelpBox = ({ classes, iconComponent, help }: IHelpBox) => {
52+
return (
53+
<div className={classes.root}>
54+
<Grid container>
55+
<Grid xs={2} className={classes.icon}>
56+
{iconComponent}
57+
</Grid>
58+
<Grid xs={10} className={classes.helpText}>
59+
{help}
60+
</Grid>
61+
</Grid>
62+
</div>
63+
);
64+
};
65+
66+
export default withStyles(styles)(HelpBox);

portal-ui/src/screens/Console/Buckets/BucketDetails/BucketEventsPanel.tsx

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
2020
import { Button } from "@material-ui/core";
2121
import get from "lodash/get";
2222
import Grid from "@material-ui/core/Grid";
23-
import { AddIcon } from "../../../../icons";
23+
import { AddIcon, LambdaIcon, TiersIcon } from "../../../../icons";
2424
import { BucketEvent, BucketEventList } from "../types";
2525
import { setErrorSnackMessage } from "../../../../actions";
2626
import { AppState } from "../../../../store";
@@ -33,6 +33,7 @@ import TableWrapper from "../../Common/TableWrapper/TableWrapper";
3333
import api from "../../../../common/api";
3434
import DeleteEvent from "./DeleteEvent";
3535
import AddEvent from "./AddEvent";
36+
import HelpBox from "../../../../common/HelpBox";
3637

3738
const styles = (theme: Theme) =>
3839
createStyles({
@@ -41,6 +42,9 @@ const styles = (theme: Theme) =>
4142
actionsTray: {
4243
...actionsTray.actionsTray,
4344
},
45+
twHeight: {
46+
minHeight: 400,
47+
},
4448
});
4549

4650
interface IBucketEventsProps {
@@ -159,6 +163,30 @@ const BucketEventsPanel = ({
159163
records={records}
160164
entityName="Events"
161165
idField="id"
166+
customPaperHeight={classes.twHeight}
167+
/>
168+
</Grid>
169+
<Grid item xs={12}>
170+
<HelpBox
171+
iconComponent={<LambdaIcon />}
172+
help={
173+
<Fragment>
174+
MinIO bucket notifications allow administrators to send
175+
notifications to supported external services on certain object
176+
or bucket events. MinIO supports bucket and object-level S3
177+
events similar to the Amazon S3 Event Notifications.
178+
<br />
179+
<br />
180+
You can learn more at our{" "}
181+
<a
182+
href="https://docs.min.io/minio/baremetal/monitoring/bucket-notifications/bucket-notifications.html?ref=con"
183+
target="_blank"
184+
>
185+
documentation
186+
</a>
187+
.
188+
</Fragment>
189+
}
162190
/>
163191
</Grid>
164192
</Grid>

portal-ui/src/screens/Console/Buckets/BucketDetails/BucketLifecyclePanel.tsx

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import get from "lodash/get";
2222
import * as reactMoment from "react-moment";
2323
import Grid from "@material-ui/core/Grid";
2424
import { LifeCycleItem } from "../types";
25-
import { AddIcon } from "../../../../icons";
25+
import { AddIcon, TiersIcon } from "../../../../icons";
2626
import {
2727
actionsTray,
2828
searchField,
@@ -34,11 +34,15 @@ import api from "../../../../common/api";
3434
import EditLifecycleConfiguration from "./EditLifecycleConfiguration";
3535
import AddLifecycleModal from "./AddLifecycleModal";
3636
import TableWrapper from "../../Common/TableWrapper/TableWrapper";
37+
import HelpBox from "../../../../common/HelpBox";
3738

3839
const styles = (theme: Theme) =>
3940
createStyles({
4041
...searchField,
4142
...actionsTray,
43+
twHeight: {
44+
minHeight: 400,
45+
},
4246
});
4347

4448
interface IBucketLifecyclePanelProps {
@@ -199,6 +203,30 @@ const BucketLifecyclePanel = ({
199203
entityName="Lifecycle"
200204
customEmptyMessage="There are no Lifecycle rules yet"
201205
idField="id"
206+
customPaperHeight={classes.twHeight}
207+
/>
208+
</Grid>
209+
<Grid item xs={12}>
210+
<HelpBox
211+
iconComponent={<TiersIcon />}
212+
help={
213+
<Fragment>
214+
MinIO Object Lifecycle Management allows creating rules for time
215+
or date based automatic transition or expiry of objects. For
216+
object transition, MinIO automatically moves the object to a
217+
configured remote storage tier.
218+
<br />
219+
<br />
220+
You can learn more at our{" "}
221+
<a
222+
href="https://docs.min.io/minio/baremetal/lifecycle-management/lifecycle-management-overview.html?ref=con"
223+
target="_blank"
224+
>
225+
documentation
226+
</a>
227+
.
228+
</Fragment>
229+
}
202230
/>
203231
</Grid>
204232
</Grid>

portal-ui/src/screens/Console/Buckets/BucketDetails/BucketReplicationPanel.tsx

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { connect } from "react-redux";
1919
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
2020
import { Button } from "@material-ui/core";
2121
import Grid from "@material-ui/core/Grid";
22-
import { AddIcon } from "../../../../icons";
22+
import { AddIcon, BucketsIcon, TiersIcon } from "../../../../icons";
2323
import { setErrorSnackMessage } from "../../../../actions";
2424
import {
2525
actionsTray,
@@ -37,6 +37,7 @@ import api from "../../../../common/api";
3737
import TableWrapper from "../../Common/TableWrapper/TableWrapper";
3838
import AddReplicationModal from "./AddReplicationModal";
3939
import DeleteReplicationRule from "./DeleteReplicationRule";
40+
import HelpBox from "../../../../common/HelpBox";
4041

4142
interface IBucketReplicationProps {
4243
classes: any;
@@ -49,6 +50,9 @@ const styles = (theme: Theme) =>
4950
createStyles({
5051
...searchField,
5152
...actionsTray,
53+
twHeight: {
54+
minHeight: 400,
55+
},
5256
});
5357

5458
const BucketReplicationPanel = ({
@@ -235,6 +239,28 @@ const BucketReplicationPanel = ({
235239
records={replicationRules}
236240
entityName="Replication Rules"
237241
idField="id"
242+
customPaperHeight={classes.twHeight}
243+
/>
244+
</Grid>
245+
<Grid item xs={12}>
246+
<HelpBox
247+
iconComponent={<BucketsIcon />}
248+
help={
249+
<Fragment>
250+
MinIO supports server-side and client-side replication of
251+
objects between source and destination buckets.
252+
<br />
253+
<br />
254+
You can learn more at our{" "}
255+
<a
256+
href="https://docs.min.io/minio/baremetal/replication/replication-overview.html?ref=con"
257+
target="_blank"
258+
>
259+
documentation
260+
</a>
261+
.
262+
</Fragment>
263+
}
238264
/>
239265
</Grid>
240266
</Grid>

0 commit comments

Comments
 (0)