push helpers

This commit is contained in:
Torsten Dittmann committed 2022-03-16 21:55:44 +01:00
1 parent e44d5b73fe
commit b7de5ca986
4 files changed
+33 -6

No files matched your search

@@ -57,7 +57,7 @@
bind:tags={elements}
placeholder="Add elements here"
/>
<InputSelect id="elements" label="Elements" bind:options bind:value={def} />
<InputSelect id="default" label="Default" bind:options bind:value={def} />
<InputBoolean id="required" label="Required" bind:value={required} />
<InputBoolean id="required" label="Array" bind:value={array} />
@@ -1,6 +1,6 @@
<script lang="ts">
import { page } from '$app/stores';
import { Card } from '$lib/components';
import { Card, Copy } from '$lib/components';
import { Button, Form, InputTags } from '$lib/elements/forms';
import { sdkForProject } from '$lib/stores/sdk';
import { onMount } from 'svelte';
@@ -47,6 +47,7 @@
<Card>
{#if $doc}
<Form on:submit={updateDocument}>
<Copy value={$doc.$id} />
{#each $collection.attributes.filter((a) => a.status === 'available') as attribute}
{#if attribute.array}
{#each $doc[attribute.key] as _v, index}
@@ -71,8 +72,20 @@
{/if}
{/each}
<h1>Permissions</h1>
<InputTags id="read" label="Read Permissions" bind:tags={$doc.$read} />
<InputTags id="write" label="Write Permissions" bind:tags={$doc.$write} />
<InputTags
id="read"
label="Read Permissions"
bind:tags={$doc.$read}
helper="Add 'role:all' for wildcard access"
placeholder="User ID, Team ID or Role"
/>
<InputTags
id="write"
label="Write Permissions"
bind:tags={$doc.$write}
helper="Add 'role:all' for wildcard access"
placeholder="User ID, Team ID or Role"
/>
<Button submit>Update</Button>
</Form>
{:else}
@@ -61,12 +61,14 @@
label="Read Access"
id="read"
helper="Add 'role:all' for wildcard access"
placeholder="User ID, Team ID or Role"
/>
<InputTags
bind:tags={$collection.$write}
label="Write Access"
id="read"
helper="Add 'role:all' for wildcard access"
placeholder="User ID, Team ID or Role"
/>
{/if}
<InputRadio
@@ -34,8 +34,20 @@
<Modal bind:show={showCreate}>
<svelte:fragment slot="header">Upload File</svelte:fragment>
<InputFile id="file" label="File" bind:files required />
<InputTags id="read" label="Read" bind:tags={read} />
<InputTags id="write" label="Write" bind:tags={write} />
<InputTags
id="read"
label="Read"
bind:tags={read}
helper="Add 'role:all' for wildcard access"
placeholder="User ID, Team ID or Role"
/>
<InputTags
id="write"
label="Write"
bind:tags={write}
helper="Add 'role:all' for wildcard access"
placeholder="User ID, Team ID or Role"
/>
<svelte:fragment slot="footer">
<Button submit>Upload</Button>
<Button secondary on:click={() => (showCreate = false)}>Cancel</Button>