Migrate navigator.clipboard in work item actions to copyToClipboard

What does this MR do and why?

Replaces the direct navigator.clipboard.writeText call in the work item actions dropdown with copyToClipboard from ~/lib/utils/copy_to_clipboard. This helper also works on non-secure (http) pages, and it lets us remove the no-restricted-properties eslint-disable comment. The call is still only made when isDetailPanel is true. Two specs were added to cover both cases.

The issue mentions isModal; that prop has since been renamed to isDetailPanel, and the condition is kept.

Closes #579495.

References

Part of epic &19827.

Screenshots or screen recordings

Not applicable — no visual change.

How to set up and validate locally

  1. Run yarn jest spec/frontend/work_items/components/work_item_actions_spec.js.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist.

This contribution was prepared with the help of an AI assistant. I reviewed the changes and take responsibility for them.

Merge request reports

Loading
Loading