From 3e627efdb056e9a3af4363b319855c434f79bae2 Mon Sep 17 00:00:00 2001 From: Eric Wang <37554696+ericwang401@users.noreply.github.com> Date: Tue, 5 Dec 2023 14:06:35 -0600 Subject: [PATCH] add copy ID to clipboard for nodes & templates --- .../scripts/components/admin/nodes/NodesContainer.tsx | 6 ++++++ .../components/admin/nodes/templates/TemplateCard.tsx | 7 +++++++ .../admin/nodes/templates/TemplateGroupCard.tsx | 10 ++++++++++ 3 files changed, 23 insertions(+) diff --git a/resources/scripts/components/admin/nodes/NodesContainer.tsx b/resources/scripts/components/admin/nodes/NodesContainer.tsx index 74ce8fdf809..41d354c33fc 100644 --- a/resources/scripts/components/admin/nodes/NodesContainer.tsx +++ b/resources/scripts/components/admin/nodes/NodesContainer.tsx @@ -94,6 +94,12 @@ const NodesContainer = () => { return ( + navigator.clipboard.writeText(node.id)} + > + Copy ID + + 0} diff --git a/resources/scripts/components/admin/nodes/templates/TemplateCard.tsx b/resources/scripts/components/admin/nodes/templates/TemplateCard.tsx index 89d46f1db59..804d94eb884 100644 --- a/resources/scripts/components/admin/nodes/templates/TemplateCard.tsx +++ b/resources/scripts/components/admin/nodes/templates/TemplateCard.tsx @@ -108,6 +108,13 @@ const TemplateCard = ({ template, group, className }: Props) => { + + navigator.clipboard.writeText(template.uuid) + } + > + Copy ID + setShowEditModal(true)}> Edit diff --git a/resources/scripts/components/admin/nodes/templates/TemplateGroupCard.tsx b/resources/scripts/components/admin/nodes/templates/TemplateGroupCard.tsx index 1d4a93e4715..0b8e332d059 100644 --- a/resources/scripts/components/admin/nodes/templates/TemplateGroupCard.tsx +++ b/resources/scripts/components/admin/nodes/templates/TemplateGroupCard.tsx @@ -42,6 +42,7 @@ import EditTemplateGroupModal from '@/components/admin/nodes/templates/EditTempl import EditTemplateModal from '@/components/admin/nodes/templates/EditTemplateModal' import TemplateCard from '@/components/admin/nodes/templates/TemplateCard' + interface Props { group: TemplateGroup className?: string @@ -211,6 +212,15 @@ const TemplateGroupCard = ({ group, className }: Props) => { /> + + navigator.clipboard.writeText( + group.uuid + ) + } + > + Copy ID + setShowEditModal(true)} >