Skip to content

Commit 6fb8da5

Browse files
committed
Merge branch 'main' into csv-imports-errors
2 parents 4b51553 + c87a8f2 commit 6fb8da5

File tree

5 files changed

+126
-125
lines changed

5 files changed

+126
-125
lines changed

src/lib/components/navbar.svelte

Lines changed: 69 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,13 @@
2323
Navbar,
2424
Icon,
2525
Layout,
26-
Link,
2726
Tooltip,
28-
Card,
2927
ActionMenu,
3028
ToggleButton,
3129
Button,
3230
Avatar,
33-
Typography
31+
Typography,
32+
Popover
3433
} from '@appwrite.io/pink-svelte';
3534
import { toggleCommandCenter } from '$lib/commandCenter/commandCenter.svelte';
3635
import {
@@ -209,91 +208,79 @@
209208
</Button.Button>
210209
<span slot="tooltip">{isMac() ? '⌘ + K' : 'Ctrl + K'}</span></Tooltip>
211210
</Layout.Stack>
212-
<Link.Button
213-
on:click={() => {
214-
showAccountMenu = !showAccountMenu;
215-
shouldAnimateThemeToggle = false;
216-
if (showAccountMenu) {
217-
trackEvent(Click.MenuDropDownClick);
218-
}
219-
}}>
220-
<div style:user-select="none">
211+
<Popover let:toggle let:showing>
212+
<button
213+
type="button"
214+
on:click|preventDefault={(e) => {
215+
toggle(e);
216+
shouldAnimateThemeToggle = false;
217+
if (showing) {
218+
trackEvent(Click.MenuDropDownClick);
219+
}
220+
}}
221+
style:user-select="none">
221222
<Avatar size="s" src={avatar} />
222-
</div>
223-
</Link.Button>
224-
{#if showAccountMenu}
225-
<div class="account-container">
226-
<Card.Base padding="xxxs" shadow={true}>
223+
</button>
224+
<svelte:fragment slot="tooltip" let:toggle>
225+
<ActionMenu.Root noPadding>
227226
<Layout.Stack gap="xxs">
228-
<ActionMenu.Root>
229-
<Layout.Stack gap="xxs">
230-
<div
231-
style:padding-inline-start="10px"
232-
style:padding-inline-end="8px"
233-
style:padding-block="4px">
234-
<Typography.Text variant="m-500">
235-
{$user.email}
236-
</Typography.Text>
237-
</div>
238-
<ActionMenu.Item.Anchor
239-
trailingIcon={IconUser}
240-
size="l"
241-
href={`${base}/account`}>
242-
Account</ActionMenu.Item.Anchor>
227+
<div
228+
style:padding-inline-start="10px"
229+
style:padding-inline-end="8px"
230+
style:padding-block="4px">
231+
<Typography.Text variant="m-500">
232+
{$user.email}
233+
</Typography.Text>
234+
</div>
235+
<ActionMenu.Item.Anchor
236+
trailingIcon={IconUser}
237+
on:click={toggle}
238+
size="l"
239+
href={`${base}/account`}>
240+
Account</ActionMenu.Item.Anchor>
243241

244-
<ActionMenu.Item.Button
245-
trailingIcon={IconLogoutRight}
246-
size="l"
247-
on:click={() => logout()}>Sign out</ActionMenu.Item.Button>
248-
<div
249-
style:padding-inline-start="10px"
250-
style:padding-inline-end="8px">
251-
<Layout.Stack
252-
justifyContent="space-between"
253-
direction="row"
254-
alignItems="center">
255-
<Typography.Text>Theme</Typography.Text>
256-
<div
257-
class:keepTransformTransition={shouldAnimateThemeToggle}>
258-
<ToggleButton
259-
bind:active={activeTheme}
260-
on:change={() => {
261-
setTimeout(() => {
262-
shouldAnimateThemeToggle = true;
263-
}, 150);
264-
}}
265-
buttons={[
266-
{
267-
id: 'light',
268-
label: 'Light',
269-
icon: IconSun
270-
},
271-
{
272-
id: 'dark',
273-
label: 'Dark',
274-
icon: IconMoon
275-
},
276-
{
277-
id: 'auto',
278-
label: 'System',
279-
icon: IconMode
280-
}
281-
]}></ToggleButton>
282-
</div>
283-
</Layout.Stack>
242+
<ActionMenu.Item.Button
243+
trailingIcon={IconLogoutRight}
244+
size="l"
245+
on:click={() => logout()}>Sign out</ActionMenu.Item.Button>
246+
<div style:padding-inline-start="10px" style:padding-inline-end="8px">
247+
<Layout.Stack
248+
justifyContent="space-between"
249+
direction="row"
250+
alignItems="center">
251+
<Typography.Text>Theme</Typography.Text>
252+
<div class:keepTransformTransition={shouldAnimateThemeToggle}>
253+
<ToggleButton
254+
bind:active={activeTheme}
255+
on:change={() => {
256+
setTimeout(() => {
257+
shouldAnimateThemeToggle = true;
258+
}, 150);
259+
}}
260+
buttons={[
261+
{
262+
id: 'light',
263+
label: 'Light',
264+
icon: IconSun
265+
},
266+
{
267+
id: 'dark',
268+
label: 'Dark',
269+
icon: IconMoon
270+
},
271+
{
272+
id: 'auto',
273+
label: 'System',
274+
icon: IconMode
275+
}
276+
]}></ToggleButton>
284277
</div>
285278
</Layout.Stack>
286-
</ActionMenu.Root>
279+
</div>
287280
</Layout.Stack>
288-
</Card.Base>
289-
</div>
290-
<button
291-
class="account-backdrop"
292-
aria-label="Account menu"
293-
on:click={() => {
294-
showAccountMenu = false;
295-
}}></button>
296-
{/if}
281+
</ActionMenu.Root>
282+
</svelte:fragment>
283+
</Popover>
297284
</div>
298285
</div>
299286
</Navbar.Base>
@@ -405,24 +392,6 @@
405392
}
406393
}
407394
408-
.account-container {
409-
position: absolute;
410-
right: var(--space-7);
411-
top: var(--base-44);
412-
width: 244px;
413-
display: flex;
414-
z-index: 1;
415-
}
416-
417-
.account-backdrop {
418-
position: absolute;
419-
left: 0;
420-
top: 0;
421-
width: 100vw;
422-
height: 100vh;
423-
background-color: transparent;
424-
}
425-
426395
/* The default drop list has a max-inline width of 280px, which squeezes the support modal. */
427396
:global(.extended-width) {
428397
max-inline-size: none;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
let error: string;
2121
let showCustomId = false;
2222
let disabled: boolean = false;
23-
let name: string = 'Appwrite project';
23+
let name: string = 'New project';
2424
2525
async function create() {
2626
try {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
export let showCreateProjectCloud: boolean;
1818
1919
let id: string = null;
20-
let name: string = 'Appwrite project';
20+
let name: string = 'New project';
2121
let region: string = Region.Fra;
2222
let error: string = null;
2323

src/routes/(console)/organization-[organization]/domains/domain-[domain]/table.svelte

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,11 @@
3939
let showDelete = false;
4040
let selectedRecord: Models.DnsRecord = null;
4141
42-
function formatRecordName(name: string) {
43-
const limit = 30;
42+
function formatName(name: string, limit: number = 30) {
4443
return {
45-
value: name.length > limit ? `${name.slice(0, limit)}...` : name,
46-
truncated: name.length > limit,
47-
whole: name
44+
value: name ? (name.length > limit ? `${name.slice(0, limit)}...` : name) : '-',
45+
truncated: name ? name.length > limit : undefined,
46+
whole: name ?? '-'
4847
};
4948
}
5049
</script>
@@ -65,7 +64,7 @@
6564
{#each $columns as column}
6665
<Table.Cell column={column.id} {root}>
6766
{#if column.id === 'name'}
68-
{@const formatted = formatRecordName(record.name)}
67+
{@const formatted = formatName(record.name)}
6968
<Tooltip placement="bottom" disabled={!formatted.truncated}>
7069
<Typography.Text truncate>{formatted.value}</Typography.Text>
7170
<span
@@ -99,7 +98,22 @@
9998
</Typography.Text>
10099
{:else if column.id === 'comment'}
101100
<Typography.Text truncate>
102-
{record?.comment ?? '-'}
101+
{@const formatted = formatName(record?.comment)}
102+
<Tooltip
103+
placement="bottom"
104+
maxWidth="fit-content"
105+
disabled={!formatted.truncated}>
106+
<Typography.Text truncate>{formatted.value}</Typography.Text>
107+
<span
108+
slot="tooltip"
109+
let:showing
110+
style:white-space="pre-wrap"
111+
style:word-break="break-all">
112+
{#if showing}
113+
{formatted.whole}
114+
{/if}
115+
</span>
116+
</Tooltip>
103117
</Typography.Text>
104118
{:else if column.id === '$createdAt'}
105119
<DualTimeView time={record.$createdAt} />

src/routes/(console)/project-[region]-[project]/overview/platforms/createFlutter.svelte

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,11 @@ static const String APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject(page.params.reg
115115
projectId,
116116
platform,
117117
$createPlatform.name,
118-
$createPlatform.key || undefined,
118+
platform === PlatformType.Flutterweb ? undefined : $createPlatform.key || undefined,
119119
undefined,
120-
undefined
120+
platform === PlatformType.Flutterweb
121+
? $createPlatform.hostname || undefined
122+
: undefined
121123
);
122124
123125
isPlatformCreated = true;
@@ -189,19 +191,35 @@ static const String APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject(page.params.reg
189191
bind:value={$createPlatform.name} />
190192

191193
<!-- Tooltips on InputText don't work as of now -->
192-
<InputText
193-
id="hostname"
194-
label={hostname[platform]}
195-
placeholder={placeholder[platform].hostname}
196-
required
197-
bind:value={$createPlatform.key}>
198-
<Tooltip slot="info" maxWidth="15rem">
199-
<Icon icon={IconInfo} size="s" />
200-
<Typography.Caption variant="400" slot="tooltip">
201-
{placeholder[platform].tooltip}
202-
</Typography.Caption>
203-
</Tooltip>
204-
</InputText>
194+
{#if platform === PlatformType.Flutterweb}
195+
<InputText
196+
id="hostname"
197+
label={hostname[platform]}
198+
placeholder={placeholder[platform].hostname}
199+
required
200+
bind:value={$createPlatform.hostname}>
201+
<Tooltip slot="info" maxWidth="15rem">
202+
<Icon icon={IconInfo} size="s" />
203+
<Typography.Caption variant="400" slot="tooltip">
204+
{placeholder[platform].tooltip}
205+
</Typography.Caption>
206+
</Tooltip>
207+
</InputText>
208+
{:else}
209+
<InputText
210+
id="key"
211+
label={hostname[platform]}
212+
placeholder={placeholder[platform].hostname}
213+
required
214+
bind:value={$createPlatform.key}>
215+
<Tooltip slot="info" maxWidth="15rem">
216+
<Icon icon={IconInfo} size="s" />
217+
<Typography.Caption variant="400" slot="tooltip">
218+
{placeholder[platform].tooltip}
219+
</Typography.Caption>
220+
</Tooltip>
221+
</InputText>
222+
{/if}
205223
</Layout.Stack>
206224

207225
<Button
@@ -212,7 +230,7 @@ static const String APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject(page.params.reg
212230
submissionLoader={isCreatingPlatform}
213231
disabled={!platform ||
214232
!$createPlatform.name ||
215-
!$createPlatform.key ||
233+
(!$createPlatform.key && !$createPlatform.hostname) ||
216234
isCreatingPlatform}>
217235
Create platform
218236
</Button>

0 commit comments

Comments
 (0)