Skip to content

Commit 01faba5

Browse files
Jillian InapurapuJillian Inapurapu
authored andcommitted
Made reusable component for Usage clarifying content
1 parent 2e28a54 commit 01faba5

File tree

3 files changed

+34
-83
lines changed

3 files changed

+34
-83
lines changed

portal-ui/src/screens/Console/Buckets/ListBuckets/BucketListItem.tsx

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import {
3838
} from "../../../../common/SecureComponent/permissions";
3939
import { hasPermission } from "../../../../common/SecureComponent";
4040
import { Bucket } from "../../../../api/consoleApi";
41+
import { usageClarifyingContent } from "screens/Console/Dashboard/BasicDashboard/ReportedUsage";
4142

4243
const BucketItemMain = styled.div(({ theme }) => ({
4344
border: `${get(theme, "borderColor", "#eaeaea")} 1px solid`,
@@ -221,33 +222,7 @@ const BucketListItem = ({
221222
{bucket.details?.versioning && (
222223
<HelpTip
223224
content={
224-
<Fragment>
225-
<div>
226-
<strong> Not what you expected?</strong>
227-
<br />
228-
This Usage value is comparable to{" "}
229-
<strong>mc du --versions</strong> which represents the size
230-
of all object versions that exist in the bucket.
231-
<br />
232-
Running{" "}
233-
<a
234-
target="_blank"
235-
href="https://min.io/docs/minio/linux/reference/minio-mc/mc-du.html"
236-
>
237-
mc du
238-
</a>{" "}
239-
without the <strong>--versions</strong> flag or{" "}
240-
<a
241-
target="_blank"
242-
href="https://man7.org/linux/man-pages/man1/df.1.html"
243-
>
244-
df
245-
</a>{" "}
246-
will provide different values corresponding to the size of
247-
all <strong>current</strong> versions and the physical disk
248-
space occupied respectively.
249-
</div>
250-
</Fragment>
225+
usageClarifyingContent
251226
}
252227
placement="top"
253228
>

portal-ui/src/screens/Console/Dashboard/BasicDashboard/ReportedUsage.tsx

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,34 @@ const ReportedUsageMain = styled.div(({ theme }) => ({
5353
},
5454
},
5555
}));
56+
export const usageClarifyingContent =
57+
<Fragment>
58+
<div>
59+
<strong> Not what you expected?</strong>
60+
<br />
61+
This Usage value is comparable to{" "}
62+
<strong>mc du --versions</strong> which represents the size of
63+
all object versions that exist in the buckets.
64+
<br />
65+
Running{" "}
66+
<a
67+
target="_blank"
68+
href="https://min.io/docs/minio/linux/reference/minio-mc/mc-du.html"
69+
>
70+
mc du
71+
</a>{" "}
72+
without the <strong>--versions</strong> flag or{" "}
73+
<a
74+
target="_blank"
75+
href="https://man7.org/linux/man-pages/man1/df.1.html"
76+
>
77+
df
78+
</a>{" "}
79+
will provide different values corresponding to the size of all{" "}
80+
<strong>current</strong> versions and the physical disk space
81+
occupied respectively.
82+
</div>
83+
</Fragment>
5684

5785
const ReportedUsage = ({
5886
usageValue,
@@ -63,6 +91,7 @@ const ReportedUsage = ({
6391
total: number | string;
6492
unit: string;
6593
}) => {
94+
6695
const plotValues = [
6796
{ value: total, color: "#D6D6D6", label: "Free Space" },
6897
{
@@ -81,33 +110,7 @@ const ReportedUsage = ({
81110

82111
<HelpTip
83112
content={
84-
<Fragment>
85-
<div>
86-
<strong> Not what you expected?</strong>
87-
<br />
88-
This Usage value is comparable to{" "}
89-
<strong>mc du --versions</strong> which represents the size of
90-
all object versions that exist in the buckets.
91-
<br />
92-
Running{" "}
93-
<a
94-
target="_blank"
95-
href="https://min.io/docs/minio/linux/reference/minio-mc/mc-du.html"
96-
>
97-
mc du
98-
</a>{" "}
99-
without the <strong>--versions</strong> flag or{" "}
100-
<a
101-
target="_blank"
102-
href="https://man7.org/linux/man-pages/man1/df.1.html"
103-
>
104-
df
105-
</a>{" "}
106-
will provide different values corresponding to the size of all{" "}
107-
<strong>current</strong> versions and the physical disk space
108-
occupied respectively.
109-
</div>
110-
</Fragment>
113+
usageClarifyingContent
111114
}
112115
placement="left"
113116
>

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

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ import { Bucket } from "../../../api/consoleApi";
5151
import { api } from "../../../api";
5252
import { errorToHandler } from "../../../api/errors";
5353
import HelpMenu from "../HelpMenu";
54+
import { usageClarifyingContent } from "../Dashboard/BasicDashboard/ReportedUsage";
5455

5556
const OBListBuckets = () => {
5657
const dispatch = useAppDispatch();
@@ -223,35 +224,7 @@ const OBListBuckets = () => {
223224
>
224225
<HelpTip
225226
content={
226-
<Fragment>
227-
<div>
228-
<strong> Not what you expected?</strong>
229-
<br />
230-
This Usage value is comparable to{" "}
231-
<strong>mc du --versions</strong> which
232-
represents the size of all object versions that
233-
exist in the bucket.
234-
<br />
235-
Running{" "}
236-
<a
237-
target="_blank"
238-
href="https://min.io/docs/minio/linux/reference/minio-mc/mc-du.html"
239-
>
240-
mc du
241-
</a>{" "}
242-
without the <strong>--versions</strong> flag or{" "}
243-
<a
244-
target="_blank"
245-
href="https://man7.org/linux/man-pages/man1/df.1.html"
246-
>
247-
df
248-
</a>{" "}
249-
will provide different values corresponding to
250-
the size of all <strong>current</strong>{" "}
251-
versions and the physical disk space occupied
252-
respectively.
253-
</div>
254-
</Fragment>
227+
usageClarifyingContent
255228
}
256229
placement="right"
257230
>

0 commit comments

Comments
 (0)