Functions WIP

This commit is contained in:
ernstmul committed 2025-03-05 17:01:10 +01:00
1 parent c7793e1595
commit 97c8c429a5
6 files changed
+22 -4

No files matched your search

+2 -1
View File
@@ -161,7 +161,8 @@ export enum Click {
OnboardingAuthEmailPasswordClick = 'click_onboarding_auth_email_password',
OnboardingAuthOauth2Click = 'click_onboarding_auth_oauth2',
OnboardingAuthAllMethodsClick = 'click_onboarding_auth_all_methods',
OnboardingDiscordClick = 'click_onboarding_discord'
OnboardingDiscordClick = 'click_onboarding_discord',
VariablesCreate = 'click_variable_create'
}
export enum Submit {
@@ -109,6 +109,7 @@
trackEvent(Submit.FunctionCreate, {
source: 'repository',
runtime: runtime,
framework: runtime.key
});
@@ -149,6 +149,7 @@
);
trackEvent(Submit.FunctionCreate, {
runtime: runtime,
source: 'template',
framework: data.template.name
});
@@ -54,6 +54,7 @@
type: 'success'
});
trackEvent(Submit.FunctionCreate, {
runtime: $createFunction.runtime,
customId: !!$createFunction.id
});
wizard.hide();
@@ -32,6 +32,7 @@
import CreateVariableModal from './createVariableModal.svelte';
import DeleteVariableModal from './deleteVariableModal.svelte';
import UpdateVariableModal from './updateVariableModal.svelte';
import { Click, trackEvent } from '$lib/actions/analytics';
export let frameworks: Models.Framework[];
export let selectedFramework: Models.Framework;
@@ -145,7 +146,15 @@
</Button>
</Layout.Stack>
{#if variables?.length}
<Button secondary size="s" on:mousedown={() => (showCreate = true)}>
<Button
secondary
size="s"
on:mousedown={() => {
showCreate = true;
trackEvent(Click.VariablesCreate, {
source: 'site_settings'
});
}}>
<Icon slot="start" icon={IconPlus} /> Create variable
</Button>
{/if}
@@ -5,7 +5,7 @@
import { CardGrid, Empty, Output, PaginationInline } from '$lib/components';
import UploadVariables from './uploadVariablesModal.svelte';
import { invalidate } from '$app/navigation';
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
import { Click, Submit, trackError, trackEvent } from '$lib/actions/analytics';
import { Dependencies } from '$lib/constants';
import { addNotification } from '$lib/stores/notifications';
import { project } from '$routes/(console)/project-[project]/store';
@@ -230,7 +230,12 @@
</Button>
</Layout.Stack>
{#if variableList.total}
<Button secondary on:mousedown={() => (showVariablesModal = true)}>
<Button
secondary
on:mousedown={() => {
showVariablesModal = true;
trackEvent(Click.VariablesCreate, { source: 'project_settings' });
}}>
<Icon slot="start" icon={IconPlus} /> Create variable
</Button>
{/if}