Skip to content

Commit b1a5d77

Browse files
authored
Merge pull request #2038 from appwrite/misc-fixes
2 parents b69648a + 001d56b commit b1a5d77

File tree

25 files changed

+192
-134
lines changed

25 files changed

+192
-134
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"@appwrite.io/pink-icons": "0.25.0",
2727
"@appwrite.io/pink-icons-svelte": "^2.0.0-RC.1",
2828
"@appwrite.io/pink-legacy": "^1.0.3",
29-
"@appwrite.io/pink-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@973fff2",
29+
"@appwrite.io/pink-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@d521606",
3030
"@popperjs/core": "^2.11.8",
3131
"@sentry/sveltekit": "^8.38.0",
3232
"@stripe/stripe-js": "^3.5.0",

pnpm-lock.yaml

Lines changed: 9 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/components/breadcrumbs.svelte

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@
341341
<ActionMenu.Root>
342342
<ActionMenu.Item.Anchor
343343
href={`${base}/project-${project.region}-${project.$id}/overview/platforms`}>
344-
{project.name}
344+
<span class="projectName dropdown">{project.name}</span>
345345
</ActionMenu.Item.Anchor>
346346
</ActionMenu.Root>
347347
</div>
@@ -421,6 +421,15 @@
421421
@media (min-width: 1024px) {
422422
max-width: 150px;
423423
}
424+
425+
&.dropdown {
426+
max-width: 200px;
427+
white-space: nowrap;
428+
overflow: hidden;
429+
text-overflow: ellipsis;
430+
display: inline-block;
431+
vertical-align: middle;
432+
}
424433
}
425434
426435
.noProjects {

src/lib/components/domains/cnameTable.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
{#if verified === true}
2727
<Badge variant="secondary" type="success" size="xs" content="Verified" />
2828
{:else if verified === false}
29-
<Badge variant="secondary" type="error" size="xs" content="Verification failed" />
29+
<Badge variant="secondary" type="warning" size="xs" content="Verification failed" />
3030
{/if}
3131
</Layout.Stack>
3232
<Typography.Text variant="m-400">

src/lib/components/domains/recordTable.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
{#if verified === true}
4141
<Badge variant="secondary" type="success" size="xs" content="Verified" />
4242
{:else if verified === false}
43-
<Badge variant="secondary" type="error" size="xs" content="Verification failed" />
43+
<Badge variant="secondary" type="warning" size="xs" content="Verification failed" />
4444
{/if}
4545
</Layout.Stack>
4646
<Typography.Text variant="m-400">

src/lib/components/expirationInput.svelte

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@
8585
return options[0]?.value ?? null;
8686
}
8787
88-
let result = 'custom';
88+
let result = null;
89+
8990
for (const option of options) {
9091
if (!isValidDate(option.value)) continue;
9192
@@ -95,6 +96,12 @@
9596
}
9697
}
9798
99+
// no matching date, check if 'custom' is available
100+
if (result === null) {
101+
const hasCustomOption = options.some((option) => option.value === 'custom');
102+
result = hasCustomOption ? 'custom' : (options[0]?.value ?? null);
103+
}
104+
98105
return result;
99106
}
100107
@@ -108,8 +115,18 @@
108115
let expirationSelect = initExpirationSelect();
109116
let expirationCustom: string | null = value ? splitDateValue(value) : null;
110117
118+
let initialized = false;
119+
let hasUserInteracted = false;
120+
111121
$: {
112-
if (!isSameDay(new Date(expirationSelect), new Date(value))) {
122+
// Set initial value if value is null on first load
123+
if (!initialized && value === null && expirationSelect !== null) {
124+
value = expirationSelect === 'custom' ? expirationCustom : expirationSelect;
125+
initialized = true;
126+
}
127+
128+
// Only update value after user interaction
129+
if (hasUserInteracted && !isSameDay(new Date(expirationSelect), new Date(value))) {
113130
value = expirationSelect === 'custom' ? expirationCustom : expirationSelect;
114131
}
115132
}
@@ -126,13 +143,15 @@
126143
{options}
127144
id="preset"
128145
label={selectorLabel}
129-
bind:value={expirationSelect} />
146+
bind:value={expirationSelect}
147+
on:change={() => (hasUserInteracted = true)} />
130148

131149
{#if expirationSelect === 'custom'}
132150
<InputDateTime
133151
required
134152
type="date"
135153
id="expire"
136154
label={dateSelectorLabel}
137-
bind:value={expirationCustom} />
155+
bind:value={expirationCustom}
156+
on:change={() => (hasUserInteracted = true)} />
138157
{/if}

src/lib/components/git/deploymentDomains.svelte

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,16 @@
33
import { Link } from '$lib/elements';
44
import { Button } from '$lib/elements/forms';
55
import type { Models } from '@appwrite.io/console';
6-
import { IconExternalLink, IconQrcode } from '@appwrite.io/pink-icons-svelte';
7-
import { ActionMenu, Icon, Layout, Popover, Tag, Typography } from '@appwrite.io/pink-svelte';
6+
import { IconExclamation, IconExternalLink, IconQrcode } from '@appwrite.io/pink-icons-svelte';
7+
import {
8+
ActionMenu,
9+
Icon,
10+
Layout,
11+
Popover,
12+
Tag,
13+
Tooltip,
14+
Typography
15+
} from '@appwrite.io/pink-svelte';
816
import { regionalProtocol } from '$routes/(console)/project-[region]-[project]/store';
917
1018
let {
@@ -34,9 +42,19 @@
3442
<Link external href={`${$regionalProtocol}${sortedDomains[0]?.domain}`} variant="muted">
3543
<Layout.Stack gap="xxs" direction="row" alignItems="center">
3644
<Trim alternativeTrim>
37-
<Typography.Text variant="m-400" color="--fgcolor-neutral-primary">
38-
{sortedDomains[0]?.domain}
39-
</Typography.Text>
45+
<Layout.Stack gap="xxs" direction="row" alignItems="flex-end">
46+
<Typography.Text variant="m-400" color="--fgcolor-neutral-primary">
47+
{sortedDomains[0]?.domain}
48+
</Typography.Text>
49+
50+
{#if sortedDomains[0]?.status !== 'verified'}
51+
<Tooltip>
52+
<Icon icon={IconExclamation} size="s" color="--bgcolor-warning" />
53+
54+
<div slot="tooltip">Not verified</div>
55+
</Tooltip>
56+
{/if}
57+
</Layout.Stack>
4058
</Trim>
4159
</Layout.Stack>
4260
</Link>

src/lib/helpers/types.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ export type TableRootProp = {
6060
selectedAll: boolean;
6161
selectedNone: boolean;
6262
selectedSome: boolean;
63-
columns: Array<PinkColumn> | number;
64-
columnsMap: Record<PinkColumn['id'], PinkColumn>;
63+
// columns: Array<Column> | number;
64+
columns: Record<PinkColumn['id'], PinkColumn>;
65+
// columnsMap: Record<PinkColumn['id'], PinkColumn>;
6566
toggle: (id: string) => void;
6667
toggleAll: () => void;
6768
addAvailableId: (id: string) => void;

src/routes/(console)/onboarding/create-organization/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@
4444
message: e.message
4545
});
4646
} finally {
47-
isLoading = false;
4847
if (organization) {
4948
loadAvailableRegions(organization?.$id).then();
5049
await goto(`${base}/organization-${organization.$id}`);
5150
}
51+
isLoading = false;
5252
}
5353
}
5454
</script>

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

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<script lang="ts">
22
import { sdk } from '$lib/stores/sdk';
33
import { onDestroy } from 'svelte';
4-
import { addNotification } from '$lib/stores/notifications';
5-
import { goto } from '$app/navigation';
4+
import { goto, invalidate } from '$app/navigation';
65
import { page } from '$app/state';
76
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
87
import { ID, type Models, Region as ConsoleRegion, Region } from '@appwrite.io/console';
98
import { base } from '$app/paths';
109
import CreateProject from '$lib/layout/createProject.svelte';
1110
import { Modal } from '$lib/components';
1211
import { Button } from '$lib/elements/forms';
12+
import { Dependencies } from '$lib/constants';
1313
1414
export let showCreateProjectCloud: boolean;
1515
export let regions: Array<Models.ConsoleRegion> = [];
@@ -22,30 +22,26 @@
2222
let showSubmissionLoader = false;
2323
const teamId = page.params.organization;
2424
25-
function onFinish() {
26-
addNotification({ type: 'success', message: `${name} has been created` });
27-
trackEvent(Submit.ProjectCreate, { customId: !!id, teamId, region: region });
28-
}
29-
3025
async function create() {
26+
let project: Models.Project;
27+
3128
showSubmissionLoader = true;
3229
3330
try {
34-
// TODO: fix typing once SDK is updated
35-
const project = await sdk.forConsole.projects.create(
36-
id ?? ID.unique(),
37-
name,
38-
teamId,
39-
region
40-
);
31+
project = await sdk.forConsole.projects.create(id ?? ID.unique(), name, teamId, region);
4132
42-
onFinish();
4333
await goto(`${base}/project-${project.region}-${project.$id}`);
34+
trackEvent(Submit.ProjectCreate, { customId: !!id, teamId, region: region });
4435
} catch (e) {
4536
error = e.message;
4637
trackError(e, Submit.ProjectCreate);
4738
} finally {
4839
showSubmissionLoader = false;
40+
41+
if (project) {
42+
// reload projects for nav breadcrumb!
43+
await invalidate(Dependencies.ORGANIZATION);
44+
}
4945
}
5046
}
5147

0 commit comments

Comments
 (0)