From e9982fad65d998e0c339a275c11259e9d45165da Mon Sep 17 00:00:00 2001 From: wesleybl Date: Wed, 9 Oct 2024 12:55:43 -0300 Subject: [PATCH 1/2] Shows working copy options for Plone Site --- .../volto/cypress/tests/workingCopy/create.js | 4 +- packages/volto/news/5284.feature | 1 + .../src/components/manage/Toolbar/More.jsx | 233 +++++++++--------- 3 files changed, 119 insertions(+), 119 deletions(-) create mode 100644 packages/volto/news/5284.feature diff --git a/packages/volto/cypress/tests/workingCopy/create.js b/packages/volto/cypress/tests/workingCopy/create.js index 55b737e07f..5143616c5d 100644 --- a/packages/volto/cypress/tests/workingCopy/create.js +++ b/packages/volto/cypress/tests/workingCopy/create.js @@ -59,9 +59,9 @@ describe('Working Copy Tests - Create', () => { cy.findByText('View working copy'); }); - it('Portal root does not have create option', function () { + it('Portal root have create option', function () { cy.visit('/'); cy.get('#toolbar-more').click(); - cy.get('.menu-more').contains('Create working copy').should('not.exist'); + cy.get('.menu-more').contains('Create working copy').should('exist'); }); }); diff --git a/packages/volto/news/5284.feature b/packages/volto/news/5284.feature new file mode 100644 index 0000000000..9efefd148b --- /dev/null +++ b/packages/volto/news/5284.feature @@ -0,0 +1 @@ +Shows working copy options for Plone Site. @wesleybl diff --git a/packages/volto/src/components/manage/Toolbar/More.jsx b/packages/volto/src/components/manage/Toolbar/More.jsx index 07d8bc7c5d..ce29883a0b 100644 --- a/packages/volto/src/components/manage/Toolbar/More.jsx +++ b/packages/volto/src/components/manage/Toolbar/More.jsx @@ -320,125 +320,124 @@ const More = (props) => { )} - {config.settings.hasWorkingCopySupport && - content['@type'] !== 'Plone Site' && ( - <> - {!content.working_copy && ( - -
  • - -
  • -
    - )} - {content.working_copy && content.working_copy_of && ( - -
  • - +
  • +
    + )} + {content.working_copy && content.working_copy_of && ( + +
  • + -
  • -
  • - -
  • -
    - )} - {content.working_copy && !content.working_copy_of && ( - -
  • - props.closeMenu()} - > - {intl.formatMessage(messages.viewWorkingCopy)} - - -
  • -
    - )} - - )} + + + +
  • + +
  • + + )} + {content.working_copy && !content.working_copy_of && ( + +
  • + props.closeMenu()} + > + {intl.formatMessage(messages.viewWorkingCopy)} + + +
  • +
    + )} + + )} {editAction && config.settings.isMultilingual && (
  • From b98aa38ec84a3d54a41c8d45cc1963d9c96ec200 Mon Sep 17 00:00:00 2001 From: Wesley Barroso Lopes Date: Wed, 18 Dec 2024 09:43:24 -0300 Subject: [PATCH 2/2] Update packages/volto/cypress/tests/workingCopy/create.js Co-authored-by: Piero Nicolli --- packages/volto/cypress/tests/workingCopy/create.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/volto/cypress/tests/workingCopy/create.js b/packages/volto/cypress/tests/workingCopy/create.js index 5143616c5d..c5b21d392d 100644 --- a/packages/volto/cypress/tests/workingCopy/create.js +++ b/packages/volto/cypress/tests/workingCopy/create.js @@ -59,7 +59,7 @@ describe('Working Copy Tests - Create', () => { cy.findByText('View working copy'); }); - it('Portal root have create option', function () { + it('Portal root has create option', function () { cy.visit('/'); cy.get('#toolbar-more').click(); cy.get('.menu-more').contains('Create working copy').should('exist');