Skip to content

Commit

Permalink
Merge branch 'develop' into feature/3498_async_articles_bulk_api
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven-Eardley committed Apr 11, 2024
2 parents 92cdc20 + ec5e76c commit 00f60ce
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 25 deletions.
1 change: 0 additions & 1 deletion cms/sass/themes/_dashboard.scss
Expand Up @@ -176,7 +176,6 @@
// Application form styles — overrides
.form {
padding: $spacing-04 0;
background: rgba($salmon, .15);
}

.form--compact {
Expand Down
5 changes: 4 additions & 1 deletion doajtest/testbook/new_application_form/maned_form.yml
Expand Up @@ -48,7 +48,10 @@ tests:
results:
- A message at the top of the form tells you that you can only choose one or two
subject classifications
- step: Remove one subject classification and 'Save'
- step: Remove one subject classification
- step: Click "Unlock & Close"
results: Confirmation dialog is displayed warning you about unsaved changes
- step: Click "Stay on Page" and then 'Save'
results:
- The form saves
- The changes you applied, both to the form, and in the functionality box, have
Expand Down
2 changes: 1 addition & 1 deletion portality/settings.py
Expand Up @@ -9,7 +9,7 @@
# Application Version information
# ~~->API:Feature~~

DOAJ_VERSION = "6.6.8"
DOAJ_VERSION = "6.6.10"
API_VERSION = "3.0.1"

######################################
Expand Down
3 changes: 1 addition & 2 deletions portality/static/js/application_form.js
Expand Up @@ -460,7 +460,6 @@ doaj.af.EditorialApplicationForm = class extends doaj.af.BaseApplicationForm {
event.preventDefault();
let id = $(this).attr("data-id");
let type = $(this).attr("data-type");
that.submitting = true;
that.unlock({type : type, id : id})
});

