Skip to content

Commit

Permalink
Merge branch 'fixRelationsRule340-691' into 'main'
Browse files Browse the repository at this point in the history
Altera regra de exibição do botão de relações - 3.4.0

See merge request softwares-pkp/plugins_ojs/authorVersion!18
  • Loading branch information
JhonathanLepidus committed Aug 12, 2024
2 parents 3f701a7 + d0240d4 commit 343af22
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 deletions.
37 changes: 36 additions & 1 deletion cypress/tests/Test5_relations.cy.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,41 @@
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 () {
before(function() {
Cypress.config('defaultCommandTimeout', 4000);
});
it('Author can change relations on posted preprint version', function () {
cy.login('zwoods', null, 'publicknowledge');
cy.get('#myQueue-button').click();
cy.contains('View Woods').click({force: true});
cy.get('button:contains("Relations")');
cy.logout();

cy.login('dbarnes', null, 'publicknowledge');
cy.get('#newVersion-button').click();
cy.contains('View Woods').click({force: true});
cy.get('#publication-button').click();
cy.get('.pkpHeader .pkpHeader__actions button:contains("Post")').click();
cy.get('.pkp_modal_panel button:contains("Post")').click();
cy.get('.pkpPublication__statusPublished');
cy.logout();

cy.login('zwoods', null, 'publicknowledge');
cy.get('#archive-button').click();
cy.contains('View Woods').click({force: true});
cy.get('.pkpPublication__statusPublished');
cy.get('button:contains("Relations")');
cy.logout();

cy.login('dbarnes', null, 'publicknowledge');
cy.get('#archive-button').click();
cy.contains('View Woods').click({force: true});
cy.get('#publication-button').click();
cy.get('button:contains("Unpost")').click();
cy.get('.modal__panel button:contains("Unpost")').click();
cy.get('.pkpPublication__statusUnpublished');
});
it('Author 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});
Expand All @@ -23,6 +57,7 @@ describe('Author Version - Submission relations updating', function () {
cy.get('#publication-button').click();
cy.get('.pkpHeader .pkpHeader__actions button:contains("Post")').click();
cy.get('.pkp_modal_panel button:contains("Post")').click();
cy.get('.pkpPublication__statusPublished');
});
it('Author can not change relations or create new version anymore', function () {
cy.login('zwoods', null, 'publicknowledge');
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.status != getConstant('STATUS_PUBLISHED')">
<span class="pkpPublication__relation" v-if="workingPublication.status != getConstant('STATUS_PUBLISHED') || workingPublication.relationStatus != {$smarty.const.PUBLICATION_RELATION_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.1.0</release>
<date>2024-07-30</date>
<release>2.0.2.0</release>
<date>2024-08-12</date>
<lazy-load>1</lazy-load>
<class>AuthorVersionPlugin</class>
</version>

0 comments on commit 343af22

Please sign in to comment.