소스 검색

Add casing to prevent clone button to be shown for addons

jnfrati 4 년 전
부모
커밋
8355a27d30
1개의 변경된 파일14개의 추가작업 그리고 1개의 파일을 삭제
  1. 14 1
      dashboard/src/main/home/cluster-dashboard/expanded-chart/SettingsSection.tsx

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

@@ -287,6 +287,19 @@ const SettingsSection: React.FC<PropsType> = ({
     return false;
     return false;
   };
   };
 
 
+  const canBeCloned = () => {
+    if(chartWasDeployedWithGithub()) {
+      return false;
+    }
+
+    // If its not web worker or job it means is an addon, and for now it's not supported
+    if (!["web", "worker", "job"].includes(currentChart?.chart?.metadata?.name)) {
+      return false
+    }
+
+    return true
+  }
+
   return (
   return (
     <Wrapper>
     <Wrapper>
       {!loadingWebhookToken ? (
       {!loadingWebhookToken ? (
@@ -294,7 +307,7 @@ const SettingsSection: React.FC<PropsType> = ({
           {renderWebhookSection()}
           {renderWebhookSection()}
           <NotificationSettingsSection currentChart={currentChart} />
           <NotificationSettingsSection currentChart={currentChart} />
           {/* Prevent the clone button to be rendered in github deployed charts */}
           {/* Prevent the clone button to be rendered in github deployed charts */}
-          {!chartWasDeployedWithGithub() && (
+          {canBeCloned() && (
             <>
             <>
               <Heading>Clone deployment</Heading>
               <Heading>Clone deployment</Heading>
               <Helper>
               <Helper>