Skip to content
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

improvement(TestRunInfo.svelte): Add popup hints for copy buttons #537

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions frontend/TestRun/IssueTemplate.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
Expand All @@ -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);
Expand Down
8 changes: 6 additions & 2 deletions frontend/TestRun/ResourcesInfo.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand All @@ -33,6 +34,9 @@
terminated: "table-danger",
};

let regions = "SCT_REGION_NAME= SCT_GCE_DATACENTER= SCT_AZURE_REGION_NAME= ";
const CMD_CLEAN_RESOURCES = `${regions} hydra clean-resources --backend ${backend} --test-id ${run_id}`;

const filterResource = function (resource) {
let resourceAsString = `${resource.name}${resource.state}${
resource.instance_info.shards_amount
Expand Down Expand Up @@ -84,10 +88,10 @@
type="button"
class="btn btn-outline-success me-2"
on:click={() => {
let regions = "SCT_REGION_NAME= SCT_GCE_DATACENTER= SCT_AZURE_REGION_NAME= ";
navigator.clipboard.writeText(
`${regions} hydra clean-resources --backend ${backend} --test-id ${run_id}`
CMD_CLEAN_RESOURCES
);
sendMessage("success", `\`${CMD_CLEAN_RESOURCES}\` has been copied to your clipboard`);
}}>
<Fa icon={faCopy} /> Hydra Clean Resources
</button>
Expand Down
2 changes: 2 additions & 0 deletions frontend/TestRun/StructuredEvent.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script>
import { faCopy, faDotCircle } from "@fortawesome/free-solid-svg-icons";
import Fa from "svelte-fa";
import { sendMessage } from "../Stores/AlertStore";


export let event;
Expand Down Expand Up @@ -38,6 +39,7 @@
class="btn btn-light"
on:click={() => {
navigator.clipboard.writeText(event.eventText);
sendMessage("success", "Event text has been copied to your clipboard");
}}
>
<Fa icon={faCopy} />
Expand Down
3 changes: 3 additions & 0 deletions frontend/TestRun/TestRunInfo.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import JenkinsBuildModal from "./Jenkins/JenkinsBuildModal.svelte";
import JenkinsCloneModal from "./Jenkins/JenkinsCloneModal.svelte";
import { createEventDispatcher } from "svelte";
import { sendMessage } from "../Stores/AlertStore";
export let test_run = {};
export let release;
export let group;
Expand Down Expand Up @@ -286,6 +287,7 @@
navigator.clipboard.writeText(
cmd_hydraInvestigateShowMonitor
);
sendMessage("success", `\`${cmd_hydraInvestigateShowMonitor}\` has been copied to your clipboard`);
}}><Fa icon={faCopy} /> Hydra Show Monitor</button
>
<button
Expand All @@ -295,6 +297,7 @@
navigator.clipboard.writeText(
cmd_hydraInvestigateShowLogs
);
sendMessage("success", `\`${cmd_hydraInvestigateShowLogs}\` has been copied to your clipboard`);
}}><Fa icon={faCopy} /> Hydra Show Logs</button
>
{/if}
Expand Down
Loading