Преглед изворни кода

fixed init key-value from revision values

jusrhee пре 4 година
родитељ
комит
4bb10e5165

+ 3 - 1
dashboard/src/components/form-refactor/field-components/KeyValueArray.tsx

@@ -22,7 +22,9 @@ const KeyValueArray: React.FC<Props> = (props) => {
     props.id,
     {
       initState: {
-        values: [],
+        values: (props.value && props.value[0]) ? Object.entries(props.value[0]).map(([k, v]) => {
+          return { key: k, value: v };
+        }) as any[] : [],
         showEnvModal: false,
         showEditorModal: false,
       },

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

@@ -651,6 +651,7 @@ const ExpandedChart: React.FC<Props> = (props) => {
     return () => (isSubscribed = false);
   }, [components, currentCluster, currentProject, currentChart]);
 
+  console.log(currentChart.form)
   return (
     <>
       <StyledExpandedChart>