From 2b9e840b91a330d319d430ceb8f33a804f137254 Mon Sep 17 00:00:00 2001 From: NogaNHS Date: Mon, 8 Jan 2024 15:49:29 +0000 Subject: [PATCH 1/3] PRMDR-412 removing view all, changing herf to placeholder --- .../LloydGeorgeRecordDetails.tsx | 89 ++++++++++--------- app/src/types/blocks/lloydGeorgeActions.ts | 5 -- app/src/types/blocks/lloydGeorgeStages.ts | 1 - 3 files changed, 46 insertions(+), 49 deletions(-) diff --git a/app/src/components/blocks/lloydGeorgeRecordDetails/LloydGeorgeRecordDetails.tsx b/app/src/components/blocks/lloydGeorgeRecordDetails/LloydGeorgeRecordDetails.tsx index 854d3a3c8..973885cb1 100644 --- a/app/src/components/blocks/lloydGeorgeRecordDetails/LloydGeorgeRecordDetails.tsx +++ b/app/src/components/blocks/lloydGeorgeRecordDetails/LloydGeorgeRecordDetails.tsx @@ -7,6 +7,7 @@ import { Link } from 'react-router-dom'; import useRole from '../../../helpers/hooks/useRole'; import { actionLinks } from '../../../types/blocks/lloydGeorgeActions'; import { LG_RECORD_STAGE } from '../../../types/blocks/lloydGeorgeStages'; +import { REPOSITORY_ROLE } from '../../../types/generic/authRole'; export type Props = { lastUpdated: string; @@ -54,54 +55,56 @@ function LloydGeorgeRecordDetails({ ) : ( -
-
+ role !== REPOSITORY_ROLE.GP_CLINICAL && ( +
- - Select an action... - - -
- {showActionsMenu && ( -
- - -
    - {actionLinks.map((link) => - role && !link.unauthorised?.includes(role) ? ( -
  1. - { - e.preventDefault(); - setStage(link.stage); - }} - > - {link.label} - -
  2. - ) : null, - )} -
-
-
+ onClick={handleMoreActions} + > +
+ + Select an action... + +
- )} -
+ {showActionsMenu && ( +
+ + +
    + {actionLinks.map((link) => + role && !link.unauthorised?.includes(role) ? ( +
  1. + { + e.preventDefault(); + setStage(link.stage); + }} + > + {link.label} + +
  2. + ) : null, + )} +
+
+
+
+ )} +
+ ) )}
); diff --git a/app/src/types/blocks/lloydGeorgeActions.ts b/app/src/types/blocks/lloydGeorgeActions.ts index 8c7f34df5..ce07e02bc 100644 --- a/app/src/types/blocks/lloydGeorgeActions.ts +++ b/app/src/types/blocks/lloydGeorgeActions.ts @@ -9,11 +9,6 @@ type PdfActionLink = { }; export const actionLinks: Array = [ - { - label: 'See all files', - key: 'see-all-files-link', - stage: LG_RECORD_STAGE.SEE_ALL, - }, { label: 'Download all files', key: 'download-all-files-link', diff --git a/app/src/types/blocks/lloydGeorgeStages.ts b/app/src/types/blocks/lloydGeorgeStages.ts index 662c9e86c..5059b8238 100644 --- a/app/src/types/blocks/lloydGeorgeStages.ts +++ b/app/src/types/blocks/lloydGeorgeStages.ts @@ -1,6 +1,5 @@ export enum LG_RECORD_STAGE { RECORD = 0, DOWNLOAD_ALL = 1, - SEE_ALL = 2, DELETE_ALL = 3, } From 24d2d8ba180286595035e8296bf0cbb0b7616a1f Mon Sep 17 00:00:00 2001 From: NogaNHS Date: Mon, 8 Jan 2024 16:50:30 +0000 Subject: [PATCH 2/3] PRMDR-412 fix test --- .../LloydGeorgeRecordDetails.test.tsx | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/app/src/components/blocks/lloydGeorgeRecordDetails/LloydGeorgeRecordDetails.test.tsx b/app/src/components/blocks/lloydGeorgeRecordDetails/LloydGeorgeRecordDetails.test.tsx index 17075cd48..ce868b0c3 100644 --- a/app/src/components/blocks/lloydGeorgeRecordDetails/LloydGeorgeRecordDetails.test.tsx +++ b/app/src/components/blocks/lloydGeorgeRecordDetails/LloydGeorgeRecordDetails.test.tsx @@ -113,15 +113,8 @@ describe('LloydGeorgeRecordDetails', () => { renderComponent(); - expect(screen.getByText(`Select an action...`)).toBeInTheDocument(); - expect(screen.getByTestId('actions-menu')).toBeInTheDocument(); - - act(() => { - userEvent.click(screen.getByTestId('actions-menu')); - }); - await waitFor(async () => { - expect(screen.queryByText(action.label)).not.toBeInTheDocument(); - }); + expect(screen.queryByText(`Select an action...`)).not.toBeInTheDocument(); + expect(screen.queryByTestId('actions-menu')).not.toBeInTheDocument(); }, ); From db45b9f2e041b1b38f92b26856835c138c20ce30 Mon Sep 17 00:00:00 2001 From: NogaNHS Date: Mon, 8 Jan 2024 17:07:07 +0000 Subject: [PATCH 3/3] fix cypress tests --- .../gp_user_workflows/download_lloyd_george_workflow.cy.js | 3 +-- .../gp_user_workflows/view_lloyd_george_workflow.cy.js | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/cypress/e2e/0-ndr-core-tests/gp_user_workflows/download_lloyd_george_workflow.cy.js b/app/cypress/e2e/0-ndr-core-tests/gp_user_workflows/download_lloyd_george_workflow.cy.js index 05275eadf..f4c9af05d 100644 --- a/app/cypress/e2e/0-ndr-core-tests/gp_user_workflows/download_lloyd_george_workflow.cy.js +++ b/app/cypress/e2e/0-ndr-core-tests/gp_user_workflows/download_lloyd_george_workflow.cy.js @@ -99,8 +99,7 @@ describe('GP Workflow: View Lloyd George record', () => { cy.get('#verify-submit').click(); cy.wait('@lloydGeorgeStitch'); - cy.getByTestId('actions-menu').click(); - cy.getByTestId('download-all-files-link').should('not.exist'); + cy.getByTestId('actions-menu').should('not.exist'); }, ); diff --git a/app/cypress/e2e/0-ndr-core-tests/gp_user_workflows/view_lloyd_george_workflow.cy.js b/app/cypress/e2e/0-ndr-core-tests/gp_user_workflows/view_lloyd_george_workflow.cy.js index 4330e9eae..8f1b30989 100644 --- a/app/cypress/e2e/0-ndr-core-tests/gp_user_workflows/view_lloyd_george_workflow.cy.js +++ b/app/cypress/e2e/0-ndr-core-tests/gp_user_workflows/view_lloyd_george_workflow.cy.js @@ -319,8 +319,7 @@ describe('GP Workflow: View Lloyd George record', () => { cy.get('#verify-submit').click(); cy.wait('@lloydGeorgeStitch'); - cy.getByTestId('actions-menu').click(); - cy.getByTestId('download-all-files-link').should('not.exist'); + cy.getByTestId('actions-menu').should('not.exist'); }, ); });