fix: add collaborator modal

This commit is contained in:
Arman
2025-03-12 15:05:54 +01:00
parent 846e7e9b1e
commit 6595da30df
@@ -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>