Skip to content

Commit d62effd

Browse files
Merge branch 'feat-profiles' of https://github.com/appwrite/console into feat-profiles
2 parents cb15bb9 + c86838c commit d62effd

28 files changed

Lines changed: 225 additions & 109 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@
9292

9393
<Modal bind:show={showSelectProject} title="Manage projects" onSubmit={updateSelected}>
9494
<svelte:fragment slot="description">
95-
Choose which {$currentPlan?.projects || 2} projects to keep. Projects over the limit will be
96-
blocked after this date.
95+
Choose which {$currentPlan?.projects || 2} projects to keep. Projects over the limit will be blocked
96+
after this date.
9797
</svelte:fragment>
9898

9999
{#if loading}

src/lib/components/logs/logsResponse.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@
143143
{:else}
144144
<Card padding="xs" radius="s">
145145
<Typography.Text>
146-
Body data is not captured by {resolvedProfile.platform} for your user's security
147-
and privacy. To display body data in the Logs tab, use <InlineCode
146+
Body data is not captured by {resolvedProfile.platform} for your user's security and
147+
privacy. To display body data in the Logs tab, use <InlineCode
148148
code="context.log()"
149149
size="s" />. <Link external {href} variant="muted">Learn more</Link>.
150150
</Typography.Text>

src/lib/studio/studio-widget.ts

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -331,13 +331,25 @@ export async function initImagine(
331331
props: {}
332332
},
333333
onNavigate(route) {
334-
if (route.id === 'project') {
335-
goto(
336-
resolve('/(console)/project-[region]-[project]/(studio)/studio', {
337-
region: route.props.region,
338-
project: route.props.projectId
339-
})
340-
);
334+
switch (route.id) {
335+
case 'project':
336+
goto(
337+
resolve('/(console)/project-[region]-[project]/(studio)/studio', {
338+
region: route.props.region,
339+
project: route.props.projectId
340+
})
341+
);
342+
break;
343+
case 'view':
344+
goto(
345+
resolve('/(console)/(redirects)/template/[template]', {
346+
template: route.props.projectId
347+
})
348+
);
349+
break;
350+
case 'home':
351+
goto(resolve('/'));
352+
break;
341353
}
342354
}
343355
});

src/routes/(console)/(migration-wizard)/resource-form.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@
129129
{#if report && !isVersionAtLeast(version, '1.4.0') && $provider.provider === 'appwrite'}
130130
<Alert.Inline status="warning">
131131
<svelte:fragment slot="title">Functions not available for import</svelte:fragment>
132-
To migrate your functions, update the version of the {resolvedProfile.platform} instance
133-
you're importing from to a version newer than 1.4
132+
To migrate your functions, update the version of the {resolvedProfile.platform} instance you're
133+
importing from to a version newer than 1.4
134134
</Alert.Inline>
135135
{/if}
136136

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { redirect } from '@sveltejs/kit';
2-
import { base } from '$app/paths';
2+
import { resolve } from '$app/paths';
33
import type { PageLoad } from './$types';
44
import { resolvedProfile } from '$lib/profiles/index.svelte';
55

@@ -9,7 +9,12 @@ export const load: PageLoad = async ({ parent }) => {
99
const teamId =
1010
account.prefs[resolvedProfile.organizationPrefKey] ?? organizations.teams[0]?.$id;
1111
if (teamId) {
12-
redirect(303, `${base}/organization-${teamId}/members`);
12+
redirect(
13+
303,
14+
resolve('/(console)/organization-[organization]/members', {
15+
organization: teamId
16+
})
17+
);
1318
}
14-
redirect(303, base);
19+
redirect(303, resolve('/'));
1520
};
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { redirect } from '@sveltejs/kit';
2+
import { resolve } from '$app/paths';
3+
import type { PageLoad } from './$types';
4+
import { resolvedProfile } from '$lib/profiles/index.svelte';
5+
6+
export const load: PageLoad = async ({ parent, params }) => {
7+
const { organizations, account } = await parent();
8+
9+
const teamId =
10+
account.prefs[resolvedProfile.organizationPrefKey] ?? organizations.teams[0]?.$id;
11+
if (teamId) {
12+
redirect(
13+
303,
14+
resolve(
15+
'/(console)/organization-[organization]/(studio)/template-[region]-[template]',
16+
{
17+
organization: teamId,
18+
template: params.template,
19+
region: 'fra'
20+
}
21+
)
22+
);
23+
}
24+
redirect(303, resolve('/'));
25+
};
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<script lang="ts">
2+
import { onDestroy, onMount, tick } from 'svelte';
3+
import {
4+
attachStudioTo,
5+
ensureStudioComponent,
6+
hideStudio,
7+
navigateToRoute
8+
} from '$lib/studio/studio-widget';
9+
import { resolvedProfile } from '$lib/profiles/index.svelte';
10+
11+
let { params } = $props();
12+
let anchor: HTMLElement = $state();
13+
14+
function positionStudio() {
15+
if (!anchor) return;
16+
attachStudioTo(anchor, { offsetX: 0, offsetY: 0 });
17+
}
18+
19+
onMount(async () => {
20+
ensureStudioComponent();
21+
await tick();
22+
positionStudio();
23+
navigateToRoute({
24+
id: 'view',
25+
props: {
26+
projectId: params.template,
27+
region: params.region
28+
}
29+
});
30+
});
31+
32+
onDestroy(() => {
33+
hideStudio();
34+
});
35+
36+
$effect(() => {
37+
positionStudio();
38+
});
39+
</script>
40+
41+
<svelte:head>
42+
<title>Template - {resolvedProfile.platform}</title>
43+
</svelte:head>
44+
45+
<div class="studio-page" bind:this={anchor}></div>
46+
47+
<style>
48+
.studio-page {
49+
position: relative;
50+
width: 100%;
51+
background: var(--bgcolor-neutral-primary);
52+
}
53+
</style>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@
8181
<svelte:fragment slot="title">Billing alerts</svelte:fragment>
8282
{#if !currentPlan.budgeting}
8383
Get notified by email when your organization meets a percentage of your budget cap. <b
84-
>{tierToPlan(organization.billingPlan).name} organizations will receive one notification
85-
at 75% resource usage.</b>
84+
>{tierToPlan(organization.billingPlan).name} organizations will receive one notification at
85+
75% resource usage.</b>
8686
{:else}
8787
Get notified by email when your organization meets or exceeds a percentage of your specified
8888
billing alert(s).

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
<Form onSubmit={updateBudget}>
5151
<CardGrid>
5252
<svelte:fragment slot="title">Budget cap</svelte:fragment>
53-
Restrict your resource usage by setting a budget cap. Cap usage is reset at the beginning of
54-
each billing cycle.
53+
Restrict your resource usage by setting a budget cap. Cap usage is reset at the beginning of each
54+
billing cycle.
5555
<svelte:fragment slot="aside">
5656
{#if !currentPlan.budgeting}
5757
<Alert.Inline status="info" title="Budget caps are a Pro plan feature">

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@
8181

8282
<CardGrid>
8383
<svelte:fragment slot="title">Delete organization</svelte:fragment>
84-
The organization will be permanently deleted, including all projects and data associated
85-
with this organization. This action is irreversible.
84+
The organization will be permanently deleted, including all projects and data associated with
85+
this organization. This action is irreversible.
8686
<svelte:fragment slot="aside">
8787
<BoxAvatar>
8888
<svelte:fragment slot="image">

0 commit comments

Comments
 (0)