Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
95cb254
add a nudge
amdomanska Jan 15, 2026
7c8d03f
add click handler to the link for anonymous user
amdomanska Jan 15, 2026
4741216
create a modal, allow logging in
amdomanska Jan 15, 2026
71ac863
move focus to the modal when opened
amdomanska Jan 15, 2026
d40e8e9
styles to the drawer
amdomanska Jan 19, 2026
73b2e31
style the drawer
amdomanska Jan 19, 2026
2a922a1
add transition
amdomanska Jan 19, 2026
8ebf52e
style the drawer
amdomanska Jan 22, 2026
efe5a17
Merge branch 'develop' into feature/4158_update_encouragament
amdomanska Feb 10, 2026
902ec31
fix width of the nudge
amdomanska Feb 10, 2026
faa8c00
use existing html for the form and fix currentUserId check
amdomanska Feb 10, 2026
af6bff4
redirect to publisher dashboard if not the owner
amdomanska Feb 10, 2026
a69be5e
change wording in a flash
amdomanska Feb 10, 2026
577ee8b
dummy commit
amdomanska Feb 12, 2026
2ca5999
fix broken functional tests
amdomanska Feb 12, 2026
f9b7977
add functional test
amdomanska Feb 12, 2026
4fd29ae
Merge branch 'develop' into feature/4158_update_encouragament
richard-jones Feb 24, 2026
1cf5397
various minor code refactorings and making the testdrive runnable by …
richard-jones Feb 25, 2026
73e7532
normalise current_user handling in js
richard-jones Feb 25, 2026
6a5cd82
Merge branch 'develop' into feature/4158_update_encouragament
Steven-Eardley Mar 31, 2026
214f588
add the testdrive path to the testbook
amdomanska Jun 4, 2026
0e22a3a
Merge branch 'develop' of https://github.com/DOAJ/doaj into feature/4…
RK206 Jun 16, 2026
4f780b3
move js to the login form and rewrite to vanillajs
amdomanska Jun 17, 2026
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
1 change: 1 addition & 0 deletions cms/sass/base/_palette.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ $dark-grey: #5C5956;
$mid-grey: #A9A7A5;
$light-grey: #F6F4F4;
$white: #FFF;
$highlight: #E3D2D2;

$disabled: #5c595626;

Expand Down
66 changes: 66 additions & 0 deletions cms/sass/components/_drawer.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
.drawer.is-open {
transform: translateX(0);
}

.drawer {
position: fixed;
top: 0;
right: 0;
max-width: 25rem;
width: 100%;
height: 100vh;
background-color: #F6F4F4;
padding: calc(90px + 1.5rem) 1.5rem 1.5rem;

transform: translateX(100%);
transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
will-change: transform;
z-index: 1000;

h1 {
font-family: 'Source Sans Pro', sans-serif;
line-height: 1.4;
font-weight: 400;
font-size: 1.2rem;
margin: 1rem 0 0 0;
padding-bottom: 1rem;
border-bottom: 1px solid #282624;
}

.drawer__close {
border: none;
position: absolute;
top: 5rem;
right: 1rem;
}

.drawer__content {
p.intro-text {
margin-top: 1rem;
font-size: .9rem;
}

p.closing-text {
margin-top: 1rem;
margin-bottom: 2rem;
font-size: 1rem;
}

form {
margin-bottom: 0;
.form__question {
margin: 0;
label {
font-size: 1rem;
margin: 0 0 .25rem 0;
}

input {
width: 100%;
margin: 0 0 1rem 0;
}
}
}
}
}
1 change: 1 addition & 0 deletions cms/sass/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"components/buttons",
"components/card",
"components/cookie-consent",
"components/drawer",
"components/dropdown",
"components/file_history",
"components/filters",
Expand Down
69 changes: 43 additions & 26 deletions cms/sass/pages/_journal-details.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,53 @@

