فهرست منبع

Hide template GH Actions (doesn't work)

Sean Rhee 5 سال پیش
والد
کامیت
09127176bf
1فایلهای تغییر یافته به همراه20 افزوده شده و 14 حذف شده
  1. 20 14
      dashboard/src/main/home/templates/expanded-template/LaunchTemplate.tsx

+ 20 - 14
dashboard/src/main/home/templates/expanded-template/LaunchTemplate.tsx

@@ -98,6 +98,10 @@ export default class LaunchTemplate extends Component<PropsType, StateType> {
     let name = this.state.templateName || randomWords({ exactly: 3, join: '-' });
     let name = this.state.templateName || randomWords({ exactly: 3, join: '-' });
     this.setState({ saveValuesStatus: 'loading' });
     this.setState({ saveValuesStatus: 'loading' });
 
 
+    if (this.state.sourceType !== 'registry') {
+      this.createGHAction(name, this.state.selectedNamespace);
+    }
+
     let values = {};
     let values = {};
     for (let key in wildcard) {
     for (let key in wildcard) {
       _.set(values, key, wildcard[key]);
       _.set(values, key, wildcard[key]);
@@ -125,11 +129,7 @@ export default class LaunchTemplate extends Component<PropsType, StateType> {
         })
         })
       } else {
       } else {
         // this.props.setCurrentView('cluster-dashboard');
         // this.props.setCurrentView('cluster-dashboard');
-        this.setState({ saveValuesStatus: 'successful' }, () => {
-          if (this.state.sourceType !== 'registry') {
-            this.createGHAction(name, this.state.selectedNamespace);
-          }
-        });
+        this.setState({ saveValuesStatus: 'successful' });
         posthog.capture('Deployed template', {
         posthog.capture('Deployed template', {
           name: this.props.currentTemplate.name,
           name: this.props.currentTemplate.name,
           namespace: this.state.selectedNamespace,
           namespace: this.state.selectedNamespace,
@@ -144,6 +144,10 @@ export default class LaunchTemplate extends Component<PropsType, StateType> {
     let name = this.state.templateName || randomWords({ exactly: 3, join: '-' });
     let name = this.state.templateName || randomWords({ exactly: 3, join: '-' });
     this.setState({ saveValuesStatus: 'loading' });
     this.setState({ saveValuesStatus: 'loading' });
 
 
+    if (this.state.sourceType !== 'registry') {
+      this.createGHAction(name, this.state.selectedNamespace);
+    }
+
     // Convert dotted keys to nested objects
     // Convert dotted keys to nested objects
     let values = {};
     let values = {};
     for (let key in rawValues) {
     for (let key in rawValues) {
@@ -187,11 +191,7 @@ export default class LaunchTemplate extends Component<PropsType, StateType> {
         })
         })
       } else {
       } else {
         // this.props.setCurrentView('cluster-dashboard');
         // this.props.setCurrentView('cluster-dashboard');
-        this.setState({ saveValuesStatus: 'successful' }, () => {
-          if (this.state.sourceType !== 'registry') {
-            this.createGHAction(name, this.state.selectedNamespace);
-          }
-        });
+        this.setState({ saveValuesStatus: 'successful' });
         posthog.capture('Deployed template', {
         posthog.capture('Deployed template', {
           name: this.props.currentTemplate.name,
           name: this.props.currentTemplate.name,
           namespace: this.state.selectedNamespace,
           namespace: this.state.selectedNamespace,
@@ -337,10 +337,16 @@ export default class LaunchTemplate extends Component<PropsType, StateType> {
         return (
         return (
           <>
           <>
             <Subtitle>
             <Subtitle>
-              Select the container image you would like to connect to this template or
-              <Highlight onClick={() => this.setState({ sourceType: 'repo' })}>
-                link a git repository
-              </Highlight>.
+              Select the container image you would like to connect to this template
+              {false &&
+                <>
+                  or
+                  <Highlight onClick={() => this.setState({ sourceType: 'repo' })}>
+                    link a git repository
+                  </Highlight>
+                </>
+              } 
+              .
               <Required>*</Required>
               <Required>*</Required>
             </Subtitle>
             </Subtitle>
             <DarkMatter />
             <DarkMatter />