mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
feat: add alerts to modals and wizards
This commit is contained in:
1 parent
c641d6ed7d
commit
e259c67d2c
3 files changed
+50
-9
No files matched your search
@@ -18,6 +18,7 @@
|
||||
<div class="alert-grid">
|
||||
{#if dismissible}
|
||||
<button
|
||||
type="button"
|
||||
class="x-button"
|
||||
aria-label="close alert box"
|
||||
on:click={() => dispatch('dismiss')}>
|
||||
|
||||
+24
-6
@@ -2,16 +2,34 @@
|
||||
import { Permissions } from '$lib/components/permissions';
|
||||
import { WizardStep } from '$lib/layout';
|
||||
import { createDocument } from './store';
|
||||
import { collection } from '../store';
|
||||
import { Alert } from '$lib/components';
|
||||
</script>
|
||||
|
||||
<WizardStep>
|
||||
<svelte:fragment slot="title">Set Permissions</svelte:fragment>
|
||||
<svelte:fragment slot="subtitle">
|
||||
Assign read or write permissions at the <b> Collection Level</b> or
|
||||
<b> Document Level</b>. If collection Level permissions are assigned, permissions applied to
|
||||
individual documents are ignored.
|
||||
Choose who can access your collection and documents. For more information, check out the <a
|
||||
href="https://appwrite.io/docs/permissions"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer">Permissions Guide</a> in our documentation.
|
||||
</svelte:fragment>
|
||||
<div class="common-section">
|
||||
<Permissions bind:permissions={$createDocument.permissions} />
|
||||
</div>
|
||||
{#if $collection.documentSecurity}
|
||||
<div class="common-section">
|
||||
<Alert type="info">
|
||||
<svelte:fragment slot="title">Document security is enabled</svelte:fragment>
|
||||
Users will be able to access this document if they have been granted
|
||||
<b>either Document or Collection permissions</b>.
|
||||
</Alert>
|
||||
</div>
|
||||
<div class="common-section">
|
||||
<Permissions bind:permissions={$createDocument.permissions} />
|
||||
</div>
|
||||
{:else}
|
||||
<Alert type="info">
|
||||
<svelte:fragment slot="title">Document security is disabled</svelte:fragment>
|
||||
If you want to assign document permissions, navigate to Collection settings and enable document
|
||||
security. Otherwise, only Collection permissions will be used.
|
||||
</Alert>
|
||||
{/if}
|
||||
</WizardStep>
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { Button, FormList, InputFile } from '$lib/elements/forms';
|
||||
import { Pill } from '$lib/elements';
|
||||
import { Modal, CustomId } from '$lib/components';
|
||||
import { Modal, CustomId, Heading, Alert } from '$lib/components';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import { page } from '$app/stores';
|
||||
@@ -69,8 +69,30 @@
|
||||
{:else}
|
||||
<CustomId bind:show={showCustomId} name="File" bind:id />
|
||||
{/if}
|
||||
<p class="heading-level-7">Permissions</p>
|
||||
<Permissions bind:permissions />
|
||||
<Heading tag="h6" size="7">Update Permissions</Heading>
|
||||
<p class="text">
|
||||
Choose who can access your buckets and files. For more information, check out the
|
||||
<a href="https://appwrite.io/docs/permissions" target="_blank" rel="noopener noreferrer"
|
||||
>Permissions Guide</a> in our documentation.
|
||||
</p>
|
||||
{#if $bucket.fileSecurity}
|
||||
<div class="common-section">
|
||||
<Alert type="info">
|
||||
<svelte:fragment slot="title">File security enabled</svelte:fragment>
|
||||
Users will be able to access this file if they have been granted
|
||||
<b>either File or Bucket permissions</b>.
|
||||
</Alert>
|
||||
</div>
|
||||
<div class="common-section">
|
||||
<Permissions bind:permissions />
|
||||
</div>
|
||||
{:else}
|
||||
<Alert type="info">
|
||||
<svelte:fragment slot="title">File security disabled</svelte:fragment>
|
||||
If you want to assign file permissions, navigate to Bucket settings and enable file security.
|
||||
Otherwise, only Bucket permissions will be used.
|
||||
</Alert>
|
||||
{/if}
|
||||
</FormList>
|
||||
<svelte:fragment slot="footer">
|
||||
<Button secondary on:click={() => (showCreate = false)}>Cancel</Button>
|
||||
|
||||
Reference in new issue
Block a user