Skip to content

Commit f1e94f2

Browse files
committed
update syntax
1 parent 3a46d36 commit f1e94f2

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

src/lib/components/billing/alerts/projectsLimit.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
<SelectProjectCloud bind:showSelectProject />
1717

1818
{#if $currentPlan && $currentPlan.projects > 0 && !hideBillingHeaderRoutes.includes(page.url.pathname)}
19-
<HeaderAlert type="warning" title="Action required: You have more than {$currentPlan.projects} projects.">
19+
<HeaderAlert
20+
type="warning"
21+
title="Action required: You have more than {$currentPlan.projects} projects.">
2022
<svelte:fragment>
2123
Choose which projects to keep before {billingProjectsLimitDate} or upgrade to Pro. Projects
2224
over the limit will be blocked after this date.

src/lib/components/billing/alerts/selectProjectCloud.svelte

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
import { page } from '$app/state';
1212
import { toLocaleDateTime } from '$lib/helpers/date';
1313
14-
const showSelectProject = $props.showSelectProject;
15-
const selectedProjects = $state([]);
14+
let { showSelectProject = $bindable(false) } = $props();
15+
let selectedProjects = $state([]);
1616
1717
let projects = $state<Array<Models.Project>>([]);
1818
let error = $state<string | null>(null);
@@ -31,7 +31,7 @@
3131
projects[0].teamId,
3232
selectedProjects
3333
);
34-
showSelectProject.set(false);
34+
showSelectProject = false;
3535
invalidate(Dependencies.ORGANIZATION);
3636
addNotification({
3737
type: 'success',
@@ -41,14 +41,14 @@
4141
error = e.message;
4242
}
4343
}
44-
45-
function formatProjectsToArchive(projects: Array<Models.Project>) {
44+
45+
function formatProjectsToArchive() {
4646
let result = '';
47-
47+
4848
projectsToArchive.forEach((project, index) => {
4949
const text = `${index === 0 ? '' : ' '}<b>${project.name}</b> `;
5050
result += text;
51-
51+
5252
if (index < projectsToArchive.length - 1) {
5353
if (index == projectsToArchive.length - 2) {
5454
result += 'and ';
@@ -58,12 +58,12 @@
5858
}
5959
}
6060
});
61-
61+
6262
return result;
6363
}
6464
</script>
6565

66-
<Modal bind:show={$showSelectProject} title={'Manage projects'} onSubmit={updateSelected}></Modal>
66+
<Modal bind:show={showSelectProject} title={'Manage projects'} onSubmit={updateSelected}>
6767
<svelte:fragment slot="description">
6868
Choose which two projects to keep. Projects over the limit will be blocked after this date.
6969
</svelte:fragment>
@@ -73,7 +73,7 @@
7373
<Table.Root
7474
let:root
7575
allowSelection
76-
bind:selectedRows={$selectedProjects}
76+
bind:selectedRows={selectedProjects}
7777
columns={[{ id: 'name' }, { id: 'created' }]}>
7878
<svelte:fragment slot="header" let:root>
7979
<Table.Header.Cell column="name" {root}>Project Name</Table.Header.Cell>
@@ -87,24 +87,24 @@
8787
</Table.Row.Base>
8888
{/each}
8989
</Table.Root>
90-
{#if $selectedProjects.length > 2}
90+
{#if selectedProjects.length > 2}
9191
<div class="u-text-warning u-mb-4">
9292
You can only select two projects. Please deselect others to continue.
9393
</div>
9494
{/if}
95-
{#if $selectedProjects.length === 2}
95+
{#if selectedProjects.length === 2}
9696
<Alert.Inline
9797
status="warning"
98-
title={`${projects.length - $selectedProjects.length} projects will be archived on ${billingProjectsLimitDate}`}>
98+
title={`${projects.length - selectedProjects.length} projects will be archived on ${billingProjectsLimitDate}`}>
9999
<span>
100-
{@html formatProjectsToArchive(projectsToArchive)}
100+
{@html formatProjectsToArchive()}
101101
will be archived.
102102
</span>
103103
</Alert.Inline>
104104
{/if}
105105
<svelte:fragment slot="footer">
106-
<Button.Button size="s" variant="secondary" on:click={() => ($showSelectProject = false)}
106+
<Button.Button size="s" variant="secondary" on:click={() => (showSelectProject = false)}
107107
>Cancel</Button.Button>
108-
<Button.Button size="s" disabled={$selectedProjects.length !== 2}>Save</Button.Button>
108+
<Button.Button size="s" disabled={selectedProjects.length !== 2}>Save</Button.Button>
109109
</svelte:fragment>
110110
</Modal>

0 commit comments

Comments
 (0)