feat(stack): enable save button when password exists (#5429)

This commit is contained in:
fhanportainer
2021-08-16 15:37:28 +12:00
committed by GitHub
parent 75a2b7efdd
commit c911cedcc8
4 changed files with 11 additions and 2 deletions

View File

@@ -34,7 +34,7 @@
name="repository_password"
placeholder="personal access token"
ng-change="$ctrl.onChangePassword($ctrl.model.RepositoryPassword)"
required
ng-required="!$ctrl.isEdit"
/>
</div>
</div>

View File

@@ -6,5 +6,6 @@ export const gitFormAuthFieldset = {
bindings: {
model: '<',
onChange: '<',
isEdit: '<',
},
};

View File

@@ -14,6 +14,7 @@ class StackRedeployGitFormController {
inProgress: false,
redeployInProgress: false,
showConfig: false,
isEdit: false,
};
this.formValues = {
@@ -122,6 +123,7 @@ class StackRedeployGitFormController {
if (this.stack.GitConfig && this.stack.GitConfig.Authentication) {
this.formValues.RepositoryUsername = this.stack.GitConfig.Authentication.Username;
this.formValues.RepositoryAuthentication = true;
this.state.isEdit = true;
}
}
}

View File

@@ -30,7 +30,13 @@
</div>
</div>
<git-form-ref-field ng-if="$ctrl.state.showConfig" value="$ctrl.formValues.RefName" on-change="($ctrl.onChangeRef)"></git-form-ref-field>
<git-form-auth-fieldset ng-if="$ctrl.state.showConfig" model="$ctrl.formValues" on-change="($ctrl.onChange)" show-auth-explanation="true"></git-form-auth-fieldset>
<git-form-auth-fieldset
ng-if="$ctrl.state.showConfig"
is-edit="$ctrl.state.isEdit"
model="$ctrl.formValues"
on-change="($ctrl.onChange)"
show-auth-explanation="true"
></git-form-auth-fieldset>
<environment-variables-panel
ng-model="$ctrl.formValues.Env"
explanation="These values will be used as substitutions in the stack file"