Expand All @@ -477,7 +476,7 @@ doaj.af.EditorialApplicationForm = class extends doaj.af.BaseApplicationForm {
// ignore any "view note" modal close button hits
// FIXME: I don't love this, it feels brittle, but I don't have a better solution
let exceptClasses = ["formulaic-notemodal-close"];
let exceptIds = ["open_withdraw_reinstate"];
let exceptIds = ["open_withdraw_reinstate", "unlock"];
let excepted = false;
for (let i = 0; i < exceptClasses.length; i++) {
if ($(event.currentTarget).hasClass(exceptClasses[i])) {
Expand Down
4 changes: 3 additions & 1 deletion portality/static/js/doaj.fieldrender.edges.js
Expand Up @@ -3506,7 +3506,9 @@ $.extend(true, doaj, {
if (dir === undefined) {
dir = "";
}
dir = " " + dir;
if (dir !== "") {
dir = " " + dir;
}
sortOptions += '<option value="' + field + '' + dir + '">' + edges.escapeHtml(display) + '</option>';
}

Expand Down
Expand Up @@ -5,8 +5,7 @@
{% import "application_form/_application_warning_msg.html" as _msg %}
{% if obj and (obj.es_type == 'journal' and obj.is_in_doaj()) %}
{{ _msg.build_journal_withdrawn_deleted_msg(obj) }}
<a class="button button--tertiary" href="{{ url_for('doaj.toc', identifier=obj.id) }}">See this
journal in DOAJ</a>
<a class="button button--tertiary" href="{{ url_for('doaj.toc', identifier=obj.id) }}" target="_blank">See this journal in DOAJ</a>
{% endif %}


Expand Down
18 changes: 9 additions & 9 deletions portality/ui/messages.py
Expand Up @@ -7,9 +7,9 @@ class Messages(object):

PUBLISHER_APPLICATION_UPDATE_SUBMITTED_FLASH = ("""
Your update request has been submitted. You may make further changes until the DOAJ Editorial Team picks it up
for review. Click the 'Edit' button to make further changes, or 'Delete' to cancel the request.
for review. Click the 'Edit' button to make further changes or 'Delete' to cancel the request.
""", 'success')
PUBLISHER_UPLOAD_ERROR = """An error has occurred and your upload may not have succeeded. {error_str} <br \> If the problem persists please report the issue with the ID: {id}"""
PUBLISHER_UPLOAD_ERROR = """An error has occurred and your upload may not have succeeded. {error_str} <br \> If the problem persists, please send the error details from the Notes column of the History of Uploads box below and a screenshot of the entire error message"""
NO_FILE_UPLOAD_ID="""No file upload record has been specified"""

ARTICLE_METADATA_SUBMITTED_FLASH = ("<a href='{url}' target='_blank'>Article created/updated</a>", "success")
Expand Down Expand Up @@ -50,7 +50,7 @@ class Messages(object):
EXCEPTION_ARTICLE_BATCH_DUPLICATE = "One or more articles in this batch have duplicate identifiers"
EXCEPTION_ARTICLE_BATCH_FAIL = "One or more articles failed to ingest; entire batch ingest halted"
EXCEPTION_ARTICLE_BATCH_CONFLICT = "One or more articles in this batch matched multiple articles as duplicates; entire batch ingest halted"
EXCEPTION_DETECT_DUPLICATE_NO_ID = "The article you provided has neither doi nor fulltext url, and as a result cannot be deduplicated"
EXCEPTION_DETECT_DUPLICATE_NO_ID = "The article you provided has neither doi nor fulltext URL, and as a result cannot be deduplicated"
EXCEPTION_ARTICLE_MERGE_CONFLICT = "The article matched multiple existing articles as duplicates, and we cannot tell which one to update"
EXCEPTION_NO_DOI_NO_FULLTEXT = "The article must have a DOI and/or a Full-Text URL"
EXCEPTION_ARTICLE_OVERRIDE = "Cannot update the article. An article with this URL and DOI already exists. If you are sure you want to replace it please delete it and then re-create it."
Expand All @@ -63,13 +63,13 @@ class Messages(object):
EXCEPTION_TOO_MANY_ISSNS = "Too many ISSNs. Only 2 ISSNs are allowed: one Print ISSN and one Online ISSN."
EXCEPTION_MISMATCHED_ISSNS = "ISSNs provided don't match any journal."
EXCEPTION_ISSNS_OF_THE_SAME_TYPE = "Both ISSNs have the same type: {type}"
EXCEPTION_IDENTICAL_PISSN_AND_EISSN = "The Print and Online ISSNs supplied are identical. If you supply 2 ISSNs they must be different."
EXCEPTION_NO_ISSNS = "Neither Print ISSN nor Online ISSN has been supplied. DOAJ requires at least one ISSN."
EXCEPTION_IDENTICAL_PISSN_AND_EISSN = "The Print and Online ISSNs supplied are identical. If you supply two ISSNs, they must be different."
EXCEPTION_NO_ISSNS = "Neither the Print ISSN nor Online ISSN have been supplied. DOAJ requires at least one ISSN."
EXCEPTION_INVALID_BIBJSON = "Invalid article bibjson: " # + Dataobj exception message

EXCEPTION_IDENTIFIER_CHANGE_CLASH = "DOI or Fulltext URL has been changed to match another article that already exists in DOAJ"
EXCEPTION_IDENTIFIER_CHANGE = "DOI or Fulltext URL have been changed. This operation is not permitted, please contact an administrator for help."
EXCEPTION_DUPLICATE_NO_PERMISSION = "You do not have the permissions to carry out the requested change"
EXCEPTION_IDENTIFIER_CHANGE = "Either the DOI or Fulltext URL has been changed. This operation is not permitted; please contact an administrator for help."
EXCEPTION_DUPLICATE_NO_PERMISSION = "You do not have permission to carry out the requested change"

EXCEPTION_EDITING_ACCEPTED_JOURNAL = "You cannot edit applications which have been accepted into DOAJ."
EXCEPTION_EDITING_WITHDRAWN_JOURNAL = "This journal has been withdrawn, update request cannot be accepted."
Expand All @@ -84,7 +84,7 @@ class Messages(object):
If you would like to see more results, you can download all of our data from
{data_dump_url}. You can also harvest from our OAI-PMH endpoints; articles: {oai_article_url}, journals: {oai_journal_url}"""

CONSENT_COOKIE_VALUE = """By using the DOAJ website you have agreed to our cookie policy."""
CONSENT_COOKIE_VALUE = """By using our website, you have agreed to our cookie policy."""

FORMS__APPLICATION_PROCESSORS__NEW_APPLICATION__FINALISE__USER_EMAIL_ERROR = "We were unable to send you an email confirmation - possible problem with the email address provided"
FORMS__APPLICATION_PROCESSORS__NEW_APPLICATION__FINALISE__LOG_EMAIL_ERROR = 'Error sending application received email.'
Expand Down Expand Up @@ -127,7 +127,7 @@ class Messages(object):
FORMS__APPLICATION_STATUS__REJECTED = 'Rejected'
FORMS__APPLICATION_STATUS__ACCEPTED = 'Accepted'

JOURNAL_CSV_VALIDATE__HEADER_CASE_MISMATCH = '"{h}" has mismatching case to expected header "{expected}".'
JOURNAL_CSV_VALIDATE__HEADER_CASE_MISMATCH = '"{h}" has a mismatching case to the expected header "{expected}".'
JOURNAL_CSV_VALIDATE__INVALID_HEADER = '"{h}" is not a valid column header. Please revert it to match what was sent to you in the original file.'
JOURNAL_CSV_VALIDATE__REQUIRED_HEADER_MISSING = '"{h}" is a required column missing from this upload. Please refer to the original file and restore the column.'
JOURNAL_CSV_VALIDATE__MISSING_JOURNAL = "There is no journal record in DOAJ for ISSN(s) {issns}. The record may not exist, or it may be withdrawn."
Expand Down
11 changes: 4 additions & 7 deletions portality/view/publisher.py
Expand Up @@ -212,9 +212,8 @@ def upload_file():
job = IngestArticlesBackgroundTask.prepare(current_user.id, upload_file=f, schema=schema, url=url, previous=previous)
IngestArticlesBackgroundTask.submit(job)
except TaskException as e:
magic = str(uuid.uuid1())
flash(Messages.PUBLISHER_UPLOAD_ERROR.format(error_str="", id=magic))
app.logger.exception('File upload error. ' + magic)
flash(Messages.PUBLISHER_UPLOAD_ERROR.format(error_str=str(e)))
app.logger.exception('File upload error. ' + str(e))
return resp
except BackgroundException as e:
if str(e) == Messages.NO_FILE_UPLOAD_ID:
Expand All @@ -223,10 +222,8 @@ def upload_file():
schema = ""
return render_template('publisher/uploadmetadata.html', previous=previous, schema=schema, error=True)


magic = str(uuid.uuid1())
flash(Messages.PUBLISHER_UPLOAD_ERROR.format(error_str=str(e), id=magic))
app.logger.exception('File upload error. ' + magic + '; ' + str(e))
flash(Messages.PUBLISHER_UPLOAD_ERROR.format(error_str=str(e)))
app.logger.exception('File upload error. ' + str(e))
return resp

if f is not None and f.filename != "":
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -5,7 +5,7 @@

setup(
name='doaj',
version='6.6.8',
version='6.6.10',
packages=find_packages(),
install_requires=[
"awscli==1.20.50",
Expand Down

0 comments on commit 00f60ce

Please sign in to comment.