|
|
@@ -5,6 +5,7 @@ import posthog from "posthog-js";
|
|
|
import _ from "lodash";
|
|
|
import { Context } from "shared/Context";
|
|
|
import api from "shared/api";
|
|
|
+import { RouteComponentProps, withRouter } from "react-router";
|
|
|
|
|
|
import {
|
|
|
ActionConfigType,
|
|
|
@@ -22,7 +23,8 @@ import ValuesWrapper from "components/values-form/ValuesWrapper";
|
|
|
import ValuesForm from "components/values-form/ValuesForm";
|
|
|
import { isAlphanumeric } from "shared/common";
|
|
|
|
|
|
-type PropsType = {
|
|
|
+
|
|
|
+type PropsType = RouteComponentProps & {
|
|
|
currentTemplate: any;
|
|
|
hideLaunch: () => void;
|
|
|
values: any;
|
|
|
@@ -57,7 +59,7 @@ const defaultActionConfig: ActionConfigType = {
|
|
|
dockerfile_path: "",
|
|
|
};
|
|
|
|
|
|
-export default class LaunchTemplate extends Component<PropsType, StateType> {
|
|
|
+class LaunchTemplate extends Component<PropsType, StateType> {
|
|
|
state = {
|
|
|
currentView: "repo",
|
|
|
clusterOptions: [] as { label: string; value: string }[],
|
|
|
@@ -133,10 +135,12 @@ export default class LaunchTemplate extends Component<PropsType, StateType> {
|
|
|
if (this.state.sourceType === "repo") {
|
|
|
this.createGHAction(name, this.state.selectedNamespace);
|
|
|
}
|
|
|
- // this.props.setCurrentView('cluster-dashboard');
|
|
|
+
|
|
|
this.setState({ saveValuesStatus: "successful" }, () => {
|
|
|
// redirect to dashboard
|
|
|
+ setTimeout(() => { this.props.history.push("cluster-dashboard")}, 1000);
|
|
|
});
|
|
|
+
|
|
|
posthog.capture("Deployed template", {
|
|
|
name: this.props.currentTemplate.name,
|
|
|
namespace: this.state.selectedNamespace,
|
|
|
@@ -241,6 +245,7 @@ export default class LaunchTemplate extends Component<PropsType, StateType> {
|
|
|
// this.props.setCurrentView('cluster-dashboard');
|
|
|
this.setState({ saveValuesStatus: "successful" }, () => {
|
|
|
// redirect to dashboard with namespace
|
|
|
+ setTimeout(() => { this.props.history.push("cluster-dashboard")}, 1000);
|
|
|
});
|
|
|
try {
|
|
|
posthog.capture("Deployed template", {
|
|
|
@@ -590,6 +595,8 @@ export default class LaunchTemplate extends Component<PropsType, StateType> {
|
|
|
|
|
|
LaunchTemplate.contextType = Context;
|
|
|
|
|
|
+export default withRouter(LaunchTemplate);
|
|
|
+
|
|
|
const Title = styled.div`
|
|
|
font-size: 24px;
|
|
|
font-weight: 600;
|