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

Updates to support VIB demo w/MUSC #57

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion src/lib/components/app/AddFile.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
}

Expand Down
30 changes: 30 additions & 0 deletions src/lib/components/app/HealthLink.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
let mode: Writable<string> = getContext('mode');

let copyNotice = '';
let sourceCopyNotice = '';

let href: Promise<string>;
let qrCodeImage: Promise<string>;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -367,6 +383,20 @@
<Button class="mb-3" color="primary" on:click={addFile}><Icon name="file-earmark-plus" /> Add {shl.files.length == 0 ? "a" : "another"} Summary</Button>
</FormGroup>
</Col>
<Col class="d-flex justify-content-center">
<FormGroup class="label shlbutton" style="width: 100%">
<div style="border-bottom: 1px solid rgb(204, 204, 204); margin-bottom: 1em"><h3>Content</h3></div>
<Label>Add, update, or remove summaries shared by this link.</Label>
<Button size="sm" color="primary" class="mx-1" style="width: fit-content" on:click={copySource} disabled={!!copyNotice}>
<Icon name="clipboard" />
{#if sourceCopyNotice}
{sourceCopyNotice}
{:else}
Copy Source Link
{/if}
</Button>
</FormGroup>
</Col>
{/if}
</Row>

Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/app/ResourceSelector.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
}
return entry;
})
ipsDispatch('ips-retrieved', { ips: content });
ipsDispatch('ips-retrieved', { ips: content, source: reference });
// submitting = false;
}

Expand Down
1 change: 1 addition & 0 deletions src/lib/utils/managementClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface SHLAdminParams {
passcode?: string;
exp?: number;
label?: string;
source?: string;
v?: number;
}

Expand Down
1 change: 1 addition & 0 deletions src/lib/utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export interface SHLSubmitEvent {
passcode?: string;
exp?: number;
patientName?: string;
source?: string;
}

export interface ResourceRetrieveEvent {
Expand Down
1 change: 1 addition & 0 deletions src/routes/(app)/create/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
shlCreated = await addFiles(shlCreated, details.shcs);
shlCreated.label = details.label;
shlCreated.passcode = details.passcode;
shlCreated.source = details.source;
return shlCreated;
}

Expand Down
Loading