sunguroku 5 lat temu
rodzic
commit
83aae9fb03

+ 2 - 2
dashboard/src/main/home/cluster-dashboard/ClusterDashboard.tsx

@@ -31,7 +31,7 @@ export default class ClusterDashboard extends Component<PropsType, StateType> {
 
     // Reset namespace filter and close expanded chart on cluster change
     if (prevProps.currentCluster !== this.props.currentCluster) {
-      this.setState({ namespace: '', currentChart: null });
+      this.setState({ namespace: 'default', currentChart: null });
     }
   }
 
@@ -55,7 +55,7 @@ export default class ClusterDashboard extends Component<PropsType, StateType> {
 
   renderContents = () => {
     let { currentCluster, setSidebar, setCurrentView } = this.props;
-
+    
     if (this.state.currentChart) {
       return (
         <ExpandedChart

+ 3 - 2
dashboard/src/main/home/cluster-dashboard/expanded-chart/ExpandedChart.tsx

@@ -65,10 +65,11 @@ export default class ExpandedChart extends Component<PropsType, StateType> {
   // Retrieve full chart data (includes form and values)
   getChartData = (chart: ChartType) => {
     let { currentProject } = this.context;
-    let { currentCluster, setCurrentChart } = this.props;
+    let { currentCluster, currentChart, setCurrentChart } = this.props;
+    
     this.setState({ loading: true })
     api.getChart('<token>', {
-      namespace: this.props.namespace,
+      namespace: currentChart.namespace,
       cluster_id: currentCluster.id,
       storage: StorageType.Secret
     }, {

+ 1 - 0
dashboard/src/main/home/templates/expanded-template/ExpandedTemplate.tsx

@@ -44,6 +44,7 @@ export default class ExpandedTemplate extends Component<PropsType, StateType> {
       if (err) {
         this.setState({ loading: false, error: true });
       } else {
+        console.log(res.data)
         let { form, values, markdown, metadata } = res.data;
         let keywords = metadata.keywords;
         this.setState({ form, values, markdown, keywords, loading: false, error: false });