Skip to content

Commit

Permalink
Merge branch 'release/2023-11-22_publisher_society_fields_different_r…
Browse files Browse the repository at this point in the history
…emove_ga'
  • Loading branch information
Steven-Eardley committed Nov 22, 2023
2 parents f2f4e5f + 6aaec57 commit 3bfc05e
Show file tree
Hide file tree
Showing 19 changed files with 153 additions and 332 deletions.
1 change: 0 additions & 1 deletion cms/pages/legal/privacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ Volunteer records must include a name and an email address so that we can assign

When you use DOAJ, cookies are set on your machine. The cookies we set are:

* Google Analytics - we track usage of this site using Google Analytics. We do not track individuals but general paths through the site. (Being retired as of August 2023.)
* jquery - we use jquery.com to load the javascript framework.
* doaj.org - a small number of required cookies for the application to function, for example when you log in and when you click away the cookie consent banner.
* schema - if you upload article metadata to us via the Upload Article XML tab, we place a cookie on your machine which allows us to remember which XSD schema you used the last time you uploaded XML to us: doaj or Crossref
Expand Down
7 changes: 7 additions & 0 deletions doajtest/testbook/new_application_form/publishers_form.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ tests:
- step: Click the X next to it
results:
- It disappears
- step: Enter the same value in Publisher's Name and Publisher's Country
- step: Click Next
results:
- "You see the error message: The value of this field and the Publisher's Country field must be different."
- step: Repeat previous step checking if the validator is case insensitive (e.g. "Publisher's name" and "publisher's Name")
results:
- The error message is still displayed
- step: Repeat steps X to X for the Publisher's Name, Country, Society name, Country
- step: Delete the values from Society name and country, click Next
results:
Expand Down
2 changes: 1 addition & 1 deletion docs/featuremap/terminals.csv
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ FieldDescriptions:Documentation
Flask:Technology
FlaskMail:Library
GeneratedDocsIndex:Script
GoogleAnalytics:ExternalService
GuideToApplying:Fragment
Huey:Technology
Java:Technology
Expand All @@ -26,6 +25,7 @@ LCC:SourceData
OpenURL:Fragment
Plagiarism:FieldSet
PlagiarismDetection:FormField
PlausibleAnalytics:ExternalService
Privacy:Fragment
Promo:Data
PublisherSupporters:Data
Expand Down
5 changes: 2 additions & 3 deletions portality/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,8 @@ def custom_static(path):
return send_from_directory(os.path.dirname(target), os.path.basename(target))
abort(404)


# Configure the Google Analytics tracker
# ~~-> GoogleAnalytics:ExternalService~~
# Configure Analytics
# ~~-> PlausibleAnalytics:ExternalService~~
from portality.lib import plausible
plausible.create_logfile(app.config.get('PLAUSIBLE_LOG_DIR', None))

