feat: use new modals

This commit is contained in:
Torsten Dittmann committed 2022-10-27 15:53:15 +02:00
1 parent f593346dbd
commit fa2a89ec2c
60 files changed
+1437 -1619

No files matched your search

+14 -14
View File
@@ -9,8 +9,8 @@
"version": "0.0.1",
"dependencies": {
"@aw-labs/appwrite-console": "^6.0.0",
"@aw-labs/icons": "0.0.0-64",
"@aw-labs/ui": "0.0.0-64",
"@aw-labs/icons": "0.0.0-66",
"@aw-labs/ui": "0.0.0-66",
"@popperjs/core": "^2.11.6",
"echarts": "^5.4.0",
"prismjs": "^1.29.0",
@@ -80,14 +80,14 @@
}
},
"node_modules/@aw-labs/icons": {
"version": "0.0.0-64",
"resolved": "https://registry.npmjs.org/@aw-labs/icons/-/icons-0.0.0-64.tgz",
"integrity": "sha512-oSZptwIflTmoaUwotXS5sOQsrYE+aDHVw7/iI+lvC6bGDg1sljKc2/LrevXX2Z3GTG8Wu27aYHVVgVFB5khSPw=="
"version": "0.0.0-66",
"resolved": "https://registry.npmjs.org/@aw-labs/icons/-/icons-0.0.0-66.tgz",
"integrity": "sha512-3r6pxixYZ6Bn9QTUbFk8XYwds+CHz1baRkOVsQ5HoFz6XgvzTWn3/+pvZZ56Ht2Ek//wr4wwI30pdCXaX4QIsA=="
},
"node_modules/@aw-labs/ui": {
"version": "0.0.0-64",
"resolved": "https://registry.npmjs.org/@aw-labs/ui/-/ui-0.0.0-64.tgz",
"integrity": "sha512-s6ntXWKssiUjaberQEZYBFQw7+Ipfn8BOcxJ4DqCMSnvllZvnx9HbPynvKWcSpYgRRUr6wUHrEKBTfKQah1SGA==",
"version": "0.0.0-66",
"resolved": "https://registry.npmjs.org/@aw-labs/ui/-/ui-0.0.0-66.tgz",
"integrity": "sha512-5qFISwKzOyZq7Ix5FG/BhVKEcIMXd2/Y8Ioba+ejTQ8B9hzj6FlwxUw7hLT49ZDhU+kxpjJQV51hRpbHGvmEag==",
"dependencies": {
"@aw-labs/icons": "*",
"normalize.css": "^8.0.1",
@@ -7790,14 +7790,14 @@
}
},
"@aw-labs/icons": {
"version": "0.0.0-64",
"resolved": "https://registry.npmjs.org/@aw-labs/icons/-/icons-0.0.0-64.tgz",
"integrity": "sha512-oSZptwIflTmoaUwotXS5sOQsrYE+aDHVw7/iI+lvC6bGDg1sljKc2/LrevXX2Z3GTG8Wu27aYHVVgVFB5khSPw=="
"version": "0.0.0-66",
"resolved": "https://registry.npmjs.org/@aw-labs/icons/-/icons-0.0.0-66.tgz",
"integrity": "sha512-3r6pxixYZ6Bn9QTUbFk8XYwds+CHz1baRkOVsQ5HoFz6XgvzTWn3/+pvZZ56Ht2Ek//wr4wwI30pdCXaX4QIsA=="
},
"@aw-labs/ui": {
"version": "0.0.0-64",
"resolved": "https://registry.npmjs.org/@aw-labs/ui/-/ui-0.0.0-64.tgz",
"integrity": "sha512-s6ntXWKssiUjaberQEZYBFQw7+Ipfn8BOcxJ4DqCMSnvllZvnx9HbPynvKWcSpYgRRUr6wUHrEKBTfKQah1SGA==",
"version": "0.0.0-66",
"resolved": "https://registry.npmjs.org/@aw-labs/ui/-/ui-0.0.0-66.tgz",
"integrity": "sha512-5qFISwKzOyZq7Ix5FG/BhVKEcIMXd2/Y8Ioba+ejTQ8B9hzj6FlwxUw7hLT49ZDhU+kxpjJQV51hRpbHGvmEag==",
"requires": {
"@aw-labs/icons": "*",
"normalize.css": "^8.0.1",
+2 -2
View File
@@ -20,8 +20,8 @@
},
"dependencies": {
"@aw-labs/appwrite-console": "^6.0.0",
"@aw-labs/icons": "0.0.0-64",
"@aw-labs/ui": "0.0.0-64",
"@aw-labs/icons": "0.0.0-66",
"@aw-labs/ui": "0.0.0-66",
"@popperjs/core": "^2.11.6",
"echarts": "^5.4.0",
"prismjs": "^1.29.0",
+1 -1
View File
@@ -5,7 +5,7 @@
<li class="drop-tabs-item">
{#if disabled}
<span class="drop-tabs-button" {disabled}>
<span class="drop-tabs-button is-disabled">
<span class="text"><slot /></span>
</span>
{:else}
+128 -133
View File
@@ -1,5 +1,5 @@
<script lang="ts">
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { Modal, Copy } from '$lib/components';
import { Pill } from '$lib/elements';
import { createEventDispatcher } from 'svelte';
@@ -157,152 +157,147 @@
//TODO: remove inline style
</script>
<Form noStyle noMargin on:submit={create}>
<Modal bind:show size="big">
<svelte:fragment slot="header">Create Event</svelte:fragment>
<Modal bind:show on:submit={create} size="big">
<svelte:fragment slot="header">Create Event</svelte:fragment>
<div>
<p class="u-text">Choose a service</p>
<div class="u-flex u-gap-8 u-margin-block-start-8">
{#each services as service}
<Pill
disabled={showInput}
selected={service.name === selectedService?.name}
button
on:click={() => {
selectedService = service;
inputData = null;
}}>{service.name}</Pill>
{/each}
</div>
</div>
{#if selectedService}
<div>
<p class="u-text">Choose a service</p>
<p class="u-text">Choose a request (optional)</p>
<div class="u-flex u-gap-8 u-margin-block-start-8">
{#each services as service}
{#each selectedService.requests as request}
<Pill
disabled={showInput}
selected={service.name === selectedService?.name}
selected={request.name === selectedRequest?.name}
button
on:click={() => {
selectedService = service;
selectedRequest === request
? (selectedRequest = null)
: (selectedRequest = request);
inputData = null;
}}>{service.name}</Pill>
}}>{request.name}</Pill>
{/each}
</div>
</div>
{#if selectedService}
<div>
<p class="u-text">Choose a request (optional)</p>
<div class="u-flex u-gap-8 u-margin-block-start-8">
{#each selectedService.requests as request}
<Pill
disabled={showInput}
selected={request.name === selectedRequest?.name}
button
on:click={() => {
selectedRequest === request
? (selectedRequest = null)
: (selectedRequest = request);
inputData = null;
}}>{request.name}</Pill>
{/each}
</div>
</div>
<div>
<p class="u-text">Choose an event (optional)</p>
<div class="u-flex u-gap-8 u-margin-block-start-8">
{#each selectedRequest?.events ?? selectedService?.events as event}
<Pill
disabled={showInput}
selected={selectedEvent === event}
button
on:click={() => {
selectedEvent === event
? (selectedEvent = null)
: (selectedEvent = event);
inputData = null;
}}>{event}</Pill>
{/each}
</div>
</div>
{#if selectedService?.name === 'users' && !selectedRequest?.name}
<div>
<p class="u-text">Choose an attribute (optional)</p>
<div class="u-flex u-gap-8 u-margin-block-start-8">
{#each selectedService?.attributes as attribute}
<Pill
disabled={showInput}
selected={selectedAttribute === attribute}
button
on:click={() => {
selectedAttribute === attribute
? (selectedAttribute = null)
: (selectedAttribute = attribute);
inputData = null;
}}>{attribute}</Pill>
{/each}
</div>
</div>
{/if}
{/if}
{#if showInput}
<div class="input-text-wrapper" style="--amount-of-buttons:2">
<input type="text" placeholder="Enter custom event" bind:value={inputData} />
<div class="options-list">
<button
on:click|preventDefault={() => {
showInput = false;
}}
class="options-list-button"
aria-label="confirm">
<span class="icon-check" aria-hidden="true" />
</button>
<button
on:click|preventDefault={() => {
<div>
<p class="u-text">Choose an event (optional)</p>
<div class="u-flex u-gap-8 u-margin-block-start-8">
{#each selectedRequest?.events ?? selectedService?.events as event}
<Pill
disabled={showInput}
selected={selectedEvent === event}
button
on:click={() => {
selectedEvent === event
? (selectedEvent = null)
: (selectedEvent = event);
inputData = null;
showInput = false;
}}
class="options-list-button"
aria-label="cancel">
<span class="icon-x" aria-hidden="true" />
</button>
</div>
}}>{event}</Pill>
{/each}
</div>
{:else}
<div class="input-text-wrapper" style="--amount-of-buttons:2">
<div type="text" readonly style="min-height: 2.5rem;">
{#if inputData}
<span>{inputData}</span>
{:else}
{#each Array.from(eventString.values()) as route, i}
<button
class:u-opacity-0-5={helper !== route.description}
on:mouseenter={() => {
helper = route.description;
}}
on:mouseleave={() => {
helper = null;
}}>
{route.value}
</button>
<span class="u-opacity-0-5">
{i + 1 < eventString?.size ? '.' : ''}
</span>
{/each}
{/if}
</div>
{#if selectedService?.name === 'users' && !selectedRequest?.name}
<div>
<p class="u-text">Choose an attribute (optional)</p>
<div class="u-flex u-gap-8 u-margin-block-start-8">
{#each selectedService?.attributes as attribute}
<Pill
disabled={showInput}
selected={selectedAttribute === attribute}
button
on:click={() => {
selectedAttribute === attribute
? (selectedAttribute = null)
: (selectedAttribute = attribute);
inputData = null;
}}>{attribute}</Pill>
{/each}
</div>
<div class="options-list">
<button
on:click|preventDefault={() => {
inputData = copyValue;
showInput = true;
}}
class="options-list-button"
aria-label="edit event">
<span class="icon-pencil" aria-hidden="true" />
</button>
<button
disabled={!copyValue}
class="options-list-button"
aria-label="copy text">
<Copy value={copyValue}>
<span class="icon-duplicate" aria-hidden="true" />
</Copy>
</button>
</div>
<p style="height: 2rem;">{helper ?? ''}</p>
</div>
{/if}
{/if}
{#if showInput}
<div class="input-text-wrapper" style="--amount-of-buttons:2">
<input type="text" placeholder="Enter custom event" bind:value={inputData} />
<div class="options-list">
<button
on:click|preventDefault={() => {
showInput = false;
}}
class="options-list-button"
aria-label="confirm">
<span class="icon-check" aria-hidden="true" />
</button>
<button
on:click|preventDefault={() => {
inputData = null;
showInput = false;
}}
class="options-list-button"
aria-label="cancel">
<span class="icon-x" aria-hidden="true" />
</button>
</div>
</div>
{:else}
<div class="input-text-wrapper" style="--amount-of-buttons:2">
<div type="text" readonly style="min-height: 2.5rem;">
{#if inputData}
<span>{inputData}</span>
{:else}
{#each Array.from(eventString.values()) as route, i}
<button
class:u-opacity-0-5={helper !== route.description}
on:mouseenter={() => {
helper = route.description;
}}
on:mouseleave={() => {
helper = null;
}}>
{route.value}
</button>
<span class="u-opacity-0-5">
{i + 1 < eventString?.size ? '.' : ''}
</span>
{/each}
{/if}
</div>
<div class="options-list">
<button
on:click|preventDefault={() => {
inputData = copyValue;
showInput = true;
}}
class="options-list-button"
aria-label="edit event">
<span class="icon-pencil" aria-hidden="true" />
</button>
<button disabled={!copyValue} class="options-list-button" aria-label="copy text">
<Copy value={copyValue}>
<span class="icon-duplicate" aria-hidden="true" />
</Copy>
</button>
</div>
<p style="height: 2rem;">{helper ?? ''}</p>
</div>
{/if}
<svelte:fragment slot="footer">
<Button secondary on:click={() => (show = false)}>Cancel</Button>
<Button disabled={showInput || !copyValue} submit>Create</Button>
</svelte:fragment>
</Modal>
</Form>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (show = false)}>Cancel</Button>
<Button disabled={showInput || !copyValue} submit>Create</Button>
</svelte:fragment>
</Modal>
+83 -91
View File
@@ -1,9 +1,6 @@
<script lang="ts">
import { browser } from '$app/environment';
import { createEventDispatcher } from 'svelte';
import { fade, fly, type FadeParams, type FlyParams } from 'svelte/transition';
import { Alert, Heading } from '$lib/components';
import { clickOnEnter } from '$lib/helpers/a11y';
import { Alert } from '$lib/components';
export let show = false;
export let size: 'small' | 'big' = null;
@@ -11,44 +8,45 @@
export let error: string = null;
export let closable = true;
let dialog: HTMLDialogElement;
let alert: HTMLElement;
const dispatch = createEventDispatcher();
const transitionFly: FlyParams = {
duration: 150,
y: 50
};
const transitionFade: FadeParams = {
duration: 150
};
const handleKeydown = (event: KeyboardEvent) => {
const dispatch = createEventDispatcher();
function handleBLur(event: MouseEvent) {
if (event.target === dialog) {
closeModal();
}
}
function openModal() {
if (dialog && !dialog.open) {
dialog.showModal();
document.body.classList.add('u-overflow-hidden');
}
}
function closeModal() {
if (closable) {
if (dialog && dialog.open) {
dispatch('close');
dialog.close();
show = false;
document.body.classList.remove('u-overflow-hidden');
}
}
}
function handleKeydown(event: KeyboardEvent) {
if (event.key === 'Escape') {
event.preventDefault();
closeModal();
}
};
const handleBLur = (event: MouseEvent) => {
const target: Partial<HTMLElement> = event.target;
if (target.hasAttribute('data-curtain')) {
closeModal();
}
};
const closeModal = () => {
if (closable) {
dispatch('close');
show = false;
}
};
}
/**
* Workaround until https://github.com/sveltejs/svelte/issues/3105 is resolved.
*/
$: if (browser) {
if (show) {
document.body.classList.add('u-overflow-hidden');
} else {
document.body.classList.remove('u-overflow-hidden');
}
$: if (show) {
openModal();
} else {
closeModal();
}
$: if (error) {
@@ -56,62 +54,56 @@
}
</script>
<svelte:window on:keydown={handleKeydown} />
<svelte:window on:click={handleBLur} on:keydown={handleKeydown} />
{#if show}
<div
class="modal-curtain"
data-curtain
on:click={handleBLur}
on:keyup|self={clickOnEnter}
transition:fade={transitionFade}>
<section
class:is-small={size === 'small'}
class:is-big={size === 'big'}
class="modal"
transition:fly={transitionFly}>
<header class="modal-header">
{#if warning}
<div class="avatar is-color-orange is-medium">
<span class="icon-exclamation" aria-hidden="true" />
</div>
{/if}
<Heading tag="h4" size="5">
<slot name="header" />
</Heading>
{#if closable}
<button
type="button"
class="x-button"
aria-label="Close Modal"
title="Close Modal"
on:click={closeModal}>
<span class="icon-x" aria-hidden="true" />
</button>
{/if}
</header>
<div class="modal-content">
{#if error}
<div bind:this={alert}>
<Alert
dismissible
type="warning"
on:dismiss={() => {
error = null;
}}>
{error}
</Alert>
</div>
{/if}
<slot />
</div>
{#if $$slots.footer}
<div class="modal-footer">
<div class="u-flex u-main-end u-gap-12">
<slot name="footer" />
</div>
<dialog
class="modal"
class:is-small={size === 'small'}
class:is-big={size === 'big'}
bind:this={dialog}>
<form class="modal-form" method="dialog" on:submit>
<header class="modal-header">
{#if warning}
<div class="avatar is-color-orange is-medium">
<span class="icon-exclamation" aria-hidden="true" />
</div>
{/if}
</section>
</div>
{/if}
<h4 class="modal-title heading-level-5">
<slot name="header" />
</h4>
{#if closable}
<button
type="button"
class="x-button"
aria-label="Close Modal"
title="Close Modal"
on:click={closeModal}>
<span class="icon-x" aria-hidden="true" />
</button>
{/if}
</header>
<div class="modal-content">
{#if error}
<div bind:this={alert}>
<Alert
dismissible
type="warning"
on:dismiss={() => {
error = null;
}}>
{error}
</Alert>
</div>
{/if}
<slot />
</div>
{#if $$slots.footer}
<div class="modal-footer">
<div class="u-flex u-main-end u-gap-16">
<slot name="footer" />
</div>
</div>
{/if}
</form>
</dialog>
+18 -22
View File
@@ -1,5 +1,5 @@
<script lang="ts">
import { Button, Form, FormList, Helper, InputText } from '$lib/elements/forms';
import { Button, FormList, Helper, InputText } from '$lib/elements/forms';
import { createEventDispatcher } from 'svelte';
import { Modal } from '..';
import type { Writable } from 'svelte/store';
@@ -25,26 +25,22 @@
$: disabled = !value || $groups.has(value);
</script>
{#if show}
<Form noMargin noStyle on:submit={create}>
<Modal bind:show on:close={reset}>
<svelte:fragment slot="header">Custom permission</svelte:fragment>
<Modal bind:show on:close={reset} on:submit={create}>
<svelte:fragment slot="header">Custom permission</svelte:fragment>
<FormList>
<InputText
showLabel={false}
id="custom-permission"
label="Custom permission"
placeholder="user:[USER_ID] or team:[TEAM_ID]/[ROLE]"
bind:value />
<Helper type="neutral">
A permission should be formatted as: user:[USER_ID] or team:[TEAM_ID]/[ROLE]¸
</Helper>
</FormList>
<FormList>
<InputText
showLabel={false}
id="custom-permission"
label="Custom permission"
placeholder="user:[USER_ID] or team:[TEAM_ID]/[ROLE]"
bind:value />
<Helper type="neutral">
A permission should be formatted as: user:[USER_ID] or team:[TEAM_ID]/[ROLE]¸
</Helper>
</FormList>
<svelte:fragment slot="footer">
<Button submit {disabled}>Create</Button>
</svelte:fragment>
</Modal>
</Form>
{/if}
<svelte:fragment slot="footer">
<Button submit {disabled}>Create</Button>
</svelte:fragment>
</Modal>
+45 -52
View File
@@ -1,5 +1,5 @@
<script lang="ts">
import { Button, Form, InputSearch } from '$lib/elements/forms';
import { Button, InputSearch } from '$lib/elements/forms';
import { createEventDispatcher } from 'svelte';
import { sdkForProject } from '$lib/stores/sdk';
import { Query, type Models } from '@aw-labs/appwrite-console';
@@ -58,54 +58,47 @@
}
</script>
{#if show}
<Form noStyle noMargin on:submit={create}>
<Modal bind:show on:close={reset} size="big">
<svelte:fragment slot="header">Select teams</svelte:fragment>
<InputSearch bind:value={search} />
{#if results?.teams}
<div class="table-wrapper">
<table class="table is-table-layout-auto is-remove-outer-styles">
<tbody class="table-tbody">
{#each results.teams as team (team.$id)}
{@const role = `team:${team.$id}`}
{@const exists = $groups.has(role)}
<tr class="table-row">
<td
class="table-col"
data-title="Enabled"
style="--p-col-width:40">
<input
id={team.$id}
type="checkbox"
class="icon-check"
aria-label="Create"
checked={exists || selected.has(role)}
disabled={exists}
on:change={(event) => onSelection(event, role)} />
</td>
<td class="table-col" data-title="Team">
<label class="u-flex u-cross-center u-gap-8" for={team.$id}>
<AvatarInitials size={32} name={team.name} />
<div class="u-line-height-1-5">
<div class="body-text-2">{team.name}</div>
<div class="u-x-small">{team.$id}</div>
</div>
</label>
</td>
</tr>
{/each}
</tbody>
</table>
</div>
{/if}
<div class="u-flex u-margin-block-start-32 u-main-space-between">
<p class="text">Total results: {results?.total}</p>
<PaginationInline limit={5} bind:offset sum={results?.total} hidePages />
</div>
<svelte:fragment slot="footer">
<Button submit disabled={!hasSelection}>Create</Button>
</svelte:fragment>
</Modal>
</Form>
{/if}
<Modal bind:show on:submit={create} on:close={reset} size="big">
<svelte:fragment slot="header">Select teams</svelte:fragment>
<InputSearch bind:value={search} />
{#if results?.teams}
<div class="table-wrapper">
<table class="table is-table-layout-auto is-remove-outer-styles">
<tbody class="table-tbody">
{#each results.teams as team (team.$id)}
{@const role = `team:${team.$id}`}
{@const exists = $groups.has(role)}
<tr class="table-row">
<td class="table-col" data-title="Enabled" style="--p-col-width:40">
<input
id={team.$id}
type="checkbox"
class="icon-check"
aria-label="Create"
checked={exists || selected.has(role)}
disabled={exists}
on:change={(event) => onSelection(event, role)} />
</td>
<td class="table-col" data-title="Team">
<label class="u-flex u-cross-center u-gap-8" for={team.$id}>
<AvatarInitials size={32} name={team.name} />
<div class="u-line-height-1-5">
<div class="body-text-2">{team.name}</div>
<div class="u-x-small">{team.$id}</div>
</div>
</label>
</td>
</tr>
{/each}
</tbody>
</table>
</div>
{/if}
<div class="u-flex u-margin-block-start-32 u-main-space-between">
<p class="text">Total results: {results?.total}</p>
<PaginationInline limit={5} bind:offset sum={results?.total} hidePages />
</div>
<svelte:fragment slot="footer">
<Button submit disabled={!hasSelection}>Create</Button>
</svelte:fragment>
</Modal>
+44 -46
View File
@@ -1,5 +1,5 @@
<script lang="ts">
import { Button, Form, InputSearch } from '$lib/elements/forms';
import { Button, InputSearch } from '$lib/elements/forms';
import { createEventDispatcher } from 'svelte';
import { AvatarInitials, Modal, PaginationInline } from '..';
import { sdkForProject } from '$lib/stores/sdk';
@@ -58,49 +58,47 @@
}
</script>
<Form noStyle noMargin on:submit={create}>
<Modal bind:show on:close={reset} size="big">
<svelte:fragment slot="header">Select users</svelte:fragment>
<InputSearch bind:value={search} />
{#if results?.users}
<div class="table-wrapper">
<table class="table is-table-layout-auto is-remove-outer-styles">
<tbody class="table-tbody">
{#each results.users as user (user.$id)}
{@const role = `user:${user.$id}`}
{@const exists = $groups.has(role)}
<tr class="table-row">
<td class="table-col" data-title="Enabled" style="--p-col-width:40">
<input
id={user.$id}
type="checkbox"
class="icon-check"
aria-label="Create"
checked={exists || selected.has(role)}
disabled={exists}
on:change={(event) => onSelection(event, role)} />
</td>
<td class="table-col" data-title="User">
<label class="u-flex u-cross-center u-gap-8" for={user.$id}>
<AvatarInitials size={32} name={user.name} />
<div class="u-line-height-1-5">
<div class="body-text-2">{user.name}</div>
<div class="u-x-small">{user.$id}</div>
</div>
</label>
</td>
</tr>
{/each}
</tbody>
</table>
</div>
{/if}
<div class="u-flex u-margin-block-start-32 u-main-space-between">
<p class="text">Total results: {results?.total}</p>
<PaginationInline limit={5} bind:offset sum={results?.total} hidePages />
<Modal bind:show on:submit={create} on:close={reset} size="big">
<svelte:fragment slot="header">Select users</svelte:fragment>
<InputSearch bind:value={search} />
{#if results?.users}
<div class="table-wrapper">
<table class="table is-table-layout-auto is-remove-outer-styles">
<tbody class="table-tbody">
{#each results.users as user (user.$id)}
{@const role = `user:${user.$id}`}
{@const exists = $groups.has(role)}
<tr class="table-row">
<td class="table-col" data-title="Enabled" style="--p-col-width:40">
<input
id={user.$id}
type="checkbox"
class="icon-check"
aria-label="Create"
checked={exists || selected.has(role)}
disabled={exists}
on:change={(event) => onSelection(event, role)} />
</td>
<td class="table-col" data-title="User">
<label class="u-flex u-cross-center u-gap-8" for={user.$id}>
<AvatarInitials size={32} name={user.name} />
<div class="u-line-height-1-5">
<div class="body-text-2">{user.name}</div>
<div class="u-x-small">{user.$id}</div>
</div>
</label>
</td>
</tr>
{/each}
</tbody>
</table>
</div>
<svelte:fragment slot="footer">
<Button submit disabled={!hasSelection}>Create</Button>
</svelte:fragment>
</Modal>
</Form>
{/if}
<div class="u-flex u-margin-block-start-32 u-main-space-between">
<p class="text">Total results: {results?.total}</p>
<PaginationInline limit={5} bind:offset sum={results?.total} hidePages />
</div>
<svelte:fragment slot="footer">
<Button submit disabled={!hasSelection}>Create</Button>
</svelte:fragment>
</Modal>
+12 -14
View File
@@ -1,6 +1,6 @@
<script lang="ts">
import { Modal } from '$lib/components';
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { createEventDispatcher } from 'svelte';
export let show = false;
@@ -11,16 +11,14 @@
}
</script>
<Form noMargin on:submit={handleSubmit}>
<Modal bind:show warning>
<svelte:fragment slot="header">Exit Process</svelte:fragment>
<p>
Are you sure you want to exit from <slot />? All data will be deleted. This action is
irreversible.
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (show = false)}>Cancel</Button>
<Button secondary submit>Exit</Button>
</svelte:fragment>
</Modal>
</Form>
<Modal bind:show on:submit={handleSubmit} warning>
<svelte:fragment slot="header">Exit Process</svelte:fragment>
<p>
Are you sure you want to exit from <slot />? All data will be deleted. This action is
irreversible.
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (show = false)}>Cancel</Button>
<Button secondary submit>Exit</Button>
</svelte:fragment>
</Modal>
+9 -11
View File
@@ -1,6 +1,6 @@
<script lang="ts">
import { Modal } from '$lib/components';
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForConsole } from '$lib/stores/sdk';
import { user } from '$lib/stores/user';
@@ -24,13 +24,11 @@
};
</script>
<Form on:submit={deleteAccount}>
<Modal bind:show={showDelete} warning>
<svelte:fragment slot="header">Delete Account</svelte:fragment>
<p>Are you sure you want to delete your account?</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
</Form>
<Modal bind:show={showDelete} on:submit={deleteAccount} warning>
<svelte:fragment slot="header">Delete Account</svelte:fragment>
<p>Are you sure you want to delete your account?</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
+28 -30
View File
@@ -1,7 +1,7 @@
<script lang="ts">
import { Modal, CustomId } from '$lib/components';
import { Pill } from '$lib/elements';
import { InputText, Button, Form, FormList } from '$lib/elements/forms';
import { InputText, Button, FormList } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForConsole } from '$lib/stores/sdk';
import { createEventDispatcher } from 'svelte';
@@ -36,32 +36,30 @@
};
</script>
<Form on:submit={create}>
<Modal {error} size="big" bind:show {closable}>
<svelte:fragment slot="header">Create New Organization</svelte:fragment>
<FormList>
<InputText
id="name"
label="Name"
placeholder="Enter name"
bind:value={name}
autofocus={true}
required />
{#if !showCustomId}
<div>
<Pill button on:click={() => (showCustomId = !showCustomId)}>
<span class="icon-pencil" aria-hidden="true" /><span class="text">
Organization ID
</span>
</Pill>
</div>
{:else}
<CustomId bind:show={showCustomId} name="organization" bind:id />
{/if}
</FormList>
<svelte:fragment slot="footer">
<Button disabled={!closable} secondary on:click={() => (show = false)}>Cancel</Button>
<Button submit>Create</Button>
</svelte:fragment>
</Modal>
</Form>
<Modal {error} on:submit={create} size="big" bind:show {closable}>
<svelte:fragment slot="header">Create New Organization</svelte:fragment>
<FormList>
<InputText
id="name"
label="Name"
placeholder="Enter name"
bind:value={name}
autofocus={true}
required />
{#if !showCustomId}
<div>
<Pill button on:click={() => (showCustomId = !showCustomId)}>
<span class="icon-pencil" aria-hidden="true" /><span class="text">
Organization ID
</span>
</Pill>
</div>
{:else}
<CustomId bind:show={showCustomId} name="organization" bind:id />
{/if}
</FormList>
<svelte:fragment slot="footer">
<Button disabled={!closable} secondary on:click={() => (show = false)}>Cancel</Button>
<Button submit>Create</Button>
</svelte:fragment>
</Modal>
@@ -1,7 +1,7 @@
<script lang="ts">
import { page } from '$app/stores';
import { Modal } from '$lib/components';
import { InputText, InputEmail, Button, Form, FormList } from '$lib/elements/forms';
import { InputText, InputEmail, Button, FormList } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForConsole } from '$lib/stores/sdk';
import { createEventDispatcher } from 'svelte';
@@ -44,25 +44,19 @@
}
</script>
<Form on:submit={create}>
<Modal {error} size="big" bind:show={showCreate}>
<svelte:fragment slot="header">Invite Member</svelte:fragment>
<FormList>
<InputEmail
id="email"
label="Email"
placeholder="Enter email"
autofocus={true}
bind:value={email} />
<InputText
id="name"
label="Name (optional)"
placeholder="Enter name"
bind:value={name} />
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showCreate = false)}>Cancel</Button>
<Button submit>Send invite</Button>
</svelte:fragment>
</Modal>
</Form>
<Modal {error} size="big" bind:show={showCreate} on:submit={create}>
<svelte:fragment slot="header">Invite Member</svelte:fragment>
<FormList>
<InputEmail
id="email"
label="Email"
placeholder="Enter email"
autofocus={true}
bind:value={email} />
<InputText id="name" label="Name (optional)" placeholder="Enter name" bind:value={name} />
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showCreate = false)}>Cancel</Button>
<Button submit>Send invite</Button>
</svelte:fragment>
</Modal>
@@ -1,7 +1,7 @@
<script lang="ts">
import { Modal, CustomId } from '$lib/components';
import { Pill } from '$lib/elements';
import { InputText, Button, Form, FormList } from '$lib/elements/forms';
import { InputText, Button, FormList } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForConsole } from '$lib/stores/sdk';
import { createEventDispatcher } from 'svelte';
@@ -33,26 +33,24 @@
};
</script>
<Form on:submit={create}>
<Modal {error} size="big" bind:show>
<svelte:fragment slot="header">Create Project</svelte:fragment>
<FormList>
<InputText id="name" label="Name" bind:value={name} required autofocus={true} />
{#if !showCustomId}
<div>
<Pill button on:click={() => (showCustomId = !showCustomId)}>
<span class="icon-pencil" aria-hidden="true" /><span class="text">
Project ID
</span>
</Pill>
</div>
{:else}
<CustomId bind:show={showCustomId} name="Project" bind:id />
{/if}
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (show = false)}>Cancel</Button>
<Button submit>Create</Button>
</svelte:fragment>
</Modal>
</Form>
<Modal {error} on:submit={create} size="big" bind:show>
<svelte:fragment slot="header">Create Project</svelte:fragment>
<FormList>
<InputText id="name" label="Name" bind:value={name} required autofocus={true} />
{#if !showCustomId}
<div>
<Pill button on:click={() => (showCustomId = !showCustomId)}>
<span class="icon-pencil" aria-hidden="true" /><span class="text">
Project ID
</span>
</Pill>
</div>
{:else}
<CustomId bind:show={showCustomId} name="Project" bind:id />
{/if}
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (show = false)}>Cancel</Button>
<Button submit>Create</Button>
</svelte:fragment>
</Modal>
@@ -2,7 +2,7 @@
import { base } from '$app/paths';
import { goto } from '$app/navigation';
import { Modal } from '$lib/components';
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForConsole } from '$lib/stores/sdk';
import type { Models } from '@aw-labs/appwrite-console';
@@ -40,19 +40,17 @@
$: isUser = selectedMember.userId === $user.$id;
</script>
<Form on:submit={deleteMembership}>
<Modal bind:show={showDelete} warning>
<svelte:fragment slot="header">
{isUser ? 'Leave Organization' : 'Delete Member'}
</svelte:fragment>
<p>
{isUser
? `Are you sure you want to leave '${selectedMember.teamName}'?`
: `Are you sure you want to delete ${selectedMember.userName} from '${selectedMember.teamName}'?`}
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>{isUser ? 'Leave' : 'Delete'}</Button>
</svelte:fragment>
</Modal>
</Form>
<Modal bind:show={showDelete} on:submit={deleteMembership} warning>
<svelte:fragment slot="header">
{isUser ? 'Leave Organization' : 'Delete Member'}
</svelte:fragment>
<p>
{isUser
? `Are you sure you want to leave '${selectedMember.teamName}'?`
: `Are you sure you want to delete ${selectedMember.userName} from '${selectedMember.teamName}'?`}
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>{isUser ? 'Leave' : 'Delete'}</Button>
</svelte:fragment>
</Modal>
@@ -1,6 +1,6 @@
<script lang="ts">
import { Modal } from '$lib/components';
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForConsole } from '$lib/stores/sdk';
import { newOrgModal, organization, organizationList } from '$lib/stores/organization';
@@ -34,16 +34,14 @@
};
</script>
<Form on:submit={deleteOrg}>
<Modal bind:show={showDelete} warning>
<svelte:fragment slot="header">Delete Organization</svelte:fragment>
<p>
Are you sure you want to delete <b>{$organization.name}</b>? All projects ({$organization.total})
and data associated with this organization will be deleted. This action is irreversible.
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
</Form>
<Modal on:submit={deleteOrg} bind:show={showDelete} warning>
<svelte:fragment slot="header">Delete Organization</svelte:fragment>
<p>
Are you sure you want to delete <b>{$organization.name}</b>? All projects ({$organization.total})
and data associated with this organization will be deleted. This action is irreversible.
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
@@ -1,14 +1,7 @@
<script lang="ts">
import { page } from '$app/stores';
import { Modal, CopyInput, Alert } from '$lib/components';
import {
Button,
InputText,
InputTextarea,
InputSwitch,
Form,
FormList
} from '$lib/elements/forms';
import { Button, InputText, InputTextarea, InputSwitch, FormList } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForConsole } from '$lib/stores/sdk';
import type { Provider } from '$lib/stores/oauth-providers';
@@ -58,46 +51,44 @@
$: secret = keyID && teamID && p8 ? JSON.stringify({ keyID, teamID, p8 }) : provider.secret;
</script>
<Form noMargin on:submit={update}>
<Modal {error} size="big" bind:show={showModal}>
<svelte:fragment slot="header">{provider.name} OAuth2 Settings</svelte:fragment>
<FormList>
<p>
To use {provider.name} authentication in your application, first fill in this form. For
more info you can
<a class="link" href={provider.docs} target="_blank" rel="noopener noreferrer">
visit the docs.
</a>
</p>
<InputSwitch id="state" bind:value={active} label={active ? 'Enabled' : 'Disabled'} />
<InputText
id="bundleID"
label="Bundle ID"
autofocus={true}
placeholder="com.company.appname"
bind:value={id} />
<InputText id="keyID" label="Key ID" placeholder="SHAB13ROFN" bind:value={keyID} />
<InputText id="teamID" label="Team ID" placeholder="ELA2CD3AED" bind:value={teamID} />
<InputTextarea id="p8" label="P8 File" placeholder="" bind:value={p8} />
<Alert type="info">
To complete set up, add this OAuth2 redirect URI to your {provider.name} app configuration.
</Alert>
<div>
<p>URI</p>
<CopyInput
value={`${
sdkForConsole.client.config.endpoint
}/account/session/oauth2/callback/${provider.name.toLocaleLowerCase()}/${projectId}`} />
</div>
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showModal = false)}>Cancel</Button>
<Button
disabled={(secret === provider.secret &&
active === provider.active &&
id === provider.id) ||
!(id && keyID && teamID && p8)}
submit>Update</Button>
</svelte:fragment>
</Modal>
</Form>
<Modal {error} on:submit={update} size="big" bind:show={showModal}>
<svelte:fragment slot="header">{provider.name} OAuth2 Settings</svelte:fragment>
<FormList>
<p>
To use {provider.name} authentication in your application, first fill in this form. For more
info you can
<a class="link" href={provider.docs} target="_blank" rel="noopener noreferrer">
visit the docs.
</a>
</p>
<InputSwitch id="state" bind:value={active} label={active ? 'Enabled' : 'Disabled'} />
<InputText
id="bundleID"
label="Bundle ID"
autofocus={true}
placeholder="com.company.appname"
bind:value={id} />
<InputText id="keyID" label="Key ID" placeholder="SHAB13ROFN" bind:value={keyID} />
<InputText id="teamID" label="Team ID" placeholder="ELA2CD3AED" bind:value={teamID} />
<InputTextarea id="p8" label="P8 File" placeholder="" bind:value={p8} />
<Alert type="info">
To complete set up, add this OAuth2 redirect URI to your {provider.name} app configuration.
</Alert>
<div>
<p>URI</p>
<CopyInput
value={`${
sdkForConsole.client.config.endpoint
}/account/session/oauth2/callback/${provider.name.toLocaleLowerCase()}/${projectId}`} />
</div>
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showModal = false)}>Cancel</Button>
<Button
disabled={(secret === provider.secret &&
active === provider.active &&
id === provider.id) ||
!(id && keyID && teamID && p8)}
submit>Update</Button>
</svelte:fragment>
</Modal>
@@ -1,14 +1,7 @@
<script lang="ts">
import { page } from '$app/stores';
import { Modal, CopyInput, Alert } from '$lib/components';
import {
Button,
InputPassword,
InputText,
InputSwitch,
Form,
FormList
} from '$lib/elements/forms';
import { Button, InputPassword, InputText, InputSwitch, FormList } from '$lib/elements/forms';
import { sdkForConsole } from '$lib/stores/sdk';
import type { Provider } from '$lib/stores/oauth-providers';
import { addNotification } from '$lib/stores/notifications';
@@ -59,54 +52,52 @@
: provider.secret;
</script>
<Form noMargin on:submit={update}>
<Modal {error} size="big" bind:show={showModal}>
<svelte:fragment slot="header">{provider.name} OAuth2 Settings</svelte:fragment>
<FormList>
<p>
To use {provider.name} authentication in your application, first fill in this form. For
more info you can
<a class="link" href={provider.docs} target="_blank" rel="noopener noreferrer"
>visit the docs.</a>
</p>
<InputSwitch id="state" bind:value={active} label={active ? 'Enabled' : 'Disabled'} />
<InputText
id="clientID"
label="Client ID"
autofocus={true}
placeholder="Enter ID"
bind:value={id} />
<InputPassword
id="secret"
label="Client Secret"
placeholder="Enter Client Secret"
minlength={0}
showPasswordButton
bind:value={clientSecret} />
<InputText
id="domain"
label="Auth0 Domain"
placeholder="Your Auth0 domain"
bind:value={auth0Domain} />
<Alert type="info">
To complete set up, add this OAuth2 redirect URI to your {provider.name} app configuration.
</Alert>
<div>
<p>URI</p>
<CopyInput
value={`${
sdkForConsole.client.config.endpoint
}/account/session/oauth2/callback/${provider.name.toLocaleLowerCase()}/${projectId}`} />
</div>
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showModal = false)}>Cancel</Button>
<Button
disabled={(secret === provider.secret &&
active === provider.active &&
id === provider.id) ||
!(id && clientSecret && auth0Domain)}
submit>Update</Button>
</svelte:fragment>
</Modal>
</Form>
<Modal {error} size="big" bind:show={showModal} on:submit={update}>
<svelte:fragment slot="header">{provider.name} OAuth2 Settings</svelte:fragment>
<FormList>
<p>
To use {provider.name} authentication in your application, first fill in this form. For more
info you can
<a class="link" href={provider.docs} target="_blank" rel="noopener noreferrer"
>visit the docs.</a>
</p>
<InputSwitch id="state" bind:value={active} label={active ? 'Enabled' : 'Disabled'} />
<InputText
id="clientID"
label="Client ID"
autofocus={true}
placeholder="Enter ID"
bind:value={id} />
<InputPassword
id="secret"
label="Client Secret"
placeholder="Enter Client Secret"
minlength={0}
showPasswordButton
bind:value={clientSecret} />
<InputText
id="domain"
label="Auth0 Domain"
placeholder="Your Auth0 domain"
bind:value={auth0Domain} />
<Alert type="info">
To complete set up, add this OAuth2 redirect URI to your {provider.name} app configuration.
</Alert>
<div>
<p>URI</p>
<CopyInput
value={`${
sdkForConsole.client.config.endpoint
}/account/session/oauth2/callback/${provider.name.toLocaleLowerCase()}/${projectId}`} />
</div>
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showModal = false)}>Cancel</Button>
<Button
disabled={(secret === provider.secret &&
active === provider.active &&
id === provider.id) ||
!(id && clientSecret && auth0Domain)}
submit>Update</Button>
</svelte:fragment>
</Modal>
@@ -1,7 +1,7 @@
<script lang="ts">
import { Modal, CustomId } from '$lib/components';
import { Pill } from '$lib/elements';
import { InputText, Button, Form, FormList } from '$lib/elements/forms';
import { InputText, Button, FormList } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForProject } from '$lib/stores/sdk';
import { createEventDispatcher } from 'svelte';
@@ -35,30 +35,28 @@
}
</script>
<Form on:submit={create}>
<Modal {error} size="big" bind:show={showCreate}>
<svelte:fragment slot="header">Create Team</svelte:fragment>
<FormList>
<InputText
id="name"
label="Name"
placeholder="Enter name"
autofocus={true}
bind:value={name} />
{#if !showCustomId}
<div>
<Pill button on:click={() => (showCustomId = !showCustomId)}
><span class="icon-pencil" aria-hidden="true" />
<span class="text"> Team ID </span>
</Pill>
</div>
{:else}
<CustomId bind:show={showCustomId} name="Team" bind:id />
{/if}
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showCreate = false)}>Cancel</Button>
<Button submit>Create</Button>
</svelte:fragment>
</Modal>
</Form>
<Modal {error} size="big" bind:show={showCreate} on:submit={create}>
<svelte:fragment slot="header">Create Team</svelte:fragment>
<FormList>
<InputText
id="name"
label="Name"
placeholder="Enter name"
autofocus={true}
bind:value={name} />
{#if !showCustomId}
<div>
<Pill button on:click={() => (showCustomId = !showCustomId)}
><span class="icon-pencil" aria-hidden="true" />
<span class="text"> Team ID </span>
</Pill>
</div>
{:else}
<CustomId bind:show={showCustomId} name="Team" bind:id />
{/if}
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showCreate = false)}>Cancel</Button>
<Button submit>Create</Button>
</svelte:fragment>
</Modal>
@@ -7,7 +7,6 @@
InputEmail,
InputText,
InputPhone,
Form,
FormList
} from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
@@ -53,40 +52,38 @@
}
</script>
<Form on:submit={create}>
<Modal {error} size="big" bind:show={showCreate}>
<svelte:fragment slot="header">Create User</svelte:fragment>
<FormList>
<InputText
id="name"
label="Name"
placeholder="Enter name"
autofocus={true}
bind:value={name} />
<InputEmail id="email" label="Email" placeholder="Enter email" bind:value={mail} />
<InputPhone id="phone" label="Phone" placeholder="Enter phone" bind:value={phone} />
<InputPassword
id="password"
label="Password"
placeholder="Enter password"
showPasswordButton={true}
bind:value={pass} />
<Modal {error} size="big" bind:show={showCreate} on:submit={create}>
<svelte:fragment slot="header">Create User</svelte:fragment>
<FormList>
<InputText
id="name"
label="Name"
placeholder="Enter name"
autofocus={true}
bind:value={name} />
<InputEmail id="email" label="Email" placeholder="Enter email" bind:value={mail} />
<InputPhone id="phone" label="Phone" placeholder="Enter phone" bind:value={phone} />
<InputPassword
id="password"
label="Password"
placeholder="Enter password"
showPasswordButton={true}
bind:value={pass} />
{#if !showDropdown}
<div>
<Pill button on:click={() => (showDropdown = !showDropdown)}>
<span class="icon-pencil" aria-hidden="true" /><span class="text">
User ID
</span>
</Pill>
</div>
{:else}
<CustomId bind:show={showDropdown} name="User" bind:id />
{/if}
</FormList>
<svelte:fragment slot="footer">
<Button text on:click={() => (showCreate = false)}>Cancel</Button>
<Button submit>Create</Button>
</svelte:fragment>
</Modal>
</Form>
{#if !showDropdown}
<div>
<Pill button on:click={() => (showDropdown = !showDropdown)}>
<span class="icon-pencil" aria-hidden="true" /><span class="text">
User ID
</span>
</Pill>
</div>
{:else}
<CustomId bind:show={showDropdown} name="User" bind:id />
{/if}
</FormList>
<svelte:fragment slot="footer">
<Button text on:click={() => (showCreate = false)}>Cancel</Button>
<Button submit>Create</Button>
</svelte:fragment>
</Modal>
@@ -1,14 +1,7 @@
<script lang="ts">
import { page } from '$app/stores';
import { Modal, CopyInput, Alert } from '$lib/components';
import {
Button,
InputPassword,
InputText,
InputSwitch,
Form,
FormList
} from '$lib/elements/forms';
import { Button, InputPassword, InputText, InputSwitch, FormList } from '$lib/elements/forms';
import { sdkForConsole } from '$lib/stores/sdk';
import type { Provider } from '$lib/stores/oauth-providers';
import { addNotification } from '$lib/stores/notifications';
@@ -54,50 +47,46 @@
};
</script>
<Form noMargin on:submit={update}>
<Modal {error} size="big" bind:show={showModal}>
<svelte:fragment slot="header">{provider.name} OAuth2 Settings</svelte:fragment>
<FormList>
<p>
To use {provider.name} authentication in your application, first fill in this form. For
more info you can
<a class="link" href={provider.docs} target="_blank" rel="noopener noreferrer"
>visit the docs.</a>
</p>
<InputSwitch id="state" bind:value={active} label={active ? 'Enabled' : 'Disabled'} />
<InputText
id="appID"
label="App ID"
autofocus={true}
placeholder="Enter ID"
bind:value={id} />
<InputPassword
id="secret"
label="App Secret"
placeholder="Enter App Secret"
minlength={0}
showPasswordButton
bind:value={secret} />
<Alert type="info">
To complete set up, add this OAuth2 redirect URI to your {provider.name} app configuration.
</Alert>
<div>
<p>URI</p>
<CopyInput
value={`${
sdkForConsole.client.config.endpoint
}/account/session/oauth2/callback/${provider.name.toLocaleLowerCase()}/${projectId}`} />
</div>
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showModal = false)}>Cancel</Button>
<Button
disabled={!id ||
!secret ||
(id === provider.id &&
secret === provider.secret &&
active === provider.active)}
submit>Update</Button>
</svelte:fragment>
</Modal>
</Form>
<Modal {error} size="big" bind:show={showModal} on:submit={update}>
<svelte:fragment slot="header">{provider.name} OAuth2 Settings</svelte:fragment>
<FormList>
<p>
To use {provider.name} authentication in your application, first fill in this form. For more
info you can
<a class="link" href={provider.docs} target="_blank" rel="noopener noreferrer"
>visit the docs.</a>
</p>
<InputSwitch id="state" bind:value={active} label={active ? 'Enabled' : 'Disabled'} />
<InputText
id="appID"
label="App ID"
autofocus={true}
placeholder="Enter ID"
bind:value={id} />
<InputPassword
id="secret"
label="App Secret"
placeholder="Enter App Secret"
minlength={0}
showPasswordButton
bind:value={secret} />
<Alert type="info">
To complete set up, add this OAuth2 redirect URI to your {provider.name} app configuration.
</Alert>
<div>
<p>URI</p>
<CopyInput
value={`${
sdkForConsole.client.config.endpoint
}/account/session/oauth2/callback/${provider.name.toLocaleLowerCase()}/${projectId}`} />
</div>
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showModal = false)}>Cancel</Button>
<Button
disabled={!id ||
!secret ||
(id === provider.id && secret === provider.secret && active === provider.active)}
submit>Update</Button>
</svelte:fragment>
</Modal>
@@ -1,14 +1,7 @@
<script lang="ts">
import { page } from '$app/stores';
import { Modal, CopyInput, Alert } from '$lib/components';
import {
Button,
InputPassword,
InputText,
InputSwitch,
Form,
FormList
} from '$lib/elements/forms';
import { Button, InputPassword, InputText, InputSwitch, FormList } from '$lib/elements/forms';
import { sdkForConsole } from '$lib/stores/sdk';
import type { Provider } from '$lib/stores/oauth-providers';
import { addNotification } from '$lib/stores/notifications';
@@ -59,55 +52,53 @@
clientSecret && tenantID ? JSON.stringify({ clientSecret, tenantID }) : provider.secret;
</script>
<Form noMargin on:submit={update}>
<Modal {error} size="big" bind:show={showModal}>
<svelte:fragment slot="header">{provider.name} OAuth2 Settings</svelte:fragment>
<FormList>
<p>
To use {provider.name} authentication in your application, first fill in this form. For
more info you can
<a class="link" href={provider.docs} target="_blank" rel="noopener noreferrer">
visit the docs.
</a>
</p>
<InputSwitch id="state" bind:value={active} label={active ? 'Enabled' : 'Disabled'} />
<InputText
id="appID"
label="Application (client) ID"
autofocus={true}
placeholder="Enter ID"
bind:value={id} />
<InputPassword
id="secret"
label="Client Secret"
placeholder="Enter Client Secret"
showPasswordButton
minlength={0}
bind:value={clientSecret} />
<InputText
id="tenant"
label="Target Tenant"
placeholder="'common','organizations','consumers' or your TenantID"
bind:value={tenantID} />
<Alert type="info">
To complete set up, add this OAuth2 redirect URI to your {provider.name} app configuration.
</Alert>
<div>
<p>URI</p>
<CopyInput
value={`${
sdkForConsole.client.config.endpoint
}/account/session/oauth2/callback/${provider.name.toLocaleLowerCase()}/${projectId}`} />
</div>
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showModal = false)}>Cancel</Button>
<Button
disabled={(secret === provider.secret &&
active === provider.active &&
id === provider.id) ||
!(id && clientSecret && tenantID)}
submit>Update</Button>
</svelte:fragment>
</Modal>
</Form>
<Modal {error} on:submit={update} size="big" bind:show={showModal}>
<svelte:fragment slot="header">{provider.name} OAuth2 Settings</svelte:fragment>
<FormList>
<p>
To use {provider.name} authentication in your application, first fill in this form. For more
info you can
<a class="link" href={provider.docs} target="_blank" rel="noopener noreferrer">
visit the docs.
</a>
</p>
<InputSwitch id="state" bind:value={active} label={active ? 'Enabled' : 'Disabled'} />
<InputText
id="appID"
label="Application (client) ID"
autofocus={true}
placeholder="Enter ID"
bind:value={id} />
<InputPassword
id="secret"
label="Client Secret"
placeholder="Enter Client Secret"
showPasswordButton
minlength={0}
bind:value={clientSecret} />
<InputText
id="tenant"
label="Target Tenant"
placeholder="'common','organizations','consumers' or your TenantID"
bind:value={tenantID} />
<Alert type="info">
To complete set up, add this OAuth2 redirect URI to your {provider.name} app configuration.
</Alert>
<div>
<p>URI</p>
<CopyInput
value={`${
sdkForConsole.client.config.endpoint
}/account/session/oauth2/callback/${provider.name.toLocaleLowerCase()}/${projectId}`} />
</div>
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showModal = false)}>Cancel</Button>
<Button
disabled={(secret === provider.secret &&
active === provider.active &&
id === provider.id) ||
!(id && clientSecret && tenantID)}
submit>Update</Button>
</svelte:fragment>
</Modal>
@@ -1,14 +1,7 @@
<script lang="ts">
import { page } from '$app/stores';
import { Modal, CopyInput, Alert } from '$lib/components';
import {
Button,
InputPassword,
InputText,
InputSwitch,
Form,
FormList
} from '$lib/elements/forms';
import { Button, InputPassword, InputText, InputSwitch, FormList } from '$lib/elements/forms';
import { sdkForConsole } from '$lib/stores/sdk';
import type { Provider } from '$lib/stores/oauth-providers';
import { addNotification } from '$lib/stores/notifications';
@@ -63,60 +56,58 @@
: provider.secret;
</script>
<Form noMargin on:submit={update}>
<Modal {error} size="big" bind:show={showModal}>
<svelte:fragment slot="header">{provider.name} OAuth2 Settings</svelte:fragment>
<FormList>
<p>
To use {provider.name} authentication in your application, first fill in this form. For
more info you can
<a class="link" href={provider.docs} target="_blank" rel="noopener noreferrer"
>visit the docs.</a>
</p>
<InputSwitch id="state" bind:value={active} label={active ? 'Enabled' : 'Disabled'} />
<InputText
id="appID"
label="Client ID"
autofocus={true}
placeholder="Enter ID"
bind:value={id} />
<InputPassword
id="secret"
label="Client Secret"
placeholder="Enter Client Secret"
minlength={0}
showPasswordButton
bind:value={clientSecret} />
<InputText
id="domain"
label="Okta Domain"
placeholder="dev-1337.okta.com"
bind:value={oktaDomain} />
<InputText
id="serverID"
label="Authorization Server ID"
placeholder="default"
bind:value={authorizationServerId} />
<Modal {error} on:submit={update} size="big" bind:show={showModal}>
<svelte:fragment slot="header">{provider.name} OAuth2 Settings</svelte:fragment>
<FormList>
<p>
To use {provider.name} authentication in your application, first fill in this form. For more
info you can
<a class="link" href={provider.docs} target="_blank" rel="noopener noreferrer"
>visit the docs.</a>
</p>
<InputSwitch id="state" bind:value={active} label={active ? 'Enabled' : 'Disabled'} />
<InputText
id="appID"
label="Client ID"
autofocus={true}
placeholder="Enter ID"
bind:value={id} />
<InputPassword
id="secret"
label="Client Secret"
placeholder="Enter Client Secret"
minlength={0}
showPasswordButton
bind:value={clientSecret} />
<InputText
id="domain"
label="Okta Domain"
placeholder="dev-1337.okta.com"
bind:value={oktaDomain} />
<InputText
id="serverID"
label="Authorization Server ID"
placeholder="default"
bind:value={authorizationServerId} />
<Alert type="info">
To complete set up, add this OAuth2 redirect URI to your {provider.name} app configuration.
</Alert>
<div>
<p>URI</p>
<CopyInput
value={`${
sdkForConsole.client.config.endpoint
}/account/session/oauth2/callback/${provider.name.toLocaleLowerCase()}/${projectId}`} />
</div>
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showModal = false)}>Cancel</Button>
<Button
disabled={(secret === provider.secret &&
active === provider.active &&
id === provider.id) ||
!(id && clientSecret && oktaDomain && authorizationServerId)}
submit>Update</Button>
</svelte:fragment>
</Modal>
</Form>
<Alert type="info">
To complete set up, add this OAuth2 redirect URI to your {provider.name} app configuration.
</Alert>
<div>
<p>URI</p>
<CopyInput
value={`${
sdkForConsole.client.config.endpoint
}/account/session/oauth2/callback/${provider.name.toLocaleLowerCase()}/${projectId}`} />
</div>
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showModal = false)}>Cancel</Button>
<Button
disabled={(secret === provider.secret &&
active === provider.active &&
id === provider.id) ||
!(id && clientSecret && oktaDomain && authorizationServerId)}
submit>Update</Button>
</svelte:fragment>
</Modal>
@@ -1,7 +1,7 @@
<script lang="ts">
import { page } from '$app/stores';
import { Modal, Alert } from '$lib/components';
import { Button, InputEmail, InputText, InputTags, Form, FormList } from '$lib/elements/forms';
import { Button, InputEmail, InputText, InputTags, FormList } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForProject } from '$lib/stores/sdk';
import { createEventDispatcher } from 'svelte';
@@ -39,31 +39,25 @@
};
</script>
<Form on:submit={create}>
<Modal {error} size="big" bind:show={showCreate}>
<svelte:fragment slot="header">Create Membership</svelte:fragment>
<FormList>
<InputEmail
id="email"
label="Email"
placeholder="Enter email"
required={true}
autofocus={true}
bind:value={email} />
<InputText
id="name"
label="Name (optional)"
placeholder="Enter name"
bind:value={name} />
<Alert type="info">
Roles are used to manage access permissions. You can create any role you want.
</Alert>
<Modal {error} on:submit={create} size="big" bind:show={showCreate}>
<svelte:fragment slot="header">Create Membership</svelte:fragment>
<FormList>
<InputEmail
id="email"
label="Email"
placeholder="Enter email"
required={true}
autofocus={true}
bind:value={email} />
<InputText id="name" label="Name (optional)" placeholder="Enter name" bind:value={name} />
<Alert type="info">
Roles are used to manage access permissions. You can create any role you want.
</Alert>
<InputTags id="tags" label="Roles" placeholder="Add roles" bind:tags={roles} />
</FormList>
<svelte:fragment slot="footer">
<Button text on:click={() => (showCreate = false)}>Cancel</Button>
<Button submit>Create</Button>
</svelte:fragment>
</Modal>
</Form>
<InputTags id="tags" label="Roles" placeholder="Add roles" bind:tags={roles} />
</FormList>
<svelte:fragment slot="footer">
<Button text on:click={() => (showCreate = false)}>Cancel</Button>
<Button submit>Create</Button>
</svelte:fragment>
</Modal>
@@ -3,7 +3,7 @@
import { base } from '$app/paths';
import { page } from '$app/stores';
import { Modal } from '$lib/components';
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForProject } from '$lib/stores/sdk';
import type { Models } from '@aw-labs/appwrite-console';
@@ -34,15 +34,13 @@
};
</script>
<Form on:submit={deleteMembership}>
<Modal bind:show={showDelete} warning>
<svelte:fragment slot="header">Delete Member</svelte:fragment>
<p>
Are you sure you want to delete <b>{selectedMembership.userName}</b> from '{selectedMembership.teamName}'?
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
</Form>
<Modal bind:show={showDelete} on:submit={deleteMembership} warning>
<svelte:fragment slot="header">Delete Member</svelte:fragment>
<p>
Are you sure you want to delete <b>{selectedMembership.userName}</b> from '{selectedMembership.teamName}'?
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
@@ -3,7 +3,7 @@
import { base } from '$app/paths';
import { page } from '$app/stores';
import { Modal } from '$lib/components';
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForProject } from '$lib/stores/sdk';
import type { Models } from '@aw-labs/appwrite-console';
@@ -25,16 +25,14 @@
};
</script>
<Form on:submit={deleteTeam}>
<Modal bind:show={showDelete} warning>
<svelte:fragment slot="header">Delete Team</svelte:fragment>
<Modal bind:show={showDelete} on:submit={deleteTeam} warning>
<svelte:fragment slot="header">Delete Team</svelte:fragment>
<p>
Are you sure you want to delete <b>{team.name}</b>?
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
</Form>
<p>
Are you sure you want to delete <b>{team.name}</b>?
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
@@ -3,7 +3,7 @@
import { base } from '$app/paths';
import { page } from '$app/stores';
import { Modal } from '$lib/components';
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForProject } from '$lib/stores/sdk';
import { user } from './store';
@@ -32,16 +32,14 @@
//TODO: implelment delete all memberships
</script>
<Form on:submit={deleteAllMemberships}>
<Modal bind:show={showDeleteAll} warning>
<svelte:fragment slot="header">Delete All Memberships</svelte:fragment>
<Modal bind:show={showDeleteAll} on:submit={deleteAllMemberships} warning>
<svelte:fragment slot="header">Delete All Memberships</svelte:fragment>
<p>
Are you sure you want to delete <b>{$user.name}'s</b> all memberships?
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDeleteAll = false)}>Cancel</Button>
<Button secondary submit disabled>To implement Delete</Button>
</svelte:fragment>
</Modal>
</Form>
<p>
Are you sure you want to delete <b>{$user.name}'s</b> all memberships?
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDeleteAll = false)}>Cancel</Button>
<Button secondary submit disabled>To implement Delete</Button>
</svelte:fragment>
</Modal>
@@ -3,7 +3,7 @@
import { page } from '$app/stores';
import { Modal } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForProject } from '$lib/stores/sdk';
import { user } from './store';
@@ -28,15 +28,13 @@
};
</script>
<Form on:submit={deleteAllSessions}>
<Modal bind:show={showDeleteAll} warning>
<svelte:fragment slot="header">Delete All Sessions</svelte:fragment>
<p>
Are you sure you want to delete <b>all of {$user.name}'s sessions?</b>
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDeleteAll = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
</Form>
<Modal bind:show={showDeleteAll} on:submit={deleteAllSessions} warning>
<svelte:fragment slot="header">Delete All Sessions</svelte:fragment>
<p>
Are you sure you want to delete <b>all of {$user.name}'s sessions?</b>
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDeleteAll = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
@@ -4,7 +4,7 @@
import { page } from '$app/stores';
import { Modal } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForProject } from '$lib/stores/sdk';
import type { Models } from '@aw-labs/appwrite-console';
@@ -37,15 +37,13 @@
};
</script>
<Form on:submit={deleteMembership}>
<Modal bind:show={showDelete} warning>
<svelte:fragment slot="header">Delete Member</svelte:fragment>
<p>
Are you sure you want to delete <b>{selectedMembership.userName}</b> from '{selectedMembership.teamName}'?
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
</Form>
<Modal bind:show={showDelete} on:submit={deleteMembership} warning>
<svelte:fragment slot="header">Delete Member</svelte:fragment>
<p>
Are you sure you want to delete <b>{selectedMembership.userName}</b> from '{selectedMembership.teamName}'?
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
@@ -3,7 +3,7 @@
import { page } from '$app/stores';
import { Modal } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForProject } from '$lib/stores/sdk';
@@ -27,14 +27,12 @@
};
</script>
<Form on:submit={deleteSession}>
<Modal bind:show={showDelete} warning>
<svelte:fragment slot="header">Delete Sessions</svelte:fragment>
<Modal bind:show={showDelete} on:submit={deleteSession} warning>
<svelte:fragment slot="header">Delete Sessions</svelte:fragment>
<p>Are you sure you want to delete this session?</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
</Form>
<p>Are you sure you want to delete this session?</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
@@ -3,7 +3,7 @@
import { base } from '$app/paths';
import { page } from '$app/stores';
import { Modal } from '$lib/components';
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForProject } from '$lib/stores/sdk';
import { user } from './store';
@@ -29,13 +29,11 @@
};
</script>
<Form on:submit={deleteUser}>
<Modal bind:show={showDelete} warning>
<svelte:fragment slot="header">Delete User</svelte:fragment>
<p>Are you sure you want to delete <b>{$user.name}</b> from '{$project.name}'?</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
</Form>
<Modal bind:show={showDelete} on:submit={deleteUser} warning>
<svelte:fragment slot="header">Delete User</svelte:fragment>
<p>Are you sure you want to delete <b>{$user.name}</b> from '{$project.name}'?</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
@@ -1,7 +1,7 @@
<script lang="ts">
import { Modal, CustomId } from '$lib/components';
import { Pill } from '$lib/elements';
import { Button, InputText, Form, FormList } from '$lib/elements/forms';
import { Button, InputText, FormList } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForProject } from '$lib/stores/sdk';
import { createEventDispatcher } from 'svelte';
@@ -29,32 +29,30 @@
};
</script>
<Form on:submit={create}>
<Modal size="big" bind:show={showCreate}>
<svelte:fragment slot="header">Create Database</svelte:fragment>
<FormList>
<InputText
id="name"
label="Name"
placeholder="Enter database name"
bind:value={name}
autofocus
required />
<Modal size="big" on:submit={create} bind:show={showCreate}>
<svelte:fragment slot="header">Create Database</svelte:fragment>
<FormList>
<InputText
id="name"
label="Name"
placeholder="Enter database name"
bind:value={name}
autofocus
required />
{#if !showCustomId}
<div>
<Pill button on:click={() => (showCustomId = !showCustomId)}
><span class="icon-pencil" aria-hidden="true" /><span class="text">
Database ID
</span></Pill>
</div>
{:else}
<CustomId bind:show={showCustomId} name="Database" bind:id />
{/if}
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showCreate = false)}>Cancel</Button>
<Button submit>Create</Button>
</svelte:fragment>
</Modal>
</Form>
{#if !showCustomId}
<div>
<Pill button on:click={() => (showCustomId = !showCustomId)}
><span class="icon-pencil" aria-hidden="true" /><span class="text">
Database ID
</span></Pill>
</div>
{:else}
<CustomId bind:show={showCustomId} name="Database" bind:id />
{/if}
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showCreate = false)}>Cancel</Button>
<Button submit>Create</Button>
</svelte:fragment>
</Modal>
@@ -120,8 +120,6 @@
</Container>
<Create bind:showCreate />
{#if selectedAttribute}
<Delete bind:showDelete {selectedAttribute} />
<Overview bind:showOverview {selectedAttribute} />
<CreateIndex bind:showCreateIndex externalAttribute={selectedAttribute} />
{/if}
<Delete bind:showDelete {selectedAttribute} />
<Overview bind:showOverview {selectedAttribute} />
<CreateIndex bind:showCreateIndex externalAttribute={selectedAttribute} />
@@ -1,7 +1,7 @@
<script lang="ts">
import { Modal } from '$lib/components';
import { option, options } from './store';
import { Button, InputText, Form, FormList, InputSelect } from '$lib/elements/forms';
import { Button, InputText, FormList, InputSelect } from '$lib/elements/forms';
import { invalidate } from '$app/navigation';
import { Dependencies } from '$lib/constants';
@@ -27,47 +27,45 @@
}
</script>
<Form on:submit={() => (submitted = true)}>
<Modal size="big" bind:show={showCreate}>
<svelte:fragment slot="header">Create Attribute</svelte:fragment>
<FormList>
<div>
<InputText
id="key"
label="Attribute Key"
placeholder="Enter Key"
bind:value={key}
autofocus
required />
<div class="u-flex u-gap-4 u-margin-block-start-8 u-small">
<span
class="icon-info u-cross-center u-margin-block-start-2 u-line-height-1 u-icon-small"
aria-hidden="true" />
<span class="text u-line-height-1-5"
>Allowed characters: alphanumeric, hyphen, non-leading underscore, period</span>
</div>
</div>
<InputSelect
options={options.map((n) => ({ value: n.name, label: n.name }))}
id="type"
label="Attribute type"
placeholder="Select type"
bind:value={selectedOption}
<Modal size="big" bind:show={showCreate} on:submit={() => (submitted = true)}>
<svelte:fragment slot="header">Create Attribute</svelte:fragment>
<FormList>
<div>
<InputText
id="key"
label="Attribute Key"
placeholder="Enter Key"
bind:value={key}
autofocus
required />
{#if selectedOption}
<svelte:component
this={$option.component}
{key}
bind:submitted
on:created={created}
on:close={() => ($option = null)} />
{/if}
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showCreate = false)}>Cancel</Button>
<Button submit>Create</Button>
</svelte:fragment>
</Modal>
</Form>
<div class="u-flex u-gap-4 u-margin-block-start-8 u-small">
<span
class="icon-info u-cross-center u-margin-block-start-2 u-line-height-1 u-icon-small"
aria-hidden="true" />
<span class="text u-line-height-1-5"
>Allowed characters: alphanumeric, hyphen, non-leading underscore, period</span>
</div>
</div>
<InputSelect
options={options.map((n) => ({ value: n.name, label: n.name }))}
id="type"
label="Attribute type"
placeholder="Select type"
bind:value={selectedOption}
required />
{#if selectedOption}
<svelte:component
this={$option.component}
{key}
bind:submitted
on:created={created}
on:close={() => ($option = null)} />
{/if}
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showCreate = false)}>Cancel</Button>
<Button submit>Create</Button>
</svelte:fragment>
</Modal>
@@ -3,7 +3,7 @@
import { base } from '$app/paths';
import { page } from '$app/stores';
import { Modal } from '$lib/components';
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { collection } from '../store';
import type { Attributes } from '../store';
@@ -35,17 +35,14 @@
};
</script>
<Form on:submit={handleDelete}>
<Modal warning={true} bind:show={showDelete}>
<svelte:fragment slot="header">Delete Attribute</svelte:fragment>
<Modal warning={true} bind:show={showDelete} on:submit={handleDelete}>
<svelte:fragment slot="header">Delete Attribute</svelte:fragment>
<p>
Are you sure you want to delete <b>'{selectedAttribute.key}' from {$collection.name}</b
>?
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
</Form>
<p>
Are you sure you want to delete <b>'{selectedAttribute.key}' from {$collection.name}</b>?
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
@@ -14,20 +14,18 @@
}
</script>
{#if selectedAttribute}
<Modal size="big" bind:show={showOverview}>
<svelte:fragment slot="header">Overview</svelte:fragment>
<FormList>
<InputText
id="ID"
label="Attribute ID"
placeholder="Enter ID"
bind:value={selectedAttribute.key}
disabled />
<Modal size="big" bind:show={showOverview}>
<svelte:fragment slot="header">Overview</svelte:fragment>
<FormList>
<InputText
id="ID"
label="Attribute ID"
placeholder="Enter ID"
bind:value={selectedAttribute.key}
disabled />
{#if selectedAttribute}
<svelte:component this={$option.component} overview={true} {selectedAttribute} />
{/if}
</FormList>
</Modal>
{/if}
{#if selectedAttribute}
<svelte:component this={$option.component} overview={true} {selectedAttribute} />
{/if}
</FormList>
</Modal>
@@ -3,7 +3,7 @@
import { base } from '$app/paths';
import { page } from '$app/stores';
import { Modal } from '$lib/components';
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForProject } from '$lib/stores/sdk';
import { collection } from '../store';
@@ -32,16 +32,14 @@
};
</script>
<Form on:submit={handleDelete}>
<Modal warning={true} bind:show={showDelete}>
<svelte:fragment slot="header">Delete Document</svelte:fragment>
<Modal warning={true} on:submit={handleDelete} bind:show={showDelete}>
<svelte:fragment slot="header">Delete Document</svelte:fragment>
<p>
Are you sure you want to delete <b>the document from {$collection.name}</b>?
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
</Form>
<p>
Are you sure you want to delete <b>the document from {$collection.name}</b>?
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
@@ -1,6 +1,6 @@
<script lang="ts">
import { Modal } from '$lib/components';
import { Button, InputText, Form, FormList, InputSelect } from '$lib/elements/forms';
import { Button, InputText, FormList, InputSelect } from '$lib/elements/forms';
import { collection } from '../store';
import { onMount } from 'svelte';
import { sdkForProject } from '$lib/stores/sdk';
@@ -73,83 +73,31 @@
};
</script>
<Form on:submit={created}>
<Modal size="big" bind:show={showCreateIndex}>
<svelte:fragment slot="header">Create Index</svelte:fragment>
<FormList>
<InputText
id="key"
label="Index Key"
placeholder="Enter Key"
bind:value={key}
autofocus
required />
<InputSelect
options={types}
id="type"
label="Index type"
placeholder="Select type"
bind:value={selectedType}
required />
<Modal size="big" on:submit={created} bind:show={showCreateIndex}>
<svelte:fragment slot="header">Create Index</svelte:fragment>
<FormList>
<InputText
id="key"
label="Index Key"
placeholder="Enter Key"
bind:value={key}
autofocus
required />
<InputSelect
options={types}
id="type"
label="Index type"
placeholder="Select type"
bind:value={selectedType}
required />
{#if attributeList?.length}
{#each attributeList as index, i}
<li class="form-item is-multiple">
<div class="form-item-part u-stretch">
<label class="label" for="attribute">Attribute</label>
<div class="select">
<select id="attribute" bind:value={index.value}>
<optgroup label="Internal">
<option value="$id">$id</option>
<option value="$createdAt">$createdAt</option>
<option value="$updatedAt">$updatedAt</option>
</optgroup>
<optgroup label="Attributes">
{#each attributeOptions as option}
<option
value={option.value}
selected={option.value === selectedAttribute}>
{option.label}
</option>
{/each}
</optgroup>
</select>
<span class="icon-cheveron-down" aria-hidden="true" />
</div>
</div>
<div class="form-item-part u-stretch">
<label class="label" for="order">Order</label>
<div class="select">
<select id="order" bind:value={index.order}>
<option value="ASC"> ASC </option>
<option value="DESC"> DESC </option>
</select>
<span class="icon-cheveron-down" aria-hidden="true" />
</div>
</div>
<div class="form-item-part u-cross-child-end">
<Button
text
disabled={externalAttribute && i === 0}
on:click={() => {
if (i === 0) attributeList = [];
attributeList = attributeList.splice(i, 1);
}}>
<span class="icon-x" aria-hidden="true" />
</Button>
</div>
</li>
{/each}
{/if}
{#if !attributeList?.length || newAttr}
{#if attributeList?.length}
{#each attributeList as index, i}
<li class="form-item is-multiple">
<div class="form-item-part u-stretch">
<label class="label" for="attribute">Attribute</label>
<div class="select">
<select required id="attribute" bind:value={selectedAttribute}>
<option value="" disabled selected hidden>Select Attribute</option>
<select id="attribute" bind:value={index.value}>
<optgroup label="Internal">
<option value="$id">$id</option>
<option value="$createdAt">$createdAt</option>
@@ -171,9 +119,7 @@
<div class="form-item-part u-stretch">
<label class="label" for="order">Order</label>
<div class="select">
<select id="order" bind:value={selectedOrder}>
<option value="" disabled selected hidden>Select Order</option>
<select id="order" bind:value={index.order}>
<option value="ASC"> ASC </option>
<option value="DESC"> DESC </option>
</select>
@@ -184,32 +130,84 @@
<div class="form-item-part u-cross-child-end">
<Button
text
disabled={false}
disabled={externalAttribute && i === 0}
on:click={() => {
newAttr = false;
selectedAttribute = selectedOrder = '';
if (i === 0) attributeList = [];
attributeList = attributeList.splice(i, 1);
}}>
<span class="icon-x" aria-hidden="true" />
</Button>
</div>
</li>
{/if}
<Button
text
on:click={() => {
newAttr = true;
if (selectedAttribute && selectedOrder) {
attributeList.push({ value: selectedAttribute, order: selectedOrder });
selectedAttribute = selectedOrder = '';
}
}}>
<span class="icon-plus" aria-hidden="true" />
<span class="text"> Add attribute </span>
</Button>
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showCreateIndex = false)}>Cancel</Button>
<Button submit>Create</Button>
</svelte:fragment>
</Modal>
</Form>
{/each}
{/if}
{#if !attributeList?.length || newAttr}
<li class="form-item is-multiple">
<div class="form-item-part u-stretch">
<label class="label" for="attribute">Attribute</label>
<div class="select">
<select required id="attribute" bind:value={selectedAttribute}>
<option value="" disabled selected hidden>Select Attribute</option>
<optgroup label="Internal">
<option value="$id">$id</option>
<option value="$createdAt">$createdAt</option>
<option value="$updatedAt">$updatedAt</option>
</optgroup>
<optgroup label="Attributes">
{#each attributeOptions as option}
<option
value={option.value}
selected={option.value === selectedAttribute}>
{option.label}
</option>
{/each}
</optgroup>
</select>
<span class="icon-cheveron-down" aria-hidden="true" />
</div>
</div>
<div class="form-item-part u-stretch">
<label class="label" for="order">Order</label>
<div class="select">
<select id="order" bind:value={selectedOrder}>
<option value="" disabled selected hidden>Select Order</option>
<option value="ASC"> ASC </option>
<option value="DESC"> DESC </option>
</select>
<span class="icon-cheveron-down" aria-hidden="true" />
</div>
</div>
<div class="form-item-part u-cross-child-end">
<Button
text
disabled={false}
on:click={() => {
newAttr = false;
selectedAttribute = selectedOrder = '';
}}>
<span class="icon-x" aria-hidden="true" />
</Button>
</div>
</li>
{/if}
<Button
text
on:click={() => {
newAttr = true;
if (selectedAttribute && selectedOrder) {
attributeList.push({ value: selectedAttribute, order: selectedOrder });
selectedAttribute = selectedOrder = '';
}
}}>
<span class="icon-plus" aria-hidden="true" />
<span class="text"> Add attribute </span>
</Button>
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showCreateIndex = false)}>Cancel</Button>
<Button submit>Create</Button>
</svelte:fragment>
</Modal>
@@ -1,6 +1,6 @@
<script lang="ts">
import { Modal } from '$lib/components';
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { collection } from '../store';
import { sdkForProject } from '$lib/stores/sdk';
@@ -32,16 +32,14 @@
};
</script>
<Form on:submit={handleDelete}>
<Modal warning={true} bind:show={showDelete}>
<svelte:fragment slot="header">Delete Index</svelte:fragment>
<Modal warning={true} on:submit={handleDelete} bind:show={showDelete}>
<svelte:fragment slot="header">Delete Index</svelte:fragment>
<p>
Are you sure you want to delete <b>'{selectedIndex.key}' from {$collection.name}</b>?
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
</Form>
<p>
Are you sure you want to delete <b>'{selectedIndex.key}' from {$collection.name}</b>?
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
@@ -3,7 +3,7 @@
import { base } from '$app/paths';
import { page } from '$app/stores';
import { Modal } from '$lib/components';
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForProject } from '$lib/stores/sdk';
import { collection } from '../store';
@@ -28,16 +28,14 @@
};
</script>
<Form on:submit={handleDelete}>
<Modal warning={true} bind:show={showDelete}>
<svelte:fragment slot="header">Delete Collection</svelte:fragment>
<Modal warning={true} bind:show={showDelete} on:submit={handleDelete}>
<svelte:fragment slot="header">Delete Collection</svelte:fragment>
<p>
Are you sure you want to delete <b>{$collection.name}</b>?
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
</Form>
<p>
Are you sure you want to delete <b>{$collection.name}</b>?
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
@@ -3,7 +3,7 @@
import { Modal, CustomId } from '$lib/components';
import { Pill } from '$lib/elements';
import { Button, InputText, Form, FormList } from '$lib/elements/forms';
import { Button, InputText, FormList } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForProject } from '$lib/stores/sdk';
import { createEventDispatcher } from 'svelte';
@@ -40,32 +40,30 @@
};
</script>
<Form on:submit={create}>
<Modal size="big" bind:show={showCreate}>
<svelte:fragment slot="header">Create Collection</svelte:fragment>
<FormList>
<InputText
id="name"
label="Name"
placeholder="Enter collection name"
bind:value={name}
autofocus
required />
<Modal size="big" bind:show={showCreate} on:submit={create}>
<svelte:fragment slot="header">Create Collection</svelte:fragment>
<FormList>
<InputText
id="name"
label="Name"
placeholder="Enter collection name"
bind:value={name}
autofocus
required />
{#if !showCustomId}
<div>
<Pill button on:click={() => (showCustomId = !showCustomId)}
><span class="icon-pencil" aria-hidden="true" /><span class="text">
Collection ID
</span></Pill>
</div>
{:else}
<CustomId bind:show={showCustomId} name="Collection" bind:id />
{/if}
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showCreate = false)}>Cancel</Button>
<Button submit>Create</Button>
</svelte:fragment>
</Modal>
</Form>
{#if !showCustomId}
<div>
<Pill button on:click={() => (showCustomId = !showCustomId)}
><span class="icon-pencil" aria-hidden="true" /><span class="text">
Collection ID
</span></Pill>
</div>
{:else}
<CustomId bind:show={showCustomId} name="Collection" bind:id />
{/if}
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showCreate = false)}>Cancel</Button>
<Button submit>Create</Button>
</svelte:fragment>
</Modal>
@@ -3,7 +3,7 @@
import { base } from '$app/paths';
import { page } from '$app/stores';
import { Modal } from '$lib/components';
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForProject } from '$lib/stores/sdk';
import { database } from './store';
@@ -25,16 +25,14 @@
};
</script>
<Form on:submit={handleDelete}>
<Modal warning={true} bind:show={showDelete}>
<svelte:fragment slot="header">Delete Database</svelte:fragment>
<Modal warning={true} bind:show={showDelete} on:submit={handleDelete}>
<svelte:fragment slot="header">Delete Database</svelte:fragment>
<p>
Are you sure you want to delete <b>{$database.name}</b>?
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
</Form>
<p>
Are you sure you want to delete <b>{$database.name}</b>?
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
@@ -1,5 +1,5 @@
<script lang="ts">
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { Modal } from '$lib/components';
import { InputText, InputPassword, FormList } from '$lib/elements/forms';
import { createEventDispatcher } from 'svelte';
@@ -26,31 +26,29 @@
};
</script>
<Form noStyle noMargin on:submit={handleVariable}>
<Modal bind:show={showCreate} size="big">
<svelte:fragment slot="header">
{selectedVar ? 'Update' : 'Create'} Variable
</svelte:fragment>
<FormList>
<InputText
id="key"
label="Key"
placeholder="Enter key"
bind:value={pair.key}
required
autofocus />
<InputPassword
id="value"
label="Value"
minlength={0}
showPasswordButton
placeholder="Enter value"
bind:value={pair.value}
required />
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showCreate = false)}>Cancel</Button>
<Button submit>{selectedVar ? 'Update' : 'Create'}</Button>
</svelte:fragment>
</Modal>
</Form>
<Modal bind:show={showCreate} on:submit={handleVariable} size="big">
<svelte:fragment slot="header">
{selectedVar ? 'Update' : 'Create'} Variable
</svelte:fragment>
<FormList>
<InputText
id="key"
label="Key"
placeholder="Enter key"
bind:value={pair.key}
required
autofocus />
<InputPassword
id="value"
label="Value"
minlength={0}
showPasswordButton
placeholder="Enter value"
bind:value={pair.value}
required />
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showCreate = false)}>Cancel</Button>
<Button submit>{selectedVar ? 'Update' : 'Create'}</Button>
</svelte:fragment>
</Modal>
@@ -1,6 +1,6 @@
<script lang="ts">
import { Modal } from '$lib/components';
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForProject } from '$lib/stores/sdk';
import type { Models } from '@aw-labs/appwrite-console';
@@ -32,13 +32,11 @@
};
</script>
<Form noMargin on:submit={handleSubmit}>
<Modal bind:show={showActivate}>
<svelte:fragment slot="header">Activate Deployment</svelte:fragment>
<p>Are you sure you want to activate this deployment?</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showActivate = false)}>Cancel</Button>
<Button secondary submit>Activate</Button>
</svelte:fragment>
</Modal>
</Form>
<Modal bind:show={showActivate} on:submit={handleSubmit}>
<svelte:fragment slot="header">Activate Deployment</svelte:fragment>
<p>Are you sure you want to activate this deployment?</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showActivate = false)}>Cancel</Button>
<Button secondary submit>Activate</Button>
</svelte:fragment>
</Modal>
@@ -1,11 +1,10 @@
<script lang="ts">
import { InputChoice, Button, InputText, InputFile, Form } from '$lib/elements/forms';
import { InputChoice, Button, InputText, InputFile, FormList } from '$lib/elements/forms';
import { Modal, Collapsible, CollapsibleItem, Tabs, Tab, Code } from '$lib/components';
import { sdkForProject } from '$lib/stores/sdk';
import { createEventDispatcher } from 'svelte';
import { addNotification } from '$lib/stores/notifications';
import { page } from '$app/stores';
import FormList from '$lib/elements/forms/formList.svelte';
import Github from '$lib/images/github-illustration.svg';
import { invalidate } from '$app/navigation';
import { Dependencies } from '$lib/constants';
@@ -74,77 +73,71 @@
};
</script>
<Form noStyle noMargin on:submit={create}>
<Modal size="big" bind:show={showCreate}>
<svelte:fragment slot="header">Create Deployment</svelte:fragment>
<Tabs>
<Tab on:click={() => (mode = Mode.CLI)} selected={mode === Mode.CLI}>CLI</Tab>
<Tab on:click={() => (mode = Mode.Github)} selected={mode === Mode.Github}>
GitHub - Soon!
</Tab>
<Tab on:click={() => (mode = Mode.Manual)} selected={mode === Mode.Manual}>Manual</Tab>
</Tabs>
{#if mode === Mode.CLI}
<p class="text">
You can deploy your function from the Appwrite CLI using Unix, CMD, or PowerShell.
Check out our Documentation to learn more about <a
href="https://appwrite.io/docs/functions#deployFunction"
target="_blank"
rel="noopener noreferrer"
class="link">deploying your functions</a
>, or how to install and use the
<a href="#/" target="_blank" rel="noopener noreferrer" class="link">Appwrite CLI</a
>.
</p>
<Collapsible>
{#each ['Unix', 'CMD', 'PowerShell'] as category}
<CollapsibleItem>
<svelte:fragment slot="title">{category}</svelte:fragment>
<Code
withLineNumbers
withCopy
language="sh"
label={codeSnippets[category].language}
code={codeSnippets[category].code} />
</CollapsibleItem>
{/each}
</Collapsible>
{:else if mode === Mode.Github}
<div class="common-section grid-1-2">
<div class="grid-1-2-col-1 u-flex u-flex-vertical u-gap-16">
<img src={Github} alt="github" />
</div>
<div class="grid-1-2-col-2 u-flex u-flex-vertical u-gap-24">
<h3 class="body-text-1">Coming Soon!</h3>
<p>
Creating deployments will be easier than ever with our upcoming Git
Integration. Just set up a repository and we’ll do the rest.
</p>
</div>
<Modal size="big" bind:show={showCreate} on:submit={create}>
<svelte:fragment slot="header">Create Deployment</svelte:fragment>
<Tabs>
<Tab on:click={() => (mode = Mode.CLI)} selected={mode === Mode.CLI}>CLI</Tab>
<Tab on:click={() => (mode = Mode.Github)} selected={mode === Mode.Github}>
GitHub - Soon!
</Tab>
<Tab on:click={() => (mode = Mode.Manual)} selected={mode === Mode.Manual}>Manual</Tab>
</Tabs>
{#if mode === Mode.CLI}
<p class="text">
You can deploy your function from the Appwrite CLI using Unix, CMD, or PowerShell. Check
out our Documentation to learn more about <a
href="https://appwrite.io/docs/functions#deployFunction"
target="_blank"
rel="noopener noreferrer"
class="link">deploying your functions</a
>, or how to install and use the
<a href="#/" target="_blank" rel="noopener noreferrer" class="link">Appwrite CLI</a>.
</p>
<Collapsible>
{#each ['Unix', 'CMD', 'PowerShell'] as category}
<CollapsibleItem>
<svelte:fragment slot="title">{category}</svelte:fragment>
<Code
withLineNumbers
withCopy
language="sh"
label={codeSnippets[category].language}
code={codeSnippets[category].code} />
</CollapsibleItem>
{/each}
</Collapsible>
{:else if mode === Mode.Github}
<div class="common-section grid-1-2">
<div class="grid-1-2-col-1 u-flex u-flex-vertical u-gap-16">
<img src={Github} alt="github" />
</div>
{:else if mode === Mode.Manual}
<FormList>
<InputText
label="Entrypoint"
placeholder="main.py"
id="entrypoint"
bind:value={entrypoint}
required />
<InputFile label="Gzipped code (tar.gz)" bind:files />
<InputChoice
label="Activate Deployment after build"
id="activate"
bind:value={active}>
This deployment will be activated after the build is completed.</InputChoice>
</FormList>
<div class="grid-1-2-col-2 u-flex u-flex-vertical u-gap-24">
<h3 class="body-text-1">Coming Soon!</h3>
<p>
Creating deployments will be easier than ever with our upcoming Git Integration.
Just set up a repository and we’ll do the rest.
</p>
</div>
</div>
{:else if mode === Mode.Manual}
<FormList>
<InputText
label="Entrypoint"
placeholder="main.py"
id="entrypoint"
bind:value={entrypoint}
required />
<InputFile label="Gzipped code (tar.gz)" bind:files />
<InputChoice label="Activate Deployment after build" id="activate" bind:value={active}>
This deployment will be activated after the build is completed.</InputChoice>
</FormList>
{/if}
<svelte:fragment slot="footer">
{#if mode === Mode.Manual}
<Button secondary on:click={() => (showCreate = false)}>Close</Button>
<Button submit>Create</Button>
{:else}
<Button secondary on:click={() => (showCreate = false)}>Close</Button>
{/if}
<svelte:fragment slot="footer">
{#if mode === Mode.Manual}
<Button secondary on:click={() => (showCreate = false)}>Close</Button>
<Button submit>Create</Button>
{:else}
<Button secondary on:click={() => (showCreate = false)}>Close</Button>
{/if}
</svelte:fragment>
</Modal>
</Form>
</svelte:fragment>
</Modal>
@@ -2,7 +2,7 @@
import { invalidate } from '$app/navigation';
import { Modal } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForProject } from '$lib/stores/sdk';
import type { Models } from '@aw-labs/appwrite-console';
@@ -31,13 +31,11 @@
};
</script>
<Form noStyle noMargin on:submit={handleSubmit}>
<Modal bind:show={showDelete} warning>
<svelte:fragment slot="header">Delete Deployment</svelte:fragment>
<p>Are you sure you want to delete this deployment?</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
</Form>
<Modal bind:show={showDelete} on:submit={handleSubmit} warning>
<svelte:fragment slot="header">Delete Deployment</svelte:fragment>
<p>Are you sure you want to delete this deployment?</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
@@ -1,6 +1,6 @@
<script lang="ts">
import { Code, Modal } from '$lib/components';
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { InputTextarea, FormList, InputChoice } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForProject } from '$lib/stores/sdk';
@@ -48,21 +48,19 @@
}
</script>
<Form noStyle noMargin on:submit={handleSubmit}>
<Modal bind:show size="big" on:close={close}>
<svelte:fragment slot="header">Execute Function</svelte:fragment>
<FormList>
<InputTextarea bind:value={data} id="data" label="Custom data (optional)" />
<InputChoice type="switchbox" id="json" label="Show example JSON" bind:value={showJson}>
Here's an example of some custom data.</InputChoice>
{#if showJson}
<Code noMargin language="json" withLineNumbers code={example} />
{/if}
</FormList>
<Modal bind:show size="big" on:submit={handleSubmit} on:close={close}>
<svelte:fragment slot="header">Execute Function</svelte:fragment>
<FormList>
<InputTextarea bind:value={data} id="data" label="Custom data (optional)" />
<InputChoice type="switchbox" id="json" label="Show example JSON" bind:value={showJson}>
Here's an example of some custom data.</InputChoice>
{#if showJson}
<Code noMargin language="json" withLineNumbers code={example} />
{/if}
</FormList>
<svelte:fragment slot="footer">
<Button text on:click={close}>Cancel</Button>
<Button submit>Execute Now</Button>
</svelte:fragment>
</Modal>
</Form>
<svelte:fragment slot="footer">
<Button text on:click={close}>Cancel</Button>
<Button submit>Execute Now</Button>
</svelte:fragment>
</Modal>
@@ -3,7 +3,7 @@
import { base } from '$app/paths';
import { page } from '$app/stores';
import { Modal } from '$lib/components';
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForProject } from '$lib/stores/sdk';
@@ -28,16 +28,14 @@
};
</script>
<Form noMargin on:submit={handleSubmit}>
<Modal bind:show={showDelete} warning>
<svelte:fragment slot="header">Delete Function</svelte:fragment>
<p>
Are you sure you want to delete this function and all associated deployments from your
project?
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
</Form>
<Modal bind:show={showDelete} on:submit={handleSubmit} warning>
<svelte:fragment slot="header">Delete Function</svelte:fragment>
<p>
Are you sure you want to delete this function and all associated deployments from your
project?
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
@@ -3,7 +3,7 @@
import { page } from '$app/stores';
import { Modal } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, Form, InputFile } from '$lib/elements/forms';
import { Button, InputFile } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForProject } from '$lib/stores/sdk';
import { createEventDispatcher } from 'svelte';
@@ -59,19 +59,16 @@
}
</script>
<Form noStyle noMargin on:submit={handleSubmit}>
<Modal bind:show>
<svelte:fragment slot="header">Upload Variables</svelte:fragment>
<p>
Upload multiple variables via a .env file that will be passed to your function at
runtime.
</p>
<Modal bind:show on:submit={handleSubmit}>
<svelte:fragment slot="header">Upload Variables</svelte:fragment>
<p>
Upload multiple variables via a .env file that will be passed to your function at runtime.
</p>
<InputFile bind:files label="Attach a file" />
<InputFile bind:files label="Attach a file" />
<svelte:fragment slot="footer">
<Button text on:click={() => (show = false)}>Cancel</Button>
<Button submit>Create</Button>
</svelte:fragment>
</Modal>
</Form>
<svelte:fragment slot="footer">
<Button text on:click={() => (show = false)}>Cancel</Button>
<Button submit>Create</Button>
</svelte:fragment>
</Modal>
@@ -3,7 +3,7 @@
import { base } from '$app/paths';
import { Modal } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForConsole } from '$lib/stores/sdk';
import { project } from '../../../store';
@@ -30,14 +30,12 @@
}
</script>
<Form on:submit={handleDelete}>
<Modal bind:show={showDelete} warning>
<svelte:fragment slot="header">Delete API Key</svelte:fragment>
<p>The API Key will be permanently deleted. This action is irreversible.</p>
<Modal bind:show={showDelete} on:submit={handleDelete} warning>
<svelte:fragment slot="header">Delete API Key</svelte:fragment>
<p>The API Key will be permanently deleted. This action is irreversible.</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
</Form>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
@@ -2,7 +2,7 @@
import { invalidate } from '$app/navigation';
import { Modal } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { InputText, Button, Form, FormList } from '$lib/elements/forms';
import { InputText, Button, FormList } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForConsole } from '$lib/stores/sdk';
import { project } from '../../.../../store';
@@ -29,16 +29,14 @@
}
</script>
<Form on:submit={create}>
<Modal bind:show size="big">
<svelte:fragment slot="header">Create API Key</svelte:fragment>
<FormList>
<InputText id="name" label="Name" bind:value={name} autofocus required />
<Scopes bind:scopes />
</FormList>
<svelte:fragment slot="footer">
<Button submit>Register</Button>
<Button secondary on:click={() => (show = false)}>Cancel</Button>
</svelte:fragment>
</Modal>
</Form>
<Modal bind:show on:submit={create} size="big">
<svelte:fragment slot="header">Create API Key</svelte:fragment>
<FormList>
<InputText id="name" label="Name" bind:value={name} autofocus required />
<Scopes bind:scopes />
</FormList>
<svelte:fragment slot="footer">
<Button submit>Register</Button>
<Button secondary on:click={() => (show = false)}>Cancel</Button>
</svelte:fragment>
</Modal>
@@ -3,7 +3,7 @@
import { base } from '$app/paths';
import { Modal } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForConsole } from '$lib/stores/sdk';
import { project } from '../../../store';
@@ -30,14 +30,12 @@
};
</script>
<Form on:submit={handleDelete}>
<Modal bind:show={showDelete} warning>
<svelte:fragment slot="header">Delete Platform</svelte:fragment>
<p>The Platform will be permanently deleted. This action is irreversible.</p>
<Modal bind:show={showDelete} on:submit={handleDelete} warning>
<svelte:fragment slot="header">Delete Platform</svelte:fragment>
<p>The Platform will be permanently deleted. This action is irreversible.</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
</Form>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
@@ -2,7 +2,7 @@
import { goto } from '$app/navigation';
import { base } from '$app/paths';
import { Modal } from '$lib/components';
import { Button, Form, FormList, InputPassword, InputText } from '$lib/elements/forms';
import { Button, FormList, InputPassword, InputText } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForConsole } from '$lib/stores/sdk';
import { project } from '../store';
@@ -30,34 +30,33 @@
};
</script>
<Form on:submit={handleDelete}>
<Modal bind:show={showDelete} warning>
<svelte:fragment slot="header">Delete Project</svelte:fragment>
<p>
<b>This project will be deleted</b>, along with all of its metadata, stats, and other
resources. <b>This action is irreversible</b>.
</p>
<Modal bind:show={showDelete} on:submit={handleDelete} warning>
<svelte:fragment slot="header">Delete Project</svelte:fragment>
<p>
<b>This project will be deleted</b>, along with all of its metadata, stats, and other
resources. <b>This action is irreversible</b>.
</p>
<FormList>
<InputText
label={`Enter "${$project.name}" to continue`}
placeholder="Enter name"
id="name"
autofocus
required
bind:value={name} />
<InputPassword
label="To verify, enter your password"
placeholder="Enter password"
id="password"
required
showPasswordButton={true}
bind:value={password} />
</FormList>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button disabled={!name || !password || name !== $project.name} secondary submit
>Delete</Button>
</svelte:fragment>
</Modal>
</Form>
<FormList>
<InputText
label={`Enter "${$project.name}" to continue`}
placeholder="Enter name"
id="name"
autofocus
required
bind:value={name} />
<InputPassword
label="To verify, enter your password"
placeholder="Enter password"
id="password"
required
showPasswordButton={true}
bind:value={password} />
</FormList>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button disabled={!name || !password || name !== $project.name} secondary submit>
Delete
</Button>
</svelte:fragment>
</Modal>
@@ -1,6 +1,6 @@
<script lang="ts">
import { Modal } from '$lib/components';
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { project } from '../../store';
import { sdkForConsole } from '$lib/stores/sdk';
import { addNotification } from '$lib/stores/notifications';
@@ -29,15 +29,13 @@
};
</script>
<Form on:submit={deleteDomain}>
<Modal bind:show={showDelete} warning>
<svelte:fragment slot="header">Delete Domain</svelte:fragment>
<p>
Are you sure you want to delete <b>{selectedDomain.domain}</b> from '{$project.name}'?
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
</Form>
<Modal bind:show={showDelete} on:submit={deleteDomain} warning>
<svelte:fragment slot="header">Delete Domain</svelte:fragment>
<p>
Are you sure you want to delete <b>{selectedDomain.domain}</b> from '{$project.name}'?
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
@@ -3,7 +3,7 @@
import { base } from '$app/paths';
import { Modal } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForConsole } from '$lib/stores/sdk';
import { project } from '../../../store';
@@ -30,13 +30,11 @@
}
</script>
<Form on:submit={handleDelete}>
<Modal bind:show={showDelete} warning>
<svelte:fragment slot="header">Delete Webhook</svelte:fragment>
<p>Are you sure you want to delete <b>{$webhook.name}</b> from '{$project.name}'?</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
</Form>
<Modal bind:show={showDelete} on:submit={handleDelete} warning>
<svelte:fragment slot="header">Delete Webhook</svelte:fragment>
<p>Are you sure you want to delete <b>{$webhook.name}</b> from '{$project.name}'?</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
@@ -3,7 +3,7 @@
import { page } from '$app/stores';
import { Modal } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForConsole } from '$lib/stores/sdk';
import { webhook } from './store';
@@ -29,16 +29,14 @@
}
</script>
<Form on:submit={regenerate}>
<Modal bind:show>
<svelte:fragment slot="header">Regenerate Key</svelte:fragment>
<p class="u-text">
Are you sure you want to generate a new Signature Key?
<b>You will not be able to recover your current key.</b>
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (show = false)}>Cancel</Button>
<Button secondary submit>Regenerate</Button>
</svelte:fragment>
</Modal>
</Form>
<Modal bind:show on:submit={regenerate}>
<svelte:fragment slot="header">Regenerate Key</svelte:fragment>
<p class="u-text">
Are you sure you want to generate a new Signature Key?
<b>You will not be able to recover your current key.</b>
</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (show = false)}>Cancel</Button>
<Button secondary submit>Regenerate</Button>
</svelte:fragment>
</Modal>
@@ -3,7 +3,7 @@
import { base } from '$app/paths';
import { page } from '$app/stores';
import { Modal } from '$lib/components';
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForProject } from '$lib/stores/sdk';
import { bucket } from './store';
@@ -24,13 +24,11 @@
};
</script>
<Form on:submit={deleteUser}>
<Modal bind:show={showDelete} warning>
<svelte:fragment slot="header">Delete Bucket</svelte:fragment>
<p>Are you sure you want to delete <b>{$bucket.name}</b>?</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
</Form>
<Modal bind:show={showDelete} on:submit={deleteUser} warning>
<svelte:fragment slot="header">Delete Bucket</svelte:fragment>
<p>Are you sure you want to delete <b>{$bucket.name}</b>?</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
@@ -1,6 +1,6 @@
<script lang="ts">
import { Modal } from '$lib/components';
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForProject } from '$lib/stores/sdk';
import type { Models } from '@aw-labs/appwrite-console';
@@ -25,13 +25,11 @@
};
</script>
<Form on:submit={deleteFile}>
<Modal bind:show={showDelete} warning>
<svelte:fragment slot="header">Delete File</svelte:fragment>
<p>Are you sure you want to delete <b>{file.name}</b>?</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
</Form>
<Modal bind:show={showDelete} on:submit={deleteFile} warning>
<svelte:fragment slot="header">Delete File</svelte:fragment>
<p>Are you sure you want to delete <b>{file.name}</b>?</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
@@ -1,5 +1,5 @@
<script lang="ts">
import { Button, Form, FormList, InputFile } from '$lib/elements/forms';
import { Button, FormList, InputFile } from '$lib/elements/forms';
import { Pill } from '$lib/elements';
import { Modal, CustomId } from '$lib/components';
import { sdkForProject } from '$lib/stores/sdk';
@@ -45,32 +45,30 @@
}
</script>
<Form on:submit={create}>
<Modal size="big" {error} bind:show={showCreate}>
<svelte:fragment slot="header">Upload File</svelte:fragment>
<FormList>
<div>
<InputFile bind:files />
<p>Max file size: {calculateSize($bucket.maximumFileSize)}</p>
</div>
<Modal size="big" {error} bind:show={showCreate} on:submit={create}>
<svelte:fragment slot="header">Upload File</svelte:fragment>
<FormList>
<div>
<InputFile bind:files />
<p>Max file size: {calculateSize($bucket.maximumFileSize)}</p>
</div>
{#if !showCustomId}
<div>
<Pill button on:click={() => (showCustomId = !showCustomId)}>
<span class="icon-pencil" aria-hidden="true" /><span class="text">
File ID
</span>
</Pill>
</div>
{:else}
<CustomId bind:show={showCustomId} name="File" bind:id />
{/if}
<p class="heading-level-7">Permissions</p>
<Permissions bind:permissions />
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showCreate = false)}>Cancel</Button>
<Button submit>Upload</Button>
</svelte:fragment>
</Modal>
</Form>
{#if !showCustomId}
<div>
<Pill button on:click={() => (showCustomId = !showCustomId)}>
<span class="icon-pencil" aria-hidden="true" /><span class="text">
File ID
</span>
</Pill>
</div>
{:else}
<CustomId bind:show={showCustomId} name="File" bind:id />
{/if}
<p class="heading-level-7">Permissions</p>
<Permissions bind:permissions />
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showCreate = false)}>Cancel</Button>
<Button submit>Upload</Button>
</svelte:fragment>
</Modal>
@@ -3,7 +3,7 @@
import { base } from '$app/paths';
import { page } from '$app/stores';
import { Modal } from '$lib/components';
import { Button, Form } from '$lib/elements/forms';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForProject } from '$lib/stores/sdk';
import { file } from './store';
@@ -26,13 +26,11 @@
};
</script>
<Form on:submit={deleteFile}>
<Modal bind:show={showDelete} warning>
<svelte:fragment slot="header">Delete File</svelte:fragment>
<p>Are you sure you want to delete <b>{$file.name}</b>?</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
</Form>
<Modal bind:show={showDelete} on:submit={deleteFile} warning>
<svelte:fragment slot="header">Delete File</svelte:fragment>
<p>Are you sure you want to delete <b>{$file.name}</b>?</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
</svelte:fragment>
</Modal>
@@ -1,7 +1,7 @@
<script lang="ts">
import { Modal, CustomId } from '$lib/components';
import { Pill } from '$lib/elements';
import { Button, InputText, Form, FormList } from '$lib/elements/forms';
import { Button, InputText, FormList } from '$lib/elements/forms';
import { sdkForProject } from '$lib/stores/sdk';
import { createEventDispatcher } from 'svelte';
@@ -34,32 +34,30 @@
}
</script>
<Form on:submit={create}>
<Modal {error} size="big" bind:show={showCreate}>
<svelte:fragment slot="header">Create Bucket</svelte:fragment>
<FormList>
<InputText
id="name"
label="Name"
placeholder="New Bucket"
bind:value={name}
autofocus
required />
<Modal {error} on:submit={create} size="big" bind:show={showCreate}>
<svelte:fragment slot="header">Create Bucket</svelte:fragment>
<FormList>
<InputText
id="name"
label="Name"
placeholder="New Bucket"
bind:value={name}
autofocus
required />
{#if !showCustomId}
<div>
<Pill button on:click={() => (showCustomId = !showCustomId)}>
<span class="icon-pencil" aria-hidden="true" />
<span class="text"> Bucket ID </span>
</Pill>
</div>
{:else}
<CustomId bind:show={showCustomId} name="Bucket" bind:id />
{/if}
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showCreate = false)}>Cancel</Button>
<Button submit>Create</Button>
</svelte:fragment>
</Modal>
</Form>
{#if !showCustomId}
<div>
<Pill button on:click={() => (showCustomId = !showCustomId)}>
<span class="icon-pencil" aria-hidden="true" />
<span class="text"> Bucket ID </span>
</Pill>
</div>
{:else}
<CustomId bind:show={showCustomId} name="Bucket" bind:id />
{/if}
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showCreate = false)}>Cancel</Button>
<Button submit>Create</Button>
</svelte:fragment>
</Modal>