Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cms/sass/components/_accordion.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.accordion:focus-within {
border: $grapefruit solid;
outline: $grapefruit solid;
}
3 changes: 0 additions & 3 deletions cms/sass/components/_filters.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@
}

.filter__choices {
max-height: $spacing-07;
height: auto;
overflow-y: auto;
padding-top: $spacing-01;
@include unstyled-list;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
suite: Editorial Form Field Placement Changes
testset: Editorial Form Field Placement Changes

tests:
- title: Admin – Updated Form Layout and Field Behaviour
setup:
- Go to /testdrive/form_rearrangement
context:
role: admin
steps:
- step: Log in as DukeDingleberry, the admin

- step: Access the journal form at /admin/journal_id
results:
- The plagiarism questions appear in the Best Practice section
- The keywords field is positioned at the end of the Editorial section
- The subject classification field is positioned at the end of the Editorial section
- There is no subject classification modal
- The subject classification question is now displayed directly in the main form body
- step: Remove the currently selected subject
results:
- The change is correctly reflected under the subject browser
- step: Use the search input to find any subject
results:
- The subject browser behaves correctly when searched
- step: Select a subject
results:
- The change is correctly reflected under the subject browser
- step: Save the form
results:
- The new subject is saved correctly
- step: Click "Unlock & Close"

- step: Access the application form at /application/application_id
results:
- Same checks as above
- step: Click "Unlock & Close"

- step: Access the update request form at /application/update_request_id
results:
- Same checks as above
- step: Click "Unlock & Close"
- step: Log out of the admin account


- title: Editor – Updated Form Layout and Field Behaviour
setup:
- Go to /testdrive/form_rearrangement
context:
role: editor
steps:
- step: Log in as CountessCrumblewhisk, the editor

- step: Access the application form at /editor/application/application_id
results:
- The plagiarism questions appear in the Best Practice section
- The keywords field is positioned at the end of the Editorial section
- The subject classification field is positioned at the end of the Editorial section
- There is no subject classification modal
- The subject classification question is now displayed directly in the main form body
- step: Remove the currently selected subject
results:
- The change is correctly reflected under the subject browser
- step: Use the search input to find any subject
results:
- The subject browser behaves correctly when searched
- step: Select a subject
results:
- The change is correctly reflected under the subject browser
- step: Save the form
results:
- The new subject is saved correctly
- step: Click "Unlock & Close"
- step: Log out of the editor account


- title: Publisher – Fields Remain in Existing Sections
setup:
- Go to /testdrive/form_rearrangement
context:
role: publisher
steps:
- step: Log in as LordSniffleton, the publisher

- step: Access the update request form at /publisher/update_request/journal_id
results:
- The keywords question remains in the About section (not moved to the Editorial section)
- The plagiarism questions appear in the Best Practice section
- step: Click "Unlock & Close"

- step: Access the new application form at /apply
results:
- Same checks as above
- step: Log out of the publisher account

106 changes: 106 additions & 0 deletions doajtest/testdrive/form_rearrangement.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
from portality import constants
from doajtest.testdrive.factory import TestDrive
from doajtest.fixtures.v2.journals import JournalFixtureFactory
from doajtest.fixtures.v2.applications import ApplicationFixtureFactory
from portality import models


class FormRearrangement(TestDrive):
def setup(self) -> dict:
publisher_un = "LordSniffleton"
publisher_pw = self.create_random_str()
publisher_acc = models.Account.make_account(
publisher_un + "@example.com",
publisher_un,
"Publisher " + publisher_un,
[constants.ROLE_PUBLISHER]
)
publisher_acc.set_password(publisher_pw)
publisher_acc.save()

admin_un = "DukeDingleberry"
admin_pw = self.create_random_str()
admin_acc = models.Account.make_account(
admin_un + "@example.com",
admin_un,
"Admin " + admin_un,
[constants.ROLE_ADMIN]
)
admin_acc.set_password(admin_pw)
admin_acc.save()

editor_un = "CountessCrumblewhisk"
editor_pw = self.create_random_str()
editor_acc = models.Account.make_account(
editor_un + "@example.com",
editor_un,
"Editor " + editor_un,
[constants.ROLE_EDITOR]
)
editor_acc.set_password(editor_pw)
editor_acc.save()

# Journal setup
source = JournalFixtureFactory.make_journal_source(in_doaj=True)
j = models.Journal(**source)
j.remove_current_application()
j.set_id(j.makeid())
j.set_owner(publisher_acc.id)
j.bibjson().eissn = "1987-0007"
j.bibjson().pissn = "3141-5926"
j.bibjson().title = "Annals of Aquatic Diplomacy"
j.bibjson().journal_url = "https://please-dont-splash.org"
del j.bibjson().discontinued_date
j.save(blocking=True)

# New application setup
source = ApplicationFixtureFactory.make_application_source()
a = models.Application(**source)
a.remove_current_journal()
a.remove_related_journal()
a.application_type = constants.APPLICATION_TYPE_NEW_APPLICATION
a.set_id(a.makeid())
a.set_editor(editor_acc.id)
a.set_owner(publisher_acc.id)
a.bibjson().eissn = "2718-2818"
a.bibjson().title = "Journal of Speculative Mycology"
a.bibjson().journal_url = "https://fungi-that-might-exist.com"
a.set_application_status(constants.APPLICATION_STATUS_IN_PROGRESS)
a.save(blocking=True)

# Update request setup
source = ApplicationFixtureFactory.make_update_request_source()
ur = models.Application(**source)
ur.set_id(ur.makeid())
ur.set_editor(editor_acc.id)
ur.set_owner(publisher_acc.id)
ur.bibjson().pissn = "0042-2718"
ur.bibjson().title = "Proceedings of Recursive Archaeology"
ur.bibjson().journal_url = "https://digging-up-the-future.net"
ur.save(blocking=True)

return {
"accounts": {
"admin": {"username": admin_acc.id, "password": admin_pw},
"editor": {"username": editor_acc.id, "password": editor_pw},
"publisher": {"username": publisher_acc.id, "password": publisher_pw},
},
"journals": {j.bibjson().title: j.id},
"applications": {a.bibjson().title: a.id},
"update_requests": {ur.bibjson().title: ur.id}
}

def teardown(self, params) -> dict:
for accid in ["admin", "editor", "publisher"]:
models.Account.remove_by_id(params["accounts"][accid]["username"])

for title, id in params["journals"].items():
models.Journal.remove_by_id(id)

for title, id in params["applications"].items():
models.Application.remove_by_id(id)

for title, id in params["update_requests"].items():
models.Application.remove_by_id(id)

return {"status": "success"}
42 changes: 31 additions & 11 deletions portality/forms/application_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2109,7 +2109,6 @@ class FieldSetDefinitions:
FieldDefinitions.JOURNAL_URL["name"],
FieldDefinitions.PISSN["name"],
FieldDefinitions.EISSN["name"],
FieldDefinitions.KEYWORDS["name"],
FieldDefinitions.LANGUAGE["name"]
]
}
Expand Down Expand Up @@ -2194,7 +2193,7 @@ class FieldSetDefinitions:
FieldDefinitions.AIMS_SCOPE_URL["name"],
FieldDefinitions.EDITORIAL_BOARD_URL["name"],
FieldDefinitions.AUTHOR_INSTRUCTIONS_URL["name"],
FieldDefinitions.PUBLICATION_TIME_WEEKS["name"]
FieldDefinitions.PUBLICATION_TIME_WEEKS["name"],
]
}

Expand Down Expand Up @@ -2327,11 +2326,21 @@ class FieldSetDefinitions:
}

# ~~->$ Subject:FieldSet~~
SUBJECT = {
"name": "subject",
"label": "Subject classification",
SUBJECT_AND_KEYWORDS = {
"name": "subject_and_keywords",
"label": "Subject classification and keywords",
"fields": [
FieldDefinitions.SUBJECT["name"]
FieldDefinitions.SUBJECT["name"],
FieldDefinitions.KEYWORDS["name"]
]
}

# ~~->$ Subject:FieldSet~~
KEYWORDS = {
"name": "keywords",
"label": "Keywords",
"fields": [
FieldDefinitions.KEYWORDS["name"]
]
}

Expand Down Expand Up @@ -2394,6 +2403,7 @@ class ApplicationContextDefinitions:
# ~~->$ NewApplication:FormContext~~
# ~~^-> ApplicationForm:Crosswalk~~
# ~~^-> NewApplication:FormProcessor~~

PUBLIC = {
"name": "public",
"fieldsets": [
Expand Down Expand Up @@ -2433,13 +2443,19 @@ class ApplicationContextDefinitions:
UPDATE["name"] = "update_request"
UPDATE["processor"] = application_processors.PublisherUpdateRequest
UPDATE["templates"]["form"] = templates.PUBLISHER_UPDATE_REQUEST_FORM
UPDATE["fieldsets"] += [
FieldSetDefinitions.KEYWORDS["name"],
]

# ~~->$ ReadOnlyApplication:FormContext~~
# ~~^-> NewApplication:FormContext~~
READ_ONLY = deepcopy(PUBLIC)
READ_ONLY["name"] = "application_read_only"
READ_ONLY["processor"] = application_processors.NewApplication # FIXME: enter the real processor
READ_ONLY["templates"]["form"] = templates.PUBLISHER_READ_ONLY_APPLICATION
READ_ONLY["fieldsets"] += [
FieldSetDefinitions.KEYWORDS["name"],
]

# ~~->$ AssociateEditorApplication:FormContext~~
# ~~^-> NewApplication:FormContext~~
Expand All @@ -2448,7 +2464,7 @@ class ApplicationContextDefinitions:
ASSOCIATE["name"] = "associate_editor"
ASSOCIATE["fieldsets"] += [
FieldSetDefinitions.STATUS["name"],
FieldSetDefinitions.SUBJECT["name"],
FieldSetDefinitions.SUBJECT_AND_KEYWORDS["name"],
FieldSetDefinitions.NOTES["name"]
]
ASSOCIATE["processor"] = application_processors.AssociateApplication
Expand All @@ -2462,7 +2478,7 @@ class ApplicationContextDefinitions:
EDITOR["fieldsets"] += [
FieldSetDefinitions.STATUS["name"],
FieldSetDefinitions.REVIEWERS["name"],
FieldSetDefinitions.SUBJECT["name"],
FieldSetDefinitions.SUBJECT_AND_KEYWORDS["name"],
FieldSetDefinitions.NOTES["name"]
]
EDITOR["processor"] = application_processors.EditorApplication
Expand All @@ -2480,12 +2496,15 @@ class ApplicationContextDefinitions:
FieldSetDefinitions.STATUS["name"],
FieldSetDefinitions.REVIEWERS["name"],
FieldSetDefinitions.CONTINUATIONS["name"],
FieldSetDefinitions.SUBJECT["name"],
FieldSetDefinitions.SUBJECT_AND_KEYWORDS["name"],
FieldSetDefinitions.NOTES["name"],
]
MANED["processor"] = application_processors.AdminApplication
MANED["templates"]["form"] = templates.MANED_APPLICATION_FORM

# now we can update the Public Context with the correct "About" fieldset
PUBLIC["fieldsets"] += [FieldSetDefinitions.KEYWORDS["name"]]


class JournalContextDefinitions:
# ~~->$ ReadOnlyJournal:FormContext~~
Expand All @@ -2509,7 +2528,9 @@ class JournalContextDefinitions:
FieldSetDefinitions.OTHER_FEES["name"],
FieldSetDefinitions.ARCHIVING_POLICY["name"],
FieldSetDefinitions.REPOSITORY_POLICY["name"],
FieldSetDefinitions.UNIQUE_IDENTIFIERS["name"]
FieldSetDefinitions.UNIQUE_IDENTIFIERS["name"],
FieldSetDefinitions.SUBJECT_AND_KEYWORDS["name"],

],
"templates": {
"form": templates.MANED_READ_ONLY_JOURNAL,
Expand All @@ -2533,7 +2554,6 @@ class JournalContextDefinitions:
# ~~^-> AssEdJournal:FormProcessor~~
ASSOCIATE = deepcopy(ADMIN_READ_ONLY)
ASSOCIATE["fieldsets"] += [
FieldSetDefinitions.SUBJECT["name"],
FieldSetDefinitions.NOTES["name"]
]
ASSOCIATE["name"] = "associate_editor"
Expand Down
Loading