瀏覽代碼

only show GitHub Actions page for Git Repository source

Anukul Sangwan 4 年之前
父節點
當前提交
05219d14c5

+ 1 - 0
dashboard/src/main/home/launch/launch-flow/LaunchFlow.tsx

@@ -347,6 +347,7 @@ const LaunchFlow: React.FC<PropsType> = (props) => {
         templateName={templateName}
         setTemplateName={setTemplateName}
         hasSource={currentTab === "porter"}
+        sourceType={sourceType}
         setPage={setCurrentPage}
         form={form}
         valuesToOverride={valuesToOverride}

+ 23 - 12
dashboard/src/main/home/launch/launch-flow/SettingsPage.tsx

@@ -19,6 +19,7 @@ import { withAuth, WithAuthProps } from "shared/auth/AuthorizationHoc";
 type PropsType = WithAuthProps & {
   onSubmit: (x?: any) => void;
   hasSource: boolean;
+  sourceType: string;
   setPage: (x: string) => void;
   form: any;
   valuesToOverride: any;
@@ -182,20 +183,30 @@ class SettingsPage extends Component<PropsType, StateType> {
   };
 
   renderHeaderSection = () => {
-    let { hasSource, templateName, setTemplateName } = this.props;
+    let {
+      hasSource,
+      sourceType,
+      templateName,
+      setPage,
+      setTemplateName,
+    } = this.props;
 
     if (hasSource) {
-      return (
-        <BackButton
-          width="155px"
-          onClick={() => {
-            this.props.setPage("workflow");
-          }}
-        >
-          <i className="material-icons">first_page</i>
-          GitHub Actions
-        </BackButton>
-      );
+      if (sourceType === "repo") {
+        return (
+          <BackButton width="155px" onClick={() => setPage("workflow")}>
+            <i className="material-icons">first_page</i>
+            GitHub Actions
+          </BackButton>
+        );
+      } else if (sourceType === "registry") {
+        return (
+          <BackButton width="155px" onClick={() => setPage("source")}>
+            <i className="material-icons">first_page</i>
+            Source Settings
+          </BackButton>
+        );
+      }
     }
 
     return (

+ 11 - 1
dashboard/src/main/home/launch/launch-flow/SourcePage.tsx

@@ -227,6 +227,16 @@ class SourcePage extends Component<PropsType, StateType> {
     }
   };
 
+  handleContinue = () => {
+    const { sourceType, setPage } = this.props;
+
+    if (sourceType == "repo") {
+      setPage("workflow");
+    } else if (sourceType == "registry") {
+      setPage("settings");
+    }
+  };
+
   render() {
     let { templateName, setTemplateName, setPage } = this.props;
 
@@ -270,7 +280,7 @@ class SourcePage extends Component<PropsType, StateType> {
         <SaveButton
           text="Continue"
           disabled={!this.checkSourceSelected()}
-          onClick={() => setPage("workflow")}
+          onClick={this.handleContinue}
           status={this.getButtonStatus()}
           makeFlush={true}
           helper={this.getButtonHelper()}