mirror of https://github.com/portainer/portainer
fix(stack): fix edit git stack validation EE-5855 (#10339)
parent
dfce48cd5e
commit
fb7a2fbbe6
|
@ -52,7 +52,7 @@ export default class GitFormAuthFieldsetController {
|
|||
...newValues,
|
||||
};
|
||||
this.onChange?.(value);
|
||||
await this.runGitValidation(value, false);
|
||||
await this.runGitValidation(value, this.isAuthEdit);
|
||||
}
|
||||
|
||||
async runGitValidation(value: GitAuthModel, isAuthEdit: boolean) {
|
||||
|
|
|
@ -179,6 +179,14 @@ class StackRedeployGitFormController {
|
|||
});
|
||||
}
|
||||
|
||||
disablePullAndRedeployButton() {
|
||||
return this.isSubmitButtonDisabled() || this.state.hasUnsavedChanges || !this.redeployGitForm.$valid;
|
||||
}
|
||||
|
||||
disableSaveSettingsButton() {
|
||||
return this.isSubmitButtonDisabled() || !this.state.hasUnsavedChanges || !this.redeployGitForm.$valid;
|
||||
}
|
||||
|
||||
isSubmitButtonDisabled() {
|
||||
return this.state.inProgress || this.state.redeployInProgress;
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
<button
|
||||
class="btn btn-sm btn-primary"
|
||||
ng-click="$ctrl.submit()"
|
||||
ng-disabled="$ctrl.isSubmitButtonDisabled() || $ctrl.state.hasUnsavedChanges || !$ctrl.redeployGitForm.$valid"
|
||||
ng-disabled="$ctrl.disablePullAndRedeployButton()"
|
||||
style="margin-top: 7px; margin-left: 0"
|
||||
button-spinner="$ctrl.state.redeployInProgress"
|
||||
analytics-on
|
||||
|
@ -93,7 +93,7 @@
|
|||
<button
|
||||
class="btn btn-sm btn-primary"
|
||||
ng-click="$ctrl.saveGitSettings()"
|
||||
ng-disabled="$ctrl.isSubmitButtonDisabled() || !$ctrl.state.hasUnsavedChanges || !$ctrl.redeployGitForm.$valid"
|
||||
ng-disabled="$ctrl.disableSaveSettingsButton()"
|
||||
style="margin-top: 7px; margin-left: 0"
|
||||
button-spinner="$ctrl.state.inProgress"
|
||||
analytics-on
|
||||
|
|
|
@ -165,7 +165,8 @@ export function gitAuthValidation(
|
|||
NewCredentialName: string()
|
||||
.default('')
|
||||
.when(['RepositoryAuthentication', 'SaveCredential'], {
|
||||
is: true,
|
||||
is: (RepositoryAuthentication: boolean, SaveCredential: boolean) =>
|
||||
RepositoryAuthentication && SaveCredential && !isAuthEdit,
|
||||
then: string()
|
||||
.required('Name is required')
|
||||
.test(
|
||||
|
|
Loading…
Reference in New Issue