Przeglądaj źródła

Merge pull request #631 from porter-dev/hotfix-disable-deploy

[hotfix] disable deploy button when deploy is in progress
sunguroku 5 lat temu
rodzic
commit
1e601233f7

+ 5 - 1
dashboard/src/components/values-form/FormWrapper.tsx

@@ -258,6 +258,10 @@ export default class FormWrapper extends Component<PropsType, StateType> {
   };
   };
 
 
   isDisabled = () => {
   isDisabled = () => {
+    if (this.props.saveValuesStatus == "loading") {
+      return true;
+    }
+
     let requiredMissing = false;
     let requiredMissing = false;
     this.state.requiredFields.forEach((requiredKey: string, i: number) => {
     this.state.requiredFields.forEach((requiredKey: string, i: number) => {
       if (!this.isSet(this.state.metaState[requiredKey]?.value)) {
       if (!this.isSet(this.state.metaState[requiredKey]?.value)) {
@@ -371,7 +375,7 @@ export default class FormWrapper extends Component<PropsType, StateType> {
             text="Deploy"
             text="Deploy"
             onClick={this.handleSubmit}
             onClick={this.handleSubmit}
             status={
             status={
-              this.isDisabled()
+              this.isDisabled() && this.props.saveValuesStatus != "loading"
                 ? "Missing required fields"
                 ? "Missing required fields"
                 : this.props.saveValuesStatus
                 : this.props.saveValuesStatus
             }
             }