diff --git a/src/lib/components/sidebar.svelte b/src/lib/components/sidebar.svelte index 7fd0bc37f..99bd5db85 100644 --- a/src/lib/components/sidebar.svelte +++ b/src/lib/components/sidebar.svelte @@ -40,7 +40,6 @@ import type { HTMLAttributes } from 'svelte/elements'; import type { NavbarProject } from '$lib/components/navbar.svelte'; - import { SHOW_INIT_FEATURES } from '$lib/system'; type $$Props = HTMLAttributes & { state?: 'closed' | 'open' | 'icons'; @@ -191,49 +190,46 @@ {projectOption.name} {/each} - {#if SHOW_INIT_FEATURES} -
- -
-
- Deploy - -
- {@const deployProjectOptions = projectOptions.filter( - (projectOption) => projectOption.category === 'deploy' - )} - {#each deployProjectOptions as projectOption} - - { - trackEvent(`click_menu_${projectOption.slug}`); - sideBarIsOpen = false; - }}> - - - - - {projectOption.name} - {#if projectOption?.badge} - - {/if} - - - {projectOption.name} - - {/each} - {/if} +
+ +
+
+ Deploy + +
+ {@const deployProjectOptions = projectOptions.filter( + (projectOption) => projectOption.category === 'deploy' + )} + {#each deployProjectOptions as projectOption} + + { + trackEvent(`click_menu_${projectOption.slug}`); + sideBarIsOpen = false; + }}> + + + + + {projectOption.name} + {#if projectOption?.badge} + + {/if} + + + {projectOption.name} + + {/each}
diff --git a/src/lib/stores/roles.ts b/src/lib/stores/roles.ts index 449424f7e..99f4594d6 100644 --- a/src/lib/stores/roles.ts +++ b/src/lib/stores/roles.ts @@ -1,8 +1,8 @@ import { page } from '$app/stores'; import { derived } from 'svelte/store'; -export const roles = derived(page, ($page) => $page.data?.roles ?? []); -export const scopes = derived(page, ($page) => $page.data?.scopes ?? []); +export const roles = derived(page, ($page) => ($page.data?.roles ?? []) as string[]); +export const scopes = derived(page, ($page) => ($page.data?.scopes ?? []) as string[]); export const isDeveloper = derived(roles, ($roles) => $roles.includes('developer')); export const isBilling = derived(roles, ($roles) => $roles.includes('billing')); @@ -50,4 +50,3 @@ export const canSeeTeams = derived(scopes, ($scopes) => $scopes.includes('teams. export const canSeeBuckets = derived(scopes, ($scopes) => $scopes.includes('buckets.read')); export const canSeeMessages = derived(scopes, ($scopes) => $scopes.includes('messages.read')); export const canSeeSites = derived(scopes, ($scopes) => $scopes.includes('sites.read')); -export const canSeeDomains = derived(scopes, ($scopes) => $scopes.includes('domains.read')); //TODO: check if correct diff --git a/src/lib/system.ts b/src/lib/system.ts index 885f92045..b49ace41b 100644 --- a/src/lib/system.ts +++ b/src/lib/system.ts @@ -27,7 +27,6 @@ export const isDev = ENV.DEV; export const isProd = ENV.PROD; export const hasStripePublicKey = !!VARS.PUBLIC_STRIPE_KEY; export const GRACE_PERIOD_OVERRIDE = false; -export const SHOW_INIT_FEATURES = true; export function isMultiRegionSupported(url: URL): boolean { if (env.PUBLIC_APPWRITE_MULTI_REGION === 'true') return true; diff --git a/src/routes/(console)/organization-[organization]/header.svelte b/src/routes/(console)/organization-[organization]/header.svelte index 9af8b5823..a3357fbde 100644 --- a/src/routes/(console)/organization-[organization]/header.svelte +++ b/src/routes/(console)/organization-[organization]/header.svelte @@ -11,13 +11,13 @@ import { members, newMemberModal, organization } from '$lib/stores/organization'; import { canSeeBilling, - canSeeDomains, canSeeProjects, canSeeTeams, isBilling, - isOwner + isOwner, + scopes } from '$lib/stores/roles'; - import { GRACE_PERIOD_OVERRIDE, isCloud, SHOW_INIT_FEATURES } from '$lib/system'; + import { GRACE_PERIOD_OVERRIDE, isCloud } from '$lib/system'; import { IconGithub, IconPlus } from '@appwrite.io/pink-icons-svelte'; import { Icon, Tooltip, Typography, Layout, Badge } from '@appwrite.io/pink-svelte'; @@ -33,6 +33,7 @@ $: avatars = $members.memberships?.map((m) => m.userName || m.userEmail) ?? []; $: organizationId = page.params.organization; $: path = `${base}/organization-${organizationId}`; + $: console.log($scopes); $: tabs = [ { href: path, @@ -45,7 +46,7 @@ href: `${path}/domains`, event: 'domains', title: 'Domains', - disabled: !isCloud || !$canSeeDomains || !SHOW_INIT_FEATURES + disabled: !isCloud }, { href: `${path}/members`, diff --git a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/+page.svelte b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/+page.svelte index 4367866f0..b4b2e9915 100644 --- a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/+page.svelte @@ -24,7 +24,6 @@ import { base } from '$app/paths'; import { IconPlus } from '@appwrite.io/pink-icons-svelte'; import type { Models } from '@appwrite.io/console'; - import { SHOW_INIT_FEATURES } from '$lib/system'; export let data: PageData; @@ -100,15 +99,13 @@ analyticsSource="database_documents" /> - {#if SHOW_INIT_FEATURES} - - {/if} + {#if !$isSmallViewport} - + + File tokens + Use tokens to provide public access to the file. + + {#if $tokens.total} + + + - - - {#each $columns as { id, title } (id)} - {title} - {/each} - + + + {#each $columns as { id, title } (id)} + {title} + {/each} + - {#each $tokens.tokens as token} - - {toLocaleDate(token.$createdAt)} + {#each $tokens.tokens as token} + + {toLocaleDate(token.$createdAt)} - - - {@const expiration = getExpiryDetails(token)} - {token.expire - ? cleanFormattedDate(token.expire) - : 'Never'} + + + {@const expiration = getExpiryDetails(token)} + {token.expire ? cleanFormattedDate(token.expire) : 'Never'} - {#if expiration.status} - - {/if} - - + {#if expiration.status} + + {/if} + + - {token.accessedAt - ? cleanFormattedDate(token.accessedAt, true) - : 'Never'} + {token.accessedAt + ? cleanFormattedDate(token.accessedAt, true) + : 'Never'} - - - - - - + + + + + + - - - - { - toggle(); - showCopyUrlModal = true; - selectedFileToken = token; - }} - leadingIcon={IconDuplicate}> - Copy URL - - + + + { toggle(); - showManageToken = true; + showCopyUrlModal = true; selectedFileToken = token; - }}> - Edit expiry - - { - toggle(); - tokenDeleteMode = true; - showManageToken = true; - selectedFileToken = token; - }}> - Delete + }} + leadingIcon={IconDuplicate}> + Copy URL - - - - - - {/each} - - {:else} - (showManageToken = true)} - >Create new file token - {/if} - - - {/if} + { + toggle(); + showManageToken = true; + selectedFileToken = token; + }}> + Edit expiry + + { + toggle(); + tokenDeleteMode = true; + showManageToken = true; + selectedFileToken = token; + }}> + Delete + + + + + + + + {/each} + + {:else} + (showManageToken = true)}>Create new file token + {/if} + + Permissions Assign read or write permissions at the bucket level or file level. If bucket level permissions