From fb77e5f2ef26f9bab62917cd532568e3cd07948b Mon Sep 17 00:00:00 2001 From: Jhon Date: Fri, 26 Jan 2024 15:09:09 -0400 Subject: [PATCH 01/24] Remove '.inc' from php files and updates copyright year Issue: documentacao-e-tarefas/scielo#629 Signed-off-by: Jhon Signed-off-by: iudi --- README.md | 7 +++---- ...nc.php => ScieloModerationStagesPlugin.php | 4 ++-- ...ationStage.inc.php => ModerationStage.php} | 0 ...tageDAO.inc.php => ModerationStageDAO.php} | 0 ...er.inc.php => ModerationStageRegister.php} | 0 ....php => ScieloModerationStagesHandler.php} | 0 index.php | 21 ------------------- locale/{en_US => en}/locale.po | 0 locale/{es_ES => es}/locale.po | 0 version.xml | 4 ++-- 10 files changed, 7 insertions(+), 29 deletions(-) rename ScieloModerationStagesPlugin.inc.php => ScieloModerationStagesPlugin.php (99%) rename classes/{ModerationStage.inc.php => ModerationStage.php} (100%) rename classes/{ModerationStageDAO.inc.php => ModerationStageDAO.php} (100%) rename classes/{ModerationStageRegister.inc.php => ModerationStageRegister.php} (100%) rename controllers/{ScieloModerationStagesHandler.inc.php => ScieloModerationStagesHandler.php} (100%) delete mode 100644 index.php rename locale/{en_US => en}/locale.po (100%) rename locale/{es_ES => es}/locale.po (100%) diff --git a/README.md b/README.md index 853a8eb..ec2e2c0 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,7 @@ This plugin adds stages of moderation to OPS, giving moderators the possibility The latest release of this plugin is compatible with the following PKP applications: -* OPS 3.3.0 - +* OPS 3.4.0 ## Plugin Download @@ -24,6 +23,6 @@ To download the plugin, go to the [Releases page](https://github.com/lepidus/sci # License __This plugin is licensed under the GNU General Public License v3.0__ -__Copyright (c) 2022 Lepidus Tecnologia__ +__Copyright (c) 2022 - 2024 Lepidus Tecnologia__ -__Copyright (c) 2022 SciELO__ +__Copyright (c) 2022 - 2024 SciELO__ diff --git a/ScieloModerationStagesPlugin.inc.php b/ScieloModerationStagesPlugin.php similarity index 99% rename from ScieloModerationStagesPlugin.inc.php rename to ScieloModerationStagesPlugin.php index 9f8bd19..07e6b28 100644 --- a/ScieloModerationStagesPlugin.inc.php +++ b/ScieloModerationStagesPlugin.php @@ -3,8 +3,8 @@ /** * @file plugins/reports/scieloModerationStages/ScieloModerationStagesPlugin.inc.php * - * Copyright (c) 2022 Lepidus Tecnologia - * Copyright (c) 2022 SciELO + * Copyright (c) 2022 - 2024 Lepidus Tecnologia + * Copyright (c) 2022 - 2024 SciELO * Distributed under the GNU GPL v3. For full terms see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt. * * @class ScieloModerationStagesPlugin diff --git a/classes/ModerationStage.inc.php b/classes/ModerationStage.php similarity index 100% rename from classes/ModerationStage.inc.php rename to classes/ModerationStage.php diff --git a/classes/ModerationStageDAO.inc.php b/classes/ModerationStageDAO.php similarity index 100% rename from classes/ModerationStageDAO.inc.php rename to classes/ModerationStageDAO.php diff --git a/classes/ModerationStageRegister.inc.php b/classes/ModerationStageRegister.php similarity index 100% rename from classes/ModerationStageRegister.inc.php rename to classes/ModerationStageRegister.php diff --git a/controllers/ScieloModerationStagesHandler.inc.php b/controllers/ScieloModerationStagesHandler.php similarity index 100% rename from controllers/ScieloModerationStagesHandler.inc.php rename to controllers/ScieloModerationStagesHandler.php diff --git a/index.php b/index.php deleted file mode 100644 index fca7cd4..0000000 --- a/index.php +++ /dev/null @@ -1,21 +0,0 @@ - From 03d07e58666d925f8d90027e29cb81152aa01d05 Mon Sep 17 00:00:00 2001 From: Jhon Date: Fri, 26 Jan 2024 15:25:41 -0400 Subject: [PATCH 02/24] Adapts moderation stage's class Issue: documentacao-e-tarefas/scielo#629 Signed-off-by: Jhon Signed-off-by: iudi --- .gitlab-ci.yml | 2 +- classes/ModerationStage.php | 33 +++++++++++++++++++-------------- tests/ModerationStageTest.php | 20 +++++++++----------- 3 files changed, 29 insertions(+), 26 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index be836c6..400c201 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,4 +6,4 @@ include: ref: main file: - 'templates/groups/pkp_plugin.yml' - - 'templates/groups/ops_plugins_unit_tests_model.yml' + - 'templates/groups/ops_3_4_plugins_unit_tests_model.yml' diff --git a/classes/ModerationStage.php b/classes/ModerationStage.php index 7e6df93..4853cae 100644 --- a/classes/ModerationStage.php +++ b/classes/ModerationStage.php @@ -1,11 +1,16 @@ 'plugins.generic.scieloModerationStages.stages.formatStage', - SCIELO_MODERATION_STAGE_CONTENT => 'plugins.generic.scieloModerationStages.stages.contentStage', - SCIELO_MODERATION_STAGE_AREA => 'plugins.generic.scieloModerationStages.stages.areaStage', + self::SCIELO_MODERATION_STAGE_FORMAT => 'plugins.generic.scieloModerationStages.stages.formatStage', + self::SCIELO_MODERATION_STAGE_CONTENT => 'plugins.generic.scieloModerationStages.stages.contentStage', + self::SCIELO_MODERATION_STAGE_AREA => 'plugins.generic.scieloModerationStages.stages.areaStage', ]; return __($stageMap[$stage]); @@ -27,8 +32,8 @@ private function getModerationStageName($stage) private function getNextModerationStage($stage) { $nextStageMap = [ - SCIELO_MODERATION_STAGE_FORMAT => SCIELO_MODERATION_STAGE_CONTENT, - SCIELO_MODERATION_STAGE_CONTENT => SCIELO_MODERATION_STAGE_AREA, + self::SCIELO_MODERATION_STAGE_FORMAT => self::SCIELO_MODERATION_STAGE_CONTENT, + self::SCIELO_MODERATION_STAGE_CONTENT => self::SCIELO_MODERATION_STAGE_AREA, ]; return $nextStageMap[$stage]; @@ -37,9 +42,9 @@ private function getNextModerationStage($stage) private function getModerationStageEntryConfig($stage) { $stageMap = [ - SCIELO_MODERATION_STAGE_FORMAT => 'formatStageEntryDate', - SCIELO_MODERATION_STAGE_CONTENT => 'contentStageEntryDate', - SCIELO_MODERATION_STAGE_AREA => 'areaStageEntryDate', + self::SCIELO_MODERATION_STAGE_FORMAT => 'formatStageEntryDate', + self::SCIELO_MODERATION_STAGE_CONTENT => 'contentStageEntryDate', + self::SCIELO_MODERATION_STAGE_AREA => 'areaStageEntryDate', ]; return $stageMap[$stage]; @@ -81,12 +86,12 @@ public function getNextStageName(): string public function canAdvanceStage(): bool { - if ($this->submission->getData('status') == STATUS_DECLINED || $this->submission->getData('status') == STATUS_PUBLISHED) { + if ($this->submission->getData('status') == Submission::STATUS_DECLINED || $this->submission->getData('status') == Submission::STATUS_PUBLISHED) { return false; } $currentStage = $this->submission->getData('currentModerationStage'); - if (is_null($currentStage) || $currentStage == SCIELO_MODERATION_STAGE_AREA) { + if (is_null($currentStage) || $currentStage == self::SCIELO_MODERATION_STAGE_AREA) { return false; } @@ -100,7 +105,7 @@ public function submissionStageExists(): bool public function setToFirstStage() { - $this->setSubmissionToStage(SCIELO_MODERATION_STAGE_FORMAT); + $this->setSubmissionToStage(self::SCIELO_MODERATION_STAGE_FORMAT); } public function sendNextStage() diff --git a/tests/ModerationStageTest.php b/tests/ModerationStageTest.php index 811c214..5787ff2 100644 --- a/tests/ModerationStageTest.php +++ b/tests/ModerationStageTest.php @@ -1,26 +1,25 @@ submission = $this->createSubmission(); $this->moderationStage = new ModerationStage($this->submission); } - private function createSubmission() + private function createSubmission(): Submission { $submission = new Submission(); - $submission->setData('currentModerationStage', SCIELO_MODERATION_STAGE_FORMAT); + $submission->setData('currentModerationStage', ModerationStage::SCIELO_MODERATION_STAGE_FORMAT); return $submission; } @@ -30,7 +29,6 @@ public function testGetCurrentStageName(): void $this->assertEquals($expectedStageName, $this->moderationStage->getCurrentStageName()); } - public function testGetNextStageName(): void { $expectedStageName = __('plugins.generic.scieloModerationStages.stages.contentStage'); @@ -49,7 +47,7 @@ public function testSubmissionDataNextStage(): void { $this->moderationStage->sendNextStage(); - $this->assertEquals(SCIELO_MODERATION_STAGE_CONTENT, $this->submission->getData('currentModerationStage')); + $this->assertEquals(ModerationStage::SCIELO_MODERATION_STAGE_CONTENT, $this->submission->getData('currentModerationStage')); $this->assertEquals(Core::getCurrentDate(), $this->submission->getData('lastModerationStageChange')); $this->assertEquals(Core::getCurrentDate(), $this->submission->getData('contentStageEntryDate')); } @@ -66,21 +64,21 @@ public function testPutOnFirstStage(): void public function testRejectedSubmissionCantAdvanceStage(): void { - $this->submission->setData('status', STATUS_DECLINED); + $this->submission->setData('status', Submission::STATUS_DECLINED); $moderationStage = new ModerationStage($this->submission); $this->assertFalse($moderationStage->canAdvanceStage()); } public function testPostedSubmissionCantAdvanceStage(): void { - $this->submission->setData('status', STATUS_PUBLISHED); + $this->submission->setData('status', Submission::STATUS_PUBLISHED); $moderationStage = new ModerationStage($this->submission); $this->assertFalse($moderationStage->canAdvanceStage()); } public function testSubmissionOnLastStageCantAdvance(): void { - $this->submission->setData('currentModerationStage', SCIELO_MODERATION_STAGE_AREA); + $this->submission->setData('currentModerationStage', ModerationStage::SCIELO_MODERATION_STAGE_AREA); $moderationStage = new ModerationStage($this->submission); $this->assertFalse($moderationStage->canAdvanceStage()); } From f649351c718b1da390ad3fca1971a537e7c22295 Mon Sep 17 00:00:00 2001 From: Jhon Date: Fri, 26 Jan 2024 15:33:48 -0400 Subject: [PATCH 03/24] Does first adaptation changes in plugin's main class Issue: documentacao-e-tarefas/scielo#629 Signed-off-by: Jhon Signed-off-by: Iudi --- ScieloModerationStagesPlugin.php | 37 +++++++++++++++++--------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/ScieloModerationStagesPlugin.php b/ScieloModerationStagesPlugin.php index 07e6b28..44cd43b 100644 --- a/ScieloModerationStagesPlugin.php +++ b/ScieloModerationStagesPlugin.php @@ -13,34 +13,37 @@ * @brief SciELO Moderation Stages Plugin */ -import('lib.pkp.classes.plugins.GenericPlugin'); -import('plugins.generic.scieloModerationStages.classes.ModerationStage'); -import('plugins.generic.scieloModerationStages.classes.ModerationStageRegister'); - -define('SCIELO_BRASIL_EMAIL', 'scielo.submission@scielo.org'); +use PKP\plugins\GenericPlugin; +use PKP\plugins\Hook; +use APP\core\Application; +use APP\template\TemplateManager; +use APP\plugins\generic\scieloModerationStages\classes\ModerationStage; +use APP\plugins\generic\scieloModerationStages\classes\ModerationStageRegister; class ScieloModerationStagesPlugin extends GenericPlugin { + private const SCIELO_BRASIL_EMAIL = 'scielo.submission@scielo.org'; + public function register($category, $path, $mainContextId = null) { $success = parent::register($category, $path, $mainContextId); - if (!Config::getVar('general', 'installed') || defined('RUNNING_UPGRADE')) { - return true; + if (Application::isUnderMaintenance()) { + return $success; } if ($success && $this->getEnabled($mainContextId)) { - HookRegistry::register('Schema::get::submission', array($this, 'addOurFieldsToSubmissionSchema')); - HookRegistry::register('submissionsubmitstep4form::execute', array($this, 'setSubmissionFirstModerationStage')); - HookRegistry::register('addparticipantform::display', array($this, 'addFieldsAssignForm')); - HookRegistry::register('addparticipantform::execute', array($this, 'sendSubmissionToNextModerationStage')); - HookRegistry::register('queryform::display', array($this, 'hideParticipantsOnDiscussionOpening')); + Hook::add('Schema::get::submission', [$this, 'addOurFieldsToSubmissionSchema']); + Hook::add('submissionsubmitstep4form::execute', [$this, 'setSubmissionFirstModerationStage']); + Hook::add('addparticipantform::display', [$this, 'addFieldsAssignForm']); + Hook::add('addparticipantform::execute', [$this, 'sendSubmissionToNextModerationStage']); + Hook::add('queryform::display', [$this, 'hideParticipantsOnDiscussionOpening']); - HookRegistry::register('Template::Workflow::Publication', array($this, 'addToWorkflowTabs')); - HookRegistry::register('Template::Workflow', array($this, 'addCurrentStageStatus')); - HookRegistry::register('LoadComponentHandler', array($this, 'setupScieloModerationStagesHandler')); + Hook::add('Template::Workflow::Publication', [$this, 'addToWorkflowTabs']); + Hook::add('Template::Workflow', [$this, 'addCurrentStageStatus']); + Hook::add('LoadComponentHandler', [$this, 'setupScieloModerationStagesHandler']); - HookRegistry::register('TemplateManager::display', array($this, 'addJavaScriptAndStylesheet')); + Hook::add('TemplateManager::display', [$this, 'addJavaScriptAndStylesheet']); $this->addHandlerURLToJavaScript(); } @@ -233,7 +236,7 @@ public function getStyleSheet() private function userIsAuthor($submission) { - $currentUser = \Application::get()->getRequest()->getUser(); + $currentUser = Application::get()->getRequest()->getUser(); $currentUserAssignedRoles = array(); if ($currentUser) { $stageAssignmentDao = DAORegistry::getDAO('StageAssignmentDAO'); From 1a92a0a26af2b546bc328f8c06c563e51fe16c7b Mon Sep 17 00:00:00 2001 From: Jhon Date: Fri, 26 Jan 2024 18:19:48 -0400 Subject: [PATCH 04/24] Renames cypress tests and creates new ones Issue: documentacao-e-tarefas/scielo#629 Signed-off-by: Jhon Signed-off-by: Iudi --- cypress/support/commands.js | 64 ++++++++++++++++ cypress/testlist.txt | 20 +++++ cypress/tests/Test0_pluginSetup.cy.js | 13 ++++ .../Test1_moderationStageAdvancement.cy.js | 42 +++++++++++ ...st1_submissionFirstModerationStage.spec.js | 74 ------------------- ... Test2_sentToStageOnUserAssignModal.cy.js} | 0 ...ec.js => Test3_submissionIsRejected.cy.js} | 0 ...spec.js => Test4_submissionIsPosted.cy.js} | 0 ...pec.js => Test5_lastModerationStage.cy.js} | 0 ...enu.spec.js => Test6_stagesViewMenu.cy.js} | 0 ... Test7_currentStageOnSubmissionPage.cy.js} | 0 ... => Test8_pastTimeOnSubmissionsList.cy.js} | 0 ...=> Test9_hideParticipantsDiscussion.cy.js} | 0 13 files changed, 139 insertions(+), 74 deletions(-) create mode 100644 cypress/support/commands.js create mode 100644 cypress/testlist.txt create mode 100644 cypress/tests/Test0_pluginSetup.cy.js create mode 100644 cypress/tests/Test1_moderationStageAdvancement.cy.js delete mode 100644 cypress/tests/Test1_submissionFirstModerationStage.spec.js rename cypress/tests/{Test2_sentToStageOnUserAssignModal.spec.js => Test2_sentToStageOnUserAssignModal.cy.js} (100%) rename cypress/tests/{Test3_submissionIsRejected.spec.js => Test3_submissionIsRejected.cy.js} (100%) rename cypress/tests/{Test4_submissionIsPosted.spec.js => Test4_submissionIsPosted.cy.js} (100%) rename cypress/tests/{Test5_lastModerationStage.spec.js => Test5_lastModerationStage.cy.js} (100%) rename cypress/tests/{Test6_stagesViewMenu.spec.js => Test6_stagesViewMenu.cy.js} (100%) rename cypress/tests/{Test7_currentStageOnSubmissionPage.spec.js => Test7_currentStageOnSubmissionPage.cy.js} (100%) rename cypress/tests/{Test8_pastTimeOnSubmissionsList.spec.js => Test8_pastTimeOnSubmissionsList.cy.js} (100%) rename cypress/tests/{Test9_hideParticipantsDiscussion.spec.js => Test9_hideParticipantsDiscussion.cy.js} (100%) diff --git a/cypress/support/commands.js b/cypress/support/commands.js new file mode 100644 index 0000000..3aa63ce --- /dev/null +++ b/cypress/support/commands.js @@ -0,0 +1,64 @@ +function beginSubmission(submissionData) { + cy.get('input[name="locale"][value="en"]').click(); + cy.setTinyMceContent('startSubmission-title-control', submissionData.title); + cy.get('input[name="submissionRequirements"]').check(); + cy.get('input[name="privacyConsent"]').check(); + + cy.contains('button', 'Begin Submission').click(); +} + +function detailsStep(submissionData) { + cy.setTinyMceContent('titleAbstract-abstract-control-en', submissionData.abstract); + submissionData.keywords.forEach(keyword => { + cy.get('#titleAbstract-keywords-control-en').type(keyword, {delay: 0}); + cy.get('#titleAbstract-keywords-control-en').type('{enter}', {delay: 0}); + }); + + cy.contains('button', 'Continue').click(); +} + +function filesStep(submissionData) { + cy.addSubmissionGalleys(submissionData.files); + cy.contains('button', 'Continue').click(); +} + +function contributorsStep(submissionData) { + submissionData.contributors.forEach(authorData => { + cy.contains('button', 'Add Contributor').click(); + cy.get('input[name="givenName-en"]').type(authorData.given, {delay: 0}); + cy.get('input[name="familyName-en"]').type(authorData.family, {delay: 0}); + cy.get('input[name="email"]').type(authorData.email, {delay: 0}); + cy.get('select[name="country"]').select(authorData.country); + + cy.get('.modal__panel:contains("Add Contributor")').find('button').contains('Save').click(); + cy.waitJQuery(); + }); + + cy.contains('button', 'Continue').click(); +} + +Cypress.Commands.add('createSubmission', function (submissionData) { + cy.get('div#myQueue a:contains("New Submission")').click(); + + beginSubmission(submissionData); + detailsStep(submissionData); + filesStep(submissionData); + contributorsStep(submissionData); + cy.get('input[name="relationStatus"][value="1"]').check(); + cy.contains('button', 'Continue').click(); + cy.contains('button', 'Submit').click(); + cy.get('.modal__panel:visible').within(() => { + cy.contains('button', 'Submit').click(); + }); + + cy.waitJQuery(); + cy.contains('h1', 'Submission complete'); +}); + +Cypress.Commands.add('findSubmission', function(tab, title) { + cy.get('#' + tab + '-button').click(); + cy.get('.listPanel__itemSubtitle:visible:contains("' + title + '")').first() + .parent().parent().within(() => { + cy.get('.pkpButton:contains("View")').click(); + }); +}); \ No newline at end of file diff --git a/cypress/testlist.txt b/cypress/testlist.txt new file mode 100644 index 0000000..60a32ed --- /dev/null +++ b/cypress/testlist.txt @@ -0,0 +1,20 @@ +Avanço de estágio de moderação + Cria uma submissão + Verifica que a submissão foi pro primeiro estágio de moderação + Envia submissão para próximo estágio de moderação pela designação de usuário + Avanço de estágio não aparece quando no último estágio + +Menu dos estágios de moderação + Autor deve poder visualizar estágios + Editor deve poder editar estágios + +Exibidor de estágio de moderação na página de submissões + Verificar vários itens que são exibidos + Autores devem ter acesso apenas a visualização do estágio de moderação + +Opção de enviar submissão para próximo estágio não deve aparecer quando: + Submissão rejeitada + Submissão postada + +Esconder participantes para autores ao abrir discussão + Teste praticamente pronto. Só conferir se está bom. \ No newline at end of file diff --git a/cypress/tests/Test0_pluginSetup.cy.js b/cypress/tests/Test0_pluginSetup.cy.js new file mode 100644 index 0000000..320de16 --- /dev/null +++ b/cypress/tests/Test0_pluginSetup.cy.js @@ -0,0 +1,13 @@ +describe('SciELO Moderation Stages - Plugin setup', function () { + it('Enables SciELO Moderation Stages plugin', function () { + cy.login('dbarnes', null, 'publicknowledge'); + + cy.contains('a', 'Website').click(); + + cy.waitJQuery(); + cy.get('#plugins-button').click(); + + cy.get('input[id^=select-cell-scielomoderationstagesplugin]').check(); + cy.get('input[id^=select-cell-scielomoderationstagesplugin]').should('be.checked'); + }); +}); \ No newline at end of file diff --git a/cypress/tests/Test1_moderationStageAdvancement.cy.js b/cypress/tests/Test1_moderationStageAdvancement.cy.js new file mode 100644 index 0000000..ee8a412 --- /dev/null +++ b/cypress/tests/Test1_moderationStageAdvancement.cy.js @@ -0,0 +1,42 @@ +import '../support/commands.js'; + +describe("SciELO Moderation Stages - Moderation stage advancement", function() { + let submissionData; + + before(function() { + Cypress.config('defaultCommandTimeout', 4000); + submissionData = { + title: "Night of the Living Dead", + abstract: 'Some people get stuck in a house when the dead arise from their graves', + keywords: ['plugin', 'testing'], + contributors: [ + { + 'given': 'George', + 'family': 'Romero', + 'email': 'george.romero@stab.com', + 'country': 'United States' + } + ], + files: [ + { + 'file': 'dummy.pdf', + 'fileName': 'dummy.pdf', + 'mimeType': 'application/pdf', + 'genre': 'Preprint Text' + } + ] + }; + }); + + it("Author creates submission", function() { + cy.login('fpaglieri', null, 'publicknowledge'); + cy.createSubmission(submissionData); + }); + it("Checks submission is set to first moderation stage", function() { + cy.login('fpaglieri', null, 'publicknowledge'); + cy.findSubmission('myQueue', submissionData.title); + + cy.contains('strong', 'Moderation stage:'); + cy.contains('span', 'Format Pre-Moderation'); + }); +}); diff --git a/cypress/tests/Test1_submissionFirstModerationStage.spec.js b/cypress/tests/Test1_submissionFirstModerationStage.spec.js deleted file mode 100644 index 7209500..0000000 --- a/cypress/tests/Test1_submissionFirstModerationStage.spec.js +++ /dev/null @@ -1,74 +0,0 @@ -function loginAuthorUser() { - cy.get('input[id=username]').clear(); - cy.get('input[id=username]').type(Cypress.env('OJSAuthorUsername'), { delay: 0 }); - cy.get('input[id=password]').type(Cypress.env('OJSAuthorPassword'), { delay: 0 }); - cy.get('button[class=submit]').click(); -} - -function loginAdminUser() { - cy.get('input[id=username]').clear(); - cy.get('input[id=username]').type(Cypress.env('OJSAdminUsername'), { delay: 0 }); - cy.get('input[id=password]').type(Cypress.env('OJSAdminPassword'), { delay: 0 }); - cy.get('button[class=submit]').click(); -} - -function userLogout() { - cy.get(".pkpDropdown.app__headerAction > .pkpButton").click(); - cy.get("a.pkpDropdown__action").contains("Logout").click(); -} - -function submissionStep1() { - cy.get('#sectionId').select('1'); - cy.get('#pkp_submissionChecklist > ul > li > label > input').check(); - cy.get('#privacyConsent').check(); - - cy.get('#submissionStep1 > .formButtons > .submitFormButton').click(); -} - -function submissionStep2() { - cy.get('#submitStep2Form > .formButtons > .submitFormButton').click(); -} - -function submissionStep3() { - cy.get('input[name^="title"]').first().type("Submission test first moderation stage", { delay: 0 }); - cy.get('label').contains('Title').click(); - cy.get('textarea[id^="abstract-"').then((node) => { - cy.setTinyMceContent(node.attr("id"), "Example of abstract"); - }); - cy.get('.section > label:visible').first().click(); - cy.get('ul[id^="en_US-keywords-"]').then(node => { - node.tagit('createTag', "Dummy keyword"); - }); - cy.get('#submitStep3Form > .formButtons > .submitFormButton').click(); -} - -function submissionStep4() { - cy.get('#submitStep4Form > .formButtons > .submitFormButton').click(); - cy.get('.pkp_modal_confirmation > .footer > .ok').click(); -} - -function checkSubmissionAssignedToFirstModerationStage() { - cy.get('.pkpButton').contains('Activity Log').click(); - cy.get('.gridCellContainer > span').should('contain', 'The submission has been sent to the Format Pre-Moderation stage'); -} - -describe("SciELO Moderation Stages Plugin - Submission is put in first moderation stage", function() { - it("Author user submits", function() { - cy.visit(Cypress.env('baseUrl') + 'index.php/scielo/submissions'); - loginAuthorUser(); - - cy.get('.pkpHeader__actions:visible > a.pkpButton').click(); - submissionStep1(); - submissionStep2(); - submissionStep3(); - submissionStep4(); - userLogout(); - }); - it("Check if plugin registered the assignment to first moderation stage in submission's activity log", function() { - loginAdminUser(); - cy.wait(3000); - cy.get("#active-button").click(); - cy.get(".listPanel__itemActions:visible > a.pkpButton").first().click(); - checkSubmissionAssignedToFirstModerationStage(); - }); -}); diff --git a/cypress/tests/Test2_sentToStageOnUserAssignModal.spec.js b/cypress/tests/Test2_sentToStageOnUserAssignModal.cy.js similarity index 100% rename from cypress/tests/Test2_sentToStageOnUserAssignModal.spec.js rename to cypress/tests/Test2_sentToStageOnUserAssignModal.cy.js diff --git a/cypress/tests/Test3_submissionIsRejected.spec.js b/cypress/tests/Test3_submissionIsRejected.cy.js similarity index 100% rename from cypress/tests/Test3_submissionIsRejected.spec.js rename to cypress/tests/Test3_submissionIsRejected.cy.js diff --git a/cypress/tests/Test4_submissionIsPosted.spec.js b/cypress/tests/Test4_submissionIsPosted.cy.js similarity index 100% rename from cypress/tests/Test4_submissionIsPosted.spec.js rename to cypress/tests/Test4_submissionIsPosted.cy.js diff --git a/cypress/tests/Test5_lastModerationStage.spec.js b/cypress/tests/Test5_lastModerationStage.cy.js similarity index 100% rename from cypress/tests/Test5_lastModerationStage.spec.js rename to cypress/tests/Test5_lastModerationStage.cy.js diff --git a/cypress/tests/Test6_stagesViewMenu.spec.js b/cypress/tests/Test6_stagesViewMenu.cy.js similarity index 100% rename from cypress/tests/Test6_stagesViewMenu.spec.js rename to cypress/tests/Test6_stagesViewMenu.cy.js diff --git a/cypress/tests/Test7_currentStageOnSubmissionPage.spec.js b/cypress/tests/Test7_currentStageOnSubmissionPage.cy.js similarity index 100% rename from cypress/tests/Test7_currentStageOnSubmissionPage.spec.js rename to cypress/tests/Test7_currentStageOnSubmissionPage.cy.js diff --git a/cypress/tests/Test8_pastTimeOnSubmissionsList.spec.js b/cypress/tests/Test8_pastTimeOnSubmissionsList.cy.js similarity index 100% rename from cypress/tests/Test8_pastTimeOnSubmissionsList.spec.js rename to cypress/tests/Test8_pastTimeOnSubmissionsList.cy.js diff --git a/cypress/tests/Test9_hideParticipantsDiscussion.spec.js b/cypress/tests/Test9_hideParticipantsDiscussion.cy.js similarity index 100% rename from cypress/tests/Test9_hideParticipantsDiscussion.spec.js rename to cypress/tests/Test9_hideParticipantsDiscussion.cy.js From f1b6385f5522bf2d6e19d4ac45dda69aca24869a Mon Sep 17 00:00:00 2001 From: Jhon Date: Mon, 29 Jan 2024 11:59:54 -0400 Subject: [PATCH 05/24] WIP: Assigning of submission to first moderation stage Issue: documentacao-e-tarefas/scielo#629 Signed-off-by: Jhon Signed-off-by: Iudi --- ScieloModerationStagesPlugin.php | 13 ++----- classes/ModerationStageRegister.php | 35 +++++++++++++------ .../listeners/AssignFirstModerationStage.php | 28 +++++++++++++++ 3 files changed, 55 insertions(+), 21 deletions(-) create mode 100644 classes/observers/listeners/AssignFirstModerationStage.php diff --git a/ScieloModerationStagesPlugin.php b/ScieloModerationStagesPlugin.php index 44cd43b..10ebbbd 100644 --- a/ScieloModerationStagesPlugin.php +++ b/ScieloModerationStagesPlugin.php @@ -13,6 +13,8 @@ * @brief SciELO Moderation Stages Plugin */ +namespace APP\plugins\generic\scieloModerationStages; + use PKP\plugins\GenericPlugin; use PKP\plugins\Hook; use APP\core\Application; @@ -34,7 +36,6 @@ public function register($category, $path, $mainContextId = null) if ($success && $this->getEnabled($mainContextId)) { Hook::add('Schema::get::submission', [$this, 'addOurFieldsToSubmissionSchema']); - Hook::add('submissionsubmitstep4form::execute', [$this, 'setSubmissionFirstModerationStage']); Hook::add('addparticipantform::display', [$this, 'addFieldsAssignForm']); Hook::add('addparticipantform::execute', [$this, 'sendSubmissionToNextModerationStage']); Hook::add('queryform::display', [$this, 'hideParticipantsOnDiscussionOpening']); @@ -46,7 +47,6 @@ public function register($category, $path, $mainContextId = null) Hook::add('TemplateManager::display', [$this, 'addJavaScriptAndStylesheet']); $this->addHandlerURLToJavaScript(); } - return $success; } @@ -127,15 +127,6 @@ public function addOurFieldsToSubmissionSchema($hookName, $params) return false; } - public function setSubmissionFirstModerationStage($hookName, $params) - { - $submission = $params[0]->submission; - $moderationStage = new ModerationStage($submission); - $moderationStage->setToFirstStage(); - $moderationStageRegister = new ModerationStageRegister(); - $moderationStageRegister->registerModerationStageOnSubmissionLog($moderationStage); - } - public function addFieldsAssignForm($hookName, $params) { $request = PKPApplication::get()->getRequest(); diff --git a/classes/ModerationStageRegister.php b/classes/ModerationStageRegister.php index 6f161e8..cda7a0d 100644 --- a/classes/ModerationStageRegister.php +++ b/classes/ModerationStageRegister.php @@ -1,21 +1,36 @@ updateObject($moderationStage->submission); + Repo::submission()->edit($stage->submission, []); } - public function registerModerationStageOnSubmissionlog($moderationStage) + public function registerModerationStageOnSubmissionlog(ModerationStage $stage) { - $moderationStageName = $moderationStage->getCurrentStageName(); - $request = Application::get()->getRequest(); - SubmissionLog::logEvent($request, $moderationStage->submission, SUBMISSION_LOG_METADATA_UPDATE, 'plugins.generic.scieloModerationStages.log.submissionSentToModerationStage', ['moderationStageName' => $moderationStageName]); + $stageName = $stage->getCurrentStageName(); + $submission = $stage->submission; + + $eventLog = Repo::eventLog()->newDataObject([ + 'assocType' => Application::ASSOC_TYPE_SUBMISSION, + 'assocId' => $submission->getId(), + 'eventType' => PKPSubmissionEventLogEntry::SUBMISSION_LOG_METADATA_UPDATE, + 'userId' => Validation::loggedInAs(), + 'message' => 'plugins.generic.scieloModerationStages.log.submissionSentToModerationStage', + 'isTranslated' => false, + 'dateLogged' => Core::getCurrentDate(), + 'moderationStageName' => $moderationStageName, + ]); + Repo::eventLog()->add($eventLog); } } diff --git a/classes/observers/listeners/AssignFirstModerationStage.php b/classes/observers/listeners/AssignFirstModerationStage.php new file mode 100644 index 0000000..ff3b49b --- /dev/null +++ b/classes/observers/listeners/AssignFirstModerationStage.php @@ -0,0 +1,28 @@ +listen( + SubmissionSubmitted::class, + AssignFirstModerationStage::class + ); + } + + public function handle(SubmissionSubmitted $event): void + { + $submission = $event->submission; + $moderationStage = new ModerationStage($submission); + $moderationStage->setToFirstStage(); + $moderationStageRegister = new ModerationStageRegister(); + $moderationStageRegister->registerModerationStageOnSubmissionLog($moderationStage); + } +} From 4d15f1b788e86418bab8f6449c945fbc936d7844 Mon Sep 17 00:00:00 2001 From: Jhon Date: Mon, 29 Jan 2024 14:30:39 -0400 Subject: [PATCH 06/24] Assigns submission to first moderation stage automatically Issue: documentacao-e-tarefas/scielo#629 Signed-off-by: Jhon Signed-off-by: Iudi --- ScieloModerationStagesPlugin.php | 21 ++++++++++++------- classes/ModerationStageRegister.php | 2 +- .../listeners/AssignFirstModerationStage.php | 3 ++- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/ScieloModerationStagesPlugin.php b/ScieloModerationStagesPlugin.php index 10ebbbd..8e66892 100644 --- a/ScieloModerationStagesPlugin.php +++ b/ScieloModerationStagesPlugin.php @@ -19,8 +19,10 @@ use PKP\plugins\Hook; use APP\core\Application; use APP\template\TemplateManager; +use Illuminate\Support\Facades\Event; use APP\plugins\generic\scieloModerationStages\classes\ModerationStage; use APP\plugins\generic\scieloModerationStages\classes\ModerationStageRegister; +use APP\plugins\generic\scieloModerationStages\classes\observers\listeners\AssignFirstModerationStage; class ScieloModerationStagesPlugin extends GenericPlugin { @@ -35,16 +37,19 @@ public function register($category, $path, $mainContextId = null) } if ($success && $this->getEnabled($mainContextId)) { + Event::subscribe(new AssignFirstModerationStage()); + Hook::add('Schema::get::submission', [$this, 'addOurFieldsToSubmissionSchema']); - Hook::add('addparticipantform::display', [$this, 'addFieldsAssignForm']); - Hook::add('addparticipantform::execute', [$this, 'sendSubmissionToNextModerationStage']); - Hook::add('queryform::display', [$this, 'hideParticipantsOnDiscussionOpening']); + // Hook::add('addparticipantform::display', [$this, 'addFieldsAssignForm']); + // Hook::add('addparticipantform::execute', [$this, 'sendSubmissionToNextModerationStage']); + // Hook::add('queryform::display', [$this, 'hideParticipantsOnDiscussionOpening']); - Hook::add('Template::Workflow::Publication', [$this, 'addToWorkflowTabs']); + // Hook::add('Template::Workflow::Publication', [$this, 'addToWorkflowTabs']); Hook::add('Template::Workflow', [$this, 'addCurrentStageStatus']); - Hook::add('LoadComponentHandler', [$this, 'setupScieloModerationStagesHandler']); + // Hook::add('LoadComponentHandler', [$this, 'setupScieloModerationStagesHandler']); + + // Hook::add('TemplateManager::display', [$this, 'addJavaScriptAndStylesheet']); - Hook::add('TemplateManager::display', [$this, 'addJavaScriptAndStylesheet']); $this->addHandlerURLToJavaScript(); } return $success; @@ -195,13 +200,13 @@ public function addToWorkflowTabs($hookName, $params) public function addCurrentStageStatus($hookName, $params) { $templateMgr = &$params[1]; - $submission = $templateMgr->get_template_vars('submission'); + $submission = $templateMgr->getTemplateVars('submission'); if (!is_null($submission->getData('currentModerationStage'))) { $moderationStage = new ModerationStage($submission); $templateMgr->assign('currentStageName', $moderationStage->getCurrentStageName()); - $templateMgr->registerFilter("output", array($this, 'addCurrentStageStatusFilter')); + $templateMgr->registerFilter("output", [$this, 'addCurrentStageStatusFilter']); } return false; diff --git a/classes/ModerationStageRegister.php b/classes/ModerationStageRegister.php index cda7a0d..2291894 100644 --- a/classes/ModerationStageRegister.php +++ b/classes/ModerationStageRegister.php @@ -29,7 +29,7 @@ public function registerModerationStageOnSubmissionlog(ModerationStage $stage) 'message' => 'plugins.generic.scieloModerationStages.log.submissionSentToModerationStage', 'isTranslated' => false, 'dateLogged' => Core::getCurrentDate(), - 'moderationStageName' => $moderationStageName, + 'moderationStageName' => $stageName, ]); Repo::eventLog()->add($eventLog); } diff --git a/classes/observers/listeners/AssignFirstModerationStage.php b/classes/observers/listeners/AssignFirstModerationStage.php index ff3b49b..a1b5b86 100644 --- a/classes/observers/listeners/AssignFirstModerationStage.php +++ b/classes/observers/listeners/AssignFirstModerationStage.php @@ -1,6 +1,6 @@ setToFirstStage(); $moderationStageRegister = new ModerationStageRegister(); + $moderationStageRegister->registerModerationStageOnDatabase($moderationStage); $moderationStageRegister->registerModerationStageOnSubmissionLog($moderationStage); } } From cdc18499ce5d3d10053301fcdaa737cf241bbfaa Mon Sep 17 00:00:00 2001 From: Jhon Date: Mon, 29 Jan 2024 17:02:54 -0400 Subject: [PATCH 07/24] Adds integration test for moderation stage advancing Issue: documentacao-e-tarefas/scielo#629 Signed-off-by: Jhon Signed-off-by: Iudi --- ScieloModerationStagesPlugin.php | 8 ++-- .../Test1_moderationStageAdvancement.cy.js | 43 +++++++++++++++++++ 2 files changed, 47 insertions(+), 4 deletions(-) diff --git a/ScieloModerationStagesPlugin.php b/ScieloModerationStagesPlugin.php index 8e66892..7b0e08a 100644 --- a/ScieloModerationStagesPlugin.php +++ b/ScieloModerationStagesPlugin.php @@ -40,8 +40,8 @@ public function register($category, $path, $mainContextId = null) Event::subscribe(new AssignFirstModerationStage()); Hook::add('Schema::get::submission', [$this, 'addOurFieldsToSubmissionSchema']); - // Hook::add('addparticipantform::display', [$this, 'addFieldsAssignForm']); - // Hook::add('addparticipantform::execute', [$this, 'sendSubmissionToNextModerationStage']); + Hook::add('addparticipantform::display', [$this, 'addFieldsAssignForm']); + Hook::add('addparticipantform::execute', [$this, 'sendSubmissionToNextModerationStage']); // Hook::add('queryform::display', [$this, 'hideParticipantsOnDiscussionOpening']); // Hook::add('Template::Workflow::Publication', [$this, 'addToWorkflowTabs']); @@ -134,7 +134,7 @@ public function addOurFieldsToSubmissionSchema($hookName, $params) public function addFieldsAssignForm($hookName, $params) { - $request = PKPApplication::get()->getRequest(); + $request = Application::get()->getRequest(); $templateMgr = TemplateManager::getManager($request); $submission = $params[0]->getSubmission(); @@ -249,7 +249,7 @@ private function userIsAuthor($submission) public function sendSubmissionToNextModerationStage($hookName, $params) { - $request = PKPApplication::get()->getRequest(); + $request = Application::get()->getRequest(); $form = $params[0]; $requestVars = $request->getUserVars(); diff --git a/cypress/tests/Test1_moderationStageAdvancement.cy.js b/cypress/tests/Test1_moderationStageAdvancement.cy.js index ee8a412..41d12b1 100644 --- a/cypress/tests/Test1_moderationStageAdvancement.cy.js +++ b/cypress/tests/Test1_moderationStageAdvancement.cy.js @@ -1,5 +1,13 @@ import '../support/commands.js'; +function checkSendNextStageOptionIsPresent() { + cy.contains("This submission is in the Format Pre-Moderation stage, do you want to send it to the Manuscript Type Pre-Moderation stage? "); + cy.get('#checkboxSendNextStageAssignYes').parent().contains("Yes"); + cy.get('#checkboxSendNextStageAssignNo').parent().contains("No"); + cy.get('#checkboxSendNextStageAssignYes').should('not.be.checked'); + cy.get('#checkboxSendNextStageAssignNo').should('not.be.checked'); +} + describe("SciELO Moderation Stages - Moderation stage advancement", function() { let submissionData; @@ -39,4 +47,39 @@ describe("SciELO Moderation Stages - Moderation stage advancement", function() { cy.contains('strong', 'Moderation stage:'); cy.contains('span', 'Format Pre-Moderation'); }); + it("Checks sending of submission to next moderation stage", function() { + cy.login('dbarnes', null, 'publicknowledge'); + cy.findSubmission('active', submissionData.title); + + cy.contains('strong', 'Moderation stage:'); + cy.contains('span', 'Format Pre-Moderation'); + + cy.contains('a', 'Assign').click(); + checkSendNextStageOptionIsPresent(); + cy.get('tr[id^="component-grid-users-userselect-userselectgrid-row"] > .first_column > input').first().click(); + cy.get('#checkboxSendNextStageAssignYes').click(); + cy.get("#addParticipantForm > .formButtons > .submitFormButton").click(); + cy.waitJQuery(); + cy.reload(); + + cy.contains('span', 'Manuscript Type Pre-Moderation'); + cy.contains('button', 'Activity Log').click(); + cy.contains('The submission has been sent to the Manuscript Type Pre-Moderation stage'); + }); + it("Checks stage advancing not present in last stage", function() { + cy.login('dbarnes', null, 'publicknowledge'); + cy.findSubmission('active', submissionData.title); + + cy.contains('a', 'Assign').click(); + cy.get('tr[id^="component-grid-users-userselect-userselectgrid-row"] > .first_column > input').first().click(); + cy.get('#checkboxSendNextStageAssignYes').click(); + cy.get("#addParticipantForm > .formButtons > .submitFormButton").click(); + cy.waitJQuery(); + cy.reload(); + + cy.contains('span', 'Area Moderation'); + cy.contains('a', 'Assign').click(); + cy.get('#checkboxSendNextStageAssignYes').should('not.exist'); + cy.get('#checkboxSendNextStageAssignNo').should('not.exist'); + }); }); From 69e8519a37e5cb0fc5625fe7e1ce935b09e3c1a9 Mon Sep 17 00:00:00 2001 From: Jhon Date: Mon, 29 Jan 2024 18:17:28 -0400 Subject: [PATCH 08/24] Fixes event logging Issue: documentacao-e-tarefas/scielo#629 Signed-off-by: Jhon Signed-off-by: Iudi --- classes/ModerationStageRegister.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/classes/ModerationStageRegister.php b/classes/ModerationStageRegister.php index 2291894..77e56f1 100644 --- a/classes/ModerationStageRegister.php +++ b/classes/ModerationStageRegister.php @@ -21,15 +21,16 @@ public function registerModerationStageOnSubmissionlog(ModerationStage $stage) $stageName = $stage->getCurrentStageName(); $submission = $stage->submission; + $user = Application::get()->getRequest()->getUser(); + $eventLog = Repo::eventLog()->newDataObject([ 'assocType' => Application::ASSOC_TYPE_SUBMISSION, 'assocId' => $submission->getId(), 'eventType' => PKPSubmissionEventLogEntry::SUBMISSION_LOG_METADATA_UPDATE, - 'userId' => Validation::loggedInAs(), - 'message' => 'plugins.generic.scieloModerationStages.log.submissionSentToModerationStage', - 'isTranslated' => false, + 'userId' => Validation::loggedInAs() ?? $user->getId(), + 'message' => __('plugins.generic.scieloModerationStages.log.submissionSentToModerationStage', ['moderationStageName' => $stageName]), + 'isTranslated' => true, 'dateLogged' => Core::getCurrentDate(), - 'moderationStageName' => $stageName, ]); Repo::eventLog()->add($eventLog); } From 3aca245879fbec220f85eeefe99f3b0cc0cc688d Mon Sep 17 00:00:00 2001 From: Jhon Date: Tue, 30 Jan 2024 10:33:27 -0400 Subject: [PATCH 09/24] Adds integration test for scenarios where stage advancement is hidden Issue: documentacao-e-tarefas/scielo#629 Signed-off-by: Jhon --- .../Test2_sentToStageOnUserAssignModal.cy.js | 88 ------------------- .../tests/Test2_stageAdvancementHidden.cy.js | 70 +++++++++++++++ 2 files changed, 70 insertions(+), 88 deletions(-) delete mode 100644 cypress/tests/Test2_sentToStageOnUserAssignModal.cy.js create mode 100644 cypress/tests/Test2_stageAdvancementHidden.cy.js diff --git a/cypress/tests/Test2_sentToStageOnUserAssignModal.cy.js b/cypress/tests/Test2_sentToStageOnUserAssignModal.cy.js deleted file mode 100644 index f3e9b00..0000000 --- a/cypress/tests/Test2_sentToStageOnUserAssignModal.cy.js +++ /dev/null @@ -1,88 +0,0 @@ -function loginAuthorUser() { - cy.get('input[id=username]').clear(); - cy.get('input[id=username]').type(Cypress.env('OJSAuthorUsername'), { delay: 0 }); - cy.get('input[id=password]').type(Cypress.env('OJSAuthorPassword'), { delay: 0 }); - cy.get('button[class=submit]').click(); -} - -function loginAdminUser() { - cy.get('input[id=username]').clear(); - cy.get('input[id=username]').type(Cypress.env('OJSAdminUsername'), { delay: 0 }); - cy.get('input[id=password]').type(Cypress.env('OJSAdminPassword'), { delay: 0 }); - cy.get('button[class=submit]').click(); -} - -function userLogout() { - cy.get(".pkpDropdown.app__headerAction > .pkpButton").click(); - cy.get("a.pkpDropdown__action").contains("Logout").click(); -} - -function submissionStep1() { - cy.get('#sectionId').select('1'); - cy.get('#pkp_submissionChecklist > ul > li > label > input').check(); - cy.get('#privacyConsent').check(); - - cy.get('#submissionStep1 > .formButtons > .submitFormButton').click(); -} - -function submissionStep2() { - cy.get('#submitStep2Form > .formButtons > .submitFormButton').click(); -} - -function submissionStep3() { - cy.get('input[name^="title"]').first().type("Submission test first moderation stage", { delay: 0 }); - cy.get('label').contains('Title').click(); - cy.get('textarea[id^="abstract-"').then((node) => { - cy.setTinyMceContent(node.attr("id"), "Example of abstract"); - }); - cy.get('.section > label:visible').first().click(); - cy.get('ul[id^="en_US-keywords-"]').then(node => { - node.tagit('createTag', "Dummy keyword"); - }); - cy.get('#submitStep3Form > .formButtons > .submitFormButton').click(); -} - -function submissionStep4() { - cy.get('#submitStep4Form > .formButtons > .submitFormButton').click(); - cy.get('.pkp_modal_confirmation > .footer > .ok').click(); -} - -function checkOptionSendNextStageIsPresent() { - cy.contains("This submission is in the Format Pre-Moderation stage, do you want to send it to the Content Pre-Moderation stage?"); - cy.get('#checkboxSendNextStageAssignYes').parent().contains("Yes"); - cy.get('#checkboxSendNextStageAssignNo').parent().contains("No"); - cy.get('#checkboxSendNextStageAssignYes').should('not.be.checked'); - cy.get('#checkboxSendNextStageAssignNo').should('not.be.checked'); -} - -function checkSubmissionHasBeenSentToNextModerationStage() { - cy.get('.pkpButton').contains('Activity Log').click(); - cy.get('.gridCellContainer > span').should('contain', 'The submission has been sent to the Content Pre-Moderation stage'); -} - -describe("SciELO Moderation Stages Plugin - Option to sent submission to next moderation stage", function() { - it("Author user submits", function() { - cy.visit(Cypress.env('baseUrl') + 'index.php/scielo/submissions'); - loginAuthorUser(); - - cy.get('.pkpHeader__actions:visible > a.pkpButton').click(); - submissionStep1(); - submissionStep2(); - submissionStep3(); - submissionStep4(); - userLogout(); - }); - it("Check option to sent submission to next moderation stage in user assign modal", function() { - loginAdminUser(); - cy.wait(3000); - cy.get("#active-button").click(); - cy.get(".listPanel__itemActions:visible > a.pkpButton").first().click(); - cy.get("a").contains("Assign").click(); - checkOptionSendNextStageIsPresent(); - cy.get('tr[id^="component-grid-users-userselect-userselectgrid-row"] > .first_column > input').first().click(); - cy.get('#checkboxSendNextStageAssignYes').click(); - cy.get("#addParticipantForm > .formButtons > .submitFormButton").click(); - cy.wait(3000); - checkSubmissionHasBeenSentToNextModerationStage(); - }); -}); diff --git a/cypress/tests/Test2_stageAdvancementHidden.cy.js b/cypress/tests/Test2_stageAdvancementHidden.cy.js new file mode 100644 index 0000000..b782e2a --- /dev/null +++ b/cypress/tests/Test2_stageAdvancementHidden.cy.js @@ -0,0 +1,70 @@ +import '../support/commands.js'; + +function checkSendNextStageOptionIsNotPresent() { + cy.contains("This submission is in the Format Pre-Moderation stage").should('not.exist'); + cy.get('#checkboxSendNextStageAssignYes').should('not.exist'); + cy.get('#checkboxSendNextStageAssignNo').should('not.exist'); +} + +describe("SciELO Moderation Stages - Moderation stage advancement", function() { + let submissionData; + + before(function() { + Cypress.config('defaultCommandTimeout', 4000); + submissionData = { + title: "Candyman", + abstract: 'A ghost appears when you speak his name 5 times in front of a mirror', + keywords: ['plugin', 'testing'], + contributors: [ + { + 'given': 'Clive', + 'family': 'Barker', + 'email': 'clive.barker@stab.com', + 'country': 'United Kingdom' + } + ], + files: [ + { + 'file': 'dummy.pdf', + 'fileName': 'dummy.pdf', + 'mimeType': 'application/pdf', + 'genre': 'Preprint Text' + } + ] + }; + }); + + it("Author creates submission", function() { + cy.login('fpaglieri', null, 'publicknowledge'); + cy.createSubmission(submissionData); + }); + it("Sending of submission to next moderation stage does not appear when posted/rejected", function() { + cy.login('dbarnes', null, 'publicknowledge'); + cy.findSubmission('active', submissionData.title); + + cy.get('#publication-button').click(); + cy.get('.pkpHeader__actions button:contains("Post")').click(); + cy.get('.pkp_modal_panel button:contains("Post")').click(); + cy.contains('span', 'Posted'); + + cy.get('#workflow-button').click(); + cy.contains('a', 'Assign').click(); + checkSendNextStageOptionIsNotPresent(); + cy.get('a.pkpModalCloseButton:visible').click(); + cy.on('window:confirm', () => true); + + cy.get('#publication-button').click(); + cy.get('.pkpHeader__actions button:contains("Unpost")').click(); + cy.get('.modal__panel button:contains("Unpost")').click(); + cy.contains('span', 'Unposted'); + + cy.get('#workflow-button').click(); + cy.contains('a', 'Decline Submission').click(); + cy.contains('button', 'Skip this email').click(); + cy.contains('button', 'Record Decision').click(); + cy.contains('a', 'View Submission').click(); + + cy.contains('a', 'Assign').click(); + checkSendNextStageOptionIsNotPresent(); + }); +}); From 6c2f9a41ecb8db5ae69714704b6aeda211677373 Mon Sep 17 00:00:00 2001 From: Jhon Date: Tue, 30 Jan 2024 14:55:25 -0400 Subject: [PATCH 10/24] Adds integration test for plugin tab in workflow Issue: documentacao-e-tarefas/scielo#629 Signed-off-by: Jhon Signed-off-by: Iudi --- .../tests/Test2_stageAdvancementHidden.cy.js | 4 +- .../tests/Test3_submissionIsRejected.cy.js | 86 ------------------ cypress/tests/Test3_workflowTab.cy.js | 89 +++++++++++++++++++ 3 files changed, 91 insertions(+), 88 deletions(-) delete mode 100644 cypress/tests/Test3_submissionIsRejected.cy.js create mode 100644 cypress/tests/Test3_workflowTab.cy.js diff --git a/cypress/tests/Test2_stageAdvancementHidden.cy.js b/cypress/tests/Test2_stageAdvancementHidden.cy.js index b782e2a..c890ee1 100644 --- a/cypress/tests/Test2_stageAdvancementHidden.cy.js +++ b/cypress/tests/Test2_stageAdvancementHidden.cy.js @@ -6,7 +6,7 @@ function checkSendNextStageOptionIsNotPresent() { cy.get('#checkboxSendNextStageAssignNo').should('not.exist'); } -describe("SciELO Moderation Stages - Moderation stage advancement", function() { +describe("SciELO Moderation Stages - Stage advancement hidden scenarios", function() { let submissionData; before(function() { @@ -38,7 +38,7 @@ describe("SciELO Moderation Stages - Moderation stage advancement", function() { cy.login('fpaglieri', null, 'publicknowledge'); cy.createSubmission(submissionData); }); - it("Sending of submission to next moderation stage does not appear when posted/rejected", function() { + it("Sending of submission to next moderation stage does not appear when posted/declined", function() { cy.login('dbarnes', null, 'publicknowledge'); cy.findSubmission('active', submissionData.title); diff --git a/cypress/tests/Test3_submissionIsRejected.cy.js b/cypress/tests/Test3_submissionIsRejected.cy.js deleted file mode 100644 index 9d11735..0000000 --- a/cypress/tests/Test3_submissionIsRejected.cy.js +++ /dev/null @@ -1,86 +0,0 @@ -function loginAuthorUser() { - cy.get('input[id=username]').clear(); - cy.get('input[id=username]').type(Cypress.env('OJSAuthorUsername'), { delay: 0 }); - cy.get('input[id=password]').type(Cypress.env('OJSAuthorPassword'), { delay: 0 }); - cy.get('button[class=submit]').click(); -} - -function loginAdminUser() { - cy.get('input[id=username]').clear(); - cy.get('input[id=username]').type(Cypress.env('OJSAdminUsername'), { delay: 0 }); - cy.get('input[id=password]').type(Cypress.env('OJSAdminPassword'), { delay: 0 }); - cy.get('button[class=submit]').click(); -} - -function userLogout() { - cy.get(".pkpDropdown.app__headerAction > .pkpButton").click(); - cy.get("a.pkpDropdown__action").contains("Logout").click(); -} - -function submissionStep1() { - cy.get('#sectionId').select('1'); - cy.get('#pkp_submissionChecklist > ul > li > label > input').check(); - cy.get('#privacyConsent').check(); - - cy.get('#submissionStep1 > .formButtons > .submitFormButton').click(); -} - -function submissionStep2() { - cy.get('#submitStep2Form > .formButtons > .submitFormButton').click(); -} - -function submissionStep3() { - cy.get('input[name^="title"]').first().type("Submission test first moderation stage", { delay: 0 }); - cy.get('label').contains('Title').click(); - cy.get('textarea[id^="abstract-"').then((node) => { - cy.setTinyMceContent(node.attr("id"), "Example of abstract"); - }); - cy.get('.section > label:visible').first().click(); - cy.get('ul[id^="en_US-keywords-"]').then(node => { - node.tagit('createTag', "Dummy keyword"); - }); - cy.get('#submitStep3Form > .formButtons > .submitFormButton').click(); -} - -function submissionStep4() { - cy.get('#submitStep4Form > .formButtons > .submitFormButton').click(); - cy.get('.pkp_modal_confirmation > .footer > .ok').click(); -} - -function rejectSubmission() { - cy.get("#editorialActions > li > a").contains("Decline").click(); - cy.get("#sendReviews > .formButtons > .submitFormButton").click(); -} - -function checkOptionSendNextStageIsNotPresent() { - cy.get("a").contains("Assign").click(); - cy.get('#checkboxSendNextStageDiv').should('not.exist'); -} - -describe("SciELO Moderation Stages Plugin - Option to sent submission to next moderation stage when submission is rejected", function() { - it("Author user submits", function() { - cy.visit(Cypress.env('baseUrl') + 'index.php/scielo/submissions'); - loginAuthorUser(); - - cy.get('.pkpHeader__actions:visible > a.pkpButton').click(); - submissionStep1(); - submissionStep2(); - submissionStep3(); - submissionStep4(); - userLogout(); - }); - it("Check option to sent submission to next moderation stage does not show when submision is rejected", function() { - loginAdminUser(); - cy.wait(3000); - cy.get("#active-button").click(); - cy.get(".listPanel__itemActions:visible > a.pkpButton").first().click(); - - rejectSubmission(); - - cy.visit(Cypress.env('baseUrl') + 'index.php/scielo/submissions'); - cy.wait(3000); - cy.get("#archive-button").click(); - cy.get(".listPanel__itemActions:visible > a.pkpButton").first().click(); - checkOptionSendNextStageIsNotPresent(); - }); -}); \ No newline at end of file diff --git a/cypress/tests/Test3_workflowTab.cy.js b/cypress/tests/Test3_workflowTab.cy.js new file mode 100644 index 0000000..2706bab --- /dev/null +++ b/cypress/tests/Test3_workflowTab.cy.js @@ -0,0 +1,89 @@ +import '../support/commands.js'; + +describe("SciELO Moderation Stages - Workflow tab", function() { + let submissionData; + let today; + let yesterday; + + before(function() { + Cypress.config('defaultCommandTimeout', 4000); + today = (new Date()).toISOString().split('T')[0]; + yesterday = new Date(); + yesterday.setDate(yesterday.getDate() - 1); + yesterday = yesterday.toISOString().split('T')[0]; + + submissionData = { + title: "Ju-on: The Grudge", + abstract: 'A house were terrible things happened', + keywords: ['plugin', 'testing'], + contributors: [ + { + 'given': 'Takashi', + 'family': 'Shimizu', + 'email': 'takashi.shimizu@stab.com', + 'country': 'Japan' + } + ], + files: [ + { + 'file': 'dummy.pdf', + 'fileName': 'dummy.pdf', + 'mimeType': 'application/pdf', + 'genre': 'Preprint Text' + } + ] + }; + }); + + it("Author creates submission", function() { + cy.login('fpaglieri', null, 'publicknowledge'); + cy.createSubmission(submissionData); + }); + it("Author views entry date for each moderation stage", function() { + cy.login('fpaglieri', null, 'publicknowledge'); + cy.findSubmission('myQueue', submissionData.title); + + cy.get('#scieloModerationStages').click(); + cy.get('#formatStageEntryDateDiv').within(() => { + cy.contains('label', 'Format Pre-Moderation'); + cy.contains('label', 'The submission has entered in this moderation stage in the following data'); + cy.get('input[name="formatStageEntryDate"]').should('have.value', today); + cy.get('input[name="formatStageEntryDate"]').should('be.disabled'); + }); + cy.get('#moderationStageSubmit').should('not.exist'); + }); + it("Editor edits submission's entry dates", function() { + cy.login('dbarnes', null, 'publicknowledge'); + cy.findSubmission('active', submissionData.title); + + cy.get('#publication-button').click(); + cy.get('#scieloModerationStages').click(); + + cy.get('#formatStageEntryDateDiv').within(() => { + cy.get('input[name="formatStageEntryDate"]').should('have.value', today); + cy.get('input[name="formatStageEntryDate"]').type(yesterday); + }); + cy.get('#moderationStageSubmit').click(); + + cy.reload(); + cy.get('#formatStageEntryDateDiv').within(() => { + cy.get('input[name="formatStageEntryDate"]').should('have.value', yesterday); + }); + }); + it("Editor advances moderation stage in workflow tab", function() { + cy.login('dbarnes', null, 'publicknowledge'); + cy.findSubmission('active', submissionData.title); + + cy.get('#publication-button').click(); + cy.get('#scieloModerationStages').click(); + + cy.get('#checkboxSendNextStageMenuYes').check(); + cy.get('#moderationStageSubmit').click(); + + cy.reload(); + cy.get('#formatStageEntryDateDiv'); + cy.get('#contentStageEntryDateDiv').within(() => { + cy.get('input[name="contentStageEntryDate"]').should('have.value', today); + }); + }); +}); From 1ac474f376bfba0ee26ca3106480ae51623a336c Mon Sep 17 00:00:00 2001 From: Jhon Date: Tue, 30 Jan 2024 15:40:13 -0400 Subject: [PATCH 11/24] WIP: Adaptation of handler class Issue: documentacao-e-tarefas/scielo#629 Signed-off-by: Jhon Signed-off-by: Iudi --- ScieloModerationStagesPlugin.php | 15 +++-- controllers/ScieloModerationStagesHandler.php | 55 +++++++++---------- 2 files changed, 36 insertions(+), 34 deletions(-) diff --git a/ScieloModerationStagesPlugin.php b/ScieloModerationStagesPlugin.php index 7b0e08a..7b5b8ee 100644 --- a/ScieloModerationStagesPlugin.php +++ b/ScieloModerationStagesPlugin.php @@ -19,6 +19,9 @@ use PKP\plugins\Hook; use APP\core\Application; use APP\template\TemplateManager; +use APP\facades\Repo; +use PKP\security\Role; +use PKP\db\DAORegistry; use Illuminate\Support\Facades\Event; use APP\plugins\generic\scieloModerationStages\classes\ModerationStage; use APP\plugins\generic\scieloModerationStages\classes\ModerationStageRegister; @@ -44,9 +47,9 @@ public function register($category, $path, $mainContextId = null) Hook::add('addparticipantform::execute', [$this, 'sendSubmissionToNextModerationStage']); // Hook::add('queryform::display', [$this, 'hideParticipantsOnDiscussionOpening']); - // Hook::add('Template::Workflow::Publication', [$this, 'addToWorkflowTabs']); + Hook::add('Template::Workflow::Publication', [$this, 'addToWorkflowTabs']); Hook::add('Template::Workflow', [$this, 'addCurrentStageStatus']); - // Hook::add('LoadComponentHandler', [$this, 'setupScieloModerationStagesHandler']); + Hook::add('LoadComponentHandler', [$this, 'setupScieloModerationStagesHandler']); // Hook::add('TemplateManager::display', [$this, 'addJavaScriptAndStylesheet']); @@ -170,7 +173,7 @@ public function addToWorkflowTabs($hookName, $params) { $templateMgr = &$params[1]; $output = &$params[2]; - $submission = $templateMgr->get_template_vars('submission'); + $submission = $templateMgr->getTemplateVars('submission'); $moderationStage = new ModerationStage($submission); if ($moderationStage->submissionStageExists()) { @@ -237,14 +240,14 @@ private function userIsAuthor($submission) if ($currentUser) { $stageAssignmentDao = DAORegistry::getDAO('StageAssignmentDAO'); $stageAssignmentsResult = $stageAssignmentDao->getBySubmissionAndUserIdAndStageId($submission->getId(), $currentUser->getId(), $submission->getData('stageId')); - $userGroupDao = DAORegistry::getDAO('UserGroupDAO'); + while ($stageAssignment = $stageAssignmentsResult->next()) { - $userGroup = $userGroupDao->getById($stageAssignment->getUserGroupId(), $submission->getData('contextId')); + $userGroup = Repo::userGroup()->get($stageAssignment->getUserGroupId(), $submission->getData('contextId')); $currentUserAssignedRoles[] = (int) $userGroup->getRoleId(); } } - return $currentUserAssignedRoles[0] == ROLE_ID_AUTHOR; + return $currentUserAssignedRoles[0] == Role::ROLE_ID_AUTHOR; } public function sendSubmissionToNextModerationStage($hookName, $params) diff --git a/controllers/ScieloModerationStagesHandler.php b/controllers/ScieloModerationStagesHandler.php index 6a27a4f..317e6cd 100644 --- a/controllers/ScieloModerationStagesHandler.php +++ b/controllers/ScieloModerationStagesHandler.php @@ -2,9 +2,14 @@ use Illuminate\Database\Capsule\Manager as Capsule; -import('classes.handler.Handler'); -import('classes.workflow.EditorDecisionActionsManager'); -import('plugins.generic.scieloModerationStages.classes.ModerationStageDAO'); +use APP\core\Application; +use APP\handler\Handler; +use PKP\security\Role; +use PKP\db\DAORegistry; +use APP\submission\Submission; +use APP\plugins\generic\scieloModerationStages\classes\ModerationStage; +use APP\plugins\generic\scieloModerationStages\classes\ModerationStageRegister; +use APP\plugins\generic\scieloModerationStages\classes\ModerationStageDAO; class ScieloModerationStagesHandler extends Handler { @@ -13,8 +18,7 @@ class ScieloModerationStagesHandler extends Handler public function updateSubmissionStageData($args, $request) { - $submissionDao = DAORegistry::getDAO('SubmissionDAO'); - $submission = $submissionDao->getById($args['submissionId']); + $submission = Repo::submission()->get($args['submissionId']); $moderationStage = new ModerationStage($submission); if (isset($args['formatStageEntryDate'])) { @@ -37,7 +41,7 @@ public function updateSubmissionStageData($args, $request) $moderationStageRegister->registerModerationStageOnSubmissionLog($moderationStage); } - $submissionDao->updateObject($submission); + Repo::submission()->edit($submission, []); return http_response_code(200); } @@ -62,8 +66,8 @@ public function getSubmissionExhibitData($args, $request) public function getUserIsAuthor($args, $request) { - $userRoles = $this->getAuthorizedContextObject(ASSOC_TYPE_USER_ROLES); - $adminRoles = [ROLE_ID_SITE_ADMIN, ROLE_ID_SUB_EDITOR]; + $userRoles = $this->getAuthorizedContextObject(Application::ASSOC_TYPE_USER_ROLES); + $adminRoles = [Role::ROLE_ID_SITE_ADMIN, Role::ROLE_ID_SUB_EDITOR]; if (count(array_intersect($userRoles, $adminRoles)) > 0) { return json_encode(0); @@ -79,9 +83,9 @@ private function getSubmissionModerationStage($submissionId) $moderationStage = $moderationStageDAO->getSubmissionModerationStage($submissionId); if (!is_null($moderationStage)) { $stageMap = [ - SCIELO_MODERATION_STAGE_FORMAT => 'plugins.generic.scieloModerationStages.stages.formatStage', - SCIELO_MODERATION_STAGE_CONTENT => 'plugins.generic.scieloModerationStages.stages.contentStage', - SCIELO_MODERATION_STAGE_AREA => 'plugins.generic.scieloModerationStages.stages.areaStage', + ModerationStage::SCIELO_MODERATION_STAGE_FORMAT => 'plugins.generic.scieloModerationStages.stages.formatStage', + ModerationStage::SCIELO_MODERATION_STAGE_CONTENT => 'plugins.generic.scieloModerationStages.stages.contentStage', + ModerationStage::SCIELO_MODERATION_STAGE_AREA => 'plugins.generic.scieloModerationStages.stages.areaStage', ]; $moderationStageText = __('plugins.generic.scieloModerationStages.currentStageStatusLabel') . ' ' . __($stageMap[$moderationStage]); @@ -128,18 +132,15 @@ private function getAreaModerators($submissionId) private function getAssignedUsers($submissionId, $abbrev): array { $stageAssignmentDao = DAORegistry::getDAO('StageAssignmentDAO'); - $userGroupDao = DAORegistry::getDAO('UserGroupDAO'); - $userDao = DAORegistry::getDAO('UserDAO'); - - $stageAssignmentsResults = $stageAssignmentDao->getBySubmissionAndRoleId($submissionId, ROLE_ID_SUB_EDITOR, self::SUBMISSION_STAGE_ID); + $stageAssignmentsResults = $stageAssignmentDao->getBySubmissionAndRoleId($submissionId, Role::ROLE_ID_SUB_EDITOR, self::SUBMISSION_STAGE_ID); $assignedUsers = []; while ($stageAssignment = $stageAssignmentsResults->next()) { - $userGroup = $userGroupDao->getById($stageAssignment->getUserGroupId()); - $userGroupAbbrev = strtolower($userGroup->getData('abbrev', 'en_US')); + $userGroup = Repo::userGroup()->get($stageAssignment->getUserGroupId()); + $userGroupAbbrev = strtolower($userGroup->getData('abbrev', 'en')); if ($userGroupAbbrev == $abbrev) { - $user = $userDao->getById($stageAssignment->getUserId(), false); + $user = Repo::user()->get($stageAssignment->getUserId(), false); $assignedUsers[$user->getData('username')] = $user->getFullName(); } } @@ -149,12 +150,12 @@ private function getAssignedUsers($submissionId, $abbrev): array private function getSecondDateParamsForTimeExhibitors($submission): array { - if ($submission->getData('status') == STATUS_PUBLISHED) { + if ($submission->getData('status') == Submission::STATUS_PUBLISHED) { $publication = $submission->getCurrentPublication(); return ['datePublished', $publication->getData('datePublished')]; } - if ($submission->getData('status') == STATUS_DECLINED) { + if ($submission->getData('status') == Submission::STATUS_DECLINED) { $result = Capsule::table('edit_decisions') ->where('submission_id', $submission->getId()) ->whereIn('decision', [SUBMISSION_EDITOR_DECISION_DECLINE, SUBMISSION_EDITOR_DECISION_INITIAL_DECLINE]) @@ -189,7 +190,7 @@ private function getDataForTimeExhibitors($submission, $firstDate, $exhibitor): private function getTimeSubmitted($submissionId) { - $submission = DAORegistry::getDAO('SubmissionDAO')->getById($submissionId); + $submission = Repo::submission()->get($submissionId); $dateSubmitted = $submission->getData('dateSubmitted'); if (empty($dateSubmitted)) { @@ -202,15 +203,13 @@ private function getTimeSubmitted($submissionId) private function getLastAssignmentDate($submissionId, $abbrev): string { $stageAssignmentDao = DAORegistry::getDAO('StageAssignmentDAO'); - $userGroupDao = DAORegistry::getDAO('UserGroupDAO'); - $userDao = DAORegistry::getDAO('UserDAO'); - $stageAssignmentsResults = $stageAssignmentDao->getBySubmissionAndRoleId($submissionId, ROLE_ID_SUB_EDITOR, self::SUBMISSION_STAGE_ID); + $stageAssignmentsResults = $stageAssignmentDao->getBySubmissionAndRoleId($submissionId, Role::ROLE_ID_SUB_EDITOR, self::SUBMISSION_STAGE_ID); $lastAssignmentDate = ""; while ($stageAssignment = $stageAssignmentsResults->next()) { - $userGroup = $userGroupDao->getById($stageAssignment->getUserGroupId()); - $currentUserGroupAbbrev = strtolower($userGroup->getData('abbrev', 'en_US')); + $userGroup = Repo::userGroup()->get($stageAssignment->getUserGroupId()); + $currentUserGroupAbbrev = strtolower($userGroup->getData('abbrev', 'en')); if ($currentUserGroupAbbrev == $abbrev) { if (empty($lastAssignmentDate) or ($stageAssignment->getData('dateAssigned') > $lastAssignmentDate)) { @@ -224,7 +223,7 @@ private function getLastAssignmentDate($submissionId, $abbrev): string private function getTimeResponsible($submissionId) { - $submission = DAORegistry::getDAO('SubmissionDAO')->getById($submissionId); + $submission = Repo::submission()->get($submissionId); $lastAssignmentDate = $this->getLastAssignmentDate($submissionId, 'resp'); if (empty($lastAssignmentDate)) { @@ -235,7 +234,7 @@ private function getTimeResponsible($submissionId) private function getTimeAreaModerator($submissionId) { - $submission = DAORegistry::getDAO('SubmissionDAO')->getById($submissionId); + $submission = Repo::submission()->get($submissionId); $lastAssignmentDate = $this->getLastAssignmentDate($submissionId, 'am'); if (empty($lastAssignmentDate)) { From ed9db83844b9c9bb8ee7aa25d1b005c7b99a0bc0 Mon Sep 17 00:00:00 2001 From: Jhon Date: Wed, 31 Jan 2024 11:43:54 -0400 Subject: [PATCH 12/24] Finishes adaptation of workflow tab Issue: documentacao-e-tarefas/scielo#629 Signed-off-by: Jhon Signed-off-by: Iudi --- controllers/ScieloModerationStagesHandler.php | 6 +++--- cypress/tests/Test3_workflowTab.cy.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/controllers/ScieloModerationStagesHandler.php b/controllers/ScieloModerationStagesHandler.php index 317e6cd..aa25c8e 100644 --- a/controllers/ScieloModerationStagesHandler.php +++ b/controllers/ScieloModerationStagesHandler.php @@ -1,9 +1,9 @@ getData('status') == Submission::STATUS_DECLINED) { - $result = Capsule::table('edit_decisions') + $result = DB::table('edit_decisions') ->where('submission_id', $submission->getId()) ->whereIn('decision', [SUBMISSION_EDITOR_DECISION_DECLINE, SUBMISSION_EDITOR_DECISION_INITIAL_DECLINE]) ->orderBy('date_decided', 'asc') diff --git a/cypress/tests/Test3_workflowTab.cy.js b/cypress/tests/Test3_workflowTab.cy.js index 2706bab..cc58fe9 100644 --- a/cypress/tests/Test3_workflowTab.cy.js +++ b/cypress/tests/Test3_workflowTab.cy.js @@ -43,7 +43,7 @@ describe("SciELO Moderation Stages - Workflow tab", function() { cy.login('fpaglieri', null, 'publicknowledge'); cy.findSubmission('myQueue', submissionData.title); - cy.get('#scieloModerationStages').click(); + cy.get('#scieloModerationStages-button').click(); cy.get('#formatStageEntryDateDiv').within(() => { cy.contains('label', 'Format Pre-Moderation'); cy.contains('label', 'The submission has entered in this moderation stage in the following data'); @@ -57,7 +57,7 @@ describe("SciELO Moderation Stages - Workflow tab", function() { cy.findSubmission('active', submissionData.title); cy.get('#publication-button').click(); - cy.get('#scieloModerationStages').click(); + cy.get('#scieloModerationStages-button').click(); cy.get('#formatStageEntryDateDiv').within(() => { cy.get('input[name="formatStageEntryDate"]').should('have.value', today); @@ -75,7 +75,7 @@ describe("SciELO Moderation Stages - Workflow tab", function() { cy.findSubmission('active', submissionData.title); cy.get('#publication-button').click(); - cy.get('#scieloModerationStages').click(); + cy.get('#scieloModerationStages-button').click(); cy.get('#checkboxSendNextStageMenuYes').check(); cy.get('#moderationStageSubmit').click(); From 0271844a8d514af0ad731225f434dc0df97c0b2f Mon Sep 17 00:00:00 2001 From: Jhon Date: Wed, 31 Jan 2024 14:01:28 -0400 Subject: [PATCH 13/24] Refactors discussion's integration test and remove useless tests Issue: documentacao-e-tarefas/scielo#629 Signed-off-by: Jhon Signed-off-by: Iudi --- ScieloModerationStagesPlugin.php | 23 ++-- ...=> Test5_hideParticipantsDiscussion.cy.js} | 11 +- cypress/tests/Test5_lastModerationStage.cy.js | 97 -------------- cypress/tests/Test6_stagesViewMenu.cy.js | 81 ------------ .../Test7_currentStageOnSubmissionPage.cy.js | 71 ----------- .../Test8_pastTimeOnSubmissionsList.cy.js | 119 ------------------ 6 files changed, 17 insertions(+), 385 deletions(-) rename cypress/tests/{Test9_hideParticipantsDiscussion.cy.js => Test5_hideParticipantsDiscussion.cy.js} (81%) delete mode 100644 cypress/tests/Test5_lastModerationStage.cy.js delete mode 100644 cypress/tests/Test6_stagesViewMenu.cy.js delete mode 100644 cypress/tests/Test7_currentStageOnSubmissionPage.cy.js delete mode 100644 cypress/tests/Test8_pastTimeOnSubmissionsList.cy.js diff --git a/ScieloModerationStagesPlugin.php b/ScieloModerationStagesPlugin.php index 7b5b8ee..bbb0571 100644 --- a/ScieloModerationStagesPlugin.php +++ b/ScieloModerationStagesPlugin.php @@ -43,12 +43,12 @@ public function register($category, $path, $mainContextId = null) Event::subscribe(new AssignFirstModerationStage()); Hook::add('Schema::get::submission', [$this, 'addOurFieldsToSubmissionSchema']); - Hook::add('addparticipantform::display', [$this, 'addFieldsAssignForm']); + Hook::add('addparticipantform::display', [$this, 'addStageAdvanceToAssignForm']); Hook::add('addparticipantform::execute', [$this, 'sendSubmissionToNextModerationStage']); - // Hook::add('queryform::display', [$this, 'hideParticipantsOnDiscussionOpening']); + Hook::add('queryform::display', [$this, 'hideParticipantsOnDiscussionOpening']); Hook::add('Template::Workflow::Publication', [$this, 'addToWorkflowTabs']); - Hook::add('Template::Workflow', [$this, 'addCurrentStageStatus']); + Hook::add('Template::Workflow', [$this, 'addCurrentStageStatusToWorkflow']); Hook::add('LoadComponentHandler', [$this, 'setupScieloModerationStagesHandler']); // Hook::add('TemplateManager::display', [$this, 'addJavaScriptAndStylesheet']); @@ -135,7 +135,7 @@ public function addOurFieldsToSubmissionSchema($hookName, $params) return false; } - public function addFieldsAssignForm($hookName, $params) + public function addStageAdvanceToAssignForm($hookName, $params) { $request = Application::get()->getRequest(); $templateMgr = TemplateManager::getManager($request); @@ -200,7 +200,7 @@ public function addToWorkflowTabs($hookName, $params) } } - public function addCurrentStageStatus($hookName, $params) + public function addCurrentStageStatusToWorkflow($hookName, $params) { $templateMgr = &$params[1]; $submission = $templateMgr->getTemplateVars('submission'); @@ -209,13 +209,13 @@ public function addCurrentStageStatus($hookName, $params) $moderationStage = new ModerationStage($submission); $templateMgr->assign('currentStageName', $moderationStage->getCurrentStageName()); - $templateMgr->registerFilter("output", [$this, 'addCurrentStageStatusFilter']); + $templateMgr->registerFilter("output", [$this, 'addCurrentStageStatusToWorkflowFilter']); } return false; } - public function addCurrentStageStatusFilter($output, $templateMgr) + public function addCurrentStageStatusToWorkflowFilter($output, $templateMgr) { if (preg_match('/]+v-if="publicationList.length/', $output, $matches, PREG_OFFSET_CAPTURE)) { $posMatch = $matches[0][1]; @@ -223,7 +223,7 @@ public function addCurrentStageStatusFilter($output, $templateMgr) $currentStageStatus = $templateMgr->fetch($this->getTemplateResource('currentStageStatus.tpl')); $output = substr_replace($output, $currentStageStatus, $posMatch, 0); - $templateMgr->unregisterFilter('output', array($this, 'addCurrentStageStatusFilter')); + $templateMgr->unregisterFilter('output', array($this, 'addCurrentStageStatusToWorkflowFilter')); } return $output; } @@ -277,19 +277,18 @@ public function hideParticipantsOnDiscussionOpening($hookName, $params) $allParticipants = $templateMgr->getTemplateVars('allParticipants'); $query = $form->getQuery(); - $submission = Services::get('submission')->get($query->getData('assocId')); + $submission = Repo::submission()->get($query->getData('assocId')); if ($this->userIsAuthor($submission)) { $author = $request->getUser(); $newParticipantsList = []; $allowedUsersEmails = [ $author->getEmail(), - SCIELO_BRASIL_EMAIL + self::SCIELO_BRASIL_EMAIL ]; foreach ($allParticipants as $participantId => $participantData) { - $userDao = DAORegistry::getDAO('UserDAO'); - $participant = $userDao->getById($participantId); + $participant = Repo::user()->get($participantId); if (in_array($participant->getEmail(), $allowedUsersEmails)) { $newParticipantsList[$participantId] = $participantData; diff --git a/cypress/tests/Test9_hideParticipantsDiscussion.cy.js b/cypress/tests/Test5_hideParticipantsDiscussion.cy.js similarity index 81% rename from cypress/tests/Test9_hideParticipantsDiscussion.cy.js rename to cypress/tests/Test5_hideParticipantsDiscussion.cy.js index ec5cffc..077b110 100644 --- a/cypress/tests/Test9_hideParticipantsDiscussion.cy.js +++ b/cypress/tests/Test5_hideParticipantsDiscussion.cy.js @@ -1,9 +1,11 @@ +import '../support/commands.js'; + describe('SciELO Moderation Stages - Hide participants discussion', function () { + let submissionTitle = 'Candyman'; + it('Moderators participants are hidden when author opens discussion', function () { cy.login('fpaglieri', null, 'publicknowledge'); - - cy.get('#archive-button').click(); - cy.contains('a','View').click(); + cy.findSubmission('archive', submissionTitle); cy.contains('Discussions').click(); cy.contains('Add discussion').click(); @@ -14,8 +16,7 @@ describe('SciELO Moderation Stages - Hide participants discussion', function () }); it('Participants are not hidden for other roles', function () { cy.login('dbarnes', null, 'publicknowledge'); - cy.get('#archive-button').click(); - cy.contains('View Paglieri').first().click(); + cy.findSubmission('archive', submissionTitle); cy.contains('Add discussion').click(); cy.waitJQuery(); diff --git a/cypress/tests/Test5_lastModerationStage.cy.js b/cypress/tests/Test5_lastModerationStage.cy.js deleted file mode 100644 index 0e4bcbe..0000000 --- a/cypress/tests/Test5_lastModerationStage.cy.js +++ /dev/null @@ -1,97 +0,0 @@ -function loginAuthorUser() { - cy.get('input[id=username]').clear(); - cy.get('input[id=username]').type(Cypress.env('OJSAuthorUsername'), { delay: 0 }); - cy.get('input[id=password]').type(Cypress.env('OJSAuthorPassword'), { delay: 0 }); - cy.get('button[class=submit]').click(); -} - -function loginAdminUser() { - cy.get('input[id=username]').clear(); - cy.get('input[id=username]').type(Cypress.env('OJSAdminUsername'), { delay: 0 }); - cy.get('input[id=password]').type(Cypress.env('OJSAdminPassword'), { delay: 0 }); - cy.get('button[class=submit]').click(); -} - -function userLogout() { - cy.get(".pkpDropdown.app__headerAction > .pkpButton").click(); - cy.get("a.pkpDropdown__action").contains("Logout").click(); -} - -function submissionStep1() { - cy.get('#sectionId').select('1'); - cy.get('#pkp_submissionChecklist > ul > li > label > input').check(); - cy.get('#privacyConsent').check(); - - cy.get('#submissionStep1 > .formButtons > .submitFormButton').click(); -} - -function submissionStep2() { - cy.get('#submitStep2Form > .formButtons > .submitFormButton').click(); -} - -function submissionStep3() { - cy.get('input[name^="title"]').first().type("Submission test first moderation stage", { delay: 0 }); - cy.get('label').contains('Title').click(); - cy.get('textarea[id^="abstract-"').then((node) => { - cy.setTinyMceContent(node.attr("id"), "Example of abstract"); - }); - cy.get('.section > label:visible').first().click(); - cy.get('ul[id^="en_US-keywords-"]').then(node => { - node.tagit('createTag', "Dummy keyword"); - }); - cy.get('#submitStep3Form > .formButtons > .submitFormButton').click(); -} - -function submissionStep4() { - cy.get('#submitStep4Form > .formButtons > .submitFormButton').click(); - cy.get('.pkp_modal_confirmation > .footer > .ok').click(); -} - -function sendSubmissionToNextStage() { - cy.get('a[id^="component-grid-users-stageparticipant-stageparticipantgrid-requestAccount"]').contains("Assign").click(); - cy.wait(500); - cy.get('tr[id^="component-grid-users-userselect-userselectgrid-row"] > .first_column > input').first().click(); - cy.get('#checkboxSendNextStageAssignYes').click(); - cy.get("#addParticipantForm > .formButtons > .submitFormButton").click(); - cy.wait(3000); -} - -function checkSendingNextStageInAssignmentIsNotPresent() { - cy.get('a[id^="component-grid-users-stageparticipant-stageparticipantgrid-requestAccount"]').contains("Assign").click(); - cy.get('#checkboxSendNextStageDiv').should('not.exist'); - cy.get('.cancelButton').click(); -} - -function checkTryingSendNextStageDoesntWork() { - cy.get('#publication-button').click(); - cy.get('#scieloModerationStages-button').click(); - cy.get('#checkboxSendNextStageMenuYes').click(); - cy.get('#moderationStageSubmit').click(); - cy.reload(); - cy.get('#scieloModerationStages-button'); -} - -describe("SciELO Moderation Stages Plugin - Option to sent submission to next moderation stage when submission in last stage", function() { - it("Author user submits", function() { - cy.visit(Cypress.env('baseUrl') + 'index.php/scielo/submissions'); - loginAuthorUser(); - - cy.get('.pkpHeader__actions:visible > a.pkpButton').click(); - submissionStep1(); - submissionStep2(); - submissionStep3(); - submissionStep4(); - userLogout(); - }); - it("Check the options to send submission to next moderation stage behavior when submission is in last moderation stage", function() { - loginAdminUser(); - cy.wait(3000); - cy.get("#active-button").click(); - cy.get(".listPanel__itemActions:visible > a.pkpButton").first().click(); - - sendSubmissionToNextStage(); - sendSubmissionToNextStage(); - checkSendingNextStageInAssignmentIsNotPresent(); - checkTryingSendNextStageDoesntWork(); - }); -}); \ No newline at end of file diff --git a/cypress/tests/Test6_stagesViewMenu.cy.js b/cypress/tests/Test6_stagesViewMenu.cy.js deleted file mode 100644 index 39b7fec..0000000 --- a/cypress/tests/Test6_stagesViewMenu.cy.js +++ /dev/null @@ -1,81 +0,0 @@ -function loginAuthorUser() { - cy.get('input[id=username]').clear(); - cy.get('input[id=username]').type(Cypress.env('OJSAuthorUsername'), { delay: 0 }); - cy.get('input[id=password]').type(Cypress.env('OJSAuthorPassword'), { delay: 0 }); - cy.get('button[class=submit]').click(); -} - -function loginAdminUser() { - cy.get('input[id=username]').clear(); - cy.get('input[id=username]').type(Cypress.env('OJSAdminUsername'), { delay: 0 }); - cy.get('input[id=password]').type(Cypress.env('OJSAdminPassword'), { delay: 0 }); - cy.get('button[class=submit]').click(); -} - -function userLogout() { - cy.get(".pkpDropdown.app__headerAction > .pkpButton").click(); - cy.get("a.pkpDropdown__action").contains("Logout").click(); -} - -function submissionStep1() { - cy.get('#sectionId').select('1'); - cy.get('#pkp_submissionChecklist > ul > li > label > input').check(); - cy.get('#privacyConsent').check(); - - cy.get('#submissionStep1 > .formButtons > .submitFormButton').click(); -} - -function submissionStep2() { - cy.get('#submitStep2Form > .formButtons > .submitFormButton').click(); -} - -function submissionStep3() { - cy.get('input[name^="title"]').first().type("Submission test first moderation stage", { delay: 0 }); - cy.get('label').contains('Title').click(); - cy.get('textarea[id^="abstract-"').then((node) => { - cy.setTinyMceContent(node.attr("id"), "Example of abstract"); - }); - cy.get('.section > label:visible').first().click(); - cy.get('ul[id^="en_US-keywords-"]').then(node => { - node.tagit('createTag', "Dummy keyword"); - }); - cy.get('#submitStep3Form > .formButtons > .submitFormButton').click(); -} - -function submissionStep4() { - cy.get('#submitStep4Form > .formButtons > .submitFormButton').click(); - cy.get('.pkp_modal_confirmation > .footer > .ok').click(); -} - -function checkOptionSendNextStageIsPresent() { - cy.contains("This submission is in the Format Pre-Moderation stage, do you want to send it to the Content Pre-Moderation stage?"); - cy.get('#checkboxSendNextStageMenuYes').parent().contains("Yes"); - cy.get('#checkboxSendNextStageMenuNo').parent().contains("No"); - cy.get('#checkboxSendNextStageMenuYes').should('not.be.checked'); - cy.get('#checkboxSendNextStageMenuNo').should('be.checked'); -} - -describe("SciELO Moderation Stages Plugin - Menu for view/edit moderation stage entry dates", function() { - it("Author user submits", function() { - cy.visit(Cypress.env('baseUrl') + 'index.php/scielo/submissions'); - loginAuthorUser(); - - cy.get('.pkpHeader__actions:visible > a.pkpButton').click(); - submissionStep1(); - submissionStep2(); - submissionStep3(); - submissionStep4(); - userLogout(); - }); - it("Check if menu for view/edit moderation stage entry dates is present in preprint view", function() { - loginAdminUser(); - cy.wait(3000); - cy.get("#active-button").click(); - cy.get(".listPanel__itemActions:visible > a.pkpButton").first().click(); - - cy.get("#publication-button").click(); - cy.get(".pkpTabs__buttons > #scieloModerationStages-button").click(); - cy.get('label').contains('Format Pre-Moderation'); - checkOptionSendNextStageIsPresent(); - }); -}); \ No newline at end of file diff --git a/cypress/tests/Test7_currentStageOnSubmissionPage.cy.js b/cypress/tests/Test7_currentStageOnSubmissionPage.cy.js deleted file mode 100644 index aa3e284..0000000 --- a/cypress/tests/Test7_currentStageOnSubmissionPage.cy.js +++ /dev/null @@ -1,71 +0,0 @@ -function loginAuthorUser() { - cy.get('input[id=username]').clear(); - cy.get('input[id=username]').type(Cypress.env('OJSAuthorUsername'), { delay: 0 }); - cy.get('input[id=password]').type(Cypress.env('OJSAuthorPassword'), { delay: 0 }); - cy.get('button[class=submit]').click(); -} - -function loginAdminUser() { - cy.get('input[id=username]').clear(); - cy.get('input[id=username]').type(Cypress.env('OJSAdminUsername'), { delay: 0 }); - cy.get('input[id=password]').type(Cypress.env('OJSAdminPassword'), { delay: 0 }); - cy.get('button[class=submit]').click(); -} - -function userLogout() { - cy.get(".pkpDropdown.app__headerAction > .pkpButton").click(); - cy.get("a.pkpDropdown__action").contains("Logout").click(); -} - -function submissionStep1() { - cy.get('#sectionId').select('1'); - cy.get('#pkp_submissionChecklist > ul > li > label > input').check(); - cy.get('#privacyConsent').check(); - - cy.get('#submissionStep1 > .formButtons > .submitFormButton').click(); -} - -function submissionStep2() { - cy.get('#submitStep2Form > .formButtons > .submitFormButton').click(); -} - -function submissionStep3() { - cy.get('input[name^="title"]').first().type("Submission test first moderation stage", { delay: 0 }); - cy.get('label').contains('Title').click(); - cy.get('textarea[id^="abstract-"').then((node) => { - cy.setTinyMceContent(node.attr("id"), "Example of abstract"); - }); - cy.get('.section > label:visible').first().click(); - cy.get('ul[id^="en_US-keywords-"]').then(node => { - node.tagit('createTag', "Dummy keyword"); - }); - cy.get('#submitStep3Form > .formButtons > .submitFormButton').click(); -} - -function submissionStep4() { - cy.get('#submitStep4Form > .formButtons > .submitFormButton').click(); - cy.get('.pkp_modal_confirmation > .footer > .ok').click(); -} - -describe("SciELO Moderation Stages Plugin - Exhibitor of submission's current stage in submission's page", function() { - it("Author user submits", function() { - cy.visit(Cypress.env('baseUrl') + 'index.php/scielo/submissions'); - loginAuthorUser(); - - cy.get('.pkpHeader__actions:visible > a.pkpButton').click(); - submissionStep1(); - submissionStep2(); - submissionStep3(); - submissionStep4(); - userLogout(); - }); - it("Check if current moderation stage exhibitor appears in submission's page", function() { - loginAdminUser(); - cy.wait(3000); - cy.get("#active-button").click(); - cy.get(".listPanel__itemActions:visible > a.pkpButton").first().click(); - cy.get("#publication-button").click(); - cy.get(".moderationStageStatus > strong").contains("Moderation stage:"); - cy.get(".moderationStageStatus > span").contains("Format Pre-Moderation"); - }); -}); \ No newline at end of file diff --git a/cypress/tests/Test8_pastTimeOnSubmissionsList.cy.js b/cypress/tests/Test8_pastTimeOnSubmissionsList.cy.js deleted file mode 100644 index ef5cbc0..0000000 --- a/cypress/tests/Test8_pastTimeOnSubmissionsList.cy.js +++ /dev/null @@ -1,119 +0,0 @@ -function loginAuthorUser() { - cy.get('input[id=username]').clear(); - cy.get('input[id=username]').type(Cypress.env('OJSAuthorUsername'), { delay: 0 }); - cy.get('input[id=password]').type(Cypress.env('OJSAuthorPassword'), { delay: 0 }); - cy.get('button[class=submit]').click(); -} - -function loginAdminUser() { - cy.get('input[id=username]').clear(); - cy.get('input[id=username]').type(Cypress.env('OJSAdminUsername'), { delay: 0 }); - cy.get('input[id=password]').type(Cypress.env('OJSAdminPassword'), { delay: 0 }); - cy.get('button[class=submit]').click(); -} - -function userLogout() { - cy.get(".pkpDropdown.app__headerAction > .pkpButton").click(); - cy.get("a.pkpDropdown__action").contains("Logout").click(); -} - -function submissionStep1() { - cy.get('#sectionId').select('1'); - cy.get('#pkp_submissionChecklist > ul > li > label > input').check(); - cy.get('#privacyConsent').check(); - - cy.get('#submissionStep1 > .formButtons > .submitFormButton').click(); -} - -function submissionStep2() { - cy.get('#submitStep2Form > .formButtons > .submitFormButton').click(); -} - -function submissionStep3() { - cy.get('input[name^="title"]').first().type("Submission test past time in submissions listing", { delay: 0 }); - cy.get('label').contains('Title').click(); - cy.get('textarea[id^="abstract-"').then((node) => { - cy.setTinyMceContent(node.attr("id"), "Example of abstract"); - }); - cy.get('.section > label:visible').first().click(); - cy.get('ul[id^="en_US-keywords-"]').then(node => { - node.tagit('createTag', "Dummy keyword"); - }); - cy.get('#submitStep3Form > .formButtons > .submitFormButton').click(); -} - -function submissionStep4() { - cy.get('#submitStep4Form > .formButtons > .submitFormButton').click(); - cy.get('.pkp_modal_confirmation > .footer > .ok').click(); -} - -function assignUser(userGroupName) { - cy.get('a[id^="component-grid-users-stageparticipant-stageparticipantgrid-requestAccount"]').contains("Assign").click(); - cy.get('select[name^="filterUserGroupId"]').select(userGroupName); - cy.get('button').contains('Search').click(); - cy.wait(500); - cy.get('tr[id^="component-grid-users-userselect-userselectgrid-row"] > .first_column > input').first().click(); - cy.get('#checkboxSendNextStageAssignNo').click(); - cy.get("#addParticipantForm > .formButtons > .submitFormButton").click(); - cy.wait(3000); -} - -function assignResponsibleUser() { - assignUser('Responsible'); -} - -function assignAreaModeratorUser() { - assignUser('Area Moderator'); -} - -describe("SciELO Moderation Stages Plugin - Past time exhibitors in submissions listing page", function() { - it("Author user submits", function() { - cy.visit(Cypress.env('baseUrl') + 'index.php/scielo/submissions'); - loginAuthorUser(); - - cy.get('.pkpHeader__actions:visible > a.pkpButton').click(); - submissionStep1(); - submissionStep2(); - submissionStep3(); - submissionStep4(); - userLogout(); - }); - it("Assign responsible and area moderator users", function() { - loginAdminUser(); - cy.wait(3000); - cy.get("#active-button").click(); - cy.get("a.pkpButton:visible").contains("View").first().click(); - assignResponsibleUser(); - cy.reload(); - assignAreaModeratorUser(); - }); - it("Check if past time exhibitors appear in submissions listing", function() { - cy.get(".app__navItem").contains("Submissions").click(); - cy.get("#active-button").click(); - cy.get(".listPanel__itemIdentity:visible > .exhibitorsSeparator").first(); - cy.get(".listPanel__itemIdentity:visible > .listPanel__itemTimeSubmitted") - .first() - .contains('Submission made less than a day ago'); - cy.get(".listPanel__itemIdentity:visible > .listPanel__itemTimeResponsible") - .first() - .contains('Responsible assigned less than a day ago'); - cy.get(".listPanel__itemIdentity:visible > .listPanel__itemTimeAreaModerator") - .first() - .contains('Area moderator assigned less than a day ago'); - cy.logout(); - }); - it("Check if past time exhibitors do not appear for authors", function() { - loginAuthorUser(); - cy.get('.listPanel__itemModerationStage').within(() => { - cy.contains('Moderation stage:'); - cy.contains('Format Pre-Moderation'); - }); - - cy.contains('Responsible:').should('not.exist'); - cy.contains('Area moderator:').should('not.exist'); - - cy.contains('Submission made').should('not.exist'); - cy.contains('Responsible assigned').should('not.exist'); - cy.contains('Area moderator assigned').should('not.exist'); - }); -}); \ No newline at end of file From 529517af161486ac8c4ae2cb994b719b7e8e63f6 Mon Sep 17 00:00:00 2001 From: Jhon Date: Wed, 31 Jan 2024 14:35:04 -0400 Subject: [PATCH 14/24] Exhibits submissions' moderation stage in submissions page Issue: documentacao-e-tarefas/scielo#629 Signed-off-by: Jhon Signed-off-by: Iudi --- ScieloModerationStagesPlugin.php | 2 +- classes/ModerationStageDAO.php | 8 +- .../Test4_exhibitorsSubmissionsPage.cy.js | 44 ++++++++++ cypress/tests/Test4_submissionIsPosted.cy.js | 87 ------------------- .../Test5_hideParticipantsDiscussion.cy.js | 4 + 5 files changed, 53 insertions(+), 92 deletions(-) create mode 100644 cypress/tests/Test4_exhibitorsSubmissionsPage.cy.js delete mode 100644 cypress/tests/Test4_submissionIsPosted.cy.js diff --git a/ScieloModerationStagesPlugin.php b/ScieloModerationStagesPlugin.php index bbb0571..ddea028 100644 --- a/ScieloModerationStagesPlugin.php +++ b/ScieloModerationStagesPlugin.php @@ -51,7 +51,7 @@ public function register($category, $path, $mainContextId = null) Hook::add('Template::Workflow', [$this, 'addCurrentStageStatusToWorkflow']); Hook::add('LoadComponentHandler', [$this, 'setupScieloModerationStagesHandler']); - // Hook::add('TemplateManager::display', [$this, 'addJavaScriptAndStylesheet']); + Hook::add('TemplateManager::display', [$this, 'addJavaScriptAndStylesheet']); $this->addHandlerURLToJavaScript(); } diff --git a/classes/ModerationStageDAO.php b/classes/ModerationStageDAO.php index 0b58f12..a846de2 100644 --- a/classes/ModerationStageDAO.php +++ b/classes/ModerationStageDAO.php @@ -9,16 +9,16 @@ * Operations for retrieving data to help identify submissions' moderation stage */ -import('lib.pkp.classes.db.DAO'); +namespace APP\plugins\generic\scieloModerationStages\classes; -use Illuminate\Database\Capsule\Manager as Capsule; -use Illuminate\Support\Collection; +use PKP\db\DAO; +use Illuminate\Support\Facades\DB; class ModerationStageDAO extends DAO { public function getSubmissionModerationStage($submissionId): ?int { - $result = Capsule::table('submission_settings') + $result = DB::table('submission_settings') ->where('submission_id', $submissionId) ->where('setting_name', 'currentModerationStage') ->select('setting_value') diff --git a/cypress/tests/Test4_exhibitorsSubmissionsPage.cy.js b/cypress/tests/Test4_exhibitorsSubmissionsPage.cy.js new file mode 100644 index 0000000..9a189f7 --- /dev/null +++ b/cypress/tests/Test4_exhibitorsSubmissionsPage.cy.js @@ -0,0 +1,44 @@ +import '../support/commands.js'; + +describe('SciELO Moderation Stages - Exhibitors on submissions page', function () { + let submission1 = "Night of the Living Dead"; + let submission2 = "Ju-on: The Grudge"; + + before(function() { + Cypress.config('defaultCommandTimeout', 4000); + }); + + it("Authors can only view submissions' moderation stage", function () { + cy.login('fpaglieri', null, 'publicknowledge'); + + cy.waitJQuery(); + cy.get('.listPanel__itemSubtitle:visible:contains("' + submission1 + '")') + .parent().within(() => { + cy.contains('Moderation stage:'); + cy.contains('Area Moderation'); + }); + + cy.get('.listPanel__itemSubtitle:visible:contains("' + submission2 + '")') + .parent().within(() => { + cy.contains('Moderation stage:'); + cy.contains('Manuscript Type Pre-Moderation'); + }); + }); + it("Editor can view all submissions' exhibitors", function () { + cy.login('dbarnes', null, 'publicknowledge'); + cy.get('#active-button').click(); + + cy.waitJQuery(); + cy.get('.listPanel__itemSubtitle:visible:contains("' + submission1 + '")') + .parent().within(() => { + cy.contains('Moderation stage:'); + cy.contains('Area Moderation'); + }); + + cy.get('.listPanel__itemSubtitle:visible:contains("' + submission2 + '")') + .parent().within(() => { + cy.contains('Moderation stage:'); + cy.contains('Manuscript Type Pre-Moderation'); + }); + }); +}); \ No newline at end of file diff --git a/cypress/tests/Test4_submissionIsPosted.cy.js b/cypress/tests/Test4_submissionIsPosted.cy.js deleted file mode 100644 index d751285..0000000 --- a/cypress/tests/Test4_submissionIsPosted.cy.js +++ /dev/null @@ -1,87 +0,0 @@ -function loginAuthorUser() { - cy.get('input[id=username]').clear(); - cy.get('input[id=username]').type(Cypress.env('OJSAuthorUsername'), { delay: 0 }); - cy.get('input[id=password]').type(Cypress.env('OJSAuthorPassword'), { delay: 0 }); - cy.get('button[class=submit]').click(); -} - -function loginAdminUser() { - cy.get('input[id=username]').clear(); - cy.get('input[id=username]').type(Cypress.env('OJSAdminUsername'), { delay: 0 }); - cy.get('input[id=password]').type(Cypress.env('OJSAdminPassword'), { delay: 0 }); - cy.get('button[class=submit]').click(); -} - -function userLogout() { - cy.get(".pkpDropdown.app__headerAction > .pkpButton").click(); - cy.get("a.pkpDropdown__action").contains("Logout").click(); -} - -function submissionStep1() { - cy.get('#sectionId').select('1'); - cy.get('#pkp_submissionChecklist > ul > li > label > input').check(); - cy.get('#privacyConsent').check(); - - cy.get('#submissionStep1 > .formButtons > .submitFormButton').click(); -} - -function submissionStep2() { - cy.get('#submitStep2Form > .formButtons > .submitFormButton').click(); -} - -function submissionStep3() { - cy.get('input[name^="title"]').first().type("Submission test first moderation stage", { delay: 0 }); - cy.get('label').contains('Title').click(); - cy.get('textarea[id^="abstract-"').then((node) => { - cy.setTinyMceContent(node.attr("id"), "Example of abstract"); - }); - cy.get('.section > label:visible').first().click(); - cy.get('ul[id^="en_US-keywords-"]').then(node => { - node.tagit('createTag', "Dummy keyword"); - }); - cy.get('#submitStep3Form > .formButtons > .submitFormButton').click(); -} - -function submissionStep4() { - cy.get('#submitStep4Form > .formButtons > .submitFormButton').click(); - cy.get('.pkp_modal_confirmation > .footer > .ok').click(); -} - -function postSubmission() { - cy.get("#publication-button").click(); - cy.get(".pkpButton:visible").contains("Post").click(); - cy.get('.pkpWorkflow__publishModal').within(() => { - return cy.get('.pkpButton').contains('Post'); - }) - .click(); -} - -function checkOptionSendNextStageIsNotPresent() { - cy.get("a").contains("Assign").click(); - cy.get('#checkboxSendNextStageDiv').should('not.exist'); -} - -describe("SciELO Moderation Stages Plugin - Option to sent submission to next moderation stage when submission is posted", function() { - it("Author user submits", function() { - cy.visit(Cypress.env('baseUrl') + 'index.php/scielo/submissions'); - loginAuthorUser(); - - cy.get('.pkpHeader__actions:visible > a.pkpButton').click(); - submissionStep1(); - submissionStep2(); - submissionStep3(); - submissionStep4(); - userLogout(); - }); - it("Check option to sent submission to next moderation stage does not show when submision is posted", function() { - loginAdminUser(); - cy.wait(3000); - cy.get("#active-button").click(); - cy.get(".listPanel__itemActions:visible > a.pkpButton").first().click(); - - postSubmission(); - cy.wait(3000); - cy.get("#workflow-button").click(); - checkOptionSendNextStageIsNotPresent(); - }); -}); \ No newline at end of file diff --git a/cypress/tests/Test5_hideParticipantsDiscussion.cy.js b/cypress/tests/Test5_hideParticipantsDiscussion.cy.js index 077b110..fa70273 100644 --- a/cypress/tests/Test5_hideParticipantsDiscussion.cy.js +++ b/cypress/tests/Test5_hideParticipantsDiscussion.cy.js @@ -3,6 +3,10 @@ import '../support/commands.js'; describe('SciELO Moderation Stages - Hide participants discussion', function () { let submissionTitle = 'Candyman'; + before(function() { + Cypress.config('defaultCommandTimeout', 4000); + }); + it('Moderators participants are hidden when author opens discussion', function () { cy.login('fpaglieri', null, 'publicknowledge'); cy.findSubmission('archive', submissionTitle); From 150fe155709adabcbee90d2e6495f339dd918482 Mon Sep 17 00:00:00 2001 From: Jhon Date: Wed, 31 Jan 2024 15:01:20 -0400 Subject: [PATCH 15/24] Exhibits time since submission in submissions page Also fixes getUserIsAuthor function Issue: documentacao-e-tarefas/scielo#629 Signed-off-by: Jhon Signed-off-by: Iudi --- .gitlab-ci.yml | 1 + controllers/ScieloModerationStagesHandler.php | 2 +- cypress/tests/Test4_exhibitorsSubmissionsPage.cy.js | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 400c201..db213d3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,3 +7,4 @@ include: file: - 'templates/groups/pkp_plugin.yml' - 'templates/groups/ops_3_4_plugins_unit_tests_model.yml' + - 'templates/groups/ops_3_4_plugins_cypress_tests_model.yml' diff --git a/controllers/ScieloModerationStagesHandler.php b/controllers/ScieloModerationStagesHandler.php index aa25c8e..3ca446f 100644 --- a/controllers/ScieloModerationStagesHandler.php +++ b/controllers/ScieloModerationStagesHandler.php @@ -67,7 +67,7 @@ public function getSubmissionExhibitData($args, $request) public function getUserIsAuthor($args, $request) { $userRoles = $this->getAuthorizedContextObject(Application::ASSOC_TYPE_USER_ROLES); - $adminRoles = [Role::ROLE_ID_SITE_ADMIN, Role::ROLE_ID_SUB_EDITOR]; + $adminRoles = [Role::ROLE_ID_SITE_ADMIN, Role::ROLE_ID_MANAGER, Role::ROLE_ID_SUB_EDITOR]; if (count(array_intersect($userRoles, $adminRoles)) > 0) { return json_encode(0); diff --git a/cypress/tests/Test4_exhibitorsSubmissionsPage.cy.js b/cypress/tests/Test4_exhibitorsSubmissionsPage.cy.js index 9a189f7..ca40ac0 100644 --- a/cypress/tests/Test4_exhibitorsSubmissionsPage.cy.js +++ b/cypress/tests/Test4_exhibitorsSubmissionsPage.cy.js @@ -33,12 +33,16 @@ describe('SciELO Moderation Stages - Exhibitors on submissions page', function ( .parent().within(() => { cy.contains('Moderation stage:'); cy.contains('Area Moderation'); + + cy.contains('Submission made less than a day ago'); }); cy.get('.listPanel__itemSubtitle:visible:contains("' + submission2 + '")') .parent().within(() => { cy.contains('Moderation stage:'); cy.contains('Manuscript Type Pre-Moderation'); + + cy.contains('Submission made less than a day ago'); }); }); }); \ No newline at end of file From 1afefedcd415ea54f919c23cbb76bd2defa260e6 Mon Sep 17 00:00:00 2001 From: Jhon Date: Wed, 31 Jan 2024 17:39:26 -0400 Subject: [PATCH 16/24] Fixes constant error in handler class Issue: documentacao-e-tarefas/scielo#629 Signed-off-by: Jhon Signed-off-by: Iudi --- controllers/ScieloModerationStagesHandler.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controllers/ScieloModerationStagesHandler.php b/controllers/ScieloModerationStagesHandler.php index 3ca446f..e3b80e4 100644 --- a/controllers/ScieloModerationStagesHandler.php +++ b/controllers/ScieloModerationStagesHandler.php @@ -7,6 +7,7 @@ use PKP\security\Role; use PKP\db\DAORegistry; use APP\submission\Submission; +use APP\decision\Decision; use APP\plugins\generic\scieloModerationStages\classes\ModerationStage; use APP\plugins\generic\scieloModerationStages\classes\ModerationStageRegister; use APP\plugins\generic\scieloModerationStages\classes\ModerationStageDAO; @@ -158,7 +159,7 @@ private function getSecondDateParamsForTimeExhibitors($submission): array if ($submission->getData('status') == Submission::STATUS_DECLINED) { $result = DB::table('edit_decisions') ->where('submission_id', $submission->getId()) - ->whereIn('decision', [SUBMISSION_EDITOR_DECISION_DECLINE, SUBMISSION_EDITOR_DECISION_INITIAL_DECLINE]) + ->whereIn('decision', [Decision::DECLINE, Decision::INITIAL_DECLINE]) ->orderBy('date_decided', 'asc') ->first(); From 6b13460e6ff2be3426ea9045180a6b1186fba38a Mon Sep 17 00:00:00 2001 From: Jhon Date: Wed, 31 Jan 2024 17:50:17 -0400 Subject: [PATCH 17/24] Fixes url construction in main class Issue: documentacao-e-tarefas/scielo#629 Signed-off-by: Jhon Signed-off-by: Iudi --- ScieloModerationStagesPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ScieloModerationStagesPlugin.php b/ScieloModerationStagesPlugin.php index ddea028..9006080 100644 --- a/ScieloModerationStagesPlugin.php +++ b/ScieloModerationStagesPlugin.php @@ -62,7 +62,7 @@ public function addHandlerURLToJavaScript() { $request = Application::get()->getRequest(); $templateMgr = TemplateManager::getManager($request); - $handlerUrl = $request->getDispatcher()->url($request, ROUTE_COMPONENT) . 'plugins/generic/scielo-moderation-stages/controllers/scielo-moderation-stages/'; + $handlerUrl = $request->getDispatcher()->url($request, Application::ROUTE_COMPONENT, null, 'plugins.generic.scieloModerationStages.controllers.ScieloModerationStagesHandler'); $data = ['moderationStagesHandlerUrl' => $handlerUrl]; $templateMgr->addJavaScript('ModerationStagesHandler', 'app = ' . json_encode($data) . ';', ['contexts' => 'backend', 'inline' => true]); From 8b8fcf76a370a2ea2d232024faefceefef3a22ba Mon Sep 17 00:00:00 2001 From: Jhon Date: Wed, 31 Jan 2024 18:09:42 -0400 Subject: [PATCH 18/24] Fixes 2nd integration test Issue: documentacao-e-tarefas/scielo#629 Signed-off-by: Jhon Signed-off-by: Iudi --- cypress/tests/Test2_stageAdvancementHidden.cy.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cypress/tests/Test2_stageAdvancementHidden.cy.js b/cypress/tests/Test2_stageAdvancementHidden.cy.js index c890ee1..c951c36 100644 --- a/cypress/tests/Test2_stageAdvancementHidden.cy.js +++ b/cypress/tests/Test2_stageAdvancementHidden.cy.js @@ -46,6 +46,7 @@ describe("SciELO Moderation Stages - Stage advancement hidden scenarios", functi cy.get('.pkpHeader__actions button:contains("Post")').click(); cy.get('.pkp_modal_panel button:contains("Post")').click(); cy.contains('span', 'Posted'); + cy.reload(); cy.get('#workflow-button').click(); cy.contains('a', 'Assign').click(); @@ -57,6 +58,7 @@ describe("SciELO Moderation Stages - Stage advancement hidden scenarios", functi cy.get('.pkpHeader__actions button:contains("Unpost")').click(); cy.get('.modal__panel button:contains("Unpost")').click(); cy.contains('span', 'Unposted'); + cy.reload(); cy.get('#workflow-button').click(); cy.contains('a', 'Decline Submission').click(); From f4e8e58695eaa25d419f539ff43b51fe1d1f052a Mon Sep 17 00:00:00 2001 From: Jhon Date: Wed, 31 Jan 2024 18:53:25 -0400 Subject: [PATCH 19/24] Adds wait after assign Signed-off-by: Jhon --- cypress/tests/Test1_moderationStageAdvancement.cy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/tests/Test1_moderationStageAdvancement.cy.js b/cypress/tests/Test1_moderationStageAdvancement.cy.js index 41d12b1..6e06060 100644 --- a/cypress/tests/Test1_moderationStageAdvancement.cy.js +++ b/cypress/tests/Test1_moderationStageAdvancement.cy.js @@ -59,7 +59,7 @@ describe("SciELO Moderation Stages - Moderation stage advancement", function() { cy.get('tr[id^="component-grid-users-userselect-userselectgrid-row"] > .first_column > input').first().click(); cy.get('#checkboxSendNextStageAssignYes').click(); cy.get("#addParticipantForm > .formButtons > .submitFormButton").click(); - cy.waitJQuery(); + cy.wait(3000); cy.reload(); cy.contains('span', 'Manuscript Type Pre-Moderation'); @@ -74,7 +74,7 @@ describe("SciELO Moderation Stages - Moderation stage advancement", function() { cy.get('tr[id^="component-grid-users-userselect-userselectgrid-row"] > .first_column > input').first().click(); cy.get('#checkboxSendNextStageAssignYes').click(); cy.get("#addParticipantForm > .formButtons > .submitFormButton").click(); - cy.waitJQuery(); + cy.wait(3000); cy.reload(); cy.contains('span', 'Area Moderation'); From 0d84b20dc4977d35c6b0b4cbaaa669ad212ba6f9 Mon Sep 17 00:00:00 2001 From: Jhon Date: Thu, 1 Feb 2024 10:46:45 -0400 Subject: [PATCH 20/24] Tries wait for jquery loading on findSubmission command Signed-off-by: Jhon --- cypress/support/commands.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 3aa63ce..f656bd8 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -56,7 +56,8 @@ Cypress.Commands.add('createSubmission', function (submissionData) { }); Cypress.Commands.add('findSubmission', function(tab, title) { - cy.get('#' + tab + '-button').click(); + cy.waitJQuery(); + cy.get('#' + tab + '-button').click(); cy.get('.listPanel__itemSubtitle:visible:contains("' + title + '")').first() .parent().parent().within(() => { cy.get('.pkpButton:contains("View")').click(); From fd92fdc0a0590a3f1063105858d94cc916fd0524 Mon Sep 17 00:00:00 2001 From: Jhon Date: Thu, 1 Feb 2024 10:57:22 -0400 Subject: [PATCH 21/24] Adds waitJQuery after posting/unposting in cypress tests Signed-off-by: Jhon --- cypress/tests/Test2_stageAdvancementHidden.cy.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cypress/tests/Test2_stageAdvancementHidden.cy.js b/cypress/tests/Test2_stageAdvancementHidden.cy.js index c951c36..4535cf3 100644 --- a/cypress/tests/Test2_stageAdvancementHidden.cy.js +++ b/cypress/tests/Test2_stageAdvancementHidden.cy.js @@ -45,6 +45,7 @@ describe("SciELO Moderation Stages - Stage advancement hidden scenarios", functi cy.get('#publication-button').click(); cy.get('.pkpHeader__actions button:contains("Post")').click(); cy.get('.pkp_modal_panel button:contains("Post")').click(); + cy.waitJQuery(); cy.contains('span', 'Posted'); cy.reload(); @@ -57,6 +58,7 @@ describe("SciELO Moderation Stages - Stage advancement hidden scenarios", functi cy.get('#publication-button').click(); cy.get('.pkpHeader__actions button:contains("Unpost")').click(); cy.get('.modal__panel button:contains("Unpost")').click(); + cy.waitJQuery(); cy.contains('span', 'Unposted'); cy.reload(); From 5c2c257e53c3ed5e9c8a21ace72073de88d8f880 Mon Sep 17 00:00:00 2001 From: Jhon Date: Thu, 1 Feb 2024 11:10:52 -0400 Subject: [PATCH 22/24] Replaces waitJQuery for wait in findSubmission cmd Signed-off-by: Jhon --- cypress/support/commands.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/commands.js b/cypress/support/commands.js index f656bd8..ee3c0ea 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -56,7 +56,7 @@ Cypress.Commands.add('createSubmission', function (submissionData) { }); Cypress.Commands.add('findSubmission', function(tab, title) { - cy.waitJQuery(); + cy.wait(3000); cy.get('#' + tab + '-button').click(); cy.get('.listPanel__itemSubtitle:visible:contains("' + title + '")').first() .parent().parent().within(() => { From 7221f65e5f3f6d5d221e27e4322c69733e279a02 Mon Sep 17 00:00:00 2001 From: Jhon Date: Thu, 1 Feb 2024 11:17:36 -0400 Subject: [PATCH 23/24] Adds wait after assign modal closing Signed-off-by: Jhon --- cypress/tests/Test2_stageAdvancementHidden.cy.js | 1 + 1 file changed, 1 insertion(+) diff --git a/cypress/tests/Test2_stageAdvancementHidden.cy.js b/cypress/tests/Test2_stageAdvancementHidden.cy.js index 4535cf3..01d6e3b 100644 --- a/cypress/tests/Test2_stageAdvancementHidden.cy.js +++ b/cypress/tests/Test2_stageAdvancementHidden.cy.js @@ -54,6 +54,7 @@ describe("SciELO Moderation Stages - Stage advancement hidden scenarios", functi checkSendNextStageOptionIsNotPresent(); cy.get('a.pkpModalCloseButton:visible').click(); cy.on('window:confirm', () => true); + cy.wait(3000); cy.get('#publication-button').click(); cy.get('.pkpHeader__actions button:contains("Unpost")').click(); From b96d5d00006e1db8ca51b9078023b53feb704711 Mon Sep 17 00:00:00 2001 From: Jhon Date: Thu, 1 Feb 2024 11:36:23 -0400 Subject: [PATCH 24/24] Finishes plugin adaptation Issue: documentacao-e-tarefas/scielo#629 Signed-off-by: Jhon Signed-off-by: Iudi --- cypress/testlist.txt | 20 -------------------- templates/moderationStageMenu.tpl | 4 ++-- version.xml | 4 ++-- 3 files changed, 4 insertions(+), 24 deletions(-) delete mode 100644 cypress/testlist.txt diff --git a/cypress/testlist.txt b/cypress/testlist.txt deleted file mode 100644 index 60a32ed..0000000 --- a/cypress/testlist.txt +++ /dev/null @@ -1,20 +0,0 @@ -Avanço de estágio de moderação - Cria uma submissão - Verifica que a submissão foi pro primeiro estágio de moderação - Envia submissão para próximo estágio de moderação pela designação de usuário - Avanço de estágio não aparece quando no último estágio - -Menu dos estágios de moderação - Autor deve poder visualizar estágios - Editor deve poder editar estágios - -Exibidor de estágio de moderação na página de submissões - Verificar vários itens que são exibidos - Autores devem ter acesso apenas a visualização do estágio de moderação - -Opção de enviar submissão para próximo estágio não deve aparecer quando: - Submissão rejeitada - Submissão postada - -Esconder participantes para autores ao abrir discussão - Teste praticamente pronto. Só conferir se está bom. \ No newline at end of file diff --git a/templates/moderationStageMenu.tpl b/templates/moderationStageMenu.tpl index 39456a0..fb97290 100644 --- a/templates/moderationStageMenu.tpl +++ b/templates/moderationStageMenu.tpl @@ -1,6 +1,6 @@ {* - * Copyright (c) 2022 Lepidus Tecnologia - * Copyright (c) 2022 SciELO + * Copyright (c) 2022 - 2024 Lepidus Tecnologia + * Copyright (c) 2022 - 2024 SciELO * Distributed under the GNU GPL v3. For full terms see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt * *} diff --git a/version.xml b/version.xml index 8849842..c8af828 100644 --- a/version.xml +++ b/version.xml @@ -13,7 +13,7 @@ scieloModerationStages plugins.generic 0 - 1.5.5.0 - 2023-12-01 + 2.0.0.0 + 2024-02-01 ScieloModerationStagesPlugin