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

Enable Button (#3198)

* Enable Button`

* Update Button

* Update Button

---------

Co-authored-by: d-g-town <66391417+d-g-town@users.noreply.github.com>
sdess09 2 лет назад
Родитель
Сommit
4212d51bc0
1 измененных файлов с 12 добавлено и 5 удалено
  1. 12 5
      dashboard/src/components/ProvisionerSettings.tsx

+ 12 - 5
dashboard/src/components/ProvisionerSettings.tsx

@@ -181,13 +181,20 @@ const ProvisionerSettings: React.FC<Props> = (props) => {
     // If all tags are valid, return false (no error)
     return false;
   }
+  const clusterNameDoesNotExist = () => {
+    return (!clusterName)
+  }
+  const userProvisioning = () => {
+    //If the cluster is updating or updating unavailabe but there are no errors do not allow re-provisioning 
+    return (isReadOnly && (props.provisionerError === ""))
+  }
+
   const isDisabled = () => {
+
     return (
-      !user.email.endsWith("porter.run") &&
-      ((!clusterName && true) ||
-        (isReadOnly && props.provisionerError === "") ||
-        props.provisionerError === "" ||
-        currentCluster?.status === "UPDATING" ||
+      !user?.isPorterUser &&
+      (clusterNameDoesNotExist() ||
+        userProvisioning() ||
         isClicked)
     );
   };