Expand Down
79 changes: 43 additions & 36 deletions portality/forms/application_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,8 @@ class FieldDefinitions:
"input": "taglist",
"help": {
"long_help": ["Choose upto 6 keywords that describe the subject matter of the journal. "
"Keywords must be in English.", "Use single words or short phrases (2 to 3 words) "
"that describe the journal's main topic.", "Do not add acronyms, abbreviations or descriptive sentences.",
"Keywords must be in English.", "Use single words or short phrases (2 to 3 words) "
"that describe the journal's main topic.", "Do not add acronyms, abbreviations or descriptive sentences.",
"Note that the keywords may be edited by DOAJ editorial staff." ],
},
"validate": [
Expand Down Expand Up @@ -476,7 +476,8 @@ class FieldDefinitions:
"label": "Publisher’s name",
"input": "text",
"validate": [
{"required": {"message": "Enter the name of the journal’s publisher"}}
{"required": {"message": "Enter the name of the journal’s publisher"}},
{"different_to": {"field": "institution_name", "message": "Publisher and Society/Institution names cannot be the same."}} # ~~^-> DifferetTo:FormValidator~~
],
"widgets": [
"trim_whitespace", # ~~^-> TrimWhitespace:FormWidget~~
Expand Down Expand Up @@ -563,6 +564,11 @@ class FieldDefinitions:
{"autocomplete": {"type" : "journal", "field": "bibjson.institution.name.exact"}}, # ~~^-> Autocomplete:FormWidget~~
"full_contents" # ~~^->FullContents:FormWidget~~
],
"validate": [
{"different_to": {"field": "publisher_name",
"message": "Publisher and Society/Institution names cannot be the same."}}
# ~~^-> DifferetTo:FormValidator~~
],
"contexts": {
"admin": {
"widgets": [
Expand Down Expand Up @@ -737,7 +743,7 @@ class FieldDefinitions:
"field": "license_display",
"value": "y",
"message": "Enter the URL for any recent article that displays or embeds a license"
}
}
},
"is_url" # ~~^->IsURL:FormValidator~~
],
Expand Down Expand Up @@ -845,7 +851,7 @@ class FieldDefinitions:
"field": "review_process",
"value": "other",
"message": "Enter the name of another type of peer review"
}
}
}
],
"widgets" : [
Expand Down Expand Up @@ -884,8 +890,8 @@ class FieldDefinitions:
"datatype": "integer",
"help": {
"long_help": ["Please enter the year that the journal started to publish all content as true open access, according to DOAJ's <a href='https://blog.doaj.org/2020/11/17/what-does-doaj-define-as-open-access/' target='_blank' rel='nofollow'>definition</a>.",
"For journals that have flipped to open access, enter the year that the journal flipped, not the original launch date of the journal.",
"For journals that have made digitised backfiles freely available, enter the year that the journal started publishing as a fully open access title, not the date of the earliest free content."]
"For journals that have flipped to open access, enter the year that the journal flipped, not the original launch date of the journal.",
"For journals that have made digitised backfiles freely available, enter the year that the journal started publishing as a fully open access title, not the date of the earliest free content."]
},
"validate": [
{"required": {"message": "Enter the Year (YYYY)."}},
Expand Down Expand Up @@ -937,7 +943,7 @@ class FieldDefinitions:
"field": "plagiarism_detection",
"value": "y",
"message": "Enter the URL for the journal’s <strong>plagiarism policy</strong> page"
}
}
},
"is_url" # ~~^->IsURL:FormValidator~~
],
Expand Down Expand Up @@ -1184,14 +1190,14 @@ class FieldDefinitions:
"help": {
"short_help": "Link to the journal’s waiver information.",
"doaj_criteria": "You must provide a URL",
"placeholder": "https://www.my-journal.com/about#waiver"
"placeholder": "https://www.my-journal.com/about#waiver"
},
"validate": [
{"required_if": {
"field": "has_waiver",
"value": "y",
"message": "Enter the URL for the journal’s <strong>waiver information</strong> page"
}
}
},
"is_url" # ~~^->IsURL:FormValidator~~
],
Expand Down Expand Up @@ -1239,7 +1245,7 @@ class FieldDefinitions:
"field": "has_other_charges",
"value": "y",
"message": "Enter the URL for the journal’s <strong>fees<strong> information page"
}
}
},
"is_url" # ~~^->IsURL:FormValidator~~
],
Expand Down Expand Up @@ -1298,7 +1304,7 @@ class FieldDefinitions:
"field": "preservation_service",
"value": "national_library",
"message": "Enter the name(s) of the national library or libraries where the journal is archived"
}
}
}
],
"asynchronous_warning": [
Expand All @@ -1324,7 +1330,7 @@ class FieldDefinitions:
"field": "preservation_service",
"value": "other",
"message": "Enter the name of another archiving policy"
}
}
}
],
"asynchronous_warning": [
Expand Down Expand Up @@ -1423,7 +1429,7 @@ class FieldDefinitions:
"field": "deposit_policy",
"value": "other",
"message": "Enter the name of another repository policy"
}
}
}
],
"asynchronous_warning": [
Expand Down Expand Up @@ -1510,8 +1516,8 @@ class FieldDefinitions:
],
"help": {
"long_help": ["A persistent article identifier (PID) is used to find the article no matter where it is "
"located. The most common type of PID is the digital object identifier (DOI). ",
"<a href='https://en.wikipedia.org/wiki/Persistent_identifier' target='_blank' rel='noopener'>Read more about PIDs.</a>"],
"located. The most common type of PID is the digital object identifier (DOI). ",
"<a href='https://en.wikipedia.org/wiki/Persistent_identifier' target='_blank' rel='noopener'>Read more about PIDs.</a>"],
},
"validate": [
{"required": {"message": "Select <strong>at least one</strong> option"}}
Expand All @@ -1529,7 +1535,7 @@ class FieldDefinitions:
"field": "persistent_identifiers",
"value": "other",
"message": "Enter the name of another type of identifier"
}
}
}
],
"asynchronous_warning": [
Expand All @@ -1552,7 +1558,7 @@ class FieldDefinitions:
"default" : "",
"help": {
"long_help": ["An <a href='https://orcid.org/' target='_blank' rel='noopener'>ORCID</a> (Open Researcher and Contributor) iD is an alphanumeric code to uniquely identify "
"authors."],
"authors."],
},
"contexts" : {
"public" : {
Expand Down Expand Up @@ -1643,7 +1649,7 @@ class FieldDefinitions:
"input": "textarea",
"help": {
"long_help": ["The selected reason for rejection, and any additional information you include, "
"are sent to the journal contact with the rejection email."]
"are sent to the journal contact with the rejection email."]
},
"validate": [
{"required_if": {"field": "quick_reject", "value": "other"}}
Expand Down Expand Up @@ -1693,15 +1699,15 @@ class FieldDefinitions:
"help" : {
"render_error_box": False,
"short_help" : "Set the status to 'In Progress' to signal to the applicant that you have started your review."
"Set the status to 'Completed' to alert the Editor that you have completed your review.",
"Set the status to 'Completed' to alert the Editor that you have completed your review.",
"update_requests_diff": False
}
},
"editor" : {
"help" : {
"render_error_box" : False,
"short_help" : "Revert the status to 'In Progress' to signal to the Associate Editor that further work is needed."
"Set the status to 'Ready' to alert the Managing Editor that you have completed your review.",
"Set the status to 'Ready' to alert the Managing Editor that you have completed your review.",
"update_requests_diff": False
}
}
Expand Down Expand Up @@ -1779,7 +1785,7 @@ class FieldDefinitions:
"input": "taglist",
"validate": [
{"is_issn_list": {"message": "This is not a valid ISSN"}}, # ~~^-> IsISSN:FormValidator~~
{"different_to": {"field": "continued_by"}}, # ~~^-> DifferetTo:FormValidator~~
{"different_to": {"field": "continued_by", "message": "The ISSN provided in both fields must be different. Please make sure to enter the ISSN of an older journal for the first field and the ISSN of a newer journal for the second field. They cannot be the same."}}, # ~~^-> DifferetTo:FormValidator~~
{
"not_if" : {
"fields" : [{"field" : "discontinued_date"}],
Expand All @@ -1802,7 +1808,7 @@ class FieldDefinitions:
"input": "taglist",
"validate": [
{"is_issn_list": {"message": "This is not a valid ISSN"}}, # ~~^-> IsISSN:FormValidator~~
{"different_to": {"field": "continues"}}, # ~~^-> DifferetTo:FormValidator~~
{"different_to": {"field": "continues", "message": "The ISSN provided in both fields must be different. Please make sure to enter the ISSN of an older journal for the first field and the ISSN of a newer journal for the second field. They cannot be the same."}}, # ~~^-> DifferetTo:FormValidator~~
{
"not_if": {
"fields": [{"field": "discontinued_date"}],
Expand Down Expand Up @@ -1830,18 +1836,18 @@ class FieldDefinitions:
"validate": [
{"required_if" : {
"field" : "application_status",
"value" : [
constants.APPLICATION_STATUS_READY,
constants.APPLICATION_STATUS_COMPLETED,
constants.APPLICATION_STATUS_ACCEPTED
],
"message" : "This field is required when setting the Application Status to {y}, {z} or {a}".format(
y=constants.APPLICATION_STATUS_READY,
z=constants.APPLICATION_STATUS_COMPLETED,
a=constants.APPLICATION_STATUS_ACCEPTED
)
}
}
"value" : [
constants.APPLICATION_STATUS_READY,
constants.APPLICATION_STATUS_COMPLETED,
constants.APPLICATION_STATUS_ACCEPTED
],
"message" : "This field is required when setting the Application Status to {y}, {z} or {a}".format(
y=constants.APPLICATION_STATUS_READY,
z=constants.APPLICATION_STATUS_COMPLETED,
a=constants.APPLICATION_STATUS_ACCEPTED
)
}
}
],
"widgets": [
"subject_tree"
Expand Down Expand Up @@ -2822,6 +2828,7 @@ class DifferentToBuilder:
@staticmethod
def render(settings, html_attrs):
html_attrs["data-parsley-different-to"] = settings.get("field")
html_attrs["data-parsley-different-to-message"] = "<p><small>" + settings.get("message") + "</small></p>"

@staticmethod
def wtforms(field, settings):
Expand Down Expand Up @@ -3092,7 +3099,7 @@ class MultiCheckboxBuilder(WTFormsBuilder):
@staticmethod
def match(field):
return field.get("input") == "checkbox" and \
(len(field.get("options", [])) > 0 or field.get("options_fn") is not None)
(len(field.get("options", [])) > 0 or field.get("options_fn") is not None)

@staticmethod
def wtform(formulaic_context, field, wtfargs):
Expand Down
Loading

0 comments on commit 3bfc05e

Please sign in to comment.