|
|
@@ -1,7 +1,6 @@
|
|
|
import React, { Component } from "react";
|
|
|
import styled from "styled-components";
|
|
|
import randomWords from "random-words";
|
|
|
-import posthog from "posthog-js";
|
|
|
import _ from "lodash";
|
|
|
import { Context } from "shared/Context";
|
|
|
import api from "shared/api";
|
|
|
@@ -138,24 +137,23 @@ class LaunchTemplate extends Component<PropsType, StateType> {
|
|
|
|
|
|
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,
|
|
|
- values: values,
|
|
|
+ setTimeout(() => { this.props.history.push("cluster-dashboard")}, 500);
|
|
|
+ window.analytics.track('Deployed Add-on', {
|
|
|
+ name: this.props.currentTemplate.name,
|
|
|
+ namespace: this.state.selectedNamespace,
|
|
|
+ values: values,
|
|
|
+ })
|
|
|
});
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
this.setState({ saveValuesStatus: "error" });
|
|
|
setCurrentError(err.response.data.errors[0]);
|
|
|
- posthog.capture("Failed to deploy template", {
|
|
|
+ window.analytics.track('Failed to Deploy Add-on', {
|
|
|
name: this.props.currentTemplate.name,
|
|
|
namespace: this.state.selectedNamespace,
|
|
|
values: values,
|
|
|
error: err,
|
|
|
- });
|
|
|
+ })
|
|
|
});
|
|
|
};
|
|
|
|
|
|
@@ -248,11 +246,12 @@ class LaunchTemplate extends Component<PropsType, StateType> {
|
|
|
setTimeout(() => { this.props.history.push("cluster-dashboard")}, 1000);
|
|
|
});
|
|
|
try {
|
|
|
- posthog.capture("Deployed template", {
|
|
|
+ window.analytics.track('Deployed Application', {
|
|
|
name: this.props.currentTemplate.name,
|
|
|
namespace: this.state.selectedNamespace,
|
|
|
+ sourceType: this.state.sourceType,
|
|
|
values: values,
|
|
|
- });
|
|
|
+ })
|
|
|
} catch (error) {
|
|
|
console.log(error);
|
|
|
}
|
|
|
@@ -261,12 +260,13 @@ class LaunchTemplate extends Component<PropsType, StateType> {
|
|
|
this.setState({ saveValuesStatus: "error" });
|
|
|
|
|
|
try {
|
|
|
- posthog.capture("Failed to deploy template", {
|
|
|
+ window.analytics.track('Failed to Deploy Application', {
|
|
|
name: this.props.currentTemplate.name,
|
|
|
namespace: this.state.selectedNamespace,
|
|
|
+ sourceType: this.state.sourceType,
|
|
|
values: values,
|
|
|
error: err,
|
|
|
- });
|
|
|
+ })
|
|
|
} catch (error) {
|
|
|
console.log(error);
|
|
|
}
|