From 552564c87f22237a31361e2c09747454d7207fa7 Mon Sep 17 00:00:00 2001 From: Steven Choi Date: Fri, 15 Sep 2023 14:25:35 +1000 Subject: [PATCH 1/4] #647 Move the "Delete Collection" button --- .../org/ala/profile/hub/OpusController.groovy | 4 ++++ .../views/opus/_editDeleteCollectionPage.gsp | 18 ++++++++++++++++++ grails-app/views/opus/edit.gsp | 9 +++------ 3 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 grails-app/views/opus/_editDeleteCollectionPage.gsp diff --git a/grails-app/controllers/au/org/ala/profile/hub/OpusController.groovy b/grails-app/controllers/au/org/ala/profile/hub/OpusController.groovy index 72b02a6a..c5119a20 100644 --- a/grails-app/controllers/au/org/ala/profile/hub/OpusController.groovy +++ b/grails-app/controllers/au/org/ala/profile/hub/OpusController.groovy @@ -677,6 +677,10 @@ class OpusController extends OpusBaseController { render template: "editAboutPage" } + def editDeleteCollectionPanel = { + render template: "editDeleteCollectionPage" + } + def reportPanel = { render template: "report" } diff --git a/grails-app/views/opus/_editDeleteCollectionPage.gsp b/grails-app/views/opus/_editDeleteCollectionPage.gsp new file mode 100644 index 00000000..d581bfda --- /dev/null +++ b/grails-app/views/opus/_editDeleteCollectionPage.gsp @@ -0,0 +1,18 @@ +
+ + +
+
+
+ +
+
+
+
\ No newline at end of file diff --git a/grails-app/views/opus/edit.gsp b/grails-app/views/opus/edit.gsp index 01b150a9..88c4983d 100644 --- a/grails-app/views/opus/edit.gsp +++ b/grails-app/views/opus/edit.gsp @@ -30,12 +30,6 @@ Public View - - - @@ -127,7 +121,10 @@ + + + From 8342719018abb03da9a4724f129291bb370adf1a Mon Sep 17 00:00:00 2001 From: Steven Choi Date: Fri, 15 Sep 2023 15:10:29 +1000 Subject: [PATCH 2/4] #647 add help text --- grails-app/views/opus/_editDeleteCollectionPage.gsp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/grails-app/views/opus/_editDeleteCollectionPage.gsp b/grails-app/views/opus/_editDeleteCollectionPage.gsp index d581bfda..19534b86 100644 --- a/grails-app/views/opus/_editDeleteCollectionPage.gsp +++ b/grails-app/views/opus/_editDeleteCollectionPage.gsp @@ -2,16 +2,21 @@
- +

+ + Error:Please note clicking delete button will delete this collection. All data of the collection will be lost and cannot be recovered. Only proceed if you are absolutely sure. +

+
+
+
From cf26e1c266dcfbb48a4d7f760370bb2bdedf6593 Mon Sep 17 00:00:00 2001 From: Steven Choi Date: Mon, 18 Sep 2023 10:14:43 +1000 Subject: [PATCH 3/4] #647 check if user is alaAdmin --- .../profileEditor/controllers/UserAccessController.js | 6 +----- grails-app/views/opus/edit.gsp | 4 +++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/grails-app/assets/javascripts/profileEditor/controllers/UserAccessController.js b/grails-app/assets/javascripts/profileEditor/controllers/UserAccessController.js index 1e1ff7b5..60012cc7 100644 --- a/grails-app/assets/javascripts/profileEditor/controllers/UserAccessController.js +++ b/grails-app/assets/javascripts/profileEditor/controllers/UserAccessController.js @@ -81,11 +81,7 @@ profileEditor.controller('UserAccessController', function (messageService, util, }; self.privateModeChanged = function() { - if (self.opus.privateCollection) { - self.roles.push(userRole); - } else { - self.roles.splice(4, 1) - } + self.roles.push(userRole); }; function showPopup(user) { diff --git a/grails-app/views/opus/edit.gsp b/grails-app/views/opus/edit.gsp index 88c4983d..7d221e05 100644 --- a/grails-app/views/opus/edit.gsp +++ b/grails-app/views/opus/edit.gsp @@ -122,7 +122,9 @@ - + + + From 6cbb2be845b722d6f6af680e54fa562a9226f69b Mon Sep 17 00:00:00 2001 From: Steven Choi Date: Mon, 18 Sep 2023 10:18:50 +1000 Subject: [PATCH 4/4] #647 revert --- .../profileEditor/controllers/UserAccessController.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/grails-app/assets/javascripts/profileEditor/controllers/UserAccessController.js b/grails-app/assets/javascripts/profileEditor/controllers/UserAccessController.js index 60012cc7..1e1ff7b5 100644 --- a/grails-app/assets/javascripts/profileEditor/controllers/UserAccessController.js +++ b/grails-app/assets/javascripts/profileEditor/controllers/UserAccessController.js @@ -81,7 +81,11 @@ profileEditor.controller('UserAccessController', function (messageService, util, }; self.privateModeChanged = function() { - self.roles.push(userRole); + if (self.opus.privateCollection) { + self.roles.push(userRole); + } else { + self.roles.splice(4, 1) + } }; function showPopup(user) {