From b4c3578b925cc9668177100e27fbfdf918c4d407 Mon Sep 17 00:00:00 2001 From: Alexey Kartashov Date: Mon, 16 Dec 2024 14:06:54 +0100 Subject: [PATCH] improvement(TestRunInfo.svelte): Add popup hints for copy buttons This commit adds success indicators when user does copy-to-clipboard actions, making it less confusing. Fixes #431 --- frontend/TestRun/IssueTemplate.svelte | 2 ++ frontend/TestRun/ResourcesInfo.svelte | 2 ++ frontend/TestRun/StructuredEvent.svelte | 2 ++ frontend/TestRun/TestRunInfo.svelte | 3 +++ 4 files changed, 9 insertions(+) diff --git a/frontend/TestRun/IssueTemplate.svelte b/frontend/TestRun/IssueTemplate.svelte index 128f27ae..61772f7e 100644 --- a/frontend/TestRun/IssueTemplate.svelte +++ b/frontend/TestRun/IssueTemplate.svelte @@ -9,6 +9,7 @@ getOperatorPackage, getOperatorHelmPackage, getOperatorHelmRepoPackage, } from "../Common/RunUtils"; import { markdownRendererOptions } from "../markdownOptions"; + import { sendMessage } from "../Stores/AlertStore"; let renderedElement; let templateElement; let issueTemplateText = ""; @@ -21,6 +22,7 @@ const copyTemplateToClipboard = function () { navigator.clipboard.writeText(templateElement.innerText); + sendMessage("success", "Issue template has been copied to your clipboard"); }; let scyllaServerPackage = getScyllaPackage(test_run.packages); diff --git a/frontend/TestRun/ResourcesInfo.svelte b/frontend/TestRun/ResourcesInfo.svelte index 36a8ac4f..05d46242 100644 --- a/frontend/TestRun/ResourcesInfo.svelte +++ b/frontend/TestRun/ResourcesInfo.svelte @@ -9,6 +9,7 @@ faCopy, faPlay, } from "@fortawesome/free-solid-svg-icons"; + import { sendMessage } from "../Stores/AlertStore"; let sortHeaders = { creationTime: ["instance_info", "creation_time"], terminationTime: ["instance_info", "termination_time"], @@ -88,6 +89,7 @@ navigator.clipboard.writeText( `${regions} hydra clean-resources --backend ${backend} --test-id ${run_id}` ); + sendMessage("success", `\`${regions} hydra clean-resources --backend ${backend} --test-id ${run_id}\` has been copied to your clipboard`); }}> Hydra Clean Resources diff --git a/frontend/TestRun/StructuredEvent.svelte b/frontend/TestRun/StructuredEvent.svelte index 31572cc4..9553d02e 100644 --- a/frontend/TestRun/StructuredEvent.svelte +++ b/frontend/TestRun/StructuredEvent.svelte @@ -1,6 +1,7 @@