diff --git a/src/lib/components/app/AddFile.svelte b/src/lib/components/app/AddFile.svelte index 80a9f45b..ab0b5345 100644 --- a/src/lib/components/app/AddFile.svelte +++ b/src/lib/components/app/AddFile.svelte @@ -248,7 +248,8 @@ label, passcode: passcode ?? undefined, exp: expiration && expiration > 0 ? new Date().getTime() / 1000 + expiration : undefined, - patientName: patientName + patientName: patientName, + source: ipsResult.source }); } diff --git a/src/lib/components/app/HealthLink.svelte b/src/lib/components/app/HealthLink.svelte index 2775fc77..96136c70 100644 --- a/src/lib/components/app/HealthLink.svelte +++ b/src/lib/components/app/HealthLink.svelte @@ -42,6 +42,7 @@ let mode: Writable = getContext('mode'); let copyNotice = ''; + let sourceCopyNotice = ''; let href: Promise; let qrCodeImage: Promise; @@ -132,6 +133,21 @@ }, 1000); } + async function copySource() { + let copyNoticePrev = sourceCopyNotice; + sourceCopyNotice = '...'; + let text = shlControlled.source; + if (text) { + navigator.clipboard.writeText(text); + sourceCopyNotice = 'Copied!'; + } else { + sourceCopyNotice = 'No source'; + } + setTimeout(() => { + sourceCopyNotice = copyNoticePrev; + }, 1000); + } + async function deleteShl() { shlClient.deleteShl(shl); $shlStore = $shlStore.filter((l) => l.id !== shl.id); @@ -367,6 +383,19 @@ + + +

Source

+ +
+ {/if} diff --git a/src/lib/components/app/ResourceSelector.svelte b/src/lib/components/app/ResourceSelector.svelte index 6c6b31dc..f83fa399 100644 --- a/src/lib/components/app/ResourceSelector.svelte +++ b/src/lib/components/app/ResourceSelector.svelte @@ -161,7 +161,7 @@ } return entry; }) - ipsDispatch('ips-retrieved', { ips: content }); + ipsDispatch('ips-retrieved', { ips: content, source: reference }); // submitting = false; } diff --git a/src/lib/utils/managementClient.ts b/src/lib/utils/managementClient.ts index 475d46e9..699a94d3 100644 --- a/src/lib/utils/managementClient.ts +++ b/src/lib/utils/managementClient.ts @@ -17,6 +17,7 @@ export interface SHLAdminParams { passcode?: string; exp?: number; label?: string; + source?: string; v?: number; } diff --git a/src/lib/utils/types.ts b/src/lib/utils/types.ts index 3507ad6a..09bdaedc 100644 --- a/src/lib/utils/types.ts +++ b/src/lib/utils/types.ts @@ -7,6 +7,7 @@ export interface SHLSubmitEvent { passcode?: string; exp?: number; patientName?: string; + source?: string; } diff --git a/src/routes/(app)/create/+page.svelte b/src/routes/(app)/create/+page.svelte index d905608b..5a1d535e 100644 --- a/src/routes/(app)/create/+page.svelte +++ b/src/routes/(app)/create/+page.svelte @@ -37,6 +37,7 @@ shlCreated = await addFiles(shlCreated, details.shcs); shlCreated.label = details.label; shlCreated.passcode = details.passcode; + shlCreated.source = details.source; return shlCreated; }