From 93f6da31e5eebbf5897fc08ddcc771f95211ec47 Mon Sep 17 00:00:00 2001 From: Laura Whitaker Date: Mon, 2 Oct 2023 12:29:54 -0600 Subject: [PATCH] Create CopyButton component --- .../event/event-details-row-expanded.svelte | 2 +- .../components/event/event-details-row.svelte | 2 +- src/lib/components/workflow-actions.svelte | 5 +- .../first-previous-next-workflow-table.svelte | 2 +- .../workflow/parent-workflow-table.svelte | 2 +- .../workflow/scheduler-table.svelte | 2 +- .../workflow/workflow-detail.svelte | 2 +- src/lib/holocene/code-block.svelte | 24 +++---- src/lib/holocene/copyable.svelte | 63 ------------------- src/lib/holocene/copyable/button.svelte | 32 ++++++++++ src/lib/holocene/copyable/index.svelte | 52 +++++++++++++++ src/lib/holocene/tooltip.svelte | 2 +- src/lib/layouts/workflow-header.svelte | 2 +- 13 files changed, 106 insertions(+), 86 deletions(-) delete mode 100644 src/lib/holocene/copyable.svelte create mode 100644 src/lib/holocene/copyable/button.svelte create mode 100644 src/lib/holocene/copyable/index.svelte diff --git a/src/lib/components/event/event-details-row-expanded.svelte b/src/lib/components/event/event-details-row-expanded.svelte index 7b0ade9da..1075ae081 100644 --- a/src/lib/components/event/event-details-row-expanded.svelte +++ b/src/lib/components/event/event-details-row-expanded.svelte @@ -2,7 +2,7 @@ import { page } from '$app/stores'; import CodeBlock from '$lib/holocene/code-block.svelte'; - import Copyable from '$lib/holocene/copyable.svelte'; + import Copyable from '$lib/holocene/copyable/index.svelte'; import Link from '$lib/holocene/link.svelte'; import { translate } from '$lib/i18n/translate'; import { format } from '$lib/utilities/format-camel-case'; diff --git a/src/lib/components/event/event-details-row.svelte b/src/lib/components/event/event-details-row.svelte index c7cbb9c84..b3041cecf 100644 --- a/src/lib/components/event/event-details-row.svelte +++ b/src/lib/components/event/event-details-row.svelte @@ -2,7 +2,7 @@ import { page } from '$app/stores'; import CodeBlock from '$lib/holocene/code-block.svelte'; - import Copyable from '$lib/holocene/copyable.svelte'; + import Copyable from '$lib/holocene/copyable/index.svelte'; import Link from '$lib/holocene/link.svelte'; import { translate } from '$lib/i18n/translate'; import { format } from '$lib/utilities/format-camel-case'; diff --git a/src/lib/components/workflow-actions.svelte b/src/lib/components/workflow-actions.svelte index 06ce8f977..2b5180769 100644 --- a/src/lib/components/workflow-actions.svelte +++ b/src/lib/components/workflow-actions.svelte @@ -10,14 +10,13 @@ import SplitButton from '$lib/holocene/split-button.svelte'; import Tooltip from '$lib/holocene/tooltip.svelte'; import { translate } from '$lib/i18n/translate'; - import { Action } from '$lib/models/workflow-actions'; - import { ResetReapplyType } from '$lib/models/workflow-actions'; + import { Action, ResetReapplyType } from '$lib/models/workflow-actions'; import { + cancelWorkflow, resetWorkflow, signalWorkflow, terminateWorkflow, } from '$lib/services/workflow-service'; - import { cancelWorkflow } from '$lib/services/workflow-service'; import { authUser } from '$lib/stores/auth-user'; import { coreUserStore } from '$lib/stores/core-user'; import { resetEvents } from '$lib/stores/events'; diff --git a/src/lib/components/workflow/first-previous-next-workflow-table.svelte b/src/lib/components/workflow/first-previous-next-workflow-table.svelte index 7a76a11ac..62676edea 100644 --- a/src/lib/components/workflow/first-previous-next-workflow-table.svelte +++ b/src/lib/components/workflow/first-previous-next-workflow-table.svelte @@ -1,5 +1,5 @@ - -{#if clickAllToCopy} - - -{:else} -
- - {content} - - -
-{/if} - - diff --git a/src/lib/holocene/copyable/button.svelte b/src/lib/holocene/copyable/button.svelte new file mode 100644 index 000000000..07e122d90 --- /dev/null +++ b/src/lib/holocene/copyable/button.svelte @@ -0,0 +1,32 @@ + + + + + diff --git a/src/lib/holocene/copyable/index.svelte b/src/lib/holocene/copyable/index.svelte new file mode 100644 index 000000000..3f57a7a03 --- /dev/null +++ b/src/lib/holocene/copyable/index.svelte @@ -0,0 +1,52 @@ + + +{#if clickAllToCopy} + +{:else} +
+ + {content} + + +
+{/if} diff --git a/src/lib/holocene/tooltip.svelte b/src/lib/holocene/tooltip.svelte index a41d21474..0b7b40f5f 100644 --- a/src/lib/holocene/tooltip.svelte +++ b/src/lib/holocene/tooltip.svelte @@ -1,5 +1,5 @@