Skip to content

Commit

Permalink
fix config redirect, remove unnecessary code (#4104)
Browse files Browse the repository at this point in the history
* fix config redirect, remove unnecessary code

* linting
  • Loading branch information
alicenstar authored Oct 20, 2023
1 parent c13c2c2 commit f5d63d8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 19 deletions.
7 changes: 1 addition & 6 deletions web/src/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -579,12 +579,7 @@ const Root = () => {
<>
<Route
path="/:slug/cluster/manage"
element={
<HelmVMClusterManagement
fromLicenseFlow={true}
appName={state.selectedAppName || undefined}
/>
}
element={<HelmVMClusterManagement fromLicenseFlow={true} />}
/>
<Route
path="/:slug/cluster/:nodeName"
Expand Down
6 changes: 3 additions & 3 deletions web/src/components/apps/HelmVMClusterManagement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ type State = {

const HelmVMClusterManagement = ({
fromLicenseFlow = false,
appName,
}: {
fromLicenseFlow?: boolean;
appName?: string;
}) => {
const [state, setState] = useReducer(
(prevState: State, newState: Partial<State>) => ({
Expand All @@ -81,7 +79,9 @@ const HelmVMClusterManagement = ({
const [selectedNodeTypes, setSelectedNodeTypes] = useState<string[]>([]);

const { data: appsData } = useApps();
const app = appsData?.apps?.find((a) => a.name === appName);
// we grab the first app because helmvm users should only ever have one app
const app = appsData?.apps?.[0];

const { slug } = useParams();

// #region queries
Expand Down
11 changes: 1 addition & 10 deletions web/src/components/apps/HelmVMViewNode.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MaterialReactTable } from "material-react-table";
import React, { useMemo } from "react";
import React, { useMemo, setState } from "react";
import { useQuery } from "@tanstack/react-query";
import { Link, useParams } from "react-router-dom";
import Loader from "@components/shared/Loader";
Expand Down Expand Up @@ -62,15 +62,6 @@ const HelmVMViewNode = () => {
err.status
);
},
onSuccess: (data) => {
setState({
// if cluster doesn't support ha, then primary will be disabled. Force into secondary
selectedNodeType: !data.ha ? "secondary" : state.selectedNodeType,
});
},
config: {
retry: false,
},
});

const node = nodeData || testData;
Expand Down

0 comments on commit f5d63d8

Please sign in to comment.