Skip to content

Commit

Permalink
Merge pull request #1533 from appwrite/fix-roles-select-selfhosted
Browse files Browse the repository at this point in the history
fix: disable role selection for selfhosted
  • Loading branch information
stnguyen90 authored Nov 27, 2024
2 parents aa15ee6 + 37f1b79 commit ea4c2a5
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import { invalidate } from '$app/navigation';
import { BillingPlan, Dependencies } from '$lib/constants';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { isCloud } from '$lib/system';
import { isCloud, isSelfHosted } from '$lib/system';
import { roles } from '$lib/stores/billing';
import InputSelect from '$lib/elements/forms/inputSelect.svelte';
import Roles from '$lib/components/roles/roles.svelte';
Expand All @@ -22,7 +22,7 @@
let email: string,
name: string,
error: string,
role: string = 'developer';
role: string = isSelfHosted ? 'owner' : 'developer';
async function create() {
try {
Expand Down Expand Up @@ -89,7 +89,9 @@
label="Name (optional)"
placeholder="Enter name"
bind:value={name} />
<InputSelect popover={Roles} id="role" label="Role" options={roles} bind:value={role} />
{#if isCloud}
<InputSelect popover={Roles} id="role" label="Role" options={roles} bind:value={role} />
{/if}
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showCreate = false)}>Cancel</Button>
Expand Down

0 comments on commit ea4c2a5

Please sign in to comment.