Skip to content
4 changes: 3 additions & 1 deletion doajtest/testbook/new_application_form/maned_form.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -99,3 +100,4 @@ tests:
- step: Attempt to paste the value (use separate editor)
results:
- Correct value is pasted

38 changes: 38 additions & 0 deletions doajtest/testbook/update_requests/update_requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 15 additions & 0 deletions portality/forms/application_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions portality/forms/application_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 9 additions & 0 deletions portality/static/js/application_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() === "") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
<h3 class="label"> Locked for editing until <span id="lock_expires"
data-timestamp="{{ lock.utc_expires() }}">{{ lock.expire_formatted() }}</span>
</h3>

{% set fs = formulaic_context.fieldset("mark_as_full_review") %}
{% if obj.application_type==constants.APPLICATION_TYPE_UPDATE_REQUEST and fs %}
{% for f in fs.fields() %}
{% set field_template = f.template %}
{% if obj.application_status == constants.APPLICATION_STATUS_ACCEPTED %}
{% set show=true %}
{% else %}
{% set show=false %}
{% endif %}
<div id="mark_as_full_review_div" {% if not show %}style="display: none"{% endif %}>
{% include field_template %}
</div>
{% endfor %}
{% endif %}
Comment thread
anusharanganathan marked this conversation as resolved.
<div class="editorial_panel--exit_buttons">
{% if obj.application_status != constants.APPLICATION_STATUS_ACCEPTED %}
<p class="cannot-submit" id="cannot-submit-invalid-fields" style="display: none"><em>You cannot save the
Expand Down
Loading