ソースを参照

remove duplicate global errors

Alexander Belanger 4 年 前
コミット
7b530b877d

+ 1 - 1
dashboard/src/components/ProvisionerStatus.tsx

@@ -85,7 +85,7 @@ const ProvisionerStatus: React.FC<Props> = ({ modules }) => {
         }
       }
 
-      const width = 100 * (provisionedResources / (totalResources * 1.0)) || 100
+      const width = 100 * (provisionedResources / (totalResources * 1.0)) || 0
 
       let error = null;
 

+ 7 - 0
dashboard/src/main/home/onboarding/steps/ProvisionResources/forms/SharedStatus.tsx

@@ -62,6 +62,13 @@ export const SharedStatus: React.FC<{
 
       tfModules[index].global_errors = [...tfModules[index].global_errors, ...globalErrors]
 
+      // remove duplicate global errors
+      tfModules[index].global_errors = tfModules[index].global_errors.filter((error, index, self) =>
+        index === self.findIndex((e) => (
+          e.error_context === error.error_context
+        ))
+      )
+
       setTFModules([...tfModules])
     }