Skip to content

Commit

Permalink
Merge branch 'ror-registry-data-cache' of https://github.com/GaziYuce…
Browse files Browse the repository at this point in the history
…l/ojs into ror-registry-data-cache
  • Loading branch information
GaziYucel committed Oct 4, 2024
2 parents bcae78b + adfbb27 commit bb10561
Show file tree
Hide file tree
Showing 27 changed files with 742 additions and 257 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ jobs:
fail-fast: false
matrix:
include:
- php-version: 8.1
- php-version: 8.2
validate: 'validate'
database: pgsql
test: 'test'
SAVE_BUILD: 'save_build'
- php-version: 8.1
- php-version: 8.2
validate: 'validate'
database: mariadb
test: 'test'
SAVE_BUILD: 'save_build'
- php-version: 8.1
- php-version: 8.2
validate: 'validate'
database: mysql
test: 'test'
Expand Down
19 changes: 19 additions & 0 deletions api/v1/emails/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/**
* @defgroup api_v1_emails Email API requests
*/

/**
* @file api/v1/emails/index.php
*
* Copyright (c) 2023 Simon Fraser University
* Copyright (c) 2023 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @ingroup api_v1_emails
*
* @brief Handle requests for emails API functions.
*
*/
return new \PKP\handler\APIHandler(new \PKP\API\v1\emails\PKPEmailController());
2 changes: 1 addition & 1 deletion classes/components/forms/publication/IssueEntryForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function __construct($action, $locales, $publication, $publicationContext
'label' => __('issue.issue'),
'options' => $issueOptions,
'publicationStatus' => $publication->getData('status'),
'value' => $publication->getData('issueId') ? $publication->getData('issueId') : 0,
'value' => $publication->getData('issueId') ? $publication->getData('issueId') : '',
]))
->addField(new FieldSelect('sectionId', [
'label' => __('section.section'),
Expand Down
2 changes: 1 addition & 1 deletion config.TEMPLATE.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -618,5 +618,5 @@

[features]

enable_new_submission_listing = Off
enable_new_submission_listing = On

6 changes: 3 additions & 3 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
*/

import Api from '../../lib/pkp/cypress/support/api.js';
import '../../lib/pkp/cypress/support/commands';
import '../../lib/pkp/cypress/support/commands_new_workflow';

Cypress.Commands.add('publish', (issueId, issueTitle) => {
cy.get('button[id="publication-button"]').click();
cy.get('div#publication button:contains("Schedule For Publication")').click();
cy.openWorkflowMenu('Title & Abstract')
cy.get('button:contains("Schedule For Publication")').click();
cy.wait(1000);
cy.get('select[id="assignToIssue-issueId-control"]').select(issueId);
cy.get('div[id^="assign-"] button:contains("Save")').click();
Expand Down
196 changes: 103 additions & 93 deletions cypress/tests/data/60-content/AmwandengaSubmission.cy.js

Large diffs are not rendered by default.

19 changes: 12 additions & 7 deletions cypress/tests/data/60-content/CcorinoSubmission.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,29 +57,34 @@ describe('Data suite: Ccorino', function() {
cy.recordDecisionSendToReview('Send for Review', submission.authorNames, [submission.title]);
cy.assignParticipant('Section editor', 'Minoti Inoue', true);

cy.get('#publication-button').click();
cy.get('#metadata-button').click();
cy.openWorkflowMenu('Title & Abstract')
cy.openWorkflowMenu('Metadata')
cy.get('#metadata-keywords-control-en').type('pr', {delay: 0});
cy.wait(500);
cy.get('li').contains('Professional Development').click({force: true});
cy.get('#metadata-keywords-control-en').type('socia', {delay: 0});
cy.contains('Social Transformation');
cy.get('#metadata-keywords-control-en').type('l{downArrow}{enter}', {delay: 50});
cy.get('#metadata button').contains('Save').click();
cy.get('#metadata [role="status"]').contains('Saved');
cy.get('button').contains('Save').click();
cy.get('[role="status"]').contains('Saved');
cy.get('#metadata-keywords-selected-en').contains('Professional Development');
cy.get('#metadata-keywords-selected-en').contains('Social Transformation');
});

it('Logins as a section editor and recommends accept', function() {
cy.login('minoue');
cy.visit('/index.php/publicknowledge/submissions');
cy.get('a').contains('View ' + familyName).click({force: true});
cy.visit('/index.php/publicknowledge/dashboard/editorial');
cy.openSubmission(familyName);
cy.clickDecision('Recommend Accept');
cy.recordRecommendation('Recommend Accept', ['Daniel Barnes', 'David Buskins', 'Stephanie Berardo']);

cy.logout();
cy.findSubmissionAsEditor('dbarnes', null, familyName);
cy.get('div.pkp_workflow_recommendations:contains("Recommendations: Accept Submission")');
cy.get('[data-cy="workflow-secondary-items"] h2').contains("Recommendation");
// FIX ME correct label should come with
//cy.get('[data-cy="workflow-actions"] p').contains("Accept Submission");
cy.get('[data-cy="workflow-secondary-items"] p').contains("Recommend Accept");


});
})
2 changes: 1 addition & 1 deletion cypress/tests/data/60-content/LkumiegaSubmission.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('Data suite tests', function() {
cy.performReview('agallego', null, 'Hydrologic Connectivity', 'Resubmit for Review');
cy.findSubmissionAsEditor('dbarnes', null, 'Kumiega');
cy.clickDecision('Request Revisions');
cy.get('label:contains("Revisions will not be subject to a new round of peer reviews.")').find('input').check();
cy.get('label:contains("Revisions will not be subject to a new round of peer reviews.")').find('input').check({force: true});
cy.get('button').contains('Next').click();
cy.waitJQuery();
cy.recordDecisionRevisions('Request Revisions', submission.authors, [
Expand Down
94 changes: 48 additions & 46 deletions cypress/tests/data/60-content/VkarbasizaedSubmission.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@ describe('Data suite tests', function() {
cy.assignParticipant('Proofreader', 'Catherine Turner');

// Create a galley
cy.get('button#publication-button').click();
cy.get('button#galleys-button').click();
cy.get('a[id^="component-grid-articlegalleys-articlegalleygrid-addGalley-button-"]').click();
cy.openWorkflowMenu('Galleys')
cy.get('[data-cy="galley-manager"] button').contains('Add galley').click();
cy.wait(1000); // Wait for the form to settle
cy.get('input[id^=label-]').type('PDF', {delay: 0});
cy.get('form#articleGalleyForm button:contains("Save")').click();
Expand All @@ -93,11 +92,11 @@ describe('Data suite tests', function() {
it('Schedule for publication', function() {
cy.login('dbarnes');
// schedule for the publication in the future issue
cy.visit('index.php/publicknowledge/submissions');
cy.get('button[id="active-button"]').click();
cy.get('#active .listPanel__itemTitle:contains("' + author.familyName + '")').parent().next().contains('a', 'View').click();
cy.get('button[id="publication-button"]').click();
cy.get('#publication button:contains("Schedule For Publication")').click();
cy.visit('index.php/publicknowledge/dashboard/editorial');
cy.get('nav').contains('Active submissions').click();
cy.openSubmission(author.familyName);
cy.openWorkflowMenu('Title & Abstract')
cy.get('button:contains("Schedule For Publication")').click();
cy.get('select[id="assignToIssue-issueId-control"]').select(issueTitle);
cy.get('div[id^="assign-"] button:contains("Save")').click();
cy.get('div:contains("All publication requirements have been met. This will be published when ' + issueTitle + ' is published. Are you sure you want to schedule this for publication?")');
Expand All @@ -106,14 +105,14 @@ describe('Data suite tests', function() {
// check status = 5 (scheduled)
cy.wait(1000); // to be able to get the header
// check submission status
cy.get('.pkpWorkflow__header:contains("Scheduled")');
cy.get('[data-cy="sidemodal-header"]').contains("Scheduled For Publication");
// check publication status
cy.get('.pkpPublication__header:contains("Scheduled")');
cy.get('[data-cy="workflow-controls-left"]').contains("Scheduled");
// the button "Unschedule" exists
// the buttons "Create New Version" (connected with submission) and "Unpublish" (connected with publication) does not exist
cy.get('#publication button:contains("Unschedule")');
cy.get('#publication button:contains("Create New Version")').should('not.exist');
cy.get('#publication button:contains("Unpublish")').should('not.exist');
cy.get('button:contains("Unschedule")');
cy.get('button:contains("Create New Version")').should('not.exist');
cy.get('button:contains("Unpublish")').should('not.exist');

// isInTOC:
cy.visit('index.php/publicknowledge/manageIssues#future');
Expand All @@ -129,18 +128,18 @@ describe('Data suite tests', function() {
cy.get('input[id="sendIssueNotification"]').click();
cy.get('button[id^=submitFormButton]').click();
// check status = 3 (published)
cy.visit('index.php/publicknowledge/submissions');
cy.get('button[id="archive-button"]').click();
cy.get('#archive .listPanel__itemTitle:contains("' + author.familyName + '")').parent().next().contains('a', 'View').click();
cy.visit('index.php/publicknowledge/dashboard/editorial');
cy.get('nav').contains('Published').click();
cy.openSubmission(author.familyName);
// check submission status
cy.get('.pkpWorkflow__header:contains("Published")');
cy.get('[data-cy="sidemodal-header"]').contains("Published");
// check publication status
cy.get('.pkpPublication__header:contains("Published")');
cy.get('[data-cy="workflow-controls-left"]').contains("Published");
cy.contains('This version has been published and can not be edited.');
// the button "Unpublish" (connected with the publication)
// and the button "Create New Version" (connected with submission) exist
cy.get('#publication button:contains("Unpublish")');
cy.get('#publication button:contains("Create New Version")');
cy.get('button:contains("Unpublish")');
cy.get('button:contains("Create New Version")');
});

it('Unpublish the issue', function() {
Expand All @@ -151,18 +150,19 @@ describe('Data suite tests', function() {
cy.get('tr:contains("' + issueTitle + '")').next().contains('a', 'Unpublish Issue').click();
cy.get('button:contains("OK")').click();
// check status = 5 (scheduled)
cy.visit('index.php/publicknowledge/submissions');
cy.get('button[id="archive-button"]').click();
cy.get('#archive .listPanel__itemTitle:contains("' + author.familyName + '")').parent().next().contains('a', 'View').click();
cy.visit('index.php/publicknowledge/dashboard/editorial');
cy.get('nav').contains('Scheduled for publication').click();
cy.openSubmission(author.familyName);

// check submission status
cy.get('.pkpWorkflow__header:contains("Scheduled")');
cy.get('[data-cy="sidemodal-header"]').contains("Scheduled");
// check publication status
cy.get('.pkpPublication__header:contains("Scheduled")');
cy.get('[data-cy="workflow-controls-left"]').contains("Scheduled");
// the button "Unschedule" exists
// the buttons "Create New Version" (connected with submission) and "Unpublish" (connected with publication) does not exist
cy.get('#publication button:contains("Unschedule")');
cy.get('#publication button:contains("Create New Version")').should('not.exist');
cy.get('#publication button:contains("Unpublish")').should('not.exist');
cy.get('button:contains("Unschedule")');
cy.get('button:contains("Create New Version")').should('not.exist');
cy.get('button:contains("Unpublish")').should('not.exist');
});

it('Republish the issue', function() {
Expand All @@ -173,18 +173,18 @@ describe('Data suite tests', function() {
cy.get('input[id="sendIssueNotification"]').click();
cy.get('button[id^=submitFormButton]').click();
// check status = 3
cy.visit('index.php/publicknowledge/submissions');
cy.get('button[id="archive-button"]').click();
cy.get('#archive .listPanel__itemTitle:contains("' + author.familyName + '")').parent().next().contains('a', 'View').click();
cy.visit('index.php/publicknowledge/dashboard/editorial');
cy.get('nav').contains('Published').click();
cy.openSubmission(author.familyName);
// check submission status
cy.get('.pkpWorkflow__header:contains("Published")');
cy.get('[data-cy="sidemodal-header"]').contains("Published");
// check publication status
cy.get('.pkpPublication__header:contains("Published")');
cy.get('[data-cy="workflow-controls-left"]').contains("Published");
cy.contains('This version has been published and can not be edited.');
// the button "Unpublish" (connected with the publication)
// and the button "Create New Version" (connected with submission) exist
cy.get('#publication button:contains("Unpublish")');
cy.get('#publication button:contains("Create New Version")');
cy.get('button:contains("Unpublish")');
cy.get('button:contains("Create New Version")');
});

it('Remove submission from TOC', function() {
Expand All @@ -199,28 +199,30 @@ describe('Data suite tests', function() {
cy.get('button:contains("OK")').click();
cy.get('span:contains("' + submission.title + '")').should('not.exist');
// check status = 1
cy.visit('index.php/publicknowledge/submissions');
cy.get('button[id="active-button"]').click();
cy.get('#active .listPanel__itemTitle:contains("' + author.familyName + '")').parent().next().contains('a', 'View').click();
cy.visit('index.php/publicknowledge/dashboard/editorial');
cy.get('nav').contains('Active submissions').click();
cy.openSubmission(author.familyName);
// check submission status
cy.get('span').should('not.have.class', 'pkpWorkflow__identificationStatus');
cy.get('[data-cy="sidemodal-header"]').contains("Production");
// check publication status
cy.get('.pkpPublication__header:contains("Unscheduled")');
cy.openWorkflowMenu('Title & Abstract')
cy.get('[data-cy="workflow-controls-left"]').contains("Unscheduled");
// the button "Schedule For Publication" exists
cy.get('#publication button:contains("Schedule For Publication")');
cy.get('button:contains("Schedule For Publication")');
});

it('Return back to the original state', function() {
cy.login('dbarnes');
// Publish in current issue
cy.visit('index.php/publicknowledge/submissions');
cy.get('button[id="active-button"]').click();
cy.get('#active .listPanel__itemTitle:contains("' + author.familyName + '")').parent().next().contains('a', 'View').click();
cy.get('button[id="publication-button"]').click();
cy.get('button[id="issue-button"]').click();
cy.visit('index.php/publicknowledge/dashboard/editorial');
cy.get('nav').contains('Active submissions').click();
cy.openSubmission(author.familyName);
cy.openWorkflowMenu('Issue')

cy.get('button:contains("Change Issue")').click();
cy.get('select[id="assignToIssue-issueId-control"]').select('Vol. 1 No. 2 (2014)');
cy.get('div[id^="assign-"] button:contains("Save")').click();
cy.get('button').contains('Schedule For Publication').click();
cy.get('div[id^="publish-"] button:contains("Publish")').click();
cy.isInIssue('Antimicrobial, heavy metal resistance', 'Vol. 1 No. 2 (2014)');
// unpublish the future issue
Expand Down
77 changes: 77 additions & 0 deletions cypress/tests/integration/ChangeSubmissionLanguage.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/**
* @file cypress/tests/integration/ChangeSubmissionLanguage.cy.js
*
* Copyright (c) 2024 Simon Fraser University
* Copyright (c) 2024 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*/

// FIX ME Temporarly disabled until the change language logic is moved legacy workflow page
describe.skip('Change Submission Language', function() {
let user;
let author;
let password;
let originalLanguage;
let originalLocaleKey;
let newLanguage;
let newLocaleKey;
let title;
let abstract;

before(function() {
user = 'dbarnes';
password = user + user;
author = {
familyName: 'Karbasizaed',
}
originalLanguage = 'English';
originalLocaleKey = 'en';
newLanguage = 'French (Canada)';
newLocaleKey = 'fr_CA';
title = {
[newLocaleKey]: "Résistance aux antimicrobiens et aux métaux lourds et profil plasmidique des coliformes isolés d'infections nosocomiales dans un hôpital d'Ispahan, Iran",
};
abstract = {
[newLocaleKey]: "Les profils de résistance aux antimicrobiens et aux métaux lourds ainsi que les profils plasmidiques des coliformes (Enterobacteriacea) isolés d'infections nosocomiales et de matières fécales humaines saines ont été comparés. Quinze des 25 isolats provenant d'infections nosocomiales ont été identifiés comme étant des Escherichia coli, et les autres comme étant des Kelebsiella pneumoniae. Soixante-douze pour cent des souches isolées d'infections nosocomiales possèdent une résistance multiple aux antibiotiques, contre 45 % des souches provenant de matières fécales humaines saines. La différence entre les valeurs de concentration minimale inhibitrice (CMI) des souches provenant de cas cliniques et de matières fécales pour quatre métaux lourds (Hg, Cu, Pb, Cd) n'était pas significative. Cependant, la plupart des souches isolées à l'hôpital étaient plus tolérantes aux métaux lourds que celles provenant de personnes en bonne santé. Il n'y avait pas de relation cohérente entre le groupe de profil plasmidique et le profil de résistance aux antimicrobiens, bien qu'un plasmide conjugatif (>56,4 kb) codant pour la résistance aux métaux lourds et aux antibiotiques ait été récupéré chez huit des souches isolées d'infections nosocomiales. Les résultats indiquent que les coliformes multirésistants sont une cause potentielle d'infection nosocomiale dans cette région.",
};
});

it('Try to change submission language after publication', function() {
cy.login(user, password, 'publicknowledge');
cy.get('nav').contains('Active submissions').click();
cy.openSubmission()
cy.contains('View ' + author.familyName).click({force: true});
cy.get(`.pkpPublication__changeSubmissionLanguage > button`).should('not.exist');
});

it('Change submission language', function() {
cy.login(user, password, 'publicknowledge');
cy.get('button[id="archive-button"]').click();
cy.contains('View ' + author.familyName).click({force: true});
// Unpublish
cy.get('button[id="publication-button"]').click();
cy.get('#publication button:contains("Unpublish")').click();
cy.get('#headlessui-dialog-panel-5 button:contains("Unpublish")').click();
// Change language
cy.get(`.pkpPublication__changeSubmissionLanguage > button`).should('be.enabled').click();
cy.get('#changeSubmissionLanguage').find(`input[value="${newLocaleKey}"]`).click();
cy.setTinyMceContent('changeSubmissionLanguageMetadata-title-control', title[newLocaleKey]);
cy.setTinyMceContent('changeSubmissionLanguageMetadata-abstract-control', abstract[newLocaleKey]);
cy.get('#changeSubmissionLanguage button[label="Confirm"]').click();
cy.get(`.pkpPublication__changeSubmissionLanguage > span`).contains(`Current Submission Language: ${newLanguage}`);
});

it('Change submission language back to the original', function() {
cy.findSubmissionAsEditor(user, password, author.familyName);
// Change language
cy.get('button[id="publication-button"]').click();
cy.get(`.pkpPublication__changeSubmissionLanguage > button`).click();
cy.get('#changeSubmissionLanguage').find(`input[value="${originalLocaleKey}"]`).click();
cy.get('#changeSubmissionLanguage button[label="Confirm"]').click();
// Publish
cy.get(`.pkpPublication__changeSubmissionLanguage > span`).contains(`Current Submission Language: ${originalLanguage}`);
cy.get('button[id="publication-button"]').click();
cy.get('div#publication button:contains("Schedule For Publication")').click();
cy.get('div.pkpWorkflow__publishModal button:contains("Publish")').click();
});
});
4 changes: 2 additions & 2 deletions cypress/tests/integration/Discussions.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
cy.get('textarea[name="comment"]').then(node => {
cy.setTinyMceContent(node.attr('id'), message);
});
cy.contains('button', 'Close').click();
cy.contains('[data-cy="active-modal"] button', 'Close').click();
cy.on('window:confirm', () => true);
cy.reload();
cy.get(discussionGrid);
Expand All @@ -32,7 +32,7 @@
cy.get('textarea[name="comment"]').then(node => {
cy.setTinyMceContent(node.attr('id'), message);
});
cy.contains('button', 'Close').click();
cy.contains('[data-cy="active-modal"] button', 'Close').click();
cy.on('window:confirm', () => false);
cy.get('#queryForm button:contains("OK")').click();
cy.get(discussionGrid + ' a:contains("' + discussion + '")');
Expand Down
Loading

0 comments on commit bb10561

Please sign in to comment.