Explorar el Código

log from every possible location dashboard is being set

jusrhee hace 5 años
padre
commit
aaedf810c1

+ 1 - 9
dashboard/src/components/TabRegion.tsx

@@ -38,15 +38,7 @@ export default class TabRegion extends Component<PropsType, StateType> {
   }
 
   renderContents = () => {
-    if (this.props.options.length === 0) {
-      return (
-        <Div>
-          <TabContents>
-            <Placeholder>No additional settings found.</Placeholder>
-          </TabContents>
-        </Div>
-      );
-    } else if (!this.props.currentTab) {
+    if (!this.props.currentTab) {
       return (
         <Loading />
       );

+ 1 - 1
dashboard/src/main/home/Home.tsx

@@ -79,7 +79,6 @@ export default class Home extends Component<PropsType, StateType> {
                 console.log('setting to provisioner...');
                 this.setState({ currentView: 'provisioner', viewData});
               }
-
             }
           });
         } else if (res.data.length === 0) {
@@ -102,6 +101,7 @@ export default class Home extends Component<PropsType, StateType> {
           prevProjectId: this.context.currentProject.id,
           currentView: 'dashboard'
         });
+        console.log('setting view to dashboard from Home');
       }
     }
   }

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

@@ -59,6 +59,7 @@ export default class ClusterSection extends Component<PropsType, StateType> {
           } else if (this.props.currentView !== 'provisioner') {
             this.setState({ clusters: [] });
             setCurrentCluster(null);
+            console.log('set to dashboard from clustersection');
             this.props.setCurrentView('dashboard');
           }
         }

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

@@ -42,6 +42,7 @@ export default class ProjectSection extends Component<PropsType, StateType> {
         if (viewData.length > 0) {
           this.props.setCurrentView('provisioner', viewData);
         } else {
+          console.log('set to dashboard from projectsection');
           this.props.setCurrentView('dashboard');
         }
       }

+ 15 - 7
dashboard/src/main/home/templates/expanded-template/LaunchTemplate.tsx

@@ -182,6 +182,20 @@ export default class LaunchTemplate extends Component<PropsType, StateType> {
     );
   }
 
+  renderTabRegion = () => {
+    if (this.state.tabOptions.length > 0) {
+      return (
+        <TabRegion
+          options={this.state.tabOptions}
+          currentTab={this.state.currentTab}
+          setCurrentTab={(x: string) => this.setState({ currentTab: x })}
+        >
+          {this.renderTabContents()}
+        </TabRegion>
+      );
+    }
+  }
+
   render() {
     let { name, icon } = this.props.currentTemplate;
     let { currentTemplate } = this.props;
@@ -240,13 +254,7 @@ export default class LaunchTemplate extends Component<PropsType, StateType> {
 
         <br />
         <Subtitle>Configure additional settings for this template (optional).</Subtitle>
-        <TabRegion
-          options={this.state.tabOptions}
-          currentTab={this.state.currentTab}
-          setCurrentTab={(x: string) => this.setState({ currentTab: x })}
-        >
-          {this.renderTabContents()}
-        </TabRegion>
+        {this.renderTabRegion()}
       </StyledLaunchTemplate>
     );
   }