Skip to content

Commit 8f7012d

Browse files
Merge pull request #618 from appwrite/feat-user-labels
Update label and custom permission modals
2 parents 8f7ce02 + 90bdf82 commit 8f7012d

File tree

3 files changed

+31
-22
lines changed

3 files changed

+31
-22
lines changed

src/lib/components/modal.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
</button>
128128
{/if}
129129
</div>
130-
<p>
130+
<p class="u-margin-block-start-4">
131131
<slot name="description">
132132
{description}
133133
</slot>

src/lib/components/permissions/custom.svelte

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import { Button, FormList, Helper, InputText } from '$lib/elements/forms';
2+
import { Button, FormItem, FormList, Helper, InputText } from '$lib/elements/forms';
33
import { createEventDispatcher } from 'svelte';
44
import { Modal } from '..';
55
import type { Writable } from 'svelte/store';
@@ -25,21 +25,24 @@
2525
$: disabled = !value || $groups.has(value);
2626
</script>
2727

28-
<Modal title="Custom permission" bind:show on:close={reset} onSubmit={create}>
29-
<p class="text">
30-
Custom permissions allow you to grant access to specific users or teams using their ID and
31-
role.
32-
</p>
28+
<Modal
29+
title="Custom permission"
30+
description="Custom permissions allow you to grant access to specific users or teams using their ID and
31+
role."
32+
bind:show
33+
on:close={reset}
34+
onSubmit={create}>
3335
<FormList>
34-
<InputText
35-
showLabel={false}
36-
id="custom-permission"
37-
label="Custom permission"
38-
placeholder="user:[USER_ID] or team:[TEAM_ID]/[ROLE]"
39-
bind:value />
40-
<Helper type="neutral">
41-
A permission should be formatted as: user:[USER_ID] or team:[TEAM_ID]/[ROLE]¸
42-
</Helper>
36+
<FormItem>
37+
<InputText
38+
id="custom-permission"
39+
label="Role"
40+
placeholder="user:[USER_ID] or team:[TEAM_ID]/[ROLE]"
41+
bind:value />
42+
<Helper type="neutral">
43+
A permission should be formatted as: user:[USER_ID] or team:[TEAM_ID]/[ROLE]¸
44+
</Helper>
45+
</FormItem>
4346
</FormList>
4447

4548
<svelte:fragment slot="footer">

src/lib/components/permissions/label.svelte

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import { Button, FormList, Helper, InputText } from '$lib/elements/forms';
2+
import { Button, FormItem, FormList, Helper, InputText } from '$lib/elements/forms';
33
import { createEventDispatcher } from 'svelte';
44
import { Modal } from '..';
55
import type { Writable } from 'svelte/store';
@@ -32,12 +32,18 @@
3232
$: disabled = !value || $groups.has(value);
3333
</script>
3434

35-
<Modal title="Label" bind:show on:close={reset} onSubmit={create}>
36-
<p class="text">Labels allow you to grant access to users with the specfied label.</p>
35+
<Modal
36+
title="Label"
37+
description="Labels allow you to grant access to users with the specfied label."
38+
bind:show
39+
on:close={reset}
40+
onSubmit={create}>
3741
<FormList>
38-
<InputText showLabel={false} id="label" label="Label" placeholder="admin" bind:value />
39-
<Helper type={isError ? 'warning' : 'neutral'}
40-
>Only alphanumeric characters are allowed.</Helper>
42+
<FormItem>
43+
<InputText id="label" label="Label" placeholder="Enter label" bind:value />
44+
<Helper type={isError ? 'warning' : 'neutral'}
45+
>Only alphanumeric characters are allowed.</Helper>
46+
</FormItem>
4147
</FormList>
4248

4349
<svelte:fragment slot="footer">

0 commit comments

Comments
 (0)