jusrhee 5 лет назад
Родитель
Сommit
a54bcebea8

+ 5 - 0
dashboard/package-lock.json

@@ -4054,6 +4054,11 @@
       "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
       "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw=="
     },
+    "highlight.run": {
+      "version": "1.4.3",
+      "resolved": "https://registry.npmjs.org/highlight.run/-/highlight.run-1.4.3.tgz",
+      "integrity": "sha512-J3sLrvmS7wNBFhAKeGonapKFFdXAkEa4zplLL6EaZLDi1Vx7OsIvh2RVNNKDjjw11aq9I1LmTIXkXp222EyxPA=="
+    },
     "history": {
       "version": "4.10.1",
       "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz",

+ 1 - 0
dashboard/package.json

@@ -29,6 +29,7 @@
     "d3-array": "^2.11.0",
     "d3-time-format": "^3.0.0",
     "dotenv": "^8.2.0",
+    "highlight.run": "^1.4.3",
     "ini": ">=1.3.6",
     "js-base64": "^3.6.0",
     "js-yaml": "^3.14.0",

+ 7 - 0
dashboard/src/main/home/Home.tsx

@@ -3,6 +3,7 @@ import { RouteComponentProps, withRouter } from "react-router";
 import styled from "styled-components";
 
 import api from "shared/api";
+import { H } from "highlight.run";
 import { Context } from "shared/Context";
 import { PorterUrl } from "shared/routing";
 import { ClusterType, ProjectType } from "shared/types";
@@ -217,6 +218,12 @@ class Home extends Component<PropsType, StateType> {
   };
 
   componentDidMount() {
+    let { user } = this.context;
+
+    // Initialize Highlight
+    H.init("y2d13lgr");
+    H.identify(user.email, { id: user.id });
+
     // Handle redirect from DO
     let queryString = window.location.search;
     let urlParams = new URLSearchParams(queryString);

+ 2 - 0
dashboard/src/main/home/cluster-dashboard/expanded-chart/ExpandedJobChart.tsx

@@ -74,6 +74,8 @@ export default class ExpandedJobChart extends Component<PropsType, StateType> {
         }
       )
       .then((res) => {
+        console.log("Charts for breakfast");
+        console.log(res.data);
         this.setState({ currentChart: res.data, loading: false }, () => {
           this.updateTabs();
         });

+ 2 - 1
dashboard/src/main/home/cluster-dashboard/expanded-chart/jobs/JobResource.tsx

@@ -150,7 +150,7 @@ export default class JobResource extends Component<PropsType, StateType> {
             <MaterialIconTray disabled={false}>
               {/* <i className="material-icons"
               onClick={this.editButtonOnClick}>mode_edit</i> */}
-              <i className="material-icons" onClick={this.expandJob}>
+              <i className="material-icons">
                 {this.state.expanded ? "expand_less" : "expand_more"}
               </i>
             </MaterialIconTray>
@@ -231,6 +231,7 @@ const MainRow = styled.div`
 
 const MaterialIconTray = styled.div`
   max-width: 60px;
+  user-select: none;
   display: flex;
   align-items: center;
   justify-content: space-between;