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,
|
...newValues,
|
||||||
};
|
};
|
||||||
this.onChange?.(value);
|
this.onChange?.(value);
|
||||||
await this.runGitValidation(value, false);
|
await this.runGitValidation(value, this.isAuthEdit);
|
||||||
}
|
}
|
||||||
|
|
||||||
async runGitValidation(value: GitAuthModel, isAuthEdit: boolean) {
|
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() {
|
isSubmitButtonDisabled() {
|
||||||
return this.state.inProgress || this.state.redeployInProgress;
|
return this.state.inProgress || this.state.redeployInProgress;
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,7 @@
|
||||||
<button
|
<button
|
||||||
class="btn btn-sm btn-primary"
|
class="btn btn-sm btn-primary"
|
||||||
ng-click="$ctrl.submit()"
|
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"
|
style="margin-top: 7px; margin-left: 0"
|
||||||
button-spinner="$ctrl.state.redeployInProgress"
|
button-spinner="$ctrl.state.redeployInProgress"
|
||||||
analytics-on
|
analytics-on
|
||||||
|
@ -93,7 +93,7 @@
|
||||||
<button
|
<button
|
||||||
class="btn btn-sm btn-primary"
|
class="btn btn-sm btn-primary"
|
||||||
ng-click="$ctrl.saveGitSettings()"
|
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"
|
style="margin-top: 7px; margin-left: 0"
|
||||||
button-spinner="$ctrl.state.inProgress"
|
button-spinner="$ctrl.state.inProgress"
|
||||||
analytics-on
|
analytics-on
|
||||||
|
|
|
@ -165,7 +165,8 @@ export function gitAuthValidation(
|
||||||
NewCredentialName: string()
|
NewCredentialName: string()
|
||||||
.default('')
|
.default('')
|
||||||
.when(['RepositoryAuthentication', 'SaveCredential'], {
|
.when(['RepositoryAuthentication', 'SaveCredential'], {
|
||||||
is: true,
|
is: (RepositoryAuthentication: boolean, SaveCredential: boolean) =>
|
||||||
|
RepositoryAuthentication && SaveCredential && !isAuthEdit,
|
||||||
then: string()
|
then: string()
|
||||||
.required('Name is required')
|
.required('Name is required')
|
||||||
.test(
|
.test(
|
||||||
|
|
Loading…
Reference in New Issue