From 0209a528250ed5ba11861baba040a35fee37d845 Mon Sep 17 00:00:00 2001 From: Mia Wong Date: Thu, 30 May 2024 18:28:26 -0700 Subject: [PATCH] hide generate support bundle cli command for embedded cluster (#4647) --- web/src/Root.tsx | 22 ++- .../troubleshoot/GenerateSupportBundle.jsx | 22 +-- .../GenerateSupportBundleModal.tsx | 143 +++++++++--------- .../troubleshoot/SupportBundleList.tsx | 3 + 4 files changed, 110 insertions(+), 80 deletions(-) diff --git a/web/src/Root.tsx b/web/src/Root.tsx index 5a79c7b3d2..ed44c727d2 100644 --- a/web/src/Root.tsx +++ b/web/src/Root.tsx @@ -768,8 +768,26 @@ const Root = () => { } > - } /> - } /> + + } + /> + + } + /> } diff --git a/web/src/components/troubleshoot/GenerateSupportBundle.jsx b/web/src/components/troubleshoot/GenerateSupportBundle.jsx index 170a4e56d0..8b5756ae7d 100644 --- a/web/src/components/troubleshoot/GenerateSupportBundle.jsx +++ b/web/src/components/troubleshoot/GenerateSupportBundle.jsx @@ -449,16 +449,18 @@ class GenerateSupportBundle extends Component { ) : ( -
- If you'd prefer,{" "} - this.fetchSupportBundleCommand()} - > - click here - {" "} - to get a command to manually generate a support bundle. -
+ !this.props.isEmbeddedClusterEnabled && ( +
+ If you'd prefer,{" "} + this.fetchSupportBundleCommand()} + > + click here + {" "} + to get a command to manually generate a support bundle. +
+ ) )} diff --git a/web/src/components/troubleshoot/GenerateSupportBundleModal.tsx b/web/src/components/troubleshoot/GenerateSupportBundleModal.tsx index b452dd3ba6..45d9d471e6 100644 --- a/web/src/components/troubleshoot/GenerateSupportBundleModal.tsx +++ b/web/src/components/troubleshoot/GenerateSupportBundleModal.tsx @@ -17,6 +17,7 @@ type Props = { toggleModal: () => void; selectedApp: App | null; updateBundleSlug: (value: string) => void; + isEmbeddedClusterEnabled: boolean; }; type State = { @@ -36,8 +37,8 @@ type State = { const GenerateSupportBundleModal = ({ isOpen, toggleModal, - updateBundleSlug, + isEmbeddedClusterEnabled, }: Props) => { const [state, setState] = useReducer( (currentState: State, newState: Partial) => ({ @@ -347,80 +348,86 @@ const GenerateSupportBundleModal = ({ ) : ( -
- - Or{" "} - - click here - {" "} - to get a command to manually generate a support bundle. This is - useful if the admin console is inaccessible. - -
+ !isEmbeddedClusterEnabled && ( +
+ + Or{" "} + + click here + {" "} + to get a command to manually generate a support bundle. This is + useful if the admin console is inaccessible. + +
+ ) )} -
- {state.uploadBundleErrMsg && ( -

- {state.uploadBundleErrMsg} -

- )} - - {!hasFile && ( -
- -

- Drag your bundle here or{" "} - - choose a file to upload - -

-
+ {state.uploadBundleErrMsg && ( +

+ {state.uploadBundleErrMsg} +

)} -
- {hasFile && ( -
-
-

- {state.supportBundleFile?.name} -

-
+ {!hasFile && ( +
+ +

+ Drag your bundle here or{" "} + + choose a file to upload + +

+
+ )} + + {hasFile && ( +
+
+

+ {state.supportBundleFile?.name} +

+
-
- - - Select a different file - +
+ + + Select a different file + +
-
- )} -
+ )} +
+ )}