瀏覽代碼

Modified closeChart function to use history goBack

jnfrati 4 年之前
父節點
當前提交
cf98f7f206
共有 1 個文件被更改,包括 8 次插入6 次删除
  1. 8 6
      dashboard/src/main/home/cluster-dashboard/expanded-chart/ExpandedChartWrapper.tsx

+ 8 - 6
dashboard/src/main/home/cluster-dashboard/expanded-chart/ExpandedChartWrapper.tsx

@@ -64,6 +64,7 @@ class ExpandedChartWrapper extends Component<PropsType, StateType> {
     let { setSidebar, location, match } = this.props;
     let { baseRoute, namespace } = match.params as any;
     let { loading, currentChart } = this.state;
+
     if (loading) {
       return (
         <LoadingWrapper>
@@ -92,12 +93,13 @@ class ExpandedChartWrapper extends Component<PropsType, StateType> {
           isMetricsInstalled={this.props.isMetricsInstalled}
           currentChart={currentChart}
           currentCluster={this.context.currentCluster}
-          closeChart={() =>
-            pushFiltered(this.props, "/applications", ["project_id"], {
-              cluster: this.context.currentCluster.name,
-              namespace: namespace,
-            })
-          }
+          closeChart={() => {
+            // pushFiltered(this.props, "/applications", ["project_id"], {
+            //   cluster: this.context.currentCluster.name,
+            //   namespace: namespace,
+            // })
+            this.props.history.goBack();
+          }}
           setSidebar={setSidebar}
         />
       );