Skip to content

Commit c2e23cc

Browse files
authored
Merge branch 'main' into fix-SER-7-Missing-padding-below-oauth-callback
2 parents ee57b26 + cf3d2a8 commit c2e23cc

File tree

61 files changed

+432
-255
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+432
-255
lines changed

e2e/journeys/upgrade-free-tier.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ test('upgrade - free tier', async ({ page }) => {
1111
await page.waitForURL(/\/organization-[^/]+\/change-plan/);
1212
await page.locator('input[value="tier-1"]').click();
1313
await page.getByRole('button', { name: 'add' }).first().click();
14+
1415
await enterCreditCard(page);
16+
17+
// wait for a second after adding a card to update the UI.
18+
await page.waitForSelector('button#method[role="combobox"]');
19+
1520
// skip members
1621
await page.getByRole('button', { name: 'change plan' }).click();
1722
await page.waitForURL(/\/console\/project-(?:[a-z0-9]+-)?([^/]+)\/get-started/);

src/lib/components/billing/paymentModal.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
try {
2222
const card = await submitStripeCard(name, page?.params?.organization ?? null);
2323
modal.closeModal();
24-
invalidate(Dependencies.PAYMENT_METHODS);
24+
await invalidate(Dependencies.PAYMENT_METHODS);
2525
dispatch('submit', card);
2626
addNotification({
2727
type: 'success',

src/lib/components/billing/planSelection.svelte

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@
2424
bind:group={billingPlan}
2525
disabled={anyOrgFree || !selfService}
2626
value={BillingPlan.FREE}
27-
tooltipShow={anyOrgFree}
2827
title={tierFree.name}
29-
tooltipText="You are limited to 1 Free organization per account.">
28+
tooltipShow={anyOrgFree}
29+
tooltipText="You are limited to 1 Free organization per account."
30+
tooltipWidth="100%">
3031
<svelte:fragment slot="action">
3132
{#if $organization?.billingPlan === BillingPlan.FREE && !isNewOrg}
3233
<Badge variant="secondary" size="xs" content="Current plan" />

src/lib/components/billing/selectPaymentMethod.svelte

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,19 @@
2020
2121
async function cardSaved(event: CustomEvent<PaymentMethodData>) {
2222
value = event.detail.$id;
23-
invalidate(Dependencies.UPGRADE_PLAN);
24-
invalidate(Dependencies.CREATE_ORGANIZATION);
23+
24+
if (value) {
25+
methods = {
26+
...methods,
27+
total: methods.total + 1,
28+
paymentMethods: [...methods.paymentMethods, event.detail]
29+
};
30+
}
31+
32+
await Promise.all([
33+
invalidate(Dependencies.UPGRADE_PLAN),
34+
invalidate(Dependencies.ORGANIZATION)
35+
]);
2536
}
2637
2738
onMount(() => {

src/lib/components/billing/validateCreditModal.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
placeholder="Promo code"
5959
id="code"
6060
label="Add promo code"
61+
autofocus
6162
bind:value={coupon} />
6263

6364
<svelte:fragment slot="footer">

src/lib/components/breadcrumbs.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@
101101
102102
async function createProjectsBottomSheet(organization: Organization): Promise<SheetMenu> {
103103
isLoadingProjects = true;
104-
loadedProjects = await projects;
104+
// null on non-org/project path like `onboarding`.
105+
loadedProjects = (await projects) ?? loadedProjects;
105106
isLoadingProjects = false;
106107
107108
const createProjectItem = {

src/lib/components/columnSelector.svelte

Lines changed: 40 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -31,49 +31,62 @@
3131
}
3232
};
3333
34-
onMount(async () => {
34+
const saveColumnPreferences = () => {
35+
const shownColumns = $columns.filter((n) => n.hide !== true).map((n) => n.id);
36+
37+
if (isCustomCollection) {
38+
preferences.setCustomCollectionColumns(page.params.collection, shownColumns);
39+
} else {
40+
preferences.setColumns(shownColumns);
41+
}
42+
};
43+
44+
onMount(() => {
3545
if (isCustomCollection) {
36-
const prefs = preferences.getCustomCollectionColumns(page.params.collection);
37-
columns.set(
38-
$columns.map((column) => {
39-
column.hide = prefs?.includes(column.id) ?? false;
46+
const shownColumns = preferences.getCustomCollectionColumns(page.params.collection);
47+
48+
columns.update((columns) => {
49+
return columns.map((column) => {
50+
column.hide = !shownColumns.includes(column.id);
4051
return column;
41-
})
42-
);
52+
});
53+
});
4354
} else {
4455
const prefs = preferences.get(page.route);
4556
46-
// Override the shown columns only if a preference was set
47-
if (prefs?.columns) {
48-
columns.set(
49-
$columns.map((column) => {
50-
column.hide = prefs.columns?.includes(column.id) ?? false;
57+
if (prefs?.columns && prefs.columns.length > 0) {
58+
columns.update((cols) => {
59+
return cols.map((column) => {
60+
column.hide = !prefs.columns.includes(column.id);
5161
return column;
52-
})
53-
);
62+
});
63+
});
5464
}
5565
}
5666
57-
columns.subscribe((ctx) => {
58-
const columns = ctx.filter((n) => n.hide === true).map((n) => n.id);
59-
60-
if (isCustomCollection) {
61-
preferences.setCustomCollectionColumns(columns);
62-
} else {
63-
preferences.setColumns(columns);
64-
}
65-
});
66-
6767
calcMaxHeight();
6868
});
6969
7070
let selectedColumnsNumber = $derived(
7171
$columns.reduce((acc, column) => {
72-
if (column.hide === true) return acc;
72+
if (column.hide) return acc;
7373
7474
return ++acc;
7575
}, 0)
7676
);
77+
78+
function toggleColumn(column: Column) {
79+
columns.update((cols) =>
80+
cols.map((col) => {
81+
if (col.id === column.id) {
82+
col.hide = !column.hide;
83+
}
84+
return col;
85+
})
86+
);
87+
88+
saveColumnPreferences();
89+
}
7790
</script>
7891

7992
<svelte:window on:resize={calcMaxHeight} />
@@ -86,15 +99,15 @@
8699
{#each $columns as column}
87100
{#if !column?.exclude}
88101
<ActionMenu.Item.Button
89-
on:click={() => (column.hide = !column.hide)}
102+
on:click={() => toggleColumn(column)}
90103
disabled={allowNoColumns
91104
? false
92105
: selectedColumnsNumber <= 1 && column.hide !== true}>
93106
<Layout.Stack direction="row" gap="s">
94107
<Selector.Checkbox
95108
checked={!column.hide}
96109
size="s"
97-
on:click={() => (column.hide = !column.hide)} />
110+
on:click={() => toggleColumn(column)} />
98111
{column.title}
99112
</Layout.Stack>
100113
</ActionMenu.Item.Button>

src/lib/components/feedback/evaluation.svelte

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
style="padding-block: 0.13rem">
1111
{#each Array(11) as _, i}
1212
<li>
13-
<Tag size="m" selected={value === i} on:click={() => (value = i)}>
13+
<Tag
14+
size="m"
15+
selected={value === i}
16+
autofocus={i === 0}
17+
data-rating={i}
18+
on:click={() => (value = i)}>
1419
{i}
1520
</Tag>
1621
</li>

src/lib/components/feedback/feedbackGeneral.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<InputTextarea
77
required
88
id="feedback"
9+
autofocus
910
bind:value={$feedbackData.message}
1011
label="Tell us more about your experience"
1112
placeholder="Share your suggestions and feature requests..." />

src/lib/components/labelCard.svelte

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<script lang="ts">
2-
import { Card, Tooltip } from '@appwrite.io/pink-svelte';
3-
import type { HTMLAttributes } from 'svelte/elements';
4-
import type { BaseCardProps } from './card.svelte';
52
import type { ComponentType } from 'svelte';
3+
import type { BaseCardProps } from './card.svelte';
4+
import type { HTMLAttributes } from 'svelte/elements';
5+
import { Card, Tooltip } from '@appwrite.io/pink-svelte';
66
77
type Props = BaseCardProps &
88
HTMLAttributes<HTMLInputElement> & {
@@ -22,8 +22,10 @@
2222
2323
export let group: string;
2424
export let value: string;
25-
export let tooltipText: string = null;
25+
2626
export let tooltipShow = false;
27+
export let tooltipText: string = null;
28+
export let tooltipWidth: string = undefined;
2729
2830
// Pink v2
2931
export let icon: Props['icon'] = undefined;
@@ -42,25 +44,27 @@
4244
let slotTitle: HTMLSpanElement;
4345
</script>
4446

45-
<Tooltip disabled={!tooltipText || !tooltipShow}>
46-
<Card.Selector
47-
{name}
48-
{src}
49-
{alt}
50-
{icon}
51-
{padding}
52-
{imageRadius}
53-
{variant}
54-
{value}
55-
{radius}
56-
{disabled}
57-
title={title ?? slotTitle?.innerText}
58-
bind:group>
59-
{#if $$slots.default}
60-
<slot />
61-
{/if}
62-
<slot name="action" slot="action" />
63-
</Card.Selector>
47+
<Tooltip maxWidth={tooltipWidth} disabled={!tooltipText || !tooltipShow}>
48+
<div style:cursor={disabled ? 'pointer' : ''}>
49+
<Card.Selector
50+
{name}
51+
{src}
52+
{alt}
53+
{icon}
54+
{padding}
55+
{imageRadius}
56+
{variant}
57+
{value}
58+
{radius}
59+
{disabled}
60+
title={title ?? slotTitle?.innerText}
61+
bind:group>
62+
{#if $$slots.default}
63+
<slot />
64+
{/if}
65+
<slot name="action" slot="action" />
66+
</Card.Selector>
67+
</div>
6468
<span slot="tooltip">{tooltipText}</span>
6569
</Tooltip>
6670

0 commit comments

Comments
 (0)