Ver Fonte

previewing prior revision config through forms + fixed tab default

jusrhee há 5 anos atrás
pai
commit
27c90a0611

+ 4 - 2
dashboard/src/components/TabRegion.tsx

@@ -29,9 +29,11 @@ export default class TabRegion extends Component<PropsType, StateType> {
   }
 
   componentDidUpdate(prevProps: PropsType) {
-    let { options } = this.props;
+    let { options, currentTab } = this.props;
     if (prevProps.options !== options) {
-      this.setDefaultTab();
+      if (options.filter(x => x.value === currentTab).length === 0) {
+        this.setDefaultTab();
+      }
     }
   }
 

+ 2 - 0
dashboard/src/components/values-form/ValuesForm.tsx

@@ -33,6 +33,7 @@ export default class ValuesForm extends Component<PropsType, StateType> {
         let key = item.name || item.variable;
         
         let def = item.settings && item.settings.default;
+        console.log(key, def)
 
         // Set default value from chart config if available
         if (this.props.config) {
@@ -60,6 +61,7 @@ export default class ValuesForm extends Component<PropsType, StateType> {
 
   // Initialize corresponding state fields for form blocks
   componentDidMount() {
+    console.log(this.props.sections)
     this.updateFormState();
   }
 

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

@@ -200,7 +200,7 @@ export default class ExpandedChart extends Component<PropsType, StateType> {
                     sections={tab.sections} 
                     onSubmit={this.upgradeValues}
                     saveValuesStatus={saveValuesStatus}
-                    config={currentChart.config}
+                    config={chart.config}
                   />
                 </ValuesFormWrapper>
               );

+ 1 - 2
dashboard/src/main/home/templates/expanded-template/LaunchTemplate.tsx

@@ -66,7 +66,6 @@ export default class LaunchTemplate extends Component<PropsType, StateType> {
             <ValuesForm 
               sections={tab.sections} 
               onSubmit={this.onSubmit}
-              disabled={!this.state.selectedImageUrl || this.state.selectedImageUrl === ''}
             />
           </ValuesFormWrapper>
         );
@@ -141,7 +140,7 @@ export default class LaunchTemplate extends Component<PropsType, StateType> {
           />
         </ClusterSection>
 
-        <Subtitle>Select the container image you would like to connect to this template.</Subtitle>
+        <Subtitle>Select the container image you would like to connect to this template (optional).</Subtitle>
         <Br />
         <ImageSelector
           selectedTag={this.state.selectedTag}