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

[GLT-3976] added copy buttons for donor names and external names #153

Merged
merged 3 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions changes/add_copyName-donor
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Copy button next to Donor name and External Donor name to copy the name to clipboard
27 changes: 19 additions & 8 deletions ts/data/case.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
} from "./requisition";
import { Tooltip } from "../component/tooltip";
import { caseFilters, latestActivitySort } from "../component/table-components";
import { makeCopyButton } from "../util/html-utils";

const dayMillis = 1000 * 60 * 60 * 24;

Expand Down Expand Up @@ -130,16 +131,26 @@ export const caseDefinition: TableDefinition<Case, Test> = {
title: "Donor",
sortType: "text",
addParentContents(kase, fragment) {
fragment.appendChild(
makeNameDiv(
kase.donor.name,
urls.miso.sample(kase.donor.id),
urls.dimsum.donor(kase.donor.name)
)
const nameDiv = makeNameDiv(
kase.donor.name,
urls.miso.sample(kase.donor.id),
urls.dimsum.donor(kase.donor.name)
);
fragment.appendChild(
makeTextDivWithTooltip(kase.donor.externalName, "External Name")
fragment.appendChild(nameDiv);
// Add copy button for donor name
const copyButtonForName = makeCopyButton(kase.donor.name);
fragment.appendChild(copyButtonForName);
djcooke marked this conversation as resolved.
Show resolved Hide resolved

const externalNameDiv = makeTextDivWithTooltip(
kase.donor.externalName,
"External Name"
);
fragment.appendChild(externalNameDiv);
// Add copy button for external name
const copyButtonForExternalName = makeCopyButton(
kase.donor.externalName
);
fragment.appendChild(copyButtonForExternalName);
djcooke marked this conversation as resolved.
Show resolved Hide resolved

const tumourDetailDiv = document.createElement("div");
tumourDetailDiv.appendChild(
Expand Down