customer notes updates
This commit is contained in:
@ -11,41 +11,49 @@ const CARDS = [
|
||||
name: "Northpass Admin",
|
||||
icon: "ri-admin-line",
|
||||
link: "https://app.northpass.com/admin",
|
||||
clipboard: false,
|
||||
},
|
||||
{
|
||||
name: "Gmail",
|
||||
icon: "ri-mail-line",
|
||||
link: "https://gmail.com",
|
||||
clipboard: false,
|
||||
},
|
||||
{
|
||||
name: "Calendar",
|
||||
icon: "ri-calendar-line",
|
||||
link: "https://calendar.google.com",
|
||||
clipboard: false,
|
||||
},
|
||||
{
|
||||
name: "Hubspot",
|
||||
icon: "ri-space-ship-line",
|
||||
link: "https://app.hubspot.com/reports-dashboard/392014/view/8969543",
|
||||
clipboard: false,
|
||||
},
|
||||
{
|
||||
name: "Jira - SE Board",
|
||||
icon: "ri-open-arm-fill",
|
||||
link: "https://northpass.atlassian.net/jira/software/c/projects/ES/boards/1",
|
||||
clipboard: false,
|
||||
},
|
||||
{
|
||||
name: "Chili Piper - 30 Min",
|
||||
icon: "ri-calendar-2-line",
|
||||
link: "https://northpass.na.chilipiper.com/book/me/norm-rasmussen",
|
||||
cliprboad: true,
|
||||
},
|
||||
{
|
||||
name: "Looker - External",
|
||||
icon: "ri-bubble-chart-line",
|
||||
link: "https://northpass.looker.com/folders/4976"
|
||||
link: "https://northpass.looker.com/folders/4976",
|
||||
clipboard: false,
|
||||
},
|
||||
{
|
||||
name: "Looker - Internal",
|
||||
icon: "ri-bubble-chart-fill",
|
||||
link: "https://northpasshq.looker.com/dashboards/21"
|
||||
link: "https://northpasshq.looker.com/dashboards/21",
|
||||
clipboard: false,
|
||||
},
|
||||
];
|
||||
|
||||
@ -128,6 +136,29 @@ const printCards = () => {
|
||||
currentCard.classList.add("card");
|
||||
currentCard.href = card.link;
|
||||
|
||||
// Handle the click event
|
||||
currentCard.addEventListener("click", async (event) => {
|
||||
// If the card doesn't have `clipboard: true` don't do anything
|
||||
if (!card.clipboard) return;
|
||||
|
||||
// Prevent the page from opening
|
||||
event.preventDefault();
|
||||
// Copy the href to the clipboard
|
||||
try {
|
||||
await navigator.clipboard.writeText(card.link);
|
||||
currentCard.blur();
|
||||
currentCardText.innerText = "Saved to clipboard!";
|
||||
setTimeout(() => {
|
||||
currentCardText.innerText = card.name;
|
||||
}, 1500);
|
||||
} catch {
|
||||
currentCardText.innerText = "Unable to copy";
|
||||
setTimeout(() => {
|
||||
currentCardText.innerText = card.name;
|
||||
}, 1500);
|
||||
}
|
||||
});
|
||||
|
||||
// Style the Icon
|
||||
currentCardIcon.classList.add("card__icon");
|
||||
|
||||
@ -139,7 +170,7 @@ const printCards = () => {
|
||||
cardContainer.appendChild(currentCard);
|
||||
}
|
||||
};
|
||||
/* Add event listener for a click or onclick to run function.
|
||||
|
||||
/****************/
|
||||
/* STARTER CODE */
|
||||
/****************/
|
||||
|
||||
Reference in New Issue
Block a user