Просмотр исходного кода

Disable source config and build settings when a chart is part of a stack

jnfrati 3 лет назад
Родитель
Сommit
2e93790cae

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

@@ -528,7 +528,7 @@ const ExpandedChart: React.FC<Props> = (props) => {
       );
       );
     }
     }
 
 
-    if (currentChart?.git_action_config?.git_repo) {
+    if (currentChart?.git_action_config?.git_repo && !currentChart.is_stack) {
       rightTabOptions.push({
       rightTabOptions.push({
         label: "Build Settings",
         label: "Build Settings",
         value: "build-settings",
         value: "build-settings",

+ 29 - 27
dashboard/src/main/home/cluster-dashboard/expanded-chart/SettingsSection.tsx

@@ -217,33 +217,35 @@ const SettingsSection: React.FC<PropsType> = ({
 
 
     return (
     return (
       <>
       <>
-        <>
-          <Heading>Source Settings</Heading>
-          <Helper>Specify an image tag to use.</Helper>
-          <ImageSelector
-            selectedTag={selectedTag}
-            selectedImageUrl={selectedImageUrl}
-            setSelectedImageUrl={(x: string) => setSelectedImageUrl(x)}
-            setSelectedTag={(x: string) => setSelectedTag(x)}
-            forceExpanded={true}
-            disableImageSelect={isDeployedFromGithub(currentChart)}
-          />
-          {!loadingWebhookToken && (
-            <>
-              <Br />
-              <Br />
-              <Br />
-              <SaveButton
-                clearPosition={true}
-                statusPosition="right"
-                text="Save Source Settings"
-                status={saveValuesStatus}
-                onClick={handleSubmit}
-              />
-            </>
-          )}
-          <Br />
-        </>
+        {!currentChart.is_stack ? (
+          <>
+            <Heading>Source Settings</Heading>
+            <Helper>Specify an image tag to use.</Helper>
+            <ImageSelector
+              selectedTag={selectedTag}
+              selectedImageUrl={selectedImageUrl}
+              setSelectedImageUrl={(x: string) => setSelectedImageUrl(x)}
+              setSelectedTag={(x: string) => setSelectedTag(x)}
+              forceExpanded={true}
+              disableImageSelect={isDeployedFromGithub(currentChart)}
+            />
+            {!loadingWebhookToken && (
+              <>
+                <Br />
+                <Br />
+                <Br />
+                <SaveButton
+                  clearPosition={true}
+                  statusPosition="right"
+                  text="Save Source Settings"
+                  status={saveValuesStatus}
+                  onClick={handleSubmit}
+                />
+              </>
+            )}
+            <Br />
+          </>
+        ) : null}
 
 
         <>
         <>
           <Heading>Redeploy Webhook</Heading>
           <Heading>Redeploy Webhook</Heading>

+ 1 - 0
dashboard/src/shared/types.tsx

@@ -21,6 +21,7 @@ export interface DetailedIngressError {
 }
 }
 
 
 export interface ChartType {
 export interface ChartType {
+  is_stack: boolean;
   image_repo_uri: string;
   image_repo_uri: string;
   git_action_config: any;
   git_action_config: any;
   build_config: BuildConfig;
   build_config: BuildConfig;