diff --git a/cms/data/notifications.yml b/cms/data/notifications.yml index 1a67c6c7c2..1e417e9b71 100644 --- a/cms/data/notifications.yml +++ b/cms/data/notifications.yml @@ -3,38 +3,38 @@ application:assed:assigned:notify: long: | An application, or update request for the journal **{journal_title}** has been assigned to you by the Editor of your group **{group_name}**. Please start work on this within 10 days. short: - New application assigned to you + New application ({issns}) assigned to you application:assed:inprogress:notify: long: | The application for **{application_title}** has not passed review by an Editor or Managing Editor and has been assigned back to you with questions or changes. short: - One of your applications has not passed review + One of your applications ({issns}) has not passed review application:editor:completed:notify: long: | **{associate_editor}** has finished a review of the application for **{application_title}** and marked it as **Completed**. Please review within 5 working days. short: - Application marked as completed + Application ({issns}) marked as completed application:editor_group:assigned:notify: long: | A new application or an update request for the journal **{journal_name}** has been assigned to your group by a Managing Editor. Please assign this to an Associate Editor within 5 working days. short: - New application assigned to your group + New application ({issns}) assigned to your group application:editor:inprogress:notify: long: | The application for **{application_title}** has not passed review by a Managing Editor and has been assigned back to your group with questions or changes. short: - Application reverted to 'In Progress' by Managing Editor + Application ({issns}) reverted to 'In Progress' by Managing Editor application:maned:ready:notify: long: | The application for **{application_title}** has been marked **Ready** by **{editor}**. Please review it as soon as possible. short: - Application marked as ready + Application ({issns}) marked as ready application:publisher:accepted:notify: long: | @@ -52,13 +52,13 @@ application:publisher:accepted:notify: We are delighted to welcome this journal into DOAJ. Do not hesitate to contact us at [helpdesk@doaj.org](mailto:helpdesk@doaj.org) if you have any questions. short: - Your journal has been accepted + Your journal ({issns}) has been accepted application:publisher:assigned:notify: long: | Your application for **{application_title}** submitted on {application_date} has been assigned to an editor for review for inclusion in the DOAJ. Please look out for further communications about the application. These may come from someone who is not using a DOAJ email address: [{volunteers_url}]({volunteers_url}) short: - Your application has been assigned an editor for review + Your application ({issns}) has been assigned to an editor for review application:publisher:created:notify: long: | @@ -72,7 +72,7 @@ application:publisher:created:notify: If you write to us, check first that there is nothing in your Spam folder from us or one of our volunteers. Our volunteers may not be emailing from a DOAJ email address so you can check that their name is there on this page [{volunteers_url}]({volunteers_url}) short: - Your application to DOAJ has been received + Your application ({issns}) to DOAJ has been received application:publisher:inprogress:notify: long: | @@ -80,7 +80,7 @@ application:publisher:inprogress:notify: The Associate Editor ([{volunteers}]({volunteers})) may contact you by email with questions. They may not be using a doaj.org email address. These emails can end up in your Spam folder so please check your Spam folder regularly. short: - Your submission is under review + Your submission ({issns}) is under review application:publisher:quickreject:notify: long: | @@ -90,13 +90,13 @@ application:publisher:quickreject:notify: You may submit a new application 6 months after the date of this email unless advised otherwise by a member of the DOAJ Editorial Team. Before you apply again, make any necessary changes to ensure your journal adheres to our criteria: ([{doaj_guide_url}]({doaj_guide_url})) short: - Your application was rejected + Your application ({issns}) was rejected application:publisher:revision:notify: long: | The update which you submitted for **{application_title}** on {date_applied} requires some revisions before it can be accepted. The Managing Editor reviewing your update will contact you to explain the changes that are needed. short: - Your update request needs revisions + Your update request ({issns}) needs revisions bg:job_finished:notify: long: | @@ -108,13 +108,13 @@ journal:assed:assigned:notify: long: | The journal **{journal_name}** has been assigned to you by the Editor of your group **{group_name}**. Please start work on this within 10 days. short: - New journal assigned to you + New journal ({issns}) assigned to you journal:editor_group:assigned:notify: long: | The journal **{journal_name}** has been assigned to your group by a Managing Editor. Please assign this to an Associate Editor within 5 working days. short: - New journal assigned to your group + New journal ({issns}) assigned to your group update_request:publisher:accepted:notify: long: | @@ -122,7 +122,7 @@ update_request:publisher:accepted:notify: Thank you for updating this journal and helping to keep the DOAJ database up-to-date. short: - Update request accepted + Update request ({issns}) accepted update_request:publisher:assigned:notify: long: | @@ -130,7 +130,7 @@ update_request:publisher:assigned:notify: Thank you for helping to keep the DOAJ database up-to-date. short: - Your update request has been assigned an editor for review + Your update request ({issns}) has been assigned to an editor for review update_request:publisher:rejected:notify: long: | @@ -140,7 +140,7 @@ update_request:publisher:rejected:notify: - We already have one active update in the system. Additional updates are rejected without review. short: - Your update request was rejected + Your update request ({issns}) was rejected journal:assed:discontinuing_soon:notify: long: | diff --git a/cms/sass/components/_dropdown.scss b/cms/sass/components/_dropdown.scss index 07524b5101..47ab4dc5e7 100644 --- a/cms/sass/components/_dropdown.scss +++ b/cms/sass/components/_dropdown.scss @@ -15,6 +15,10 @@ } } +.dropdown--notifications { + @extend .dropdown; +} + .dropdown__menu { display: none; padding: 0; diff --git a/cms/sass/layout/_editorial-panel.scss b/cms/sass/layout/_editorial-panel.scss index 4cef1bbef4..a08cb98ca3 100644 --- a/cms/sass/layout/_editorial-panel.scss +++ b/cms/sass/layout/_editorial-panel.scss @@ -14,7 +14,7 @@ @media (min-width: 992px) { position: -webkit-sticky; position: sticky; - top: 55px; // sticky header + 5px + top: 100px; &__content { max-height: 70vh; diff --git a/doajtest/testdrive/todo_maned_editor_associate.py b/doajtest/testdrive/todo_maned_editor_associate.py index a30f45cea0..5b038f2153 100644 --- a/doajtest/testdrive/todo_maned_editor_associate.py +++ b/doajtest/testdrive/todo_maned_editor_associate.py @@ -13,45 +13,55 @@ class TodoManedEditorAssociate(TestDrive): def setup(self) -> dict: un = self.create_random_str() pw = self.create_random_str() - acc = models.Account.make_account(un + "@example.com", un, "TodoManedEditorAssociate " + un, ["admin", "editor", constants.ROLE_ASSOCIATE_EDITOR]) - acc.set_password(pw) - acc.save() + admin = models.Account.make_account(un + "@example.com", un, "TodoManedEditorAssociate " + un, ["admin", "editor", constants.ROLE_ASSOCIATE_EDITOR]) + admin.set_password(pw) + admin.save() oun = self.create_random_str() owner = models.Account.make_account(oun + "@example.com", oun, "Owner " + un, ["publisher"]) owner.save() eun = self.create_random_str() - editor = models.Account.make_account(eun + "@example.com", eun, "Associate Editor " + un, ["associate_editor"]) - editor.save() + assed = models.Account.make_account(eun + "@example.com", eun, "Associate Editor " + un, ["associate_editor"]) + assed.save() gn1 = "Maned Group " + un eg1 = models.EditorGroup(**{ "name": gn1 }) - eg1.set_maned(acc.id) - eg1.add_associate(editor.id) + eg1.set_maned(admin.id) + eg1.add_associate(assed.id) eg1.save() gn2 = "Editor Group " + un eg2 = models.EditorGroup(**{ "name": gn2 }) - eg2.set_editor(acc.id) + eg2.set_editor(admin.id) eg2.save() + # the eponymous group + eg3 = models.EditorGroup(**{ + "name": admin.id + }) + eg3.set_maned(admin.id) + eg3.set_editor(admin.id) + eg3.add_associate(admin.id) + eg3.save() + aapps = build_associate_applications(un) eapps = build_editor_applications(un, eg2) - mapps = build_maned_applications(un, eg1, owner.id) + mapps = build_maned_applications(un, eg1, owner.id, eg3) + return { "account": { - "username": acc.id, + "username": admin.id, "password": pw }, "users": [ owner.id, - editor.id + assed.id ], "editor_group": { "id": eg2.id, @@ -86,7 +96,7 @@ def teardown(self, params) -> dict: return {"status": "success"} -def build_maned_applications(un, eg, owner): +def build_maned_applications(un, eg, owner, eponymous_group): w = 7 * 24 * 60 * 60 apps = {} @@ -132,6 +142,16 @@ def build_maned_applications(un, eg, owner): "title": un + " Maned Pending Application" }] + app = build_application(un + " Maned Low Priority Pending Application", 1 * w, 1 * w, + constants.APPLICATION_STATUS_PENDING, + editor_group=eponymous_group.name, owner=owner) + app.remove_editor() + app.save() + apps["low_priority_pending"] = [{ + "id": app.id, + "title": un + " Maned Low Priority Pending Application" + }] + return apps diff --git a/doajtest/unit/application_processors/test_application_processor_emails.py b/doajtest/unit/application_processors/test_application_processor_emails.py index 44630b518c..15df1fd727 100644 --- a/doajtest/unit/application_processors/test_application_processor_emails.py +++ b/doajtest/unit/application_processors/test_application_processor_emails.py @@ -120,11 +120,11 @@ def test_01_public_application_email(self): # * to the applicant, informing them the application was received public_template = re.escape('notification_email.jinja2') public_to = re.escape(account.email) - public_subject = "Directory of Open Access Journals - Your application to DOAJ has been received" + public_subject = re.escape("Directory of Open Access Journals - Your application (" + ", ".join(issn for issn in processor.source.bibjson().issns()) + ") to DOAJ has been received") public_email_matched = re.search(email_log_regex % (public_template, public_to, public_subject), info_stream_contents, re.DOTALL) - assert bool(public_email_matched) + assert bool(public_email_matched), info_stream_contents assert len(re.findall(email_count_string, info_stream_contents)) == 1 @@ -220,7 +220,7 @@ def test_01_maned_review_emails(self): editor_template = re.escape('notification_email.jinja2') editor_to = re.escape('eddie@example.com') - editor_subject = "Application reverted to 'In Progress' by Managing Editor" + editor_subject = re.escape("Application (" + ", ".join(issn for issn in processor.source.bibjson().issns()) + ") reverted to 'In Progress' by Managing Editor\n") editor_email_matched = re.search(email_log_regex % (editor_template, editor_to, editor_subject), info_stream_contents, re.DOTALL) @@ -236,7 +236,7 @@ def test_01_maned_review_emails(self): assoc_editor_template = re.escape('email/notification_email.jinja2') assoc_editor_to = re.escape('associate@example.com') - assoc_editor_subject = self.svc.short_notification(ApplicationAssedInprogressNotify.ID)# "an application assigned to you has not passed review." + assoc_editor_subject = re.escape(self.svc.short_notification(ApplicationAssedInprogressNotify.ID).replace("{issns}", ", ".join(issn for issn in processor.source.bibjson().issns())) + "\n")# "an application assigned to you has not passed review." assoc_editor_email_matched = re.search(email_log_regex % (assoc_editor_template, assoc_editor_to, assoc_editor_subject), info_stream_contents, re.DOTALL) @@ -288,7 +288,7 @@ def test_01_maned_review_emails(self): editor_template = re.escape('email/notification_email.jinja2') editor_to = re.escape('eddie@example.com') - editor_subject = "Directory of Open Access Journals - Application reverted to 'In Progress' by Managing Editor" + editor_subject = re.escape("Directory of Open Access Journals - Application ({}) reverted to 'In Progress' by Managing Editor".format(', '.join(issn for issn in processor.source.bibjson().issns()))) editor_email_matched = re.search(email_log_regex % (editor_template, editor_to, editor_subject), info_stream_contents, re.DOTALL) @@ -304,7 +304,7 @@ def test_01_maned_review_emails(self): assoc_editor_template = re.escape('email/notification_email.jinja2') assoc_editor_to = re.escape('associate@example.com') - assoc_editor_subject = self.svc.short_notification(ApplicationAssedInprogressNotify.ID) # "an application assigned to you has not passed review." + assoc_editor_subject = re.escape(self.svc.short_notification(ApplicationAssedInprogressNotify.ID).replace("{issns}", ", ".join(issn for issn in processor.source.bibjson().issns())) + "\n") # "an application assigned to you has not passed review." assoc_editor_email_matched = re.search( email_log_regex % (assoc_editor_template, assoc_editor_to, assoc_editor_subject), info_stream_contents, @@ -345,7 +345,7 @@ def test_01_maned_review_emails(self): # * and to the publisher informing them there's an editor assigned. assEd_template = re.escape('email/notification_email.jinja2') assEd_to = re.escape(models.Account.pull('associate_3').email) - assEd_subject = 'Directory of Open Access Journals - New application assigned to you' + assEd_subject = re.escape('Directory of Open Access Journals - New application ({}) assigned to you'.format(', '.join(issn for issn in processor.source.bibjson().issns()))) assEd_email_matched = re.search(email_log_regex % (assEd_template, assEd_to, assEd_subject), info_stream_contents, @@ -354,7 +354,7 @@ def test_01_maned_review_emails(self): publisher_template = re.escape('email/notification_email.jinja2') publisher_to = re.escape(owner.email) - publisher_subject = 'Directory of Open Access Journals - Your application has been assigned an editor for review' + publisher_subject = re.escape('Directory of Open Access Journals - Your application ({}) has been assigned to an editor for review'.format(', '.join(issn for issn in processor.source.bibjson().issns()))) publisher_email_matched = re.search(email_log_regex % (publisher_template, publisher_to, publisher_subject), info_stream_contents, @@ -386,7 +386,7 @@ def test_01_maned_review_emails(self): # * to the AssEd who's been assigned editor_template = re.escape('email/notification_email.jinja2') editor_to = re.escape('eddie@example.com') - editor_subject = 'Directory of Open Access Journals - New application assigned to your group' + editor_subject = re.escape('Directory of Open Access Journals - New application ({}) assigned to your group'.format(', '.join(issn for issn in processor.source.bibjson().issns()))) editor_email_matched = re.search(email_log_regex % (editor_template, editor_to, editor_subject), info_stream_contents, @@ -395,8 +395,7 @@ def test_01_maned_review_emails(self): assEd_template = re.escape('email/notification_email.jinja2') assEd_to = re.escape(models.Account.pull('associate_3').email) - assEd_subject = 'Directory of Open Access Journals - New application assigned to you' - + assEd_subject = re.escape('Directory of Open Access Journals - New application ({}) assigned to you'.format(', '.join(issn for issn in processor.source.bibjson().issns()))) assEd_email_matched = re.search(email_log_regex % (assEd_template, assEd_to, assEd_subject), info_stream_contents, re.DOTALL) @@ -435,7 +434,7 @@ def test_01_maned_review_emails(self): # * to the ManEd in charge of the assigned Editor Group, saying an application is ready manEd_template = re.escape('email/notification_email.jinja2') manEd_to = re.escape(acc.email) - manEd_subject = 'Directory of Open Access Journals - Application marked as ready' + manEd_subject = re.escape('Directory of Open Access Journals - Application ({}) marked as ready'.format(', '.join(issn for issn in processor.source.bibjson().issns()))) manEd_email_matched = re.search(email_log_regex % (manEd_template, manEd_to, manEd_subject), info_stream_contents, @@ -460,7 +459,7 @@ def test_01_maned_review_emails(self): # * to the publisher, informing them of the journal's acceptance publisher_template = re.escape('email/notification_email.jinja2') publisher_to = re.escape(owner.email) - publisher_subject = 'Directory of Open Access Journals - Your journal has been accepted' + publisher_subject = re.escape('Directory of Open Access Journals - Your journal ({}) has been accepted'.format(', '.join(issn for issn in processor.source.bibjson().issns()))) publisher_email_matched = re.search(email_log_regex % (publisher_template, publisher_to, publisher_subject), info_stream_contents, @@ -511,7 +510,7 @@ def test_02_ed_review_emails(self): # * to the ManEds, saying an application is ready manEd_template = 'email/notification_email.jinja2' manEd_to = re.escape("maned@example.com") - manEd_subject = 'Application marked as ready' + manEd_subject = re.escape('Application ({}) marked as ready'.format(', '.join(issn for issn in processor.source.bibjson().issns()))) manEd_email_matched = re.search(email_log_regex % (manEd_template, manEd_to, manEd_subject), info_stream_contents, @@ -546,7 +545,7 @@ def test_02_ed_review_emails(self): # * and to the publisher informing them there's an editor assigned. assEd_template = 'email/notification_email.jinja2' assEd_to = re.escape(models.Account.pull('associate_3').email) - assEd_subject = 'New application assigned to you' + assEd_subject = re.escape('New application ({}) assigned to you'.format(', '.join(issn for issn in processor.source.bibjson().issns()))) assEd_email_matched = re.search(email_log_regex % (assEd_template, assEd_to, assEd_subject), info_stream_contents, @@ -555,7 +554,7 @@ def test_02_ed_review_emails(self): publisher_template = 'email/notification_email.jinja2' publisher_to = re.escape(owner.email) - publisher_subject = 'Your update request has been assigned an editor for review' + publisher_subject = re.escape('Your update request ({}) has been assigned to an editor for review'.format(', '.join(issn for issn in processor.source.bibjson().issns()))) publisher_email_matched = re.search(email_log_regex % (publisher_template, publisher_to, publisher_subject), info_stream_contents, @@ -584,7 +583,7 @@ def test_02_ed_review_emails(self): # * to the AssEd who's been assigned, assEd_template = 'email/notification_email.jinja2' assEd_to = re.escape(models.Account.pull('associate_2').email) - assEd_subject = 'New application assigned to you' + assEd_subject = re.escape('New application ({}) assigned to you'.format(', '.join(issn for issn in processor.source.bibjson().issns()))) assEd_email_matched = re.search(email_log_regex % (assEd_template, assEd_to, assEd_subject), info_stream_contents, @@ -626,7 +625,7 @@ def test_02_ed_review_emails(self): # * to the editor telling them an application has reverted to in progress assoc_editor_template = re.escape('email/notification_email.jinja2') assoc_editor_to = re.escape('associate@example.com') - assoc_editor_subject = "One of your applications has not passed review" + assoc_editor_subject = re.escape('One of your applications ({}) has not passed review'.format(', '.join(issn for issn in processor.source.bibjson().issns()))) assoc_editor_email_matched = re.search( email_log_regex % (assoc_editor_template, assoc_editor_to, assoc_editor_subject), info_stream_contents, @@ -668,7 +667,7 @@ def test_03_assoc_ed_review_emails(self): # * to the publisher, notifying that an editor is viewing their application publisher_template = re.escape('email/notification_email.jinja2') publisher_to = re.escape(owner.email) - publisher_subject = 'Directory of Open Access Journals - Your submission is under review' + publisher_subject = re.escape('Directory of Open Access Journals - Your submission ({}) is under review'.format(', '.join(issn for issn in processor.source.bibjson().issns()))) publisher_email_matched = re.search(email_log_regex % (publisher_template, publisher_to, publisher_subject), info_stream_contents, @@ -689,7 +688,7 @@ def test_03_assoc_ed_review_emails(self): # * to the editor, informing them an application has been completed by an Associate Editor editor_template = re.escape('notification_email.jinja2') editor_to = re.escape('eddie@example.com') - editor_subject = 'Directory of Open Access Journals - Application marked as completed' + editor_subject = re.escape('Directory of Open Access Journals - Application ({}) marked as completed'.format(', '.join(issn for issn in processor.source.bibjson().issns()))) editor_email_matched = re.search(email_log_regex % (editor_template, editor_to, editor_subject), info_stream_contents, re.DOTALL) @@ -805,7 +804,7 @@ def test_01_maned_review_emails(self): editor_template = re.escape('email/notification_email.jinja2') editor_to = re.escape('eddie@example.com') - editor_subject = "Application reverted to 'In Progress' by Managing Editor" + editor_subject = re.escape("Application ({}) reverted to 'In Progress' by Managing Editor".format(', '.join(issn for issn in processor.source.bibjson().issns()))) editor_email_matched = re.search(email_log_regex % (editor_template, editor_to, editor_subject), info_stream_contents, re.DOTALL) @@ -822,8 +821,8 @@ def test_01_maned_review_emails(self): assoc_editor_template = re.escape('email/notification_email.jinja2') assoc_editor_to = re.escape('associate@example.com') - assoc_editor_subject = self.svc.short_notification( - ApplicationAssedInprogressNotify.ID) # "an application assigned to you has not passed review." + assoc_editor_subject = re.escape(self.svc.short_notification( + ApplicationAssedInprogressNotify.ID).replace("{issns}", ", ".join(issn for issn in processor.target.bibjson().issns())) + "\n") # "an application assigned to you has not passed review." assoc_editor_email_matched = re.search( email_log_regex % (assoc_editor_template, assoc_editor_to, assoc_editor_subject), info_stream_contents, @@ -876,7 +875,7 @@ def test_01_maned_review_emails(self): editor_template = re.escape('email/notification_email.jinja2') editor_to = re.escape('eddie@example.com') - editor_subject = "Application reverted to 'In Progress' by Managing Editor" + editor_subject = re.escape("Application ({}) reverted to 'In Progress' by Managing Editor".format(', '.join(issn for issn in processor.source.bibjson().issns()))) editor_email_matched = re.search(email_log_regex % (editor_template, editor_to, editor_subject), info_stream_contents, re.DOTALL) @@ -893,8 +892,8 @@ def test_01_maned_review_emails(self): assoc_editor_template = re.escape('email/notification_email.jinja2') assoc_editor_to = re.escape('associate@example.com') - assoc_editor_subject = self.svc.short_notification( - ApplicationAssedInprogressNotify.ID) # "an application assigned to you has not passed review." + assoc_editor_subject = re.escape(self.svc.short_notification( + ApplicationAssedInprogressNotify.ID).replace("{issns}", ", ".join(issn for issn in processor.source.bibjson().issns())) + "\n") # "an application assigned to you has not passed review." assoc_editor_email_matched = re.search( email_log_regex % (assoc_editor_template, assoc_editor_to, assoc_editor_subject), info_stream_contents, @@ -929,7 +928,7 @@ def test_01_maned_review_emails(self): # * and to the publisher informing them there's an editor assigned. assEd_template = 'email/notification_email.jinja2' assEd_to = re.escape(models.Account.pull('associate_3').email) - assEd_subject = 'New application assigned to you' + assEd_subject = re.escape('New application ({}) assigned to you'.format(', '.join(issn for issn in processor.source.bibjson().issns()))) assEd_email_matched = re.search(email_log_regex % (assEd_template, assEd_to, assEd_subject), info_stream_contents, @@ -938,7 +937,7 @@ def test_01_maned_review_emails(self): publisher_template = 'email/notification_email.jinja2' publisher_to = re.escape(owner.email) - publisher_subject = 'Your update request has been assigned an editor for review' + publisher_subject = re.escape('Your update request ({}) has been assigned to an editor for review'.format(', '.join(issn for issn in processor.source.bibjson().issns()))) publisher_email_matched = re.search(email_log_regex % (publisher_template, publisher_to, publisher_subject), info_stream_contents, @@ -970,7 +969,7 @@ def test_01_maned_review_emails(self): # * to the AssEd who's been assigned editor_template = re.escape('email/notification_email.jinja2') editor_to = re.escape('eddie@example.com') - editor_subject = 'New application assigned to your group' + editor_subject = re.escape('New application ({}) assigned to your group'.format(', '.join(issn for issn in processor.source.bibjson().issns()))) editor_email_matched = re.search(email_log_regex % (editor_template, editor_to, editor_subject), info_stream_contents, @@ -979,7 +978,7 @@ def test_01_maned_review_emails(self): assEd_template = 'email/notification_email.jinja2' assEd_to = re.escape(models.Account.pull('associate_3').email) - assEd_subject = 'New application assigned to you' + assEd_subject = re.escape('New application ({}) assigned to you'.format(', '.join(issn for issn in processor.source.bibjson().issns()))) assEd_email_matched = re.search(email_log_regex % (assEd_template, assEd_to, assEd_subject), info_stream_contents, @@ -1007,7 +1006,7 @@ def test_01_maned_review_emails(self): # * to the ManEds, saying an application is ready manEd_template = 'email/notification_email.jinja2' manEd_to = re.escape("maned@example.com") - manEd_subject = 'Application marked as ready' + manEd_subject = re.escape('Application ({}) marked as ready'.format(', '.join(issn for issn in processor.source.bibjson().issns()))) manEd_email_matched = re.search(email_log_regex % (manEd_template, manEd_to, manEd_subject), info_stream_contents, @@ -1034,7 +1033,7 @@ def test_01_maned_review_emails(self): # * to the journal contact, informing them of the journal's acceptance publisher_template = 'email/notification_email.jinja2' publisher_to = re.escape(owner.email) - publisher_subject = 'Update request accepted' + publisher_subject = re.escape('Update request ({}) accepted'.format(', '.join(issn for issn in processor.source.bibjson().issns()))) publisher_email_matched = re.search(email_log_regex % (publisher_template, publisher_to, publisher_subject), info_stream_contents, @@ -1084,7 +1083,7 @@ def test_02_ed_review_emails(self): # * to the ManEds, saying an application is ready manEd_template = 'email/notification_email.jinja2' manEd_to = re.escape("maned@example.com") - manEd_subject = 'Application marked as ready' + manEd_subject = re.escape('Application ({}) marked as ready'.format(', '.join(issn for issn in processor.source.bibjson().issns()))) manEd_email_matched = re.search(email_log_regex % (manEd_template, manEd_to, manEd_subject), info_stream_contents, @@ -1118,7 +1117,7 @@ def test_02_ed_review_emails(self): # * and to the publisher informing them there's an editor assigned. assEd_template = 'email/notification_email.jinja2' assEd_to = re.escape(models.Account.pull('associate_3').email) - assEd_subject = 'New application assigned to you' + assEd_subject = re.escape('New application ({}) assigned to you'.format(', '.join(issn for issn in processor.source.bibjson().issns()))) assEd_email_matched = re.search(email_log_regex % (assEd_template, assEd_to, assEd_subject), info_stream_contents, @@ -1127,7 +1126,7 @@ def test_02_ed_review_emails(self): publisher_template = 'email/notification_email.jinja2' publisher_to = re.escape(owner.email) - publisher_subject = 'Your update request has been assigned an editor for review' + publisher_subject = re.escape('Your update request ({}) has been assigned to an editor for review'.format(', '.join(issn for issn in processor.source.bibjson().issns()))) publisher_email_matched = re.search(email_log_regex % (publisher_template, publisher_to, publisher_subject), info_stream_contents, @@ -1156,7 +1155,7 @@ def test_02_ed_review_emails(self): # * to the AssEd who's been assigned, assEd_template = 'email/notification_email.jinja2' assEd_to = re.escape(models.Account.pull('associate_2').email) - assEd_subject = 'New application assigned to you' + assEd_subject = re.escape('New application ({}) assigned to you'.format(', '.join(issn for issn in processor.source.bibjson().issns()))) assEd_email_matched = re.search(email_log_regex % (assEd_template, assEd_to, assEd_subject), info_stream_contents, @@ -1197,7 +1196,7 @@ def test_02_ed_review_emails(self): # * to the associate editor, informing them the application has been bounced back to in progress. assoc_editor_template = re.escape('email/notification_email.jinja2') assoc_editor_to = re.escape('associate@example.com') - assoc_editor_subject = "One of your applications has not passed review" + assoc_editor_subject = re.escape('One of your applications ({}) has not passed review'.format(', '.join(issn for issn in processor.source.bibjson().issns()))) assoc_editor_email_matched = re.search( email_log_regex % (assoc_editor_template, assoc_editor_to, assoc_editor_subject), info_stream_contents, @@ -1243,7 +1242,7 @@ def test_03_assoc_ed_review_emails(self): # * to the publisher, notifying that an editor is viewing their application publisher_template = re.escape('email/notification_email.jinja2') publisher_to = re.escape(owner.email) - publisher_subject = 'Your submission is under review' + publisher_subject = re.escape('Your submission ({}) is under review'.format(', '.join(issn for issn in processor.source.bibjson().issns()))) publisher_email_matched = re.search(email_log_regex % (publisher_template, publisher_to, publisher_subject), info_stream_contents, @@ -1264,7 +1263,7 @@ def test_03_assoc_ed_review_emails(self): # * to the editor, informing them an application has been completed by an Associate Editor editor_template = re.escape('email/notification_email.jinja2') editor_to = re.escape('eddie@example.com') - editor_subject = "Application marked as completed" + editor_subject = re.escape("Application ({}) marked as completed".format(', '.join(issn for issn in processor.source.bibjson().issns()))) editor_email_matched = re.search(email_log_regex % (editor_template, editor_to, editor_subject), info_stream_contents, re.DOTALL) @@ -1332,7 +1331,7 @@ def test_01_maned_review_emails(self): # * to the AssEd who's been assigned, editor_template = re.escape('email/notification_email.jinja2') editor_to = re.escape('eddie@example.com') - editor_subject = 'Directory of Open Access Journals - New journal assigned to your group' + editor_subject = re.escape('Directory of Open Access Journals - New journal ({}) assigned to your group'.format(', '.join(issn for issn in processor.source.bibjson().issns()))) editor_email_matched = re.search(email_log_regex % (editor_template, editor_to, editor_subject), info_stream_contents, @@ -1341,7 +1340,7 @@ def test_01_maned_review_emails(self): assEd_template = re.escape('email/notification_email.jinja2') assEd_to = re.escape(models.Account.pull('associate_3').email) - assEd_subject = 'Directory of Open Access Journals - New journal assigned to you' + assEd_subject = re.escape('Directory of Open Access Journals - New journal ({}) assigned to you'.format(', '.join(issn for issn in processor.source.bibjson().issns()))) assEd_email_matched = re.search(email_log_regex % (assEd_template, assEd_to, assEd_subject), info_stream_contents, @@ -1372,7 +1371,7 @@ def test_02_ed_review_emails(self): # * to the AssEd who's been assigned assEd_template = re.escape('email/notification_email.jinja2') assEd_to = re.escape(models.Account.pull('associate_2').email) - assEd_subject = 'Directory of Open Access Journals - New journal assigned to you' + assEd_subject = re.escape('Directory of Open Access Journals - New journal ({}) assigned to you'.format(', '.join(issn for issn in processor.source.bibjson().issns()))) assEd_email_matched = re.search(email_log_regex % (assEd_template, assEd_to, assEd_subject), info_stream_contents, diff --git a/doajtest/unit/test_bll_todo_top_todo_assed.py b/doajtest/unit/test_bll_todo_top_todo_assed.py index c4768c7c56..99f9462393 100644 --- a/doajtest/unit/test_bll_todo_top_todo_assed.py +++ b/doajtest/unit/test_bll_todo_top_todo_assed.py @@ -131,6 +131,7 @@ def build_application(self, id, lmu_diff, cd_diff, status, app_registry, additio ap.set_last_manual_update(dates.before_now(lmu_diff)) ap.set_created(dates.before_now(cd_diff)) ap.set_application_status(status) + ap.application_type = constants.APPLICATION_TYPE_NEW_APPLICATION if additional_fn is not None: additional_fn(ap) diff --git a/doajtest/unit/test_bll_todo_top_todo_editor.py b/doajtest/unit/test_bll_todo_top_todo_editor.py index 6b0f740c57..d952a8709d 100644 --- a/doajtest/unit/test_bll_todo_top_todo_editor.py +++ b/doajtest/unit/test_bll_todo_top_todo_editor.py @@ -134,6 +134,7 @@ def build_application(self, id, lmu_diff, cd_diff, status, app_registry, additio ap.set_last_manual_update(dates.before_now(lmu_diff)) ap.set_created(dates.before_now(cd_diff)) ap.set_application_status(status) + ap.application_type = constants.APPLICATION_TYPE_NEW_APPLICATION if additional_fn is not None: additional_fn(ap) diff --git a/portality/bll/services/todo.py b/portality/bll/services/todo.py index 2ea93bcc95..8a0a54b51c 100644 --- a/portality/bll/services/todo.py +++ b/portality/bll/services/todo.py @@ -85,11 +85,23 @@ def top_todo(self, account, size=25): if account.has_role("editor"): groups = [g for g in models.EditorGroup.groups_by_editor(account.id)] + regular_groups = [g for g in groups if g.maned != account.id] + maned_groups = [g for g in groups if g.maned == account.id] if len(groups) > 0: queries.append(TodoRules.editor_follow_up_old(groups, size)) queries.append(TodoRules.editor_stalled(groups, size)) queries.append(TodoRules.editor_completed(groups, size)) - queries.append(TodoRules.editor_assign_pending(groups, size)) + + # for groups where the user is not the maned for a group, given them the assign + # pending todos at the regular priority + if len(regular_groups) > 0: + queries.append(TodoRules.editor_assign_pending(regular_groups, size)) + + # for groups where the user IS the maned for a group, give them the assign + # pending todos at a lower priority + if len(maned_groups) > 0: + qi = TodoRules.editor_assign_pending(maned_groups, size) + queries.append((constants.TODO_EDITOR_ASSIGN_PENDING_LOW_PRIORITY, qi[1], qi[2], -2)) if account.has_role(constants.ROLE_ASSOCIATE_EDITOR): queries.extend([ @@ -184,7 +196,7 @@ def maned_ready(cls, size, maned_of): sort="last_manual_update", size=size ) - return constants.TODO_MANED_READY, ready, "last_manual_update", 1 + return constants.TODO_MANED_READY, ready, "created_date", 1 @classmethod def maned_completed(cls, size, maned_of): @@ -221,7 +233,8 @@ def editor_stalled(cls, groups, size): stalled = TodoQuery( musts=[ TodoQuery.lmu_older_than(6), - TodoQuery.editor_groups(groups) + TodoQuery.editor_groups(groups), + TodoQuery.is_new_application() ], must_nots=[ TodoQuery.status([ @@ -240,7 +253,8 @@ def editor_follow_up_old(cls, groups, size): follow_up_old = TodoQuery( musts=[ TodoQuery.cd_older_than(8), - TodoQuery.editor_groups(groups) + TodoQuery.editor_groups(groups), + TodoQuery.is_new_application() ], must_nots=[ TodoQuery.status([ @@ -259,7 +273,8 @@ def editor_completed(cls, groups, size): completed = TodoQuery( musts=[ TodoQuery.status([constants.APPLICATION_STATUS_COMPLETED]), - TodoQuery.editor_groups(groups) + TodoQuery.editor_groups(groups), + TodoQuery.is_new_application() ], sort="last_manual_update", size=size @@ -271,7 +286,8 @@ def editor_assign_pending(cls, groups, size): assign_pending = TodoQuery( musts=[ TodoQuery.editor_groups(groups), - TodoQuery.status([constants.APPLICATION_STATUS_PENDING]) + TodoQuery.status([constants.APPLICATION_STATUS_PENDING]), + TodoQuery.is_new_application() ], must_nots=[ TodoQuery.exists("admin.editor") @@ -287,7 +303,8 @@ def associate_stalled(cls, acc_id, size): stalled = TodoQuery( musts=[ TodoQuery.lmu_older_than(3), - TodoQuery.editor(acc_id) + TodoQuery.editor(acc_id), + TodoQuery.is_new_application() ], must_nots=[ TodoQuery.status([ @@ -308,7 +325,8 @@ def associate_follow_up_old(cls, acc_id, size): follow_up_old = TodoQuery( musts=[ TodoQuery.cd_older_than(6), - TodoQuery.editor(acc_id) + TodoQuery.editor(acc_id), + TodoQuery.is_new_application() ], must_nots=[ TodoQuery.status([ @@ -329,7 +347,8 @@ def associate_start_pending(cls, acc_id, size): assign_pending = TodoQuery( musts=[ TodoQuery.editor(acc_id), - TodoQuery.status([constants.APPLICATION_STATUS_PENDING]) + TodoQuery.status([constants.APPLICATION_STATUS_PENDING]), + TodoQuery.is_new_application() ], sort=sort_field, size=size @@ -341,7 +360,8 @@ def associate_all_applications(cls, acc_id, size): sort_field = "created_date" all = TodoQuery( musts=[ - TodoQuery.editor(acc_id) + TodoQuery.editor(acc_id), + TodoQuery.is_new_application() ], must_nots=[ TodoQuery.status([ @@ -387,6 +407,14 @@ def query(self): } return q + @classmethod + def is_new_application(cls): + return { + "term": { + "admin.application_type.exact": constants.APPLICATION_TYPE_NEW_APPLICATION + } + } + @classmethod def editor_group(cls, groups): return { diff --git a/portality/constants.py b/portality/constants.py index 9074e3288b..2f2bb566b6 100644 --- a/portality/constants.py +++ b/portality/constants.py @@ -48,6 +48,7 @@ TODO_EDITOR_FOLLOW_UP_OLD = "todo_editor_follow_up_old" TODO_EDITOR_COMPLETED = "todo_editor_completed" TODO_EDITOR_ASSIGN_PENDING = "todo_editor_assign_pending" +TODO_EDITOR_ASSIGN_PENDING_LOW_PRIORITY = "todo_editor_assign_pending_low_priority" TODO_ASSOCIATE_PROGRESS_STALLED = "todo_associate_progress_stalled" TODO_ASSOCIATE_FOLLOW_UP_OLD = "todo_associate_follow_up_old" TODO_ASSOCIATE_START_PENDING = "todo_associate_start_pending" diff --git a/portality/events/consumers/application_assed_assigned_notify.py b/portality/events/consumers/application_assed_assigned_notify.py index 54b5c72c9b..954a359832 100644 --- a/portality/events/consumers/application_assed_assigned_notify.py +++ b/portality/events/consumers/application_assed_assigned_notify.py @@ -38,7 +38,9 @@ def consume(cls, event): journal_title=application.bibjson().title, group_name=application.editor_group ) - notification.short = svc.short_notification(cls.ID) + notification.short = svc.short_notification(cls.ID).format( + issns=", ".join(issn for issn in application.bibjson().issns()) + ) notification.action = url_for("editor.application", application_id=application.id) svc.notify(notification) diff --git a/portality/events/consumers/application_assed_inprogress_notify.py b/portality/events/consumers/application_assed_inprogress_notify.py index 060b1d0034..652dc60f77 100644 --- a/portality/events/consumers/application_assed_inprogress_notify.py +++ b/portality/events/consumers/application_assed_inprogress_notify.py @@ -36,7 +36,9 @@ def consume(cls, event): notification.created_by = cls.ID notification.classification = constants.NOTIFICATION_CLASSIFICATION_STATUS_CHANGE notification.long = svc.long_notification(cls.ID).format(application_title=application.bibjson().title) - notification.short = svc.short_notification(cls.ID) + notification.short = svc.short_notification(cls.ID).format( + issns=", ".join(issn for issn in application.bibjson().issns()) + ) notification.action = url_for("editor.application", application_id=application.id) svc.notify(notification) diff --git a/portality/events/consumers/application_editor_completed_notify.py b/portality/events/consumers/application_editor_completed_notify.py index 23c42b87c3..cd90c8bb51 100644 --- a/portality/events/consumers/application_editor_completed_notify.py +++ b/portality/events/consumers/application_editor_completed_notify.py @@ -58,7 +58,9 @@ def consume(cls, event): application_title=application.bibjson().title, associate_editor=associate_editor ) - notification.short = svc.short_notification(cls.ID) + notification.short = svc.short_notification(cls.ID).format( + issns=", ".join(issn for issn in application.bibjson().issns()) + ) notification.action = url_for("editor.application", application_id=application.id) svc.notify(notification) diff --git a/portality/events/consumers/application_editor_group_assigned_notify.py b/portality/events/consumers/application_editor_group_assigned_notify.py index e496337c13..22b277d283 100644 --- a/portality/events/consumers/application_editor_group_assigned_notify.py +++ b/portality/events/consumers/application_editor_group_assigned_notify.py @@ -43,7 +43,9 @@ def consume(cls, event): notification.long = svc.long_notification(cls.ID).format( journal_name=application.bibjson().title ) - notification.short = svc.short_notification(cls.ID) + notification.short = svc.short_notification(cls.ID).format( + issns=", ".join(issn for issn in application.bibjson().issns()) + ) notification.action = url_for("editor.application", application_id=application.id) diff --git a/portality/events/consumers/application_editor_inprogress_notify.py b/portality/events/consumers/application_editor_inprogress_notify.py index 1fdbe029d8..0c929e3631 100644 --- a/portality/events/consumers/application_editor_inprogress_notify.py +++ b/portality/events/consumers/application_editor_inprogress_notify.py @@ -53,7 +53,9 @@ def consume(cls, event): notification.long = svc.long_notification(cls.ID).format( application_title=application.bibjson().title ) - notification.short = svc.short_notification(cls.ID) + notification.short = svc.short_notification(cls.ID).format( + issns=", ".join(issn for issn in application.bibjson().issns()) + ) notification.action = url_for("editor.application", application_id=application.id) svc.notify(notification) diff --git a/portality/events/consumers/application_maned_ready_notify.py b/portality/events/consumers/application_maned_ready_notify.py index 798f204627..58b22384b8 100644 --- a/portality/events/consumers/application_maned_ready_notify.py +++ b/portality/events/consumers/application_maned_ready_notify.py @@ -49,7 +49,9 @@ def consume(cls, event): application_title=application.bibjson().title, editor=editor ) - notification.short = svc.short_notification(cls.ID) + notification.short = svc.short_notification(cls.ID).format( + issns=", ".join(issn for issn in application.bibjson().issns()) + ) notification.action = url_for("admin.application", application_id=application.id) svc.notify(notification) diff --git a/portality/events/consumers/application_publisher_accepted_notify.py b/portality/events/consumers/application_publisher_accepted_notify.py index bf6ecca6f9..9bd34769c2 100644 --- a/portality/events/consumers/application_publisher_accepted_notify.py +++ b/portality/events/consumers/application_publisher_accepted_notify.py @@ -67,7 +67,9 @@ def consume(cls, event): publisher_dashboard_url=app.config.get("BASE_URL") + url_for("publisher.journals"), faq_url=app.config.get("BASE_URL") + url_for("doaj.faq") ) - notification.short = svc.short_notification(cls.ID) + notification.short = svc.short_notification(cls.ID).format( + issns=", ".join(issn for issn in application.bibjson().issns()) + ) notification.action = url_for("publisher.journals") diff --git a/portality/events/consumers/application_publisher_assigned_notify.py b/portality/events/consumers/application_publisher_assigned_notify.py index 22acf66d02..2349dca60c 100644 --- a/portality/events/consumers/application_publisher_assigned_notify.py +++ b/portality/events/consumers/application_publisher_assigned_notify.py @@ -64,7 +64,9 @@ def consume(cls, event): application_date=dates.human_date(application.date_applied), volunteers_url=app.config.get('BASE_URL', "https://doaj.org") + url_for("doaj.volunteers"), ) - notification.short = svc.short_notification(cls.ID) + notification.short = svc.short_notification(cls.ID).format( + issns=", ".join(issn for issn in application.bibjson().issns()) + ) # note that there is no action url svc.notify(notification) diff --git a/portality/events/consumers/application_publisher_created_notify.py b/portality/events/consumers/application_publisher_created_notify.py index 743b67cbf4..14640a18e0 100644 --- a/portality/events/consumers/application_publisher_created_notify.py +++ b/portality/events/consumers/application_publisher_created_notify.py @@ -41,6 +41,8 @@ def consume(cls, event): journal_url=application.bibjson().journal_url, application_date=dates.human_date(application.date_applied), volunteers_url=url_for("doaj.volunteers")) - notification.short = svc.short_notification(cls.ID) + notification.short = svc.short_notification(cls.ID).format( + issns=", ".join(issn for issn in application.bibjson().issns()) + ) svc.notify(notification) diff --git a/portality/events/consumers/application_publisher_inprogress_notify.py b/portality/events/consumers/application_publisher_inprogress_notify.py index f6391f96f5..659d5d31c2 100644 --- a/portality/events/consumers/application_publisher_inprogress_notify.py +++ b/portality/events/consumers/application_publisher_inprogress_notify.py @@ -46,6 +46,8 @@ def consume(cls, event): date_applied=date_applied, volunteers=volunteers ) - notification.short = svc.short_notification(cls.ID) + notification.short = svc.short_notification(cls.ID).format( + issns=", ".join(issn for issn in application.bibjson().issns()) + ) svc.notify(notification) diff --git a/portality/events/consumers/application_publisher_quickreject_notify.py b/portality/events/consumers/application_publisher_quickreject_notify.py index 0548b6d581..7608d18cbf 100644 --- a/portality/events/consumers/application_publisher_quickreject_notify.py +++ b/portality/events/consumers/application_publisher_quickreject_notify.py @@ -51,7 +51,9 @@ def consume(cls, event): note=note if note is not None else "", doaj_guide_url=app.config.get('BASE_URL', "https://doaj.org") + url_for("doaj.guide") ) - notification.short = svc.short_notification(cls.ID) + notification.short = svc.short_notification(cls.ID).format( + issns=", ".join(issn for issn in application.bibjson().issns()) + ) # there is no action url for this notification diff --git a/portality/events/consumers/application_publisher_revision_notify.py b/portality/events/consumers/application_publisher_revision_notify.py index d710fcb96d..143e0c2ccb 100644 --- a/portality/events/consumers/application_publisher_revision_notify.py +++ b/portality/events/consumers/application_publisher_revision_notify.py @@ -43,6 +43,8 @@ def consume(cls, event): application_title=application.bibjson().title, date_applied=date_applied ) - notification.short = svc.short_notification(cls.ID) + notification.short = svc.short_notification(cls.ID).format( + issns=", ".join(issn for issn in application.bibjson().issns()) + ) svc.notify(notification) diff --git a/portality/events/consumers/journal_assed_assigned_notify.py b/portality/events/consumers/journal_assed_assigned_notify.py index 00d76a39ba..c57d3d07d0 100644 --- a/portality/events/consumers/journal_assed_assigned_notify.py +++ b/portality/events/consumers/journal_assed_assigned_notify.py @@ -39,7 +39,9 @@ def consume(cls, event): journal_name=journal.bibjson().title, group_name=journal.editor_group ) - notification.short = svc.short_notification(cls.ID) + notification.short = svc.short_notification(cls.ID).format( + issns=", ".join(issn for issn in journal.bibjson().issns()) + ) notification.action = url_for("editor.journal_page", journal_id=journal.id) svc.notify(notification) diff --git a/portality/events/consumers/journal_editor_group_assigned_notify.py b/portality/events/consumers/journal_editor_group_assigned_notify.py index ac696375f4..217a404b80 100644 --- a/portality/events/consumers/journal_editor_group_assigned_notify.py +++ b/portality/events/consumers/journal_editor_group_assigned_notify.py @@ -44,7 +44,9 @@ def consume(cls, event): notification.long = svc.long_notification(cls.ID).format( journal_name=journal.bibjson().title ) - notification.short = svc.short_notification(cls.ID) + notification.short = svc.short_notification(cls.ID).format( + issns=", ".join(issn for issn in journal.bibjson().issns()) + ) notification.action = url_for("editor.journal_page", journal_id=journal.id) svc.notify(notification) diff --git a/portality/events/consumers/update_request_publisher_accepted_notify.py b/portality/events/consumers/update_request_publisher_accepted_notify.py index d9cd05d102..3484617232 100644 --- a/portality/events/consumers/update_request_publisher_accepted_notify.py +++ b/portality/events/consumers/update_request_publisher_accepted_notify.py @@ -67,7 +67,9 @@ def consume(cls, event): application_date=dates.human_date(application.date_applied), publisher_dashboard_url=app.config.get('BASE_URL', "https://doaj.org") + url_for("publisher.journals") ) - notification.short = svc.short_notification(cls.ID) + notification.short = svc.short_notification(cls.ID).format( + issns=", ".join(issn for issn in application.bibjson().issns()) + ) notification.action = url_for("publisher.journals") diff --git a/portality/events/consumers/update_request_publisher_assigned_notify.py b/portality/events/consumers/update_request_publisher_assigned_notify.py index 7d47eb3002..63254fbbc2 100644 --- a/portality/events/consumers/update_request_publisher_assigned_notify.py +++ b/portality/events/consumers/update_request_publisher_assigned_notify.py @@ -62,7 +62,9 @@ def consume(cls, event): application_title=application.bibjson().title, application_date=dates.human_date(application.date_applied) ) - notification.short = svc.short_notification(cls.ID) + notification.short = svc.short_notification(cls.ID).format( + issns=", ".join(issn for issn in application.bibjson().issns()) + ) # note that there is no action url svc.notify(notification) diff --git a/portality/events/consumers/update_request_publisher_rejected_notify.py b/portality/events/consumers/update_request_publisher_rejected_notify.py index 6db89fc39b..8885891a96 100644 --- a/portality/events/consumers/update_request_publisher_rejected_notify.py +++ b/portality/events/consumers/update_request_publisher_rejected_notify.py @@ -65,7 +65,9 @@ def consume(cls, event): title=application.bibjson().title, date_applied=date_applied, ) - notification.short = svc.short_notification(cls.ID) + notification.short = svc.short_notification(cls.ID).format( + issns=", ".join(issn for issn in application.bibjson().issns()) + ) # there is no action url associated with this notification diff --git a/portality/settings.py b/portality/settings.py index e667d8ec22..f3536a3e01 100644 --- a/portality/settings.py +++ b/portality/settings.py @@ -9,7 +9,7 @@ # Application Version information # ~~->API:Feature~~ -DOAJ_VERSION = "6.3.13" +DOAJ_VERSION = "6.3.15" API_VERSION = "3.0.1" ###################################### diff --git a/portality/static/js/doaj.fieldrender.edges.js b/portality/static/js/doaj.fieldrender.edges.js index 08a2aa35bf..169ce93133 100644 --- a/portality/static/js/doaj.fieldrender.edges.js +++ b/portality/static/js/doaj.fieldrender.edges.js @@ -2276,7 +2276,7 @@ $.extend(true, doaj, { // the remove block looks different, depending on the kind of filter to remove if (def.filter === "term" || def.filter === "terms") { - filters += ''; + filters += ''; filters += def.display + valDisplay; filters += ' '; filters += ""; @@ -2331,6 +2331,7 @@ $.extend(true, doaj, { this.removeFilter = function (element) { var el = this.component.jq(element); + var sf = this.component; // if this is a compound filter, remove it by id var compound = el.attr("data-compound"); @@ -2346,20 +2347,9 @@ $.extend(true, doaj, { var value = false; if (ft === "terms" || ft === "term") { - val = el.attr("data-value"); - // translate string value to a type required by a model - if (val === "true"){ - value = true; - } - else if (val === "false"){ - value = false; - } - else if (!isNaN(parseInt(val))){ - value = parseInt(val); - } - else { - value = val; - } + let values = sf.mustFilters[field].values; + let idx = el.attr("data-value-idx") + value = values[idx].val } else if (ft === "range") { value = {}; diff --git a/portality/static/js/notifications.js b/portality/static/js/notifications.js index 6bf24b3010..c564aff81e 100644 --- a/portality/static/js/notifications.js +++ b/portality/static/js/notifications.js @@ -58,6 +58,14 @@ doaj.notifications.notificationsReceived = function(data) { } $(".notification_action_link").on("click", doaj.notifications.notificationClicked); + $(".dropdown--notifications").hoverIntent(doaj.notifications.showDropdown, doaj.notifications.hideDropdown); +} + +doaj.notifications.showDropdown = function(e) { + $("#top_notifications").show(); +} +doaj.notifications.hideDropdown = function() { + $("#top_notifications").hide(); } doaj.notifications.notificationClicked = function(event) { diff --git a/portality/static/js/vendors/jquery.hoverIntent.min.js b/portality/static/js/vendors/jquery.hoverIntent.min.js new file mode 100644 index 0000000000..270354a739 --- /dev/null +++ b/portality/static/js/vendors/jquery.hoverIntent.min.js @@ -0,0 +1,9 @@ +/*! + * hoverIntent v1.10.2 // 2020.04.28 // jQuery v1.7.0+ + * http://briancherne.github.io/jquery-hoverIntent/ + * + * You may use hoverIntent under the terms of the MIT license. Basically that + * means you are free to use hoverIntent as long as this header is left intact. + * Copyright 2007-2019 Brian Cherne + */ +!function(factory){"use strict";"function"==typeof define&&define.amd?define(["jquery"],factory):"object"==typeof module&&module.exports?module.exports=factory(require("jquery")):jQuery&&!jQuery.fn.hoverIntent&&factory(jQuery)}(function($){"use strict";function track(ev){cX=ev.pageX,cY=ev.pageY}function isFunction(value){return"function"==typeof value}var cX,cY,_cfg={interval:100,sensitivity:6,timeout:0},INSTANCE_COUNT=0,compare=function(ev,$el,s,cfg){if(Math.sqrt((s.pX-cX)*(s.pX-cX)+(s.pY-cY)*(s.pY-cY)) + {# get bootstrap js #} {# TODO: this is probably not the right place to keep this file #} {# I’m using a much smaller & reduced version of Boostrap’s JS, with some modified classes and only the components we need #} diff --git a/portality/templates/application_form/editorial_form_body.html b/portality/templates/application_form/editorial_form_body.html index 7912037689..53be1f5437 100644 --- a/portality/templates/application_form/editorial_form_body.html +++ b/portality/templates/application_form/editorial_form_body.html @@ -1,6 +1,5 @@ {% include "application_form/_edit_status.html" %} {% include "application_form/_backend_validation.html" %} -{% include "application_form/_contact.html" %} {% import "application_form/_application_warning_msg.html" as _msg %} {{ _msg.build_journal_withdrawn_deleted_msg(obj) }} diff --git a/portality/templates/application_form/editorial_side_panel.html b/portality/templates/application_form/editorial_side_panel.html index cde46632fc..34db9ba93e 100644 --- a/portality/templates/application_form/editorial_side_panel.html +++ b/portality/templates/application_form/editorial_side_panel.html @@ -1,3 +1,4 @@ +{% include "application_form/_contact.html" %} {% if obj %}

LOCKED FOR EDITING UNTIL {{lock.expire_formatted()}}

{% if obj.application_status != constants.APPLICATION_STATUS_ACCEPTED %} @@ -17,7 +18,6 @@

LOCKED FOR EDITING UNTIL -
{% set fs = formulaic_context.fieldset("notes") %} {% if fs %} diff --git a/portality/templates/dashboard/_todo.html b/portality/templates/dashboard/_todo.html index b4184cfa65..35bccf0c93 100644 --- a/portality/templates/dashboard/_todo.html +++ b/portality/templates/dashboard/_todo.html @@ -53,6 +53,12 @@ "feather": "inbox", "link" : url_for('editor.group_suggestions') + "?source=" + search_query_source(term=[{"admin.application_status.exact":"pending"}]) }, + constants.TODO_EDITOR_ASSIGN_PENDING_LOW_PRIORITY: { + "text" : "Pending Assign to Associate Editor", + "colour" : "var(--yellow)", + "feather": "inbox", + "link" : url_for('editor.group_suggestions') + "?source=" + search_query_source(term=[{"admin.application_status.exact":"pending"}]) + }, constants.TODO_ASSOCIATE_PROGRESS_STALLED: { "text" : "Stalled Complete as soon as possible", "show_status": true, diff --git a/portality/templates/editor/nav.html b/portality/templates/editor/nav.html index 8b41fe7f91..2ab38010b1 100644 --- a/portality/templates/editor/nav.html +++ b/portality/templates/editor/nav.html @@ -4,12 +4,16 @@ {% set ass_apps = url_for('editor.associate_suggestions') %} {% set ass_journals = url_for('editor.associate_journals') %} - - + +{# +Tabs removed for https://github.com/DOAJ/doajPM/issues/3422 +(ass_journals, "Journals assigned to you", None, "book-open") +(group_journals, "Your group’s journals", "list_group_journals", "book") +#} + {% set tabs = [ (index, "Dashboard", None, "list"), (group_apps, "Your group’s applications", "list_group_suggestions", "users"), - (group_journals, "Your group’s journals", "list_group_journals", "book"), (ass_apps, "Applications assigned to you", None, "file-text") ] %} diff --git a/portality/templates/includes/_header-secondary-navigation-account.html b/portality/templates/includes/_header-secondary-navigation-account.html index dc5ecb7620..35b3b6aa2c 100644 --- a/portality/templates/includes/_header-secondary-navigation-account.html +++ b/portality/templates/includes/_header-secondary-navigation-account.html @@ -17,7 +17,7 @@ {% endif %} - {% if current_user.has_role("editor") or current_user.has_role("associate_editor") %} + {% if (current_user.has_role("editor") or current_user.has_role("associate_editor")) and not current_user.has_role("admin") %}
  • Editor diff --git a/portality/templates/layouts/dashboard_base.html b/portality/templates/layouts/dashboard_base.html index b818d1e8b6..355463e4e2 100644 --- a/portality/templates/layouts/dashboard_base.html +++ b/portality/templates/layouts/dashboard_base.html @@ -26,19 +26,20 @@

    DOAJ Dashboard