-
Notifications
You must be signed in to change notification settings - Fork 1
CCM-12890: copy to clipboard #801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…emplate-management into feature/CCM-12890_copy-to-clipboard
…because of linting
…emplate-management into feature/CCM-12890_copy-to-clipboard
| 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", |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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>>( |
There was a problem hiding this comment.
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"', |
There was a problem hiding this comment.
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}`} |
There was a problem hiding this comment.
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?
|
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 () => { |
There was a problem hiding this comment.
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
Description
Context
ccm-12890.mp4
Type of changes
Checklist
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.