.journal-details {

.journal-details__alt-title {
display: block;
color: $dark-grey;
font-weight: 400;
}

.three-col {
display: flex;
justify-content: space-between;
flex-direction: column;

@media (min-width: 769px) {
flex-direction: row;
.journal-details__alt-title {
display: block;
color: $dark-grey;
font-weight: 400;
}

> section {
width: 100%;
.three-col {
display: flex;
justify-content: space-between;
flex-direction: column;

@media (min-width: 769px) {
padding-bottom: 0;
width: calc(100% / 3 - 20px);
}
@media (min-width: 769px) {
flex-direction: row;
}

@media (min-width: 1280px) {
width: calc(100% / 3 - 40px);
}
> section {
width: 100%;

@media (min-width: 769px) {
padding-bottom: 0;
width: calc(100% / 3 - 20px);
}

@media (min-width: 1280px) {
width: calc(100% / 3 - 40px);
}
}
}

.card {
dl {
width: 100%;
.ur_nudge {
margin-top: .75rem;
padding: .5rem .5rem .5rem 2.5rem;
background-color: $light-grey;
margin-left: -2.5rem;
width: calc(100% + 4rem);
.ur_nudge--question {
font-style: italic;
}
}
}
}

.tabs__menu {
margin-bottom: $spacing-04;
}
}

.tabs__menu {
margin-bottom: $spacing-04;
}
}
56 changes: 50 additions & 6 deletions doajtest/testbook/public_site/ToC.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
suite: Public Site
testset: ToC
tests:
- title: Test Correctly Displayed Discontinued Date
- title: Test Correctly Displayed Discontinued Date
context:
role: anonymous
setup:
- To prepare to do this test make sure there are 3 journals publically available in DOAJ
- one with discontinued date in the past
- one with discontinued date in the future
- one with discontinued date today
steps:
- step: To prepare to do this test make sure there are 3 journals publically available in DOAJ
one with discontinued date in the past
one with discontinued date in the future
one with discontinued date today
- step: Search for every journal from the list above
results:
- On the ToC of the journal with discontinued date in the past or today - the discontinued date is displayed
Expand Down Expand Up @@ -41,4 +42,47 @@ tests:
path: /search/journals
- step: click the journal title to go to the ToC page
results:
- At the bottom of the ToC page is a "Last Full Review" date, showing the date set in the journal record.
- At the bottom of the ToC page is a "Last Full Review" date, showing the date set in the journal record.

- title: Update Request link behaviour for publisher and non-owner
context:
role: anonymous
path: /testdrive/ur_nudge
steps:
- step: Ensure you are not logged in. You may use a private browsing window to do this if you are already logged in.
- step: Go to the public page of "Journal of Exoplanetary Biosignatures XXXXX". Where XXXX is the unique
identifier provided on the testdrive page. You may follow the link from the testdrive page to get to the journal's
public page.
results:
- In the "Journal metadata" column, in the "Publisher" tile, a message is displayed "Are you associated with this
journal? Help us keep your record accurate! Click here to submit an update."
- step: Click the "Click here to submit an update" link.
results:
- A right-hand drawer opens displaying a login form.
- step: Log in using the admin credentials for Celestial Frontiers Press provided on the testdrive page.
results:
- The update request form for the journal "Journal of Exoplanetary Biosignatures" is displayed.
- step: Without logging out, return to the public page of "Journal of Exoplanetary Biosignatures".
results:
- In the "Journal metadata" column, in the "Publisher" tile, a message is displayed "This is your journal! Help us
keep your record accurate. Click here to submit an update."
- step: Click the "Click here to submit an update" link.
results:
- The update request form for the journal "Journal of Exoplanetary Biosignatures" is displayed.
- step: Without logging out, go to the public page of "Annals of Stellar Habitat Studies XXXXX". Where XXXXX is the
unique identifier provided on the testdrive page. You may follow the link from the testdrive page to get to the
journal's public page.
results:
- In the "Journal metadata" column, in the "Publisher" tile, no update request link is displayed.
- step: Log out.
- step: Go to the public page of "Annals of Stellar Habitat Studies".
results:
- In the "Journal metadata" column, in the "Publisher" tile, the update request link is displayed.
- step: Click the "Click here to submit an update" link.
results:
- A right-hand drawer opens displaying a login form.
- step: Log in as "Celestial Frontier Press" using the credentials provided on the testdrive page.
results:
- You are redirected to the "My journals" section of the Publisher Dashboard.
- A message is displayed at the top of the page "You are not the owner of a journal you're trying to access.
Here are the journals associated with your account."
71 changes: 71 additions & 0 deletions doajtest/testdrive/ur_nudge.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
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
from portality.core import app

class UrNudge(TestDrive):
def setup(self) -> dict:
random_id = self.create_random_str()


un = "CelestialFrontierPress_" + random_id
pw = self.create_random_str()
acc = models.Account.make_account("cfp@example.com", un, un, [constants.ROLE_PUBLISHER, constants.ROLE_API])
acc.set_password(pw)
acc.generate_api_key()
acc.save()

un1 = "DeepOrbitAcademicPress_" + random_id
pw1 = self.create_random_str()
acc1 = models.Account.make_account("doap@example.com", un1, un1, [constants.ROLE_PUBLISHER, constants.ROLE_API])
acc1.set_password(pw1)
acc1.save()

source = JournalFixtureFactory.make_journal_source(in_doaj=True)
j = models.Journal(**source)
j.remove_current_application()
j.set_id(j.makeid())
j.set_owner(acc.id)
j.bibjson().title = "Journal of Exoplanetary Biosignatures " + random_id
del j.bibjson().discontinued_date
del j.bibjson().is_replaced_by
del j.bibjson().replaces
j.bibjson().eissn = self.generate_unique_issn()
j.bibjson().pissn = self.generate_unique_issn()
j.save()

source = JournalFixtureFactory.make_journal_source(in_doaj=True)
j1 = models.Journal(**source)
j1.remove_current_application()
j1.bibjson().title = "Annals of Stellar Habitat Studies " + random_id
del j1.bibjson().discontinued_date
del j1.bibjson().is_replaced_by
del j1.bibjson().replaces
j1.set_id(j.makeid())
j1.set_owner(acc1.id)
j1.bibjson().eissn = self.generate_unique_issn()
j1.bibjson().pissn = self.generate_unique_issn()
j1.save()

return {
"accounts": {
"username": acc.id,
"password": pw
},
"journals": {j.bibjson().title: app.config.get("BASE_URL") + "/toc/" + j.bibjson().eissn,
j1.bibjson().title: app.config.get("BASE_URL") + "/toc/" + j1.bibjson().eissn},
"non_renderable": {
"accounts": [acc.id, acc1.id],
"journals": [j.id, j1.id],
}
}

def teardown(self, params) -> dict:
ids = params["non_renderable"]
for aid in ids["accounts"]:
models.Account.remove_by_id(aid)
for jid in ids["journals"]:
models.Journal.remove_by_id(jid)
return {"status": "success"}
4 changes: 2 additions & 2 deletions portality/static/js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,11 @@ ${status}</a></li>`;
if (historicalNumbers) {
statisticsFrag += `<section>`;

if (current_user.role.includes("admin") || historicalNumbers.associate_editors.length > 0) {
if (doaj.current_user.role.includes("admin") || historicalNumbers.associate_editors.length > 0) {
statisticsFrag += `<h3>Statistics for the current year (${historicalNumbers.year})</h3>`;
}

if (current_user.role.includes("admin")) {
if (doaj.current_user.role.includes("admin")) {
// Ready applications by editor
statisticsFrag += `<h4 class="label label--secondary">Editor's <span class="label status status--ready" style="padding: .5em; display: unset;">Ready</span> Applications: `;
statisticsFrag += `<span class="label tag" style="margin-left: .5em;">${historicalNumbers.editor.id}</span> <span class="tag tag--tertiary">${historicalNumbers.editor.count}</span></h4>`;
Expand Down
8 changes: 4 additions & 4 deletions portality/static/js/doaj.fieldrender.edges.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ $.extend(true, doaj, {
must: [
es.newTermFilter({
field: "index.flag_assignees.exact",
value: doaj.session.currentUserId
value: doaj.current_user.id
})
]
}
Expand Down Expand Up @@ -707,7 +707,7 @@ $.extend(true, doaj, {
facetOptions += `<option value="${facetExport.component_id}">${display}</option>`;
}

let exportNotes = current_user && current_user.role.includes("ultra_admin_reports_with_notes")
let exportNotes = doaj.current_user && doaj.current_user.role.includes("ultra_admin_reports_with_notes")
let notesFrag = "";
if (exportNotes) {
notesFrag = `<div class="checkbox">
Expand Down Expand Up @@ -765,7 +765,7 @@ $.extend(true, doaj, {
let name = this.context.find(nameSelector).val();

let notes = false;
let exportNotes = current_user && current_user.role.includes("ultra_admin_reports_with_notes")
let exportNotes = doaj.current_user && doaj.current_user.role.includes("ultra_admin_reports_with_notes")
if (exportNotes) {
let includeNotesSelector = edges.css_class_selector(this.namespace, "notes", this);
notes = this.context.find(includeNotesSelector).is(":checked");
Expand Down Expand Up @@ -5390,7 +5390,7 @@ $.extend(true, doaj, {
if (resultobj.index.is_flagged || s2o) {
field += '<div class="badges badges--search-result badges--search-result--maned flex-start">'
if (resultobj.index.is_flagged) {
if (resultobj.index.flag_assignees.includes(doaj.session.currentUserId)) {
if (resultobj.index.flag_assignees.includes(doaj.current_user.id)) {
field += doaj.fieldRender.fragment.fullFlagHTML;
} else {
field += doaj.fieldRender.fragment.emptyFlagHTML;
Expand Down
4 changes: 2 additions & 2 deletions portality/static/js/formulaic.js
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@ var formulaic = {
let flagDetailsText_deadline = "";

if ($assigneeInput.is(":disabled")) {
if ($assigneeInput.val() === doaj.session.currentUserId) {
if ($assigneeInput.val() === doaj.current_user.id) {
flagDetailsText += this.fullFlagHTML();
}
else {
Expand Down Expand Up @@ -1041,7 +1041,7 @@ var formulaic = {
if ($(".flag").length > 0) {
$(".flag").remove();
}
if ($assigneeInput.val() === doaj.session.currentUserId) {
if ($assigneeInput.val() === doaj.current_user.id) {
if ($(".flag").length > 0) {
$(".flag").remove();
}
Expand Down
Loading
Loading