Bladeren bron

fixed cluster drawer always showing dashboard issue

jusrhee 5 jaren geleden
bovenliggende
commit
16cb22302a

+ 2 - 8
dashboard/src/main/home/Home.tsx

@@ -2,7 +2,6 @@ import React, { Component } from 'react';
 import posthog from 'posthog-js';
 import styled from 'styled-components';
 import ReactModal from 'react-modal';
-import * as FullStory from '@fullstory/browser';
 
 import { Context } from '../../shared/Context';
 import api from '../../shared/api';
@@ -91,22 +90,17 @@ export default class Home extends Component<PropsType, StateType> {
   }
 
   componentDidMount() {
-    console.log('newest release')
     let { user } = this.context;
     window.location.href.indexOf('127.0.0.1') === -1 && posthog.init(process.env.POSTHOG_API_KEY, {
       api_host: process.env.POSTHOG_HOST,
-      loaded: function(posthog) { posthog.identify(user.email) }
+      loaded: function(posthog: any) { posthog.identify(user.email) }
     })
 
-    FullStory.identify(user.email)
     this.getProjects();
   }
 
   componentDidUpdate(prevProps: PropsType) {
-    if (
-      prevProps.currentProject !== this.props.currentProject
-      || prevProps.currentCluster !== this.props.currentCluster
-    ) {
+    if (prevProps.currentProject !== this.props.currentProject) {
       this.initializeView();
     }
   }

+ 1 - 0
dashboard/src/main/home/sidebar/ClusterSection.tsx

@@ -51,6 +51,7 @@ export default class ClusterSection extends Component<PropsType, StateType> {
         this.props.setWelcome(false);
         // TODO: handle uninitialized kubeconfig
         if (res.data) {
+          console.log(res.data);
           let clusters = res.data;
           clusters.sort((a: any, b: any) => a.id - b.id);
           if (clusters.length > 0) {

+ 2 - 0
dashboard/src/shared/baseApi.tsx

@@ -56,6 +56,8 @@ export const baseApi = <T extends {}, S = {}>(requestType: string, endpoint: ((p
         }
       })
       .then(res => {
+        console.log('from axio')
+        console.log(res.data);
         callback && callback(null, res);
       })
       .catch(err => {