Skip to content

Commit

Permalink
#700 save button should disable when public access mode is back
Browse files Browse the repository at this point in the history
  • Loading branch information
schoicsiro committed Oct 6, 2023
1 parent 555d64b commit c683d02
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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.");
Expand Down Expand Up @@ -142,7 +143,7 @@ profileEditor.controller('UserAccessController', function (messageService, util,
popupateUserDetails(user);
});

self.privateModeChanged();
self.privateModeChanged(form);

if (form) {
form.$setPristine();
Expand Down
2 changes: 1 addition & 1 deletion grails-app/views/opus/_editAccessControl.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<div class="checkbox padding-bottom-1">
<label for="privateCollection" class="inline-label">
<input id="privateCollection" type="checkbox" name="privateCollection"
ng-change="userCtrl.privateModeChanged()"
ng-change="userCtrl.privateModeChanged(UserForm)"
ng-model="userCtrl.opus.privateCollection" ng-false-value="false">
Make this collection private
</label>
Expand Down

0 comments on commit c683d02

Please sign in to comment.