Skip to content

Commit

Permalink
Merge branch 'fixRelationsButtonRules340-687' into 'main'
Browse files Browse the repository at this point in the history
Altera regras para exibição de botão de relações - 3.4.0

See merge request softwares-pkp/plugins_ojs/authorVersion!16
  • Loading branch information
JhonathanLepidus committed Jul 30, 2024
2 parents 645207c + 9dac943 commit 3f701a7
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ include:
ref: main
file:
- 'templates/groups/pkp_plugin.yml'
- 'templates/groups/ops_3_4_plugins_cypress_tests_model.yml'
- 'templates/groups/ops/cypress_tests.yml'
22 changes: 15 additions & 7 deletions cypress/tests/Test5_relations.cy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
describe('Author Version - Submission relations updating', function () {
let publishedArticleDoi = 'https://doi.org/10.1234/Non-existentDoi';

it('Changes preprint relation to "published as an article"', function () {
cy.login('zwoods', null, 'publicknowledge');
cy.get('#myQueue-button').click();
cy.contains('View Woods').click({force: true});

cy.get('button:contains("Relations")').click();
cy.get('.pkpWorkflow__relateForm input[value="3"]').click();
cy.get('.pkpWorkflow__relateForm input[name="vorDoi"]').clear().type(publishedArticleDoi, {delay: 0});
cy.get('.pkpWorkflow__relateForm button:contains("Save")').click();

cy.reload();
cy.get('button:contains("Relations")');
cy.get('button:contains("Create New Version")').should('not.exist');
});
it('Moderator posts last version of submission', function () {
cy.login('dbarnes', null, 'publicknowledge');
cy.get('#newVersion-button').click();
Expand All @@ -10,17 +24,11 @@ describe('Author Version - Submission relations updating', function () {
cy.get('.pkpHeader .pkpHeader__actions button:contains("Post")').click();
cy.get('.pkp_modal_panel button:contains("Post")').click();
});
it('Changes preprint relation to "published as an article"', function () {
it('Author can not change relations or create new version anymore', function () {
cy.login('zwoods', null, 'publicknowledge');
cy.get('#archive-button').click();
cy.contains('View Woods').click({force: true});

cy.get('button:contains("Relations")').click();
cy.get('.pkpWorkflow__relateForm input[value="3"]').click();
cy.get('.pkpWorkflow__relateForm input[name="vorDoi"]').clear().type(publishedArticleDoi, {delay: 0});
cy.get('.pkpWorkflow__relateForm button:contains("Save")').click();

cy.reload();
cy.get('button:contains("Relations")').should('not.exist');
cy.get('button:contains("Create New Version")').should('not.exist');
});
Expand Down
2 changes: 1 addition & 1 deletion templates/relationsButton.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<span class="pkpPublication__relation" v-if="workingPublication.relationStatus != {$smarty.const.PUBLICATION_RELATION_PUBLISHED} && workingPublication.status === getConstant('STATUS_PUBLISHED')">
<span class="pkpPublication__relation" v-if="workingPublication.status != getConstant('STATUS_PUBLISHED')">
<dropdown
class="pkpWorkflow__relation"
label="{translate key="publication.relation"}"
Expand Down
4 changes: 2 additions & 2 deletions version.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<version>
<application>authorVersion</application>
<type>plugins.generic</type>
<release>2.0.0.0</release>
<date>2023-12-11</date>
<release>2.0.1.0</release>
<date>2024-07-30</date>
<lazy-load>1</lazy-load>
<class>AuthorVersionPlugin</class>
</version>

0 comments on commit 3f701a7

Please sign in to comment.