Skip to content

Conversation

@bhansell1
Copy link
Contributor

@bhansell1 bhansell1 commented Jan 21, 2026

Description

  • adds a copy to clipboard button on the MessagePlanList page

Context

ccm-12890.mp4

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming
  • If I have used the 'skip-trivy-package' label I have done so responsibly and in the knowledge that this is being fixed as part of a separate ticket/PR.

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

@bhansell1 bhansell1 marked this pull request as ready for review January 23, 2026 12:22
@bhansell1 bhansell1 requested a review from a team as a code owner January 23, 2026 12:22
noMessagePlansMessage: 'You do not have any message plans in {{status}} yet.',
messagePlanLink: '/message-plans/choose-templates/{{routingConfigId}}',
copyText: 'Copy names and IDs to clipboard',
copiedText: "Names and ID's copied to clipboard",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bad apostrophe - i know it literally says to do this on the ticket but it's still wrong!


const clipboardItem = new ClipboardItem({
'text/plain': csv,
'text/html': html,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the use case for the HTML table?

return {
copyToClipboard,
copied,
error: copyError,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like returning an error and not using it for anything?

return [headerRow, ...dataRows].join('\n');
};

const generateHTMLTable = <T extends Record<string, unknown>>(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we decided not to do this? and just do the csv?


const expectedCSV = [
'routing_plan_name,routing_plan_id',
'"Plan 1","id-1"',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think the ID is supposed to be in quotes btw

</Table>
<Button
type='button'
data-testid={`copy-button-${statusDisplayLower}`}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the statusDisplayLower just so you get one draft and one for production?

@nicki-nhs
Copy link
Contributor

I think needs adding into the component tests for the message plans page too

jest.clearAllMocks();
});

it('should copy data in both CSV and HTML formats to clipboard', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

said elsewhere but pretty sure we agreed in refinement not to do the html format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants