From 8302387aa73dfa0411f81c26dcc1fd0467209f87 Mon Sep 17 00:00:00 2001 From: Jan Klattenhoff Date: Tue, 21 Jan 2025 11:19:48 +0100 Subject: [PATCH] feat(dashboard): add links to element IDs in dashboard table --- src/app/dashboard/dashboard.component.html | 4 +++- src/app/dashboard/dashboard.component.ts | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/app/dashboard/dashboard.component.html b/src/app/dashboard/dashboard.component.html index e47f465..d797e70 100644 --- a/src/app/dashboard/dashboard.component.html +++ b/src/app/dashboard/dashboard.component.html @@ -14,7 +14,9 @@ ID - {{element.id}} + + {{element.id}} + diff --git a/src/app/dashboard/dashboard.component.ts b/src/app/dashboard/dashboard.component.ts index 20fce72..428b89f 100644 --- a/src/app/dashboard/dashboard.component.ts +++ b/src/app/dashboard/dashboard.component.ts @@ -21,7 +21,11 @@ export class DashboardComponent { constructor(private linkService: LinkService, private router: Router) { }; copyLink(id: string) { - navigator.clipboard.writeText(window.location.hostname + '/' + id); + navigator.clipboard.writeText(this.getShortLink(id)); + } + + getShortLink(id: string): string { + return window.location.hostname + '/' + id; } ngOnInit(): void {