From e867eae32e4fe716ff558bf748b759e2a62a38e7 Mon Sep 17 00:00:00 2001 From: Anusha Ranganathan Date: Fri, 24 Apr 2026 11:53:45 +0530 Subject: [PATCH 1/9] Can set journal last full review from update request --- portality/forms/application_forms.py | 15 +++++++++++++++ portality/forms/application_processors.py | 14 ++++++++++++++ .../includes/_editorial_side_panel.html | 7 +++++++ 3 files changed, 36 insertions(+) diff --git a/portality/forms/application_forms.py b/portality/forms/application_forms.py index 728354f8b7..f141ac8c44 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": "Mark as full review", + "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..6742f254be 100644 --- a/portality/forms/application_processors.py +++ b/portality/forms/application_processors.py @@ -421,6 +421,14 @@ 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.form.mark_as_full_review.data: + j.last_full_review = dates.now_str() + # ToDo - Do I need to add a note for the last full review? + # n = Messages.LAST_FULL_REVIEW_NOTE.format(date=j.last_full_review, username=account.id) + # j.add_note(n, date=dates.now_str(), author_id=account.id) + # 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) @@ -465,6 +473,12 @@ def finalise(self, account, save_target=True, email_alert=True): # the application was neither accepted or rejected, so just save it else: + if (self.source.current_journal is not None and j is not None and + self.form.mark_as_full_review.data): + j.last_full_review = dates.now_str() + # ToDo - Do I need to add a note for the last full review? + # n = Messages.LAST_FULL_REVIEW_NOTE.format(date=j.last_full_review, username=account.id) + # j.add_note(n, date=dates.now_str(), author_id=account.id) self.target.set_last_manual_update() self.target.save() 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..668da9b7e3 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,13 @@

Locked for editing until {{ lock.expire_formatted() }}

+ {% set fs = formulaic_context.fieldset("mark_as_full_review") %} + {% if fs %} + {% for f in fs.fields() %} + {% set field_template = f.template %} + {% include field_template %} + {% endfor %} + {% endif %}
{% if obj.application_status != constants.APPLICATION_STATUS_ACCEPTED %}

Locked for editing until {{ lock.expire_formatted() }}

+ {% set fs = formulaic_context.fieldset("mark_as_full_review") %} - {% if fs %} + {% if obj.application_type==constants.APPLICATION_TYPE_UPDATE_REQUEST and fs %} {% for f in fs.fields() %} {% set field_template = f.template %} - {% include field_template %} + {% include field_template %} {% endfor %} {% endif %}
From 8affa77cc70d382edf101be402ff7144a7419125 Mon Sep 17 00:00:00 2001 From: Anusha Ranganathan Date: Tue, 16 Jun 2026 12:40:37 +0530 Subject: [PATCH 6/9] Make display conditional and add note in target application --- .../testbook/new_application_form/maned_form.yml | 12 ++++++++++-- portality/forms/application_processors.py | 14 ++++++-------- portality/static/js/application_form.js | 9 +++++++++ .../includes/_editorial_side_panel.html | 9 ++++++++- 4 files changed, 33 insertions(+), 11 deletions(-) diff --git a/doajtest/testbook/new_application_form/maned_form.yml b/doajtest/testbook/new_application_form/maned_form.yml index 91244ecfb6..40db8b319c 100644 --- a/doajtest/testbook/new_application_form/maned_form.yml +++ b/doajtest/testbook/new_application_form/maned_form.yml @@ -107,14 +107,22 @@ tests: - step: an admin account (admin1) - step: Login as `admin1` - step: Go to Application page at `/admin/application/1234` + results: + - if the status is not accepted, the "Mark as full review" checkbox is not visible - step: Select the status as `Accepted` in Change Status - - step: Click on the "Mark as full review" checkbox in the side panel + results: + - "Mark as full review" checkbox in the side panel is visible + - step: Click on the "Mark as full review" checkbox results: - "Mark as full review" checkbox is filled - step: Click "Save" button results: - The last full review date is saved in the associated journal - - a new note will be created + - a new note will be created in 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 + - a new note will be created in the journal (search for the journal and click on edit to see note) - 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 diff --git a/portality/forms/application_processors.py b/portality/forms/application_processors.py index 1f42ba97d2..349bee7666 100644 --- a/portality/forms/application_processors.py +++ b/portality/forms/application_processors.py @@ -426,10 +426,15 @@ def finalise(self, account, save_target=True, email_alert=True): 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) @@ -474,13 +479,6 @@ def finalise(self, account, save_target=True, email_alert=True): # the application was neither accepted or rejected, so just save it else: - if (self.source.current_journal is not None and j is not None and - self.form.mark_as_full_review.data and - self.target.application_type == constants.APPLICATION_TYPE_UPDATE_REQUEST): - now = dates.now_str() - 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) self.target.set_last_manual_update() self.target.save() 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 dae14f4804..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 @@ -10,7 +10,14 @@

Locked for editing until + {% include field_template %} +

{% endfor %} {% endif %}
From 9fa03f985a5343cb640b6884b874963c1c9d8d3c Mon Sep 17 00:00:00 2001 From: Anusha Ranganathan Date: Tue, 16 Jun 2026 15:57:00 +0530 Subject: [PATCH 7/9] Fixed the testbook for the feature --- .../new_application_form/maned_form.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/doajtest/testbook/new_application_form/maned_form.yml b/doajtest/testbook/new_application_form/maned_form.yml index 40db8b319c..4eb2f28ef8 100644 --- a/doajtest/testbook/new_application_form/maned_form.yml +++ b/doajtest/testbook/new_application_form/maned_form.yml @@ -107,22 +107,26 @@ tests: - step: an admin account (admin1) - step: Login as `admin1` - step: Go to Application page at `/admin/application/1234` + - step: Check the current status of the application results: - - if the status is not accepted, the "Mark as full review" checkbox is not visible + - if the status is not accepted, the `Mark as full review` checkbox is not visible + - if the status is accepted, the `Mark as full review` checkbox is visible - step: Select the status as `Accepted` in Change Status results: - - "Mark as full review" checkbox in the side panel is visible - - step: Click on the "Mark as full review" checkbox + - The checkbox `Mark as full review` in the side panel is visible + - step: Click on the `Mark as full review` checkbox results: - - "Mark as full review" checkbox is filled + - The checkbox `Mark as full review` is filled - step: Click "Save" button results: - - The last full review date is saved in the associated journal - - a new note will be created in the application + - 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 - - a new note will be created in the journal (search for the journal and click on edit to see note) + - 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 From a42435419ed122d63ad64086504283838948410b Mon Sep 17 00:00:00 2001 From: Anusha Ranganathan Date: Wed, 17 Jun 2026 12:02:28 +0530 Subject: [PATCH 8/9] Moved test doc to update request --- .../new_application_form/maned_form.yml | 31 +-------------- .../update_requests/update_requests.yml | 38 +++++++++++++++++++ 2 files changed, 39 insertions(+), 30 deletions(-) diff --git a/doajtest/testbook/new_application_form/maned_form.yml b/doajtest/testbook/new_application_form/maned_form.yml index 4eb2f28ef8..fc2e49688d 100644 --- a/doajtest/testbook/new_application_form/maned_form.yml +++ b/doajtest/testbook/new_application_form/maned_form.yml @@ -100,33 +100,4 @@ tests: - step: Attempt to paste the value (use separate editor) results: - Correct value is pasted -- title: Mark as full review feature for admin - context: - role: admin - steps: - - step: an admin account (admin1) - - step: Login as `admin1` - - step: Go to Application page at `/admin/application/1234` - - step: Check the current status of the application - results: - - if the status is not accepted, the `Mark as full review` checkbox is not visible - - if the status is accepted, the `Mark as full review` checkbox 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 + diff --git a/doajtest/testbook/update_requests/update_requests.yml b/doajtest/testbook/update_requests/update_requests.yml index 6fce22a963..c7a2154a12 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 to the `Update requests` icon on the Admin dashboard + 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 "View Update (Finished)" + - step: Click the "View 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 left side is not visible + - if the status is accepted, the `Mark as full review` checkbox in the left 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 From 7ac15f2b2f8e9339fdfe4f73f8e22f4cbb5fa10c Mon Sep 17 00:00:00 2001 From: Anusha Ranganathan Date: Mon, 22 Jun 2026 16:32:27 +0530 Subject: [PATCH 9/9] Modified testbook steps as requested --- doajtest/testbook/update_requests/update_requests.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doajtest/testbook/update_requests/update_requests.yml b/doajtest/testbook/update_requests/update_requests.yml index c7a2154a12..d8aac0adb4 100644 --- a/doajtest/testbook/update_requests/update_requests.yml +++ b/doajtest/testbook/update_requests/update_requests.yml @@ -87,19 +87,19 @@ tests: steps: - step: an admin account (admin1) - step: Login as `admin1` - - step: Click to the `Update requests` icon on the Admin dashboard + - 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 "View Update (Finished)" - - step: Click the "View Update" button next to one of the records + - 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 left side is not visible - - if the status is accepted, the `Mark as full review` checkbox in the left side is visible + - 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