mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fix: add collaborator modal
This commit is contained in:
+12
-11
@@ -14,6 +14,7 @@
|
||||
import InputSelect from '$lib/elements/forms/inputSelect.svelte';
|
||||
import Roles from '$lib/components/roles/roles.svelte';
|
||||
import { Layout } from '@appwrite.io/pink-svelte';
|
||||
import { isCloud, isSelfHosted } from '$lib/system';
|
||||
|
||||
export let show = false;
|
||||
|
||||
@@ -24,7 +25,7 @@
|
||||
let email: string,
|
||||
name: string,
|
||||
error: string,
|
||||
role: string = 'viewer';
|
||||
role: string = isSelfHosted ? 'owner' : 'viewer';
|
||||
|
||||
async function create() {
|
||||
try {
|
||||
@@ -59,8 +60,6 @@
|
||||
email = null;
|
||||
name = null;
|
||||
}
|
||||
|
||||
//TODO: fix popover
|
||||
</script>
|
||||
|
||||
<Modal title="Add collaborator" {error} bind:show onSubmit={create}>
|
||||
@@ -75,14 +74,16 @@
|
||||
placeholder="Enter email"
|
||||
autofocus={true}
|
||||
bind:value={email} />
|
||||
<InputSelect
|
||||
popover={Roles}
|
||||
id="role"
|
||||
label="Role"
|
||||
placeholder="Select role"
|
||||
required
|
||||
options={roles}
|
||||
bind:value={role} />
|
||||
{#if isCloud}
|
||||
<InputSelect
|
||||
popover={Roles}
|
||||
id="role"
|
||||
label="Role"
|
||||
placeholder="Select role"
|
||||
required
|
||||
options={roles}
|
||||
bind:value={role} />
|
||||
{/if}
|
||||
</Layout.Stack>
|
||||
<svelte:fragment slot="footer">
|
||||
<Button secondary on:click={() => (show = false)}>Cancel</Button>
|
||||
|
||||
Reference in New Issue
Block a user