From 9bdc8f6982bed349fc4e4ec66dbc4162226e6598 Mon Sep 17 00:00:00 2001 From: Mia Wong Date: Tue, 13 Aug 2024 20:29:31 +0000 Subject: [PATCH 1/8] show join command during restore --- web/src/Root.tsx | 9 ++++- .../apps/EmbeddedClusterManagement.tsx | 36 +++++++++++-------- web/src/components/shared/NavBar.tsx | 7 ++-- 3 files changed, 34 insertions(+), 18 deletions(-) diff --git a/web/src/Root.tsx b/web/src/Root.tsx index 205f253177..eb5e990978 100644 --- a/web/src/Root.tsx +++ b/web/src/Root.tsx @@ -501,6 +501,9 @@ const Root = () => { isEmbeddedClusterEnabled={Boolean( state.adminConsoleMetadata?.isEmbeddedCluster )} + isEmbeddedClusterNodeWaiting={ + state.isEmbeddedClusterWaitingForNodes + } isGitOpsSupported={isGitOpsSupported()} isIdentityServiceSupported={isIdentityServiceSupported()} appsList={state.appsList} @@ -636,7 +639,11 @@ const Root = () => { state.adminConsoleMetadata?.isKurl ? ( ) : ( - + ) } /> diff --git a/web/src/components/apps/EmbeddedClusterManagement.tsx b/web/src/components/apps/EmbeddedClusterManagement.tsx index ae0da1388b..7b1158c0f1 100644 --- a/web/src/components/apps/EmbeddedClusterManagement.tsx +++ b/web/src/components/apps/EmbeddedClusterManagement.tsx @@ -31,8 +31,10 @@ type State = { const EmbeddedClusterManagement = ({ fromLicenseFlow = false, + isEmbeddedClusterNodeWaiting = false, }: { fromLicenseFlow?: boolean; + isEmbeddedClusterNodeWaiting?: boolean; }) => { const [state, setState] = useReducer( (prevState: State, newState: Partial) => ({ @@ -415,11 +417,13 @@ const EmbeddedClusterManagement = ({ const AddNodeInstructions = () => { return (
-

- Optionally add nodes to the cluster. Click{" "} - Continue - to proceed with a single node. -

+ {Utilities.isInitialAppInstall(app) && ( +

+ Optionally add nodes to the cluster. Click{" "} + Continue + to proceed with a single node. +

+ )}

{rolesData?.roles && rolesData.roles.length > 1 && @@ -526,16 +530,18 @@ const EmbeddedClusterManagement = ({

{" "} - {!Utilities.isInitialAppInstall(app) && ( -
-

- View the nodes in your cluster, generate commands to add nodes - to the cluster, and view workloads running on each node. -

-
- )} + {!Utilities.isInitialAppInstall(app) && + !isEmbeddedClusterNodeWaiting && ( +
+

+ View the nodes in your cluster, generate commands to add nodes + to the cluster, and view workloads running on each node. +

+
+ )} {Utilities.sessionRolesHasOneOf([rbacRoles.CLUSTER_ADMIN]) && - !Utilities.isInitialAppInstall(app) && ( + !Utilities.isInitialAppInstall(app) && + !isEmbeddedClusterNodeWaiting && (
- {Utilities.isInitialAppInstall(app) && ( + {Utilities.isInitialAppInstall(app) && !isEmbeddedClusterNodeWaiting && (
diff --git a/web/src/components/shared/NavBar.tsx b/web/src/components/shared/NavBar.tsx index 3521d6eb3c..f65cae4776 100644 --- a/web/src/components/shared/NavBar.tsx +++ b/web/src/components/shared/NavBar.tsx @@ -19,6 +19,7 @@ type Props = { isIdentityServiceSupported: boolean; isKurlEnabled: boolean; isEmbeddedClusterEnabled: boolean; + isEmbeddedClusterNodeWaiting: boolean; isSnapshotsSupported: boolean; logo: string | null; onLogoutError: (message: string) => void; @@ -144,6 +145,7 @@ export class NavBar extends PureComponent { fetchingMetadata, isKurlEnabled, isEmbeddedClusterEnabled, + isEmbeddedClusterNodeWaiting, isGitOpsSupported, isIdentityServiceSupported, appsList, @@ -206,7 +208,8 @@ export class NavBar extends PureComponent {
{Utilities.isLoggedIn() && appsList?.length > 0 && - !isInitialEmbeddedInstall && ( + !isInitialEmbeddedInstall && + !isEmbeddedClusterNodeWaiting && (
{
)}
- {Utilities.isLoggedIn() && ( + {Utilities.isLoggedIn() && !isEmbeddedClusterNodeWaiting && ( <> Date: Thu, 15 Aug 2024 21:42:40 +0000 Subject: [PATCH 2/8] fix logic --- .../apps/EmbeddedClusterManagement.tsx | 53 ++++++++++--------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/web/src/components/apps/EmbeddedClusterManagement.tsx b/web/src/components/apps/EmbeddedClusterManagement.tsx index 7b1158c0f1..26bf5a40fc 100644 --- a/web/src/components/apps/EmbeddedClusterManagement.tsx +++ b/web/src/components/apps/EmbeddedClusterManagement.tsx @@ -520,7 +520,6 @@ const EmbeddedClusterManagement = ({ ); }; - return (
@@ -530,32 +529,34 @@ const EmbeddedClusterManagement = ({

{" "} - {!Utilities.isInitialAppInstall(app) && - !isEmbeddedClusterNodeWaiting && ( -
-

- View the nodes in your cluster, generate commands to add nodes - to the cluster, and view workloads running on each node. -

-
- )} - {Utilities.sessionRolesHasOneOf([rbacRoles.CLUSTER_ADMIN]) && - !Utilities.isInitialAppInstall(app) && - !isEmbeddedClusterNodeWaiting && ( - - )} + {!Utilities.isInitialAppInstall(app) || + (!isEmbeddedClusterNodeWaiting && ( + <> +
+

+ View the nodes in your cluster, generate commands to add + nodes to the cluster, and view workloads running on each + node. +

+
+ {Utilities.sessionRolesHasOneOf([rbacRoles.CLUSTER_ADMIN]) && ( + + )} + + ))}
- {Utilities.isInitialAppInstall(app) && !isEmbeddedClusterNodeWaiting && ( -
- - -
- )} + {Utilities.isInitialAppInstall(app) || + (isEmbeddedClusterNodeWaiting && ( +
+ + +
+ ))}
{nodesLoading && ( From c4545f8947b03a71ee75b8d8a094960da39a9450 Mon Sep 17 00:00:00 2001 From: Mia Wong Date: Thu, 22 Aug 2024 18:44:03 +0000 Subject: [PATCH 3/8] use same name --- web/src/Root.tsx | 4 ++-- web/src/components/apps/EmbeddedClusterManagement.tsx | 8 ++++---- web/src/components/shared/NavBar.tsx | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/web/src/Root.tsx b/web/src/Root.tsx index eb5e990978..e2c5048ab1 100644 --- a/web/src/Root.tsx +++ b/web/src/Root.tsx @@ -501,7 +501,7 @@ const Root = () => { isEmbeddedClusterEnabled={Boolean( state.adminConsoleMetadata?.isEmbeddedCluster )} - isEmbeddedClusterNodeWaiting={ + isEmbeddedClusterWaitingForNodes={ state.isEmbeddedClusterWaitingForNodes } isGitOpsSupported={isGitOpsSupported()} @@ -640,7 +640,7 @@ const Root = () => { ) : ( diff --git a/web/src/components/apps/EmbeddedClusterManagement.tsx b/web/src/components/apps/EmbeddedClusterManagement.tsx index 26bf5a40fc..0d92c7d4fc 100644 --- a/web/src/components/apps/EmbeddedClusterManagement.tsx +++ b/web/src/components/apps/EmbeddedClusterManagement.tsx @@ -31,10 +31,10 @@ type State = { const EmbeddedClusterManagement = ({ fromLicenseFlow = false, - isEmbeddedClusterNodeWaiting = false, + isEmbeddedClusterWaitingForNodes = false, }: { fromLicenseFlow?: boolean; - isEmbeddedClusterNodeWaiting?: boolean; + isEmbeddedClusterWaitingForNodes?: boolean; }) => { const [state, setState] = useReducer( (prevState: State, newState: Partial) => ({ @@ -530,7 +530,7 @@ const EmbeddedClusterManagement = ({
{" "} {!Utilities.isInitialAppInstall(app) || - (!isEmbeddedClusterNodeWaiting && ( + (!isEmbeddedClusterWaitingForNodes && ( <>

@@ -551,7 +551,7 @@ const EmbeddedClusterManagement = ({ ))}

{Utilities.isInitialAppInstall(app) || - (isEmbeddedClusterNodeWaiting && ( + (isEmbeddedClusterWaitingForNodes && (
diff --git a/web/src/components/shared/NavBar.tsx b/web/src/components/shared/NavBar.tsx index f65cae4776..aaa996d280 100644 --- a/web/src/components/shared/NavBar.tsx +++ b/web/src/components/shared/NavBar.tsx @@ -19,7 +19,7 @@ type Props = { isIdentityServiceSupported: boolean; isKurlEnabled: boolean; isEmbeddedClusterEnabled: boolean; - isEmbeddedClusterNodeWaiting: boolean; + isEmbeddedClusterWaitingForNodes: boolean; isSnapshotsSupported: boolean; logo: string | null; onLogoutError: (message: string) => void; @@ -145,7 +145,7 @@ export class NavBar extends PureComponent { fetchingMetadata, isKurlEnabled, isEmbeddedClusterEnabled, - isEmbeddedClusterNodeWaiting, + isEmbeddedClusterWaitingForNodes, isGitOpsSupported, isIdentityServiceSupported, appsList, @@ -209,7 +209,7 @@ export class NavBar extends PureComponent { {Utilities.isLoggedIn() && appsList?.length > 0 && !isInitialEmbeddedInstall && - !isEmbeddedClusterNodeWaiting && ( + !isEmbeddedClusterWaitingForNodes && (
{
)}
- {Utilities.isLoggedIn() && !isEmbeddedClusterNodeWaiting && ( + {Utilities.isLoggedIn() && !isEmbeddedClusterWaitingForNodes && ( <> Date: Fri, 23 Aug 2024 19:43:37 +0000 Subject: [PATCH 4/8] ugh prettier --- .../components/apps/EmbeddedClusterManagement.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/web/src/components/apps/EmbeddedClusterManagement.tsx b/web/src/components/apps/EmbeddedClusterManagement.tsx index 0d92c7d4fc..71f49477c6 100644 --- a/web/src/components/apps/EmbeddedClusterManagement.tsx +++ b/web/src/components/apps/EmbeddedClusterManagement.tsx @@ -550,13 +550,13 @@ const EmbeddedClusterManagement = ({ ))}
- {Utilities.isInitialAppInstall(app) || - (isEmbeddedClusterWaitingForNodes && ( -
- - -
- ))} + {(Utilities.isInitialAppInstall(app) || + isEmbeddedClusterWaitingForNodes) && ( +
+ + +
+ )}
{nodesLoading && ( From 338b61ac26f933c4689e5d859e18199aa2f5bde2 Mon Sep 17 00:00:00 2001 From: Mia Wong Date: Fri, 23 Aug 2024 19:45:15 +0000 Subject: [PATCH 5/8] f --- .../apps/EmbeddedClusterManagement.tsx | 39 +++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/web/src/components/apps/EmbeddedClusterManagement.tsx b/web/src/components/apps/EmbeddedClusterManagement.tsx index 71f49477c6..3596349ae9 100644 --- a/web/src/components/apps/EmbeddedClusterManagement.tsx +++ b/web/src/components/apps/EmbeddedClusterManagement.tsx @@ -529,26 +529,25 @@ const EmbeddedClusterManagement = ({

{" "} - {!Utilities.isInitialAppInstall(app) || - (!isEmbeddedClusterWaitingForNodes && ( - <> -
-

- View the nodes in your cluster, generate commands to add - nodes to the cluster, and view workloads running on each - node. -

-
- {Utilities.sessionRolesHasOneOf([rbacRoles.CLUSTER_ADMIN]) && ( - - )} - - ))} + {(!Utilities.isInitialAppInstall(app) || + !isEmbeddedClusterWaitingForNodes) && ( + <> +
+

+ View the nodes in your cluster, generate commands to add nodes + to the cluster, and view workloads running on each node. +

+
+ {Utilities.sessionRolesHasOneOf([rbacRoles.CLUSTER_ADMIN]) && ( + + )} + + )}
{(Utilities.isInitialAppInstall(app) || isEmbeddedClusterWaitingForNodes) && ( From f7ff20b827ff1f2011765e70c86d5c8c1a0c831e Mon Sep 17 00:00:00 2001 From: Mia Wong Date: Fri, 23 Aug 2024 19:47:45 +0000 Subject: [PATCH 6/8] f --- web/src/components/apps/EmbeddedClusterManagement.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/components/apps/EmbeddedClusterManagement.tsx b/web/src/components/apps/EmbeddedClusterManagement.tsx index 3596349ae9..dcd2d67417 100644 --- a/web/src/components/apps/EmbeddedClusterManagement.tsx +++ b/web/src/components/apps/EmbeddedClusterManagement.tsx @@ -538,7 +538,7 @@ const EmbeddedClusterManagement = ({ to the cluster, and view workloads running on each node.

- {Utilities.sessionRolesHasOneOf([rbacRoles.CLUSTER_ADMIN]) && ( + {Utilities.sessionRolesHasOneOf([rbacRoles.CLUSTER_ADMIN]) && !Utilities.isInitialAppInstall(app) && (
- {Utilities.sessionRolesHasOneOf([rbacRoles.CLUSTER_ADMIN]) && !Utilities.isInitialAppInstall(app) && ( - - )} + {Utilities.sessionRolesHasOneOf([rbacRoles.CLUSTER_ADMIN]) && + !Utilities.isInitialAppInstall(app) && ( + + )} )}
From 1b485679daf686200caa076f478ebcb52a104cfb Mon Sep 17 00:00:00 2001 From: Mia Wong Date: Fri, 23 Aug 2024 20:33:53 +0000 Subject: [PATCH 8/8] isInitialInstallOrRestore --- .../apps/EmbeddedClusterManagement.tsx | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/web/src/components/apps/EmbeddedClusterManagement.tsx b/web/src/components/apps/EmbeddedClusterManagement.tsx index e8d5d20034..3fd9c40347 100644 --- a/web/src/components/apps/EmbeddedClusterManagement.tsx +++ b/web/src/components/apps/EmbeddedClusterManagement.tsx @@ -520,6 +520,10 @@ const EmbeddedClusterManagement = ({ ); }; + + const isInitialInstallOrRestore = + Utilities.isInitialAppInstall(app) || isEmbeddedClusterWaitingForNodes; + return (
@@ -528,9 +532,7 @@ const EmbeddedClusterManagement = ({ Nodes

- {" "} - {(!Utilities.isInitialAppInstall(app) || - !isEmbeddedClusterWaitingForNodes) && ( + {!isInitialInstallOrRestore && ( <>

@@ -538,20 +540,18 @@ const EmbeddedClusterManagement = ({ to the cluster, and view workloads running on each node.

- {Utilities.sessionRolesHasOneOf([rbacRoles.CLUSTER_ADMIN]) && - !Utilities.isInitialAppInstall(app) && ( - - )} + {Utilities.sessionRolesHasOneOf([rbacRoles.CLUSTER_ADMIN]) && ( + + )} )}
- {(Utilities.isInitialAppInstall(app) || - isEmbeddedClusterWaitingForNodes) && ( + {isInitialInstallOrRestore && (