Quellcode durchsuchen

broken: Implement key value array

jnfrati vor 4 Jahren
Ursprung
Commit
ad3a5a9109

+ 21 - 2
dashboard/src/main/home/cluster-dashboard/expanded-chart/BuildSettingsTab.tsx

@@ -1,11 +1,30 @@
+import Heading from "components/form-components/Heading";
+import KeyValueArray from "components/form-components/KeyValueArray";
 import MultiSaveButton from "components/MultiSaveButton";
-import React from "react";
+import React, { useContext } from "react";
+import { Context } from "shared/Context";
+import { ChartTypeWithExtendedConfig } from "shared/types";
 import styled from "styled-components";
 
-const BuildSettingsTab = () => {
+const BuildSettingsTab: React.FC<{ chart: ChartTypeWithExtendedConfig }> = ({
+  chart,
+}) => {
+  const { currentCluster } = useContext(Context);
+
   return (
     <Wrapper>
       <StyledSettingsSection>
+        <Heading>Build step env variables</Heading>
+
+        <KeyValueArray
+          values={chart.config.container.env}
+          envLoader
+          label="Environment Variables: "
+          externalValues={{
+            namespace: chart.namespace,
+            clusterId: currentCluster.id,
+          }}
+        ></KeyValueArray>
         <MultiSaveButton
           options={[
             {

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

@@ -517,7 +517,7 @@ const ExpandedChart: React.FC<Props> = (props) => {
           />
         );
       case "build-settings":
-        return <BuildSettingsTab />;
+        return <BuildSettingsTab chart={chart} />;
       default:
     }
   };