Skip to content

Commit 6a10e22

Browse files
various fixes
1 parent f713049 commit 6a10e22

22 files changed

+581
-510
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
"dependencies": {
2222
"@appwrite.io/console": "https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@ae1eb53",
2323
"@appwrite.io/pink-icons": "0.25.0",
24-
"@appwrite.io/pink-icons-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@35f29290",
24+
"@appwrite.io/pink-icons-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@2ff4e332",
2525
"@appwrite.io/pink-legacy": "^1.0.1",
26-
"@appwrite.io/pink-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@35f29290",
26+
"@appwrite.io/pink-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@2ff4e332",
2727
"@popperjs/core": "^2.11.8",
2828
"@sentry/sveltekit": "^8.38.0",
2929
"@stripe/stripe-js": "^3.5.0",

pnpm-lock.yaml

+14-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/components/avatarGroup.svelte

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424

2525
{#if total > 2}
2626
<Avatar {size}>
27-
+{total - 2}
27+
<span style:font-size="10px">
28+
+{total - 2}
29+
</span>
2830
</Avatar>
2931
{/if}
3032
</AvatarGroup>

src/lib/components/roles/base.svelte

+3-14
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
1-
<div class="u-flex-vertical u-gap-16">
1+
<div>
22
<slot />
33
</div>
44

55
<style>
66
div {
7-
color: hsl(var(--color-neutral-50));
8-
line-height: 1.25rem;
9-
&:first-child {
10-
color: hsl(var(--color-neutral-70));
11-
}
12-
}
13-
14-
:global(.theme-dark) div {
15-
color: hsl(var(--color-neutral-20));
16-
17-
&:first-child {
18-
color: hsl(var(--color-neutral-10));
19-
}
7+
max-width: 360px;
8+
text-wrap: auto;
209
}
2110
</style>

src/lib/components/roles/upgrade.svelte

+49-45
Original file line numberDiff line numberDiff line change
@@ -5,58 +5,62 @@
55
import { organization } from '$lib/stores/organization';
66
import { BillingPlan } from '$lib/constants';
77
import Button from '$lib/elements/forms/button.svelte';
8+
import { Badge, Layout, Link, Tag, Typography } from '@appwrite.io/pink-svelte';
89
</script>
910

1011
<Base>
11-
{#if isCloud}
12-
{#if $organization?.billingPlan !== BillingPlan.FREE}
13-
<div class="u-flex-vertical u-gap-8">
14-
<p>
15-
<span class="u-bold">Roles</span>
16-
{#if $organization?.billingPlan === BillingPlan.FREE}
17-
<span class="inline-tag u-normal u-x-small">Pro plan</span>
18-
{/if}
19-
</p>
20-
<p>Owner, Developer, Editor, Analyst and Billing.</p>
21-
</div>
22-
<p>
23-
<Button link external href="https://appwrite.io/docs/advanced/platform/roles"
24-
>Learn more</Button> about roles.
25-
</p>
26-
{:else}
27-
<div class="u-flex-vertical u-gap-8">
28-
<p>
29-
<span class="u-bold">Roles</span>
30-
{#if $organization?.billingPlan === BillingPlan.FREE}
31-
<span class="inline-tag u-normal u-x-small">Pro plan</span>
32-
{/if}
33-
</p>
34-
<p>
12+
<Layout.Stack>
13+
{#if isCloud}
14+
{#if $organization?.billingPlan !== BillingPlan.FREE}
15+
<Typography.Text variant="m-600">Roles</Typography.Text>
16+
<Typography.Text>Owner, Developer, Editor, Analyst and Billing.</Typography.Text>
17+
<Typography.Text>
18+
<Link.Anchor
19+
target="_blank"
20+
rel="noopener noreferrer"
21+
href="https://appwrite.io/docs/advanced/platform/roles"
22+
>Learn more</Link.Anchor>
23+
</Typography.Text>
24+
{:else}
25+
<Layout.Stack direction="row" gap="s">
26+
<Typography.Text variant="m-600">
27+
<span class="u-bold">Roles</span>
28+
</Typography.Text>
29+
<Badge variant="secondary" size="xs" content="Pro plan" />
30+
</Layout.Stack>
31+
<Typography.Text>
3532
Upgrade to Pro to assign new roles to members such as Owner, Developer, Editor
3633
or Analyst.
34+
</Typography.Text>
35+
36+
<p class="u-flex u-main-end u-cross-center u-gap-4">
37+
<Button
38+
size="s"
39+
text
40+
external
41+
href="https://appwrite.io/docs/advanced/platform/roles">Learn more</Button>
42+
<Button size="s" secondary external href={$upgradeURL}>Upgrade plan</Button>
3743
</p>
38-
</div>
44+
{/if}
45+
{:else}
46+
<Layout.Stack direction="row" gap="s">
47+
<Typography.Text variant="m-600">
48+
<span class="u-bold">Roles</span>
49+
</Typography.Text>
50+
<Badge variant="secondary" size="xs" content="Cloud" />
51+
</Layout.Stack>
52+
<Typography.Text>
53+
Upgrade to Cloud to assign new roles to members or ask us about our enterprise self
54+
hosted offering.
55+
</Typography.Text>
3956
<p class="u-flex u-main-end u-cross-center u-gap-4">
40-
<Button text external href="https://appwrite.io/docs/advanced/platform/roles"
41-
>Learn more</Button>
42-
<Button secondary external href={$upgradeURL}>Upgrade plan</Button>
57+
<Button
58+
size="s"
59+
text
60+
external
61+
href="https://appwrite.io/docs/advanced/platform/roles">Learn more</Button>
62+
<Button size="s" secondary external href={$upgradeURL}>Upgrade to Cloud</Button>
4363
</p>
4464
{/if}
45-
{:else}
46-
<div class="u-flex-vertical u-gap-8">
47-
<p>
48-
<span class="u-bold">Roles</span>
49-
<span class="inline-tag u-normal u-x-small">Appwrite Cloud</span>
50-
</p>
51-
<p>
52-
Upgrade to Cloud to assign new roles to members or ask us about our entriprise self
53-
hosted offering.
54-
</p>
55-
</div>
56-
<p class="u-flex u-main-end u-cross-center u-gap-4">
57-
<Button text external href="https://appwrite.io/docs/advanced/platform/roles"
58-
>Learn more</Button>
59-
<Button secondary external href={$upgradeURL}>Upgrade to Cloud</Button>
60-
</p>
61-
{/if}
65+
</Layout.Stack>
6266
</Base>

src/lib/components/tab.svelte

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
export let selected = false;
1111
export let href: string = null;
1212
export let event: string = null;
13+
export let noscroll = false;
1314
export let root: { variant: Variant; stretch: boolean } = {
1415
variant: 'primary',
1516
stretch: false
@@ -87,6 +88,7 @@
8788

8889
{#if href}
8990
<Tabs.Item.Link
91+
{noscroll}
9092
{root}
9193
{href}
9294
bind:active={selected}

src/lib/elements/forms/inputSelect.svelte

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
{placeholder}
5353
{disabled}
5454
{isSearchable}
55+
{required}
5556
helper={error}
5657
state={error ? 'error' : 'default'}
5758
on:invalid={handleInvalid}

src/routes/(console)/account/sessions/+page.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { goto, invalidate } from '$app/navigation';
44
import { base } from '$app/paths';
55
import { Submit, trackEvent } from '$lib/actions/analytics';
6-
import { Heading, Trim } from '$lib/components';
6+
import { Trim } from '$lib/components';
77
import { Dependencies } from '$lib/constants';
88
import { Button } from '$lib/elements/forms';
99
import { isValueOfStringEnum } from '$lib/helpers/types';

src/routes/(console)/organization-[organization]/+page.svelte

+37-8
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,25 @@
2525
import { sdk } from '$lib/stores/sdk';
2626
import { loading } from '$routes/store';
2727
import type { Models } from '@appwrite.io/console';
28-
import { ID, Region } from '@appwrite.io/console';
28+
import { ID, Region, PlatformType } from '@appwrite.io/console';
2929
import { openImportWizard } from '../project-[project]/settings/migrations/(import)';
3030
import { readOnly } from '$lib/stores/billing';
3131
import type { RegionList } from '$lib/sdk/billing';
32-
import { onMount } from 'svelte';
32+
import { onMount, type ComponentType } from 'svelte';
3333
import { organization } from '$lib/stores/organization';
3434
import { canWriteProjects } from '$lib/stores/roles';
3535
import { checkPricingRefAndRedirect } from '$lib/helpers/pricingRedirect';
36-
import { Icon } from '@appwrite.io/pink-svelte';
37-
import { IconPlus } from '@appwrite.io/pink-icons-svelte';
36+
import { Badge, Icon } from '@appwrite.io/pink-svelte';
37+
import {
38+
IconAndroid,
39+
IconApple,
40+
IconCode,
41+
IconFlutter,
42+
IconGlobe,
43+
IconPlus,
44+
IconReact,
45+
IconUnity
46+
} from '@appwrite.io/pink-icons-svelte';
3847
import { getPlatformInfo } from '$lib/helpers/platform';
3948
4049
export let data;
@@ -64,6 +73,26 @@
6473
if (isCloud) wizard.start(Create);
6574
else showCreate = true;
6675
}
76+
77+
function getIconForPlatform(platform: string): ComponentType {
78+
switch (platform) {
79+
case 'web':
80+
return IconCode;
81+
case 'flutter':
82+
return IconFlutter;
83+
case 'apple':
84+
return IconApple;
85+
case 'android':
86+
return IconAndroid;
87+
case 'react-native':
88+
return IconReact;
89+
case 'unity':
90+
return IconUnity;
91+
default:
92+
return null;
93+
}
94+
}
95+
6796
$: $registerCommands([
6897
{
6998
label: 'Create project',
@@ -170,10 +199,10 @@
170199

171200
{#each platforms as platform, i}
172201
{#if i < 3}
173-
<Pill>
174-
<span class={`icon-${platform.icon}`} aria-hidden="true" />
175-
{platform.name}
176-
</Pill>
202+
{@const icon = getIconForPlatform(platform.icon)}
203+
<Badge variant="secondary" content={platform.name}>
204+
<Icon {icon} size="s" slot="start" />
205+
</Badge>
177206
{/if}
178207
{/each}
179208
{#if platforms?.length > 3}

src/routes/(console)/organization-[organization]/createMember.svelte

+17-17
Original file line numberDiff line numberDiff line change
@@ -59,24 +59,24 @@
5959
}
6060
</script>
6161

62-
<Modal title="Invite member" {error} size="big" bind:show={showCreate} onSubmit={create}>
63-
<FormList>
64-
<InputEmail
62+
<Modal title="Invite member" {error} bind:show={showCreate} onSubmit={create}>
63+
<InputEmail
64+
required
65+
id="email"
66+
label="Email"
67+
placeholder="Enter email"
68+
autofocus={true}
69+
bind:value={email} />
70+
<InputText id="member-name" label="Name" placeholder="Enter name" bind:value={name} />
71+
{#if isCloud}
72+
<InputSelect
6573
required
66-
id="email"
67-
label="Email"
68-
placeholder="Enter email"
69-
autofocus={true}
70-
bind:value={email} />
71-
<InputText
72-
id="member-name"
73-
label="Name (optional)"
74-
placeholder="Enter name"
75-
bind:value={name} />
76-
{#if isCloud}
77-
<InputSelect popover={Roles} id="role" label="Role" options={roles} bind:value={role} />
78-
{/if}
79-
</FormList>
74+
popover={Roles}
75+
id="role"
76+
label="Role"
77+
options={roles}
78+
bind:value={role} />
79+
{/if}
8080
<svelte:fragment slot="footer">
8181
<Button secondary on:click={() => (showCreate = false)}>Cancel</Button>
8282
<Button submit submissionLoader>Send invite</Button>

0 commit comments

Comments
 (0)