Merge pull request 'replace copy-to-clipboard with share-via-link-mail-to' (#24) from f054_mail-to-link into development
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
Reviewed-on: #24
This commit was merged in pull request #24.
This commit is contained in:
@@ -129,13 +129,22 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function setClipboard(text) {
|
function constructMailToLink() {
|
||||||
const type = "text/plain";
|
const subject = "Link zum Tatvorgang";
|
||||||
const clipboardItemData = {
|
const link = $page.url.toString().split('?')[0];
|
||||||
[type]: text,
|
const body = `Hallo,
|
||||||
};
|
|
||||||
const clipboardItem = new ClipboardItem(clipboardItemData);
|
hier ist der Link zum Tatvorgang:
|
||||||
await navigator.clipboard.write([clipboardItem]);
|
${link}
|
||||||
|
|
||||||
|
Der Zugangs-PIN wird zur Sicherheit über einen zweiten Kommunikationskanal übermittelt.
|
||||||
|
|
||||||
|
Mit freundlichen Grüßen,
|
||||||
|
`;
|
||||||
|
|
||||||
|
const mailtoLink = `mailto:?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(body)}`;
|
||||||
|
|
||||||
|
return mailtoLink;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -144,7 +153,7 @@
|
|||||||
<h1 class="text-xl">Vorgang {vorgang.name}</h1>
|
<h1 class="text-xl">Vorgang {vorgang.name}</h1>
|
||||||
{#if data?.user?.admin}
|
{#if data?.user?.admin}
|
||||||
Zugangs-PIN: {vorgang.pin}
|
Zugangs-PIN: {vorgang.pin}
|
||||||
<Button on:click={() => setClipboard($page.url.toString().split('?')[0])}>Copy Link</Button>
|
<a href="{constructMailToLink()}"><Button>Share Link</Button></a>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<div class="mx-auto flex justify-center max-w-7xl h-full">
|
<div class="mx-auto flex justify-center max-w-7xl h-full">
|
||||||
|
|||||||
Reference in New Issue
Block a user