Skip to content

Commit

Permalink
PRMDR-412 removing view all, changing herf to placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
NogaNHS committed Jan 9, 2024
1 parent 9e63948 commit 2b9e840
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -54,54 +55,56 @@ function LloydGeorgeRecordDetails({
</Button>
</div>
) : (
<div className="lloydgeorge_record-details_actions">
<div
data-testid="actions-menu"
className={`nhsuk-select lloydgeorge_record-details_actions-select ${
showActionsMenu
? 'lloydgeorge_record-details_actions-select--selected'
: ''
}`}
onClick={handleMoreActions}
>
role !== REPOSITORY_ROLE.GP_CLINICAL && (
<div className="lloydgeorge_record-details_actions">
<div
className={`lloydgeorge_record-details_actions-select_border ${
data-testid="actions-menu"
className={`nhsuk-select lloydgeorge_record-details_actions-select ${
showActionsMenu
? 'lloydgeorge_record-details_actions-select_border--selected'
? 'lloydgeorge_record-details_actions-select--selected'
: ''
}`}
/>
<span className="lloydgeorge_record-details_actions-select_placeholder">
Select an action...
</span>
<Chevron className="lloydgeorge_record-details_actions-select_icon" />
</div>
{showActionsMenu && (
<div ref={actionsRef}>
<Card className="lloydgeorge_record-details_actions-menu">
<Card.Content>
<ol>
{actionLinks.map((link) =>
role && !link.unauthorised?.includes(role) ? (
<li key={link.key} data-testid={link.key}>
<Link
to="#"
onClick={(e) => {
e.preventDefault();
setStage(link.stage);
}}
>
{link.label}
</Link>
</li>
) : null,
)}
</ol>
</Card.Content>
</Card>
onClick={handleMoreActions}
>
<div
className={`lloydgeorge_record-details_actions-select_border ${
showActionsMenu
? 'lloydgeorge_record-details_actions-select_border--selected'
: ''
}`}
/>
<span className="lloydgeorge_record-details_actions-select_placeholder">
Select an action...
</span>
<Chevron className="lloydgeorge_record-details_actions-select_icon" />
</div>
)}
</div>
{showActionsMenu && (
<div ref={actionsRef}>
<Card className="lloydgeorge_record-details_actions-menu">
<Card.Content>
<ol>
{actionLinks.map((link) =>
role && !link.unauthorised?.includes(role) ? (
<li key={link.key} data-testid={link.key}>
<Link
to="#placeholder"
onClick={(e) => {
e.preventDefault();
setStage(link.stage);
}}
>
{link.label}
</Link>
</li>
) : null,
)}
</ol>
</Card.Content>
</Card>
</div>
)}
</div>
)
)}
</div>
);
Expand Down
5 changes: 0 additions & 5 deletions app/src/types/blocks/lloydGeorgeActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ type PdfActionLink = {
};

export const actionLinks: Array<PdfActionLink> = [
{
label: 'See all files',
key: 'see-all-files-link',
stage: LG_RECORD_STAGE.SEE_ALL,
},
{
label: 'Download all files',
key: 'download-all-files-link',
Expand Down
1 change: 0 additions & 1 deletion app/src/types/blocks/lloydGeorgeStages.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export enum LG_RECORD_STAGE {
RECORD = 0,
DOWNLOAD_ALL = 1,
SEE_ALL = 2,
DELETE_ALL = 3,
}

0 comments on commit 2b9e840

Please sign in to comment.