Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix config redirect, remove unnecessary code #4104

Merged
merged 2 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading