diff --git a/doajtest/testbook/new_application_form/maned_form.yml b/doajtest/testbook/new_application_form/maned_form.yml index 23483521db..fc2e49688d 100644 --- a/doajtest/testbook/new_application_form/maned_form.yml +++ b/doajtest/testbook/new_application_form/maned_form.yml @@ -50,7 +50,8 @@ tests: subject classifications - step: Remove one subject classification - step: Click "Unlock & Close" - results: Confirmation dialog is displayed warning you about unsaved changes + results: + - Confirmation dialog is displayed warning you about unsaved changes - step: Click "Stay on Page" and then 'Save' results: - The form saves @@ -99,3 +100,4 @@ tests: - step: Attempt to paste the value (use separate editor) results: - Correct value is pasted + diff --git a/doajtest/testbook/update_requests/update_requests.yml b/doajtest/testbook/update_requests/update_requests.yml index 6fce22a963..d8aac0adb4 100644 --- a/doajtest/testbook/update_requests/update_requests.yml +++ b/doajtest/testbook/update_requests/update_requests.yml @@ -81,3 +81,41 @@ tests: - step: Go back to the My update requests tab in the other browser window, where you are signed in as a publisher results: - The status of the update requests has changed to 'Application rejected'. +- title: Mark as full review feature + context: + role: managing editor or admin + steps: + - step: an admin account (admin1) + - step: Login as `admin1` + - step: Click on the `Update requests` tab on the LHS panel + results: + - You will see a list of records + - step: Filter the results by `Open` and select any status except `Accepted` + results: + - You will see a list of records, each with a button "Review Update" + - step: Click the "Review Update" button next to one of the records + results: + - a new browser tab opens, titled `Update request ...` + - step: Check the current status of the application + results: + - If the status is not accepted, the `Mark as full review` checkbox in the right side is not visible + - If the status is accepted, the `Mark as full review` checkbox in the right side is visible + - step: Select the status as `Accepted` in Change Status + results: + - The checkbox `Mark as full review` in the side panel is visible + - step: Click on the `Mark as full review` checkbox + results: + - The checkbox `Mark as full review` is filled + - step: Click "Save" button + results: + - a new note will be added to the application + - It will have the message "Last full review completed on {date} by `{username}`" + - your username and user id will be shown on that note + - the date and time you save the application will be shown + - step: Search for the journal and click on edit + results: + - The last full review date is saved in the associated journal + - a new note will be added to the journal + - It will have the message "Last full review completed on {date} by `{username}`" + - your username and user id will be shown on that note + - the date and time you save the application will be shown \ No newline at end of file diff --git a/portality/forms/application_forms.py b/portality/forms/application_forms.py index 728354f8b7..082cf9101e 100644 --- a/portality/forms/application_forms.py +++ b/portality/forms/application_forms.py @@ -2107,6 +2107,12 @@ class FieldDefinitions: ] } + MARK_AS_FULL_REVIEW = { + "name": "mark_as_full_review", + "label": "This update request constitutes a full review of the journal", + "input": "checkbox" + } + ########################################################## # Define our fieldsets @@ -2328,6 +2334,14 @@ class FieldSetDefinitions: ] } + MARK_AS_FULL_REVIEW = { + "name": "mark_as_full_review", + "label": "Mark as full review", + "fields": [ + FieldDefinitions.MARK_AS_FULL_REVIEW["name"] + ] + } + # ~~->$ Status:FieldSet~~ STATUS = { "name": "status", @@ -2515,6 +2529,7 @@ class ApplicationContextDefinitions: FieldSetDefinitions.CONTINUATIONS["name"], FieldSetDefinitions.SUBJECT["name"], FieldSetDefinitions.NOTES["name"], + FieldSetDefinitions.MARK_AS_FULL_REVIEW["name"], ] MANED["processor"] = application_processors.AdminApplication MANED["templates"]["form"] = templates.MANED_APPLICATION_FORM diff --git a/portality/forms/application_processors.py b/portality/forms/application_processors.py index 8e033d80bc..349bee7666 100644 --- a/portality/forms/application_processors.py +++ b/portality/forms/application_processors.py @@ -421,6 +421,20 @@ def finalise(self, account, save_target=True, email_alert=True): # if this application is being accepted, then do the conversion to a journal if self.target.application_status == constants.APPLICATION_STATUS_ACCEPTED: j = applicationService.accept_application(self.target, account) + + # Record the current time as last full review, if mark as full review has been selected + if (self.target.application_type == constants.APPLICATION_TYPE_UPDATE_REQUEST and + self.form.mark_as_full_review.data): + now = dates.now_str() + # Add last full review note to update request application + n = Messages.LAST_FULL_REVIEW_NOTE.format(date=now, username=account.id) + self.target.add_note(n, date=now, author_id=account.id) + self.target.save() + # Add last full review note to journal + j.last_full_review = now + n = Messages.LAST_FULL_REVIEW_NOTE.format(date=now, username=account.id) + j.add_note(n, date=now, author_id=account.id) + j.save() # record the url the journal is available at in the admin are and alert the user if has_request_context(): # fixme: if we handle alerts via a notification service we won't have to toggle on request context jurl = url_for("doaj.toc", identifier=j.toc_id) diff --git a/portality/static/js/application_form.js b/portality/static/js/application_form.js index 0d855ef2f8..2dd03a7f2e 100644 --- a/portality/static/js/application_form.js +++ b/portality/static/js/application_form.js @@ -718,6 +718,15 @@ doaj.af.ManEdApplicationForm = class extends doaj.af.EditorialApplicationForm { $("#modal-quick_reject").show(); }); + $("#application_status").on("change", (e) => { + e.preventDefault(); + if ($("#application_status").val() === "accepted") { + $("#mark_as_full_review_div").show(); + } else { + $("#mark_as_full_review_div").hide(); + } + }); + let that = this; $("#submit_quick_reject").on("click", function(event) { if ($("#quick_reject").val() === "" && $("#quick_reject_details").val() === "") { diff --git a/portality/templates-v2/management/_application-form/includes/_editorial_side_panel.html b/portality/templates-v2/management/_application-form/includes/_editorial_side_panel.html index 6b13b1bcce..a3e836ae85 100644 --- a/portality/templates-v2/management/_application-form/includes/_editorial_side_panel.html +++ b/portality/templates-v2/management/_application-form/includes/_editorial_side_panel.html @@ -5,6 +5,21 @@