mirror of
https://github.com/portainer/portainer.git
synced 2025-08-10 00:05:24 +02:00
fix(app):fix additional not save warning EE-799 (#5161)
* fix(app):fix additional not save warning EE-799 * fix additional warning when user leave page * fix additional warning when user leave page in buildImageController.js * fix docker build controller additional warning message * fix changes required from reviews * - refactored ondestroy hook function to align it closer to (below) oninit - removed duplicated hook func duplication in configurationController Co-authored-by: zees-dev <dev.786zshan@gmail.com>
This commit is contained in:
parent
75baf14b38
commit
3257cb1e28
13 changed files with 49 additions and 0 deletions
|
@ -189,6 +189,10 @@ class CreateCustomTemplateViewController {
|
|||
};
|
||||
}
|
||||
|
||||
$onDestroy() {
|
||||
this.state.isEditorDirty = false;
|
||||
}
|
||||
|
||||
async uiCanExit() {
|
||||
if (this.state.Method === 'editor' && this.formValues.FileContent && this.state.isEditorDirty) {
|
||||
return this.ModalService.confirmWebEditorDiscard();
|
||||
|
|
|
@ -123,6 +123,10 @@ class EditCustomTemplateViewController {
|
|||
}
|
||||
};
|
||||
}
|
||||
|
||||
$onDestroy() {
|
||||
this.state.isEditorDirty = false;
|
||||
}
|
||||
}
|
||||
|
||||
export default EditCustomTemplateViewController;
|
||||
|
|
|
@ -53,6 +53,10 @@ angular
|
|||
}
|
||||
};
|
||||
|
||||
$scope.$on('$destroy', function() {
|
||||
$scope.state.isEditorDirty = false;
|
||||
})
|
||||
|
||||
$scope.onChangeFormValues = onChangeFormValues;
|
||||
|
||||
$scope.addEnvironmentVariable = function () {
|
||||
|
|
|
@ -70,6 +70,10 @@ angular.module('portainer.app').controller('StackController', [
|
|||
}
|
||||
};
|
||||
|
||||
$scope.$on('$destroy', function() {
|
||||
$scope.state.isEditorDirty = false;
|
||||
})
|
||||
|
||||
$scope.handleEnvVarChange = handleEnvVarChange;
|
||||
function handleEnvVarChange(value) {
|
||||
$scope.formValues.Env = value;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue