From 854181f63e0da0a7875ff77ffb64be7ccc5ae992 Mon Sep 17 00:00:00 2001 From: Alex <33497058+bexsoft@users.noreply.github.com> Date: Mon, 14 Aug 2023 17:07:31 -0600 Subject: [PATCH] Disabled input fields and changed Register label in Subscription features (#2994) Signed-off-by: Benjamin Perez --- .../screens/Console/HealthInfo/HealthInfo.tsx | 2 +- .../screens/Console/Speedtest/Speedtest.tsx | 19 +-- .../src/screens/Console/Support/CallHome.tsx | 4 +- .../src/screens/Console/Support/Profile.tsx | 8 +- .../Console/Support/RegisterCluster.tsx | 2 +- .../src/screens/Console/Tools/Inspect.tsx | 6 +- portal-ui/tests/permissions-2/inspect.ts | 36 ------ portal-ui/tests/permissions-5/diagnostics.ts | 111 ------------------ portal-ui/tests/utils/elements.ts | 2 +- 9 files changed, 26 insertions(+), 164 deletions(-) diff --git a/portal-ui/src/screens/Console/HealthInfo/HealthInfo.tsx b/portal-ui/src/screens/Console/HealthInfo/HealthInfo.tsx index 679217b2a..b82699be9 100644 --- a/portal-ui/src/screens/Console/HealthInfo/HealthInfo.tsx +++ b/portal-ui/src/screens/Console/HealthInfo/HealthInfo.tsx @@ -313,7 +313,7 @@ const HealthInfo = () => { variant={ !clusterRegistered ? "regular" : "callAction" } - disabled={startDiagnostic} + disabled={startDiagnostic || !clusterRegistered} onClick={startDiagnosticAction} label={buttonStartText} /> diff --git a/portal-ui/src/screens/Console/Speedtest/Speedtest.tsx b/portal-ui/src/screens/Console/Speedtest/Speedtest.tsx index da1800b66..170b37077 100644 --- a/portal-ui/src/screens/Console/Speedtest/Speedtest.tsx +++ b/portal-ui/src/screens/Console/Speedtest/Speedtest.tsx @@ -27,6 +27,7 @@ import { PageLayout, SpeedtestIcon, WarnIcon, + InputBox, } from "mds"; import { DateTime } from "luxon"; import createStyles from "@mui/styles/createStyles"; @@ -44,7 +45,6 @@ import { IAM_SCOPES, } from "../../../common/SecureComponent/permissions"; import STResults from "./STResults"; -import InputBoxWrapper from "../Common/FormComponents/InputBoxWrapper/InputBoxWrapper"; import ProgressBarWrapper from "../Common/ProgressBarWrapper/ProgressBarWrapper"; import InputUnitMenu from "../Common/FormComponents/InputUnitMenu/InputUnitMenu"; import { SecureComponent } from "../../../common/SecureComponent"; @@ -258,7 +258,7 @@ const Speedtest = () => {
- { }} noLabelMinWidth={true} value={size} - disabled={start} + disabled={start || !clusterRegistered} overlayObject={ { { label: "MiB", value: "MiB" }, { label: "GiB", value: "GiB" }, ]} - disabled={start} + disabled={start || !clusterRegistered} /> } /> @@ -286,7 +286,7 @@ const Speedtest = () => {
- { }} noLabelMinWidth={true} value={duration} - disabled={start} + disabled={start || !clusterRegistered} overlayObject={ {}} unitSelected={"s"} unitsList={[{ label: "s", value: "s" }]} - disabled={start} + disabled={start || !clusterRegistered} /> } pattern={"[0-9]*"} @@ -324,7 +324,10 @@ const Speedtest = () => { } className={`${classes.buttonBackground} ${classes.speedStart}`} disabled={ - duration.trim() === "" || size.trim() === "" || start + duration.trim() === "" || + size.trim() === "" || + start || + !clusterRegistered } label={buttonLabel} /> diff --git a/portal-ui/src/screens/Console/Support/CallHome.tsx b/portal-ui/src/screens/Console/Support/CallHome.tsx index 740a36066..0f3295bc2 100644 --- a/portal-ui/src/screens/Console/Support/CallHome.tsx +++ b/portal-ui/src/screens/Console/Support/CallHome.tsx @@ -207,7 +207,7 @@ const CallHome = () => { variant={"secondary"} data-test-id="call-home-toggle-button" onClick={disableCallHomeAction} - disabled={loading} + disabled={loading || !clusterRegistered} > Disable Call Home @@ -218,7 +218,7 @@ const CallHome = () => { variant={mainVariant} data-test-id="call-home-toggle-button" onClick={confirmCallHomeAction} - disabled={loading} + disabled={loading || !clusterRegistered} > Save Configuration diff --git a/portal-ui/src/screens/Console/Support/Profile.tsx b/portal-ui/src/screens/Console/Support/Profile.tsx index d719766bd..50416cc75 100644 --- a/portal-ui/src/screens/Console/Support/Profile.tsx +++ b/portal-ui/src/screens/Console/Support/Profile.tsx @@ -132,7 +132,7 @@ const Profile = () => { {typesList.map((t) => ( -1} - disabled={profilingStarted} + disabled={profilingStarted || !clusterRegistered} key={`checkbox-${t.label}`} id={`checkbox-${t.label}`} label={t.label} @@ -154,7 +154,9 @@ const Profile = () => { id={"start-profiling"} type="submit" variant={clusterRegistered ? "callAction" : "regular"} - disabled={profilingStarted || types.length < 1} + disabled={ + profilingStarted || types.length < 1 || !clusterRegistered + } onClick={() => { if (!clusterRegistered) { navigate("/support/register"); @@ -169,7 +171,7 @@ const Profile = () => { type="submit" variant="callAction" color="primary" - disabled={!profilingStarted} + disabled={!profilingStarted || !clusterRegistered} onClick={() => { stopProfiling(); }} diff --git a/portal-ui/src/screens/Console/Support/RegisterCluster.tsx b/portal-ui/src/screens/Console/Support/RegisterCluster.tsx index 2d538f727..c4d9461e0 100644 --- a/portal-ui/src/screens/Console/Support/RegisterCluster.tsx +++ b/portal-ui/src/screens/Console/Support/RegisterCluster.tsx @@ -39,7 +39,7 @@ const RegisterCluster = ({ compactMode = false }: IRegisterCluster) => { ); const registerMessage = - "Use your MinIO Subscription Network login credentials to register this cluster."; + "Please use your MinIO Subscription Network login credentials to register this cluster and enable this feature."; if (compactMode) { return ( diff --git a/portal-ui/src/screens/Console/Tools/Inspect.tsx b/portal-ui/src/screens/Console/Tools/Inspect.tsx index b1b1da650..25c0fee14 100644 --- a/portal-ui/src/screens/Console/Tools/Inspect.tsx +++ b/portal-ui/src/screens/Console/Tools/Inspect.tsx @@ -377,6 +377,7 @@ const Inspect = () => { error={volumeError} required placeholder={"test-bucket"} + disabled={!clusterRegistered} /> { value={inspectPath} required placeholder={"test*/xl.meta"} + disabled={!clusterRegistered} /> { onChange={() => { setIsEncrypt(!isEncrypt); }} + disabled={!clusterRegistered} /> { data-test-id="inspect-clear-button" onClick={resetForm} label={"Clear"} + disabled={!clusterRegistered} />