From c683d024db2c9dbf1c27ca7fc60013845485d1d2 Mon Sep 17 00:00:00 2001 From: steven choi Date: Fri, 6 Oct 2023 11:09:10 +1100 Subject: [PATCH] #700 save button should disable when public access mode is back --- .../profileEditor/controllers/UserAccessController.js | 5 +++-- grails-app/views/opus/_editAccessControl.gsp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/grails-app/assets/javascripts/profileEditor/controllers/UserAccessController.js b/grails-app/assets/javascripts/profileEditor/controllers/UserAccessController.js index 2e9258c0..12da2827 100644 --- a/grails-app/assets/javascripts/profileEditor/controllers/UserAccessController.js +++ b/grails-app/assets/javascripts/profileEditor/controllers/UserAccessController.js @@ -80,7 +80,7 @@ profileEditor.controller('UserAccessController', function (messageService, util, }); }; - self.privateModeChanged = function() { + self.privateModeChanged = function(form) { if (self.opus.privateCollection) { self.roles.push(userRole); } else { @@ -90,6 +90,7 @@ profileEditor.controller('UserAccessController', function (messageService, util, var data = {privateCollection: self.opus.privateCollection, authorities: self.users}; var promise = profileService.updateUsers(self.opusId, data); promise.then(function () { + form.$setPristine(); messageService.success("User access has been successfully updated."); }, function () { messageService.alert("An error has occurred while updating user access."); @@ -142,7 +143,7 @@ profileEditor.controller('UserAccessController', function (messageService, util, popupateUserDetails(user); }); - self.privateModeChanged(); + self.privateModeChanged(form); if (form) { form.$setPristine(); diff --git a/grails-app/views/opus/_editAccessControl.gsp b/grails-app/views/opus/_editAccessControl.gsp index dce2fd9e..c3a50c83 100644 --- a/grails-app/views/opus/_editAccessControl.gsp +++ b/grails-app/views/opus/_editAccessControl.gsp @@ -21,7 +21,7 @@