From 6a10e22c4aa6d222736644dcadd8caae1125fdde Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 19 Feb 2025 14:53:27 +0100 Subject: [PATCH 1/7] various fixes --- package.json | 4 +- pnpm-lock.yaml | 28 +- src/lib/components/avatarGroup.svelte | 4 +- src/lib/components/roles/base.svelte | 17 +- src/lib/components/roles/upgrade.svelte | 94 +++--- src/lib/components/tab.svelte | 2 + src/lib/elements/forms/inputSelect.svelte | 1 + .../(console)/account/sessions/+page.svelte | 2 +- .../organization-[organization]/+page.svelte | 45 ++- .../createMember.svelte | 34 +- .../createProject.svelte | 30 +- .../members/+page.svelte | 129 ++++---- .../settings/+page.svelte | 15 +- .../settings/deleteOrganizationModal.svelte | 201 ++++++------ .../project-[project]/overview/+layout.svelte | 295 ++++++++++-------- .../overview/bandwidth.svelte | 47 +-- .../overview/platforms/+page.svelte | 80 +++-- .../overview/platforms/action.svelte | 55 +++- .../overview/realtime.svelte | 8 +- .../overview/requests.svelte | 40 ++- src/themes/light-cloud.json | 2 +- src/themes/light.json | 2 +- 22 files changed, 603 insertions(+), 532 deletions(-) diff --git a/package.json b/package.json index 1b65b2542..fae9d8bf6 100644 --- a/package.json +++ b/package.json @@ -21,9 +21,9 @@ "dependencies": { "@appwrite.io/console": "https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@ae1eb53", "@appwrite.io/pink-icons": "0.25.0", - "@appwrite.io/pink-icons-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@35f29290", + "@appwrite.io/pink-icons-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@2ff4e332", "@appwrite.io/pink-legacy": "^1.0.1", - "@appwrite.io/pink-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@35f29290", + "@appwrite.io/pink-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@2ff4e332", "@popperjs/core": "^2.11.8", "@sentry/sveltekit": "^8.38.0", "@stripe/stripe-js": "^3.5.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6bfda9144..377b7d110 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,14 +15,14 @@ importers: specifier: 0.25.0 version: 0.25.0 '@appwrite.io/pink-icons-svelte': - specifier: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@35f29290 - version: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@35f29290(svelte@4.2.19) + specifier: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@2ff4e332 + version: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@2ff4e332(svelte@4.2.19) '@appwrite.io/pink-legacy': specifier: ^1.0.1 version: 1.0.1 '@appwrite.io/pink-svelte': - specifier: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@35f29290 - version: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@35f29290(react-dom@18.3.1(react@18.3.1))(svelte@4.2.19) + specifier: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@2ff4e332 + version: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@2ff4e332(react-dom@18.3.1(react@18.3.1))(svelte@4.2.19) '@popperjs/core': specifier: ^2.11.8 version: 2.11.8 @@ -215,14 +215,14 @@ packages: resolution: {tarball: https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@ae1eb53} version: 1.2.1 - '@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@35f29290': - resolution: {tarball: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@35f29290} + '@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@2ff4e332': + resolution: {tarball: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@2ff4e332} version: 1.0.0-next.7 peerDependencies: svelte: ^4.0.0 - '@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@35f2929064b9d126a377b6a3e85f59198c5901a2': - resolution: {tarball: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@35f2929064b9d126a377b6a3e85f59198c5901a2} + '@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@2ff4e332a9fec20d8ed842170634ede486bda8df': + resolution: {tarball: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@2ff4e332a9fec20d8ed842170634ede486bda8df} version: 1.0.0-next.7 peerDependencies: svelte: ^4.0.0 @@ -236,8 +236,8 @@ packages: '@appwrite.io/pink-legacy@1.0.1': resolution: {integrity: sha512-e5IZx2drqSxgl2WXvmr0eLfg/WiOCzuqQE8oksD+9GoFBkcL9HWvXul5GjFni3RBAN9XFRL3nUExGk4T0H8sFw==} - '@appwrite.io/pink-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@35f29290': - resolution: {tarball: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@35f29290} + '@appwrite.io/pink-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@2ff4e332': + resolution: {tarball: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@2ff4e332} version: 1.0.0-next.85 peerDependencies: react-dom: ^18.0.0 @@ -4099,11 +4099,11 @@ snapshots: '@appwrite.io/console@https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@ae1eb53': {} - '@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@35f29290(svelte@4.2.19)': + '@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@2ff4e332(svelte@4.2.19)': dependencies: svelte: 4.2.19 - '@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@35f2929064b9d126a377b6a3e85f59198c5901a2(svelte@4.2.19)': + '@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@2ff4e332a9fec20d8ed842170634ede486bda8df(svelte@4.2.19)': dependencies: svelte: 4.2.19 @@ -4116,9 +4116,9 @@ snapshots: '@appwrite.io/pink-icons': 1.0.0 the-new-css-reset: 1.11.3 - '@appwrite.io/pink-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@35f29290(react-dom@18.3.1(react@18.3.1))(svelte@4.2.19)': + '@appwrite.io/pink-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@2ff4e332(react-dom@18.3.1(react@18.3.1))(svelte@4.2.19)': dependencies: - '@appwrite.io/pink-icons-svelte': https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@35f2929064b9d126a377b6a3e85f59198c5901a2(svelte@4.2.19) + '@appwrite.io/pink-icons-svelte': https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@2ff4e332a9fec20d8ed842170634ede486bda8df(svelte@4.2.19) '@floating-ui/dom': 1.6.13 '@melt-ui/pp': 0.3.2(@melt-ui/svelte@0.86.3(svelte@4.2.19))(svelte@4.2.19) '@melt-ui/svelte': 0.86.3(svelte@4.2.19) diff --git a/src/lib/components/avatarGroup.svelte b/src/lib/components/avatarGroup.svelte index 6c19d6b05..499cd5e95 100644 --- a/src/lib/components/avatarGroup.svelte +++ b/src/lib/components/avatarGroup.svelte @@ -24,7 +24,9 @@ {#if total > 2} - +{total - 2} + + +{total - 2} + {/if} diff --git a/src/lib/components/roles/base.svelte b/src/lib/components/roles/base.svelte index 9e37e47b5..6733ad202 100644 --- a/src/lib/components/roles/base.svelte +++ b/src/lib/components/roles/base.svelte @@ -1,21 +1,10 @@ -
+
diff --git a/src/lib/components/roles/upgrade.svelte b/src/lib/components/roles/upgrade.svelte index 9e5487476..e482387c8 100644 --- a/src/lib/components/roles/upgrade.svelte +++ b/src/lib/components/roles/upgrade.svelte @@ -5,58 +5,62 @@ import { organization } from '$lib/stores/organization'; import { BillingPlan } from '$lib/constants'; import Button from '$lib/elements/forms/button.svelte'; + import { Badge, Layout, Link, Tag, Typography } from '@appwrite.io/pink-svelte'; - {#if isCloud} - {#if $organization?.billingPlan !== BillingPlan.FREE} -
-

- Roles - {#if $organization?.billingPlan === BillingPlan.FREE} - Pro plan - {/if} -

-

Owner, Developer, Editor, Analyst and Billing.

-
-

- about roles. -

- {:else} -
-

- Roles - {#if $organization?.billingPlan === BillingPlan.FREE} - Pro plan - {/if} -

-

+ + {#if isCloud} + {#if $organization?.billingPlan !== BillingPlan.FREE} + Roles + Owner, Developer, Editor, Analyst and Billing. + + Learn more + + {:else} + + + Roles + + + + Upgrade to Pro to assign new roles to members such as Owner, Developer, Editor or Analyst. + + +

+ +

-
+ {/if} + {:else} + + + Roles + + + + + Upgrade to Cloud to assign new roles to members or ask us about our enterprise self + hosted offering. +

- - + +

{/if} - {:else} -
-

- Roles - Appwrite Cloud -

-

- Upgrade to Cloud to assign new roles to members or ask us about our entriprise self - hosted offering. -

-
-

- - -

- {/if} + diff --git a/src/lib/components/tab.svelte b/src/lib/components/tab.svelte index 9ca8c022a..70a7e05f1 100644 --- a/src/lib/components/tab.svelte +++ b/src/lib/components/tab.svelte @@ -10,6 +10,7 @@ export let selected = false; export let href: string = null; export let event: string = null; + export let noscroll = false; export let root: { variant: Variant; stretch: boolean } = { variant: 'primary', stretch: false @@ -87,6 +88,7 @@ {#if href} - {#if member.invited && !member.joined} - + {/if} @@ -121,49 +124,41 @@ {#if $isOwner} - - { - e.preventDefault(); - showDropdown[index] = !showDropdown[index]; - }}> - + + + - - { - selectedMember = member; - showEdit = true; - showDropdown[index] = false; - }}> - Edit role - - {#if member.invited && !member.joined} - + + { - resend(member); + selectedMember = member; + showEdit = true; showDropdown[index] = false; }}> - Resend - - {/if} - { - selectedMember = member; - showDelete = true; - showDropdown[index] = false; - }}> - Remove - - - + Edit role + + {#if member.invited && !member.joined} + { + resend(member); + }}> + Resend + + {/if} + { + selectedMember = member; + showDelete = true; + }}> + Remove + + +
+ {/if} diff --git a/src/routes/(console)/organization-[organization]/settings/+page.svelte b/src/routes/(console)/organization-[organization]/settings/+page.svelte index 59bb50f98..0788e3092 100644 --- a/src/routes/(console)/organization-[organization]/settings/+page.svelte +++ b/src/routes/(console)/organization-[organization]/settings/+page.svelte @@ -53,14 +53,13 @@ Name -
    - -
+
diff --git a/src/routes/(console)/organization-[organization]/settings/deleteOrganizationModal.svelte b/src/routes/(console)/organization-[organization]/settings/deleteOrganizationModal.svelte index 95ff127d9..52bc80b28 100644 --- a/src/routes/(console)/organization-[organization]/settings/deleteOrganizationModal.svelte +++ b/src/routes/(console)/organization-[organization]/settings/deleteOrganizationModal.svelte @@ -1,6 +1,6 @@ -
- - {#if upcomingInvoice} - - - You have a pending {formatCurrency(upcomingInvoice.grossAmount)} invoice for your - {tierToPlan(upcomingInvoice.plan).name} plan - -

- By proceeding, your invoice will be processed within the hour. Upon successful - payment, your organization will be deleted. -

-
- {/if} - -

- {#if $projects.total > 0} - The following projects and all data associated with {$organization.name} will - be permanently deleted. This action is irreversible. - {:else} - All data associated with {$organization.name} will be permanently deleted. - This action is irreversible. - {/if} -

+ + {#if upcomingInvoice} + + By proceeding, your invoice will be processed within the hour. Upon successful payment, + your organization will be deleted. + + {/if} +

{#if $projects.total > 0} -

- - {#each tabs as { name, label, total }} - (selectedTab = name)}> - {label.desktop} ({total}) - - {/each} - - - - - {#each tabData.headers as header} - {header} - {/each} - - - {#each tabData.rows as row} - - {#each row.cells as cell} - {cell} - {/each} - - {/each} - - -
-
- - {#each tabs as { name, label, total }} - (selectedTab = name)}> - {label.mobile} ({total}) - - {/each} - - - - - {#each tabData.headers as header, index} - {header} - {/each} - - - {#each tabData.rows as row} - - {#each row.cells as cell, index} - {cell} - {/each} - - {/each} - - -
+ The following projects and all data associated with {$organization.name} will be + permanently deleted. This action is irreversible. + {:else} + All data associated with {$organization.name} will be permanently deleted. + This action is irreversible. {/if} +

- - - + {#if $projects.total > 0} + + {#each tabs as { name, label, total }} + (selectedTab = name)} + active={selectedTab === name}> + {label.desktop} ({total}) + + {/each} + - - - - -
-
+ + + {#each tabData.headers as header} + {header} + {/each} + + {#each tabData.rows as row} + + {#each row.cells as cell} + {cell} + {/each} + + {/each} + +
+ + {#each tabs as { name, label, total }} + (selectedTab = name)}> + {label.mobile} ({total}) + + {/each} + + + + + {#each tabData.headers as header, index} + {header} + {/each} + + + {#each tabData.rows as row} + + {#each row.cells as cell, index} + {cell} + {/each} + + {/each} + + +
+ {/if} + + + + + + diff --git a/src/routes/(console)/project-[project]/overview/bandwidth.svelte b/src/routes/(console)/project-[project]/overview/bandwidth.svelte index a6e1b53c9..8f4924671 100644 --- a/src/routes/(console)/project-[project]/overview/bandwidth.svelte +++ b/src/routes/(console)/project-[project]/overview/bandwidth.svelte @@ -1,16 +1,16 @@ -
+
-
+ {bandwidth.value} {bandwidth.unit} -
-
Bandwidth
+ + Bandwidth
- - - - dispatch('change', '24h')}>24h - dispatch('change', '30d')}>30d - dispatch('change', '90d')}>90d + + + + {period} + + + + + + dispatch('change', '24h')} + >24h + dispatch('change', '30d')} + >30d + dispatch('change', '90d')} + >90d + - -
+ + {#if bandwidth.value !== '0'}
{:else} -
-
- {#if $app.themeInUse === 'dark'} - - {:else} - - {/if} - -
- Create a platform to get started. -

- Need a hand? Learn more in our documentation. -

-
-
- - - {#if $canWritePlatforms} - - {/if} - - addPlatform(Platform.Flutter)}> + + + + + + {#if $canWritePlatforms} + + {/if} +
+ + addPlatform(Platform.Flutter)} + leadingIcon={IconFlutter}> Flutter - - addPlatform(Platform.Android)}> + + addPlatform(Platform.Android)} + leadingIcon={IconAndroid}> Android - - addPlatform(Platform.Apple)}> + + addPlatform(Platform.Apple)} + leadingIcon={IconApple}> Apple - - addPlatform(Platform.ReactNative)}> + + addPlatform(Platform.ReactNative)} + leadingIcon={IconReact}> React Native - - - -
- -
-
+ + +
+ +
+ + {/if} diff --git a/src/routes/(console)/project-[project]/overview/platforms/action.svelte b/src/routes/(console)/project-[project]/overview/platforms/action.svelte index 7e2b723ce..214bf8276 100644 --- a/src/routes/(console)/project-[project]/overview/platforms/action.svelte +++ b/src/routes/(console)/project-[project]/overview/platforms/action.svelte @@ -3,25 +3,50 @@ import DropListItem from '$lib/components/dropListItem.svelte'; import Button from '$lib/elements/forms/button.svelte'; import { canWritePlatforms } from '$lib/stores/roles'; - import { Icon } from '@appwrite.io/pink-svelte'; + import { ActionMenu, Icon, Popover } from '@appwrite.io/pink-svelte'; import { addPlatform, Platform } from './+page.svelte'; - import { IconPlus } from '@appwrite.io/pink-icons-svelte'; + import { + IconAndroid, + IconApple, + IconFlutter, + IconPlus, + IconReact + } from '@appwrite.io/pink-icons-svelte'; let showDropdown = false; {#if $canWritePlatforms} - - - - addPlatform(Platform.Flutter)}>Flutter app - addPlatform(Platform.Android)}>Android app - addPlatform(Platform.Apple)}>Apple app - addPlatform(Platform.ReactNative)} - >React Native app - - + + {#if $canWritePlatforms} + + {/if} +
+ + addPlatform(Platform.Flutter)} + leadingIcon={IconFlutter}> + Flutter + + addPlatform(Platform.Android)} + leadingIcon={IconAndroid}> + Android + + addPlatform(Platform.Apple)} + leadingIcon={IconApple}> + Apple + + addPlatform(Platform.ReactNative)} + leadingIcon={IconReact}> + React Native + + +
+
{/if} diff --git a/src/routes/(console)/project-[project]/overview/realtime.svelte b/src/routes/(console)/project-[project]/overview/realtime.svelte index 852065d0b..14b5f50f3 100644 --- a/src/routes/(console)/project-[project]/overview/realtime.svelte +++ b/src/routes/(console)/project-[project]/overview/realtime.svelte @@ -3,6 +3,7 @@ import { BarChart } from '$lib/charts'; import { Card } from '$lib/components'; import { formatNum } from '$lib/helpers/string'; + import { Link, Typography } from '@appwrite.io/pink-svelte'; import { stats } from '../store'; $: projectId = $page.params.project; @@ -34,12 +35,11 @@ class="icon-chart-square-bar text-large" aria-hidden="true" style="font-size: 32px;" /> -

No data to show

- No data to show + Get started with Realtime + rel="noopener noreferrer">Get started with Realtime {/if} diff --git a/src/routes/(console)/project-[project]/overview/requests.svelte b/src/routes/(console)/project-[project]/overview/requests.svelte index 7fe57efda..c9f940532 100644 --- a/src/routes/(console)/project-[project]/overview/requests.svelte +++ b/src/routes/(console)/project-[project]/overview/requests.svelte @@ -6,6 +6,8 @@ import { createEventDispatcher } from 'svelte'; import { LineChart } from '$lib/charts'; import { formatNum } from '$lib/helpers/string'; + import { ActionMenu, Icon, Layout, Link, Popover, Typography } from '@appwrite.io/pink-svelte'; + import { IconChevronDown } from '@appwrite.io/pink-icons-svelte'; export let period: UsagePeriods; @@ -23,25 +25,31 @@ } -
+
-
+ {formatNum(totalMetrics($usage?.requests))} -
-
Requests
+ + Requests
- - - - dispatch('change', '24h')}>24h - dispatch('change', '30d')}>30d - dispatch('change', '90d')}>90d - - -
+ + + + {period} + + + + + dispatch('change', '24h')} + >24h + dispatch('change', '30d')} + >30d + dispatch('change', '90d')} + >90d + + + + {#if totalMetrics($usage?.requests) !== 0}
Date: Wed, 19 Feb 2025 16:46:37 +0100 Subject: [PATCH 2/7] Only highlight settings when on the actual project settings page --- src/lib/components/sidebar.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/components/sidebar.svelte b/src/lib/components/sidebar.svelte index 0f1b3ecca..aed4df6a1 100644 --- a/src/lib/components/sidebar.svelte +++ b/src/lib/components/sidebar.svelte @@ -66,6 +66,7 @@ $: state = $isTabletViewport ? 'closed' : getSidebarState(); $: pathname = $page.url.pathname; + $: isOnProjectSettings = /^\/console\/project-[a-zA-Z0-9-]+\/settings$/.test(pathname); const projectOptions = [ { name: 'Auth', icon: IconUserGroup, slug: 'auth' }, @@ -232,7 +233,7 @@ Date: Thu, 20 Feb 2025 10:29:10 +0100 Subject: [PATCH 3/7] Add onboarding hub analytics --- .../project-[project]/overview/header.svelte | 2 + .../project-[project]/overview/onboard.svelte | 56 +++++++++++++++++-- .../overview/platforms/+page.svelte | 9 +++ 3 files changed, 63 insertions(+), 4 deletions(-) diff --git a/src/routes/(console)/project-[project]/overview/header.svelte b/src/routes/(console)/project-[project]/overview/header.svelte index be16c1b39..d3251dceb 100644 --- a/src/routes/(console)/project-[project]/overview/header.svelte +++ b/src/routes/(console)/project-[project]/overview/header.svelte @@ -10,6 +10,7 @@ import { user } from '$lib/stores/user'; import { isSmallViewport } from '$lib/stores/viewport'; import { Dependencies } from '$lib/constants'; + import { trackEvent } from '$lib/actions/analytics'; {#if !$page.url.pathname.includes('get-started')} @@ -45,6 +46,7 @@ variant="secondary" size="s" on:click={async () => { + trackEvent('onboarding_hub_platform_dismiss'); await setHasOnboardingDismissed($project.$id); goto(`${base}/project-${$project.$id}/overview`); requestAnimationFrame(() => { diff --git a/src/routes/(console)/project-[project]/overview/onboard.svelte b/src/routes/(console)/project-[project]/overview/onboard.svelte index feeb49746..4c191ff50 100644 --- a/src/routes/(console)/project-[project]/overview/onboard.svelte +++ b/src/routes/(console)/project-[project]/overview/onboard.svelte @@ -37,8 +37,15 @@ import { AvatarGroup } from '$lib/components'; import type { Models } from '@appwrite.io/console'; import { getPlatformInfo } from '$lib/helpers/platform'; + import { trackEvent } from '$lib/actions/analytics'; + import { redirect } from '@sveltejs/kit'; + import { goto } from '$app/navigation'; function createKey() { + trackEvent('onboarding_hub_platform', { + platform: 'server', + state: 'add' + }); wizard.start(Wizard); } @@ -386,7 +393,12 @@ - addPlatform(0)} padding="s" + { + trackEvent('onboarding_hub_setup_databases'); + goto(`${base}/project-${projectId}/databases`); + }} + padding="s" >
{ + trackEvent( + 'onboarding_hub_api_references' + ); + }} target="_blank">API references { + trackEvent('onboarding_hub_tutorials'); + }} target="_blank">Tutorials { + trackEvent( + 'onboarding_hub_storage_quick_start' + ); + }} target="_blank" >Storage quick start { + trackEvent( + 'onboarding_hub_functions_quick_start' + ); + }} target="_blank" >Functions quick start @@ -458,16 +488,29 @@ { + trackEvent( + 'onboarding_hub_auth_email_password' + ); + }} >E-mail and password OAuth 2 + on:click={() => { + trackEvent( + 'onboarding_hub_auth_oauth2' + ); + }}>OAuth 2 View all methods + on:click={() => { + trackEvent( + 'onboarding_hub_auth_all_methods' + ); + }}>View all methods
- + { + trackEvent('onboarding_hub_discord'); + }}>
diff --git a/src/routes/(console)/project-[project]/overview/platforms/+page.svelte b/src/routes/(console)/project-[project]/overview/platforms/+page.svelte index f6b27c860..83943e974 100644 --- a/src/routes/(console)/project-[project]/overview/platforms/+page.svelte +++ b/src/routes/(console)/project-[project]/overview/platforms/+page.svelte @@ -8,6 +8,7 @@ import CreateReactNative from './createReactNative.svelte'; import CreateWeb from './createWeb.svelte'; import { createPlatform, versions } from './wizard/store'; + import { trackEvent } from '$lib/actions/analytics'; export enum Platform { Web, @@ -20,6 +21,10 @@ export async function addPlatform(type: Platform) { await versions.load(); createPlatform.reset(); + trackEvent('onboarding_hub_platform', { + platform: platforms[type], + state: 'add' + }); wizard.start(platforms[type]); } @@ -35,6 +40,10 @@ key: key, type: type }); + trackEvent('onboarding_hub_platform', { + platform: platforms[platform], + state: 'continue' + }); wizard.start(platforms[platform], null, 1, { isPlatformCreated: true, platform: type, From 002bbca8a676632f52bc2e64c545c676de629e08 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Thu, 20 Feb 2025 10:29:17 +0100 Subject: [PATCH 4/7] Remove unused page --- src/routes/(console)/onboarding/+page.svelte | 149 ------------------- 1 file changed, 149 deletions(-) delete mode 100644 src/routes/(console)/onboarding/+page.svelte diff --git a/src/routes/(console)/onboarding/+page.svelte b/src/routes/(console)/onboarding/+page.svelte deleted file mode 100644 index e4c1f1ae7..000000000 --- a/src/routes/(console)/onboarding/+page.svelte +++ /dev/null @@ -1,149 +0,0 @@ - - - - - Create a new organization -
- - - {#if isCloud} -
-

Plan

-

- For more details on our plans, visit our . -

- - - -
- {/if} - -
-
-
-
From b370e12677a1b43152e2e544e1d087f9c9aad2a9 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Thu, 20 Feb 2025 10:49:33 +0100 Subject: [PATCH 5/7] Add support and feedback events --- src/lib/components/sidebar.svelte | 34 ++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/src/lib/components/sidebar.svelte b/src/lib/components/sidebar.svelte index aed4df6a1..d73c49992 100644 --- a/src/lib/components/sidebar.svelte +++ b/src/lib/components/sidebar.svelte @@ -34,6 +34,7 @@ import MobileFeedbackModal from '$routes/(console)/wizard/feedback/mobileFeedbackModal.svelte'; import { getSidebarState, updateSidebarState } from '$lib/helpers/sidebar'; import { isTabletViewport } from '$lib/stores/viewport'; + import { trackEvent } from '$lib/actions/analytics'; type $$Props = HTMLElement & { state?: 'closed' | 'open' | 'icons'; @@ -112,6 +113,7 @@ class="progress-card" href={`/console/project-${project.$id}/get-started`} on:click={() => { + trackEvent('click_menu_get_started'); sideBarIsOpen = false; }}>
@@ -139,6 +141,7 @@ class="link" class:active={pathname.includes('overview')} on:click={() => { + trackEvent('click_menu_overview'); sideBarIsOpen = false; }} > { + trackEvent(`click_menu_${projectOption.slug}`); sideBarIsOpen = false; }} >
- { + trackEvent('click_menu_settings'); + }} + class="link" > toggleFeedback()} + on:click={() => { + toggleFeedback(); + trackEvent('click_menu_feedback'); + }} >Feedback @@ -213,7 +225,10 @@ ($showSupportModal = true)}> + on:click={() => { + $showSupportModal = true; + trackEvent('click_menu_support'); + }}> Support @@ -233,6 +248,9 @@ { + trackEvent('click_menu_settings'); + }} class:active={isOnProjectSettings} > toggleFeedback()} + on:click={() => { + toggleFeedback(); + trackEvent('click_menu_feedback'); + }} >Feedback @@ -264,7 +285,10 @@ ($showSupportModal = true)}> + on:click={() => { + $showSupportModal = true; + trackEvent('click_menu_support'); + }}> Support From 037bf4627ba87a0e10e02d2232f06d4881836314 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Thu, 20 Feb 2025 10:58:16 +0100 Subject: [PATCH 6/7] Add more analytics events --- src/lib/components/navbar.svelte | 24 ++++++++++++++++++++++-- src/lib/components/sidebar.svelte | 8 ++++---- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/lib/components/navbar.svelte b/src/lib/components/navbar.svelte index 0585199b5..bf6947be6 100644 --- a/src/lib/components/navbar.svelte +++ b/src/lib/components/navbar.svelte @@ -44,6 +44,7 @@ import { isTabletViewport } from '$lib/stores/viewport'; import { isCloud } from '$lib/system.js'; import { user } from '$lib/stores/user'; + import { trackEvent } from '$lib/actions/analytics'; let showSupport = false; @@ -68,6 +69,10 @@ : 'light' : theme; + trackEvent('select_theme', { + value: theme === 'auto' ? 'system' : theme + }); + app.update(() => ({ themeInUse: themeInUse, theme: theme @@ -130,12 +135,24 @@ { + trackEvent('click_organization_upgrade', { + from: 'button', + source: 'top_nav' + }); + }} href={`${base}/organization-${currentOrg.$id}/change-plan`} >Upgrade {/if} - toggleFeedback()} + { + toggleFeedback(); + trackEvent('click_menu_feedback', { source: 'top_nav' }); + }} >Feedback @@ -152,7 +169,10 @@ (showSupport = !showSupport)}> + on:click={() => { + showSupport = !showSupport; + trackEvent('click_menu_support', { source: 'top_nav' }); + }}> Support diff --git a/src/lib/components/sidebar.svelte b/src/lib/components/sidebar.svelte index d73c49992..b9462140a 100644 --- a/src/lib/components/sidebar.svelte +++ b/src/lib/components/sidebar.svelte @@ -212,7 +212,7 @@ size="s" on:click={() => { toggleFeedback(); - trackEvent('click_menu_feedback'); + trackEvent('click_menu_feedback', { source: 'side_nav' }); }} >Feedback @@ -227,7 +227,7 @@ size="s" on:click={() => { $showSupportModal = true; - trackEvent('click_menu_support'); + trackEvent('click_menu_support', { source: 'side_nav' }); }}> Support @@ -272,7 +272,7 @@ size="s" on:click={() => { toggleFeedback(); - trackEvent('click_menu_feedback'); + trackEvent('click_menu_feedback', { source: 'side_nav' }); }} >Feedback @@ -287,7 +287,7 @@ size="s" on:click={() => { $showSupportModal = true; - trackEvent('click_menu_support'); + trackEvent('click_menu_support', { source: 'side_nav' }); }}> Support From 12e68ce2b893c9c148f27db8f5933a1c7387ad40 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Thu, 20 Feb 2025 11:02:05 +0100 Subject: [PATCH 7/7] Add personal menu open analytics --- src/lib/components/navbar.svelte | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/components/navbar.svelte b/src/lib/components/navbar.svelte index bf6947be6..2ff8986ec 100644 --- a/src/lib/components/navbar.svelte +++ b/src/lib/components/navbar.svelte @@ -194,6 +194,9 @@ { showAccountMenu = !showAccountMenu; + if (showAccountMenu) { + trackEvent('click_menu_dropdown'); + } }}>