mirror of https://github.com/portainer/portainer
fixed save settings n redeploy button
parent
0c87634bc3
commit
5d2fe2d818
|
@ -15,6 +15,7 @@ class KubernetesRedeployAppGitFormController {
|
||||||
redeployInProgress: false,
|
redeployInProgress: false,
|
||||||
showConfig: false,
|
showConfig: false,
|
||||||
isEdit: false,
|
isEdit: false,
|
||||||
|
hasUnsavedChanges: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
this.formValues = {
|
this.formValues = {
|
||||||
|
@ -44,6 +45,7 @@ class KubernetesRedeployAppGitFormController {
|
||||||
...this.formValues,
|
...this.formValues,
|
||||||
...values,
|
...values,
|
||||||
};
|
};
|
||||||
|
this.state.hasUnsavedChanges = angular.toJson(this.savedFormValues) !== angular.toJson(this.formValues);
|
||||||
}
|
}
|
||||||
|
|
||||||
buildAnalyticsProperties() {
|
buildAnalyticsProperties() {
|
||||||
|
@ -98,6 +100,8 @@ class KubernetesRedeployAppGitFormController {
|
||||||
try {
|
try {
|
||||||
this.state.saveGitSettingsInProgress = true;
|
this.state.saveGitSettingsInProgress = true;
|
||||||
await this.StackService.updateKubeStack({ EndpointId: this.stack.EndpointId, Id: this.stack.Id }, null, this.formValues);
|
await this.StackService.updateKubeStack({ EndpointId: this.stack.EndpointId, Id: this.stack.Id }, null, this.formValues);
|
||||||
|
this.savedFormValues = angular.copy(this.formValues);
|
||||||
|
this.state.hasUnsavedChanges = false;
|
||||||
this.Notifications.success('Save stack settings successfully');
|
this.Notifications.success('Save stack settings successfully');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.Notifications.error('Failure', err, 'Unable to save application settings');
|
this.Notifications.error('Failure', err, 'Unable to save application settings');
|
||||||
|
@ -135,6 +139,8 @@ class KubernetesRedeployAppGitFormController {
|
||||||
this.formValues.RepositoryAuthentication = true;
|
this.formValues.RepositoryAuthentication = true;
|
||||||
this.state.isEdit = true;
|
this.state.isEdit = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.savedFormValues = angular.copy(this.formValues);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,9 +37,9 @@
|
||||||
class="btn btn-sm btn-primary"
|
class="btn btn-sm btn-primary"
|
||||||
ng-click="$ctrl.pullAndRedeployApplication()"
|
ng-click="$ctrl.pullAndRedeployApplication()"
|
||||||
ng-if="!$ctrl.formValues.AutoUpdate.RepositoryAutomaticUpdates"
|
ng-if="!$ctrl.formValues.AutoUpdate.RepositoryAutomaticUpdates"
|
||||||
ng-disabled="$ctrl.isSubmitButtonDisabled() || !$ctrl.redeployGitForm.$valid"
|
ng-disabled="$ctrl.isSubmitButtonDisabled() || $ctrl.state.hasUnsavedChanges|| !$ctrl.redeployGitForm.$valid"
|
||||||
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
|
||||||
analytics-category="kubernetes"
|
analytics-category="kubernetes"
|
||||||
analytics-event="kubernetes-application-edit-git-pull"
|
analytics-event="kubernetes-application-edit-git-pull"
|
||||||
|
@ -50,7 +50,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.redeployGitForm.$valid"
|
ng-disabled="$ctrl.isSubmitButtonDisabled() || !$ctrl.state.hasUnsavedChanges|| !$ctrl.redeployGitForm.$valid"
|
||||||
style="margin-top: 7px; margin-left: 0;"
|
style="margin-top: 7px; margin-left: 0;"
|
||||||
button-spinner="$ctrl.state.saveGitSettingsInProgress"
|
button-spinner="$ctrl.state.saveGitSettingsInProgress"
|
||||||
analytics-on
|
analytics-on
|
||||||
|
|
Loading…
Reference in New Issue