diff --git a/src/lib/actions/analytics.ts b/src/lib/actions/analytics.ts index 84c178cc46..b9724ff751 100644 --- a/src/lib/actions/analytics.ts +++ b/src/lib/actions/analytics.ts @@ -131,6 +131,7 @@ export enum Submit { ProjectCreate = 'submit_project_create', ProjectDelete = 'submit_project_delete', ProjectUpdateName = 'submit_project_update_name', + ProjectUpdateTeam = 'submit_project_update_team', ProjectService = 'submit_project_service', MemberCreate = 'submit_member_create', MemberDelete = 'submit_member_delete', diff --git a/src/routes/console/project-[project]/settings/+page.svelte b/src/routes/console/project-[project]/settings/+page.svelte index cf8659329c..cbd241faed 100644 --- a/src/routes/console/project-[project]/settings/+page.svelte +++ b/src/routes/console/project-[project]/settings/+page.svelte @@ -3,10 +3,18 @@ import { onMount } from 'svelte'; import { toLocaleDateTime } from '$lib/helpers/date'; import { addNotification } from '$lib/stores/notifications'; + import { organizationList } from '$lib/stores/organization'; import { project } from '../store'; import { services, type Service } from '$lib/stores/project-services'; import { CardGrid, CopyInput, Box, Heading } from '$lib/components'; - import { Button, Form, FormList, InputText, InputSwitch } from '$lib/elements/forms'; + import { + Button, + Form, + FormList, + InputText, + InputSwitch, + InputSelect + } from '$lib/elements/forms'; import { Container } from '$lib/layout'; import { invalidate } from '$app/navigation'; import { Dependencies } from '$lib/constants'; @@ -14,14 +22,18 @@ import { base } from '$app/paths'; import { page } from '$app/stores'; import { Submit, trackEvent, trackError } from '$lib/actions/analytics'; + import Transfer from './transferProject.svelte'; let name: string = null; + let teamId: string = null; let showDelete = false; + let showTransfer = false; const endpoint = sdk.forConsole.client.config.endpoint; const projectId = $page.params.project; onMount(async () => { name ??= $project.name; + teamId ??= $project.teamId; }); async function updateName() { @@ -137,7 +149,30 @@ + + Transfer project +

Transfer your project to another organization that you own.

+ + + ({ + value: team.$id, + label: team.name + }))} /> + + + + + + +
Delete Project @@ -163,3 +198,9 @@ +{#if teamId} + t.$id == teamId).name} + bind:show={showTransfer} /> +{/if} diff --git a/src/routes/console/project-[project]/settings/transferProject.svelte b/src/routes/console/project-[project]/settings/transferProject.svelte new file mode 100644 index 0000000000..9e16d56117 --- /dev/null +++ b/src/routes/console/project-[project]/settings/transferProject.svelte @@ -0,0 +1,59 @@ + + + + Transfer project +

Are you sure you want to transfer {$project.name} to {teamName}?

+

+ Members who are not part of the destination organization must be invited to gain access to + this project. +

+ + + + + +