feat: track error events

This commit is contained in:
Torsten Dittmann committed 2023-02-13 12:27:21 +01:00
1 parent 3c84356c76
commit 9b82b624cf
107 files changed
+495 -264

No files matched your search

+116
View File
@@ -4,6 +4,7 @@ import { get } from 'svelte/store';
import { page } from '$app/stores';
import { user } from '$lib/stores/user';
import { growthEndpoint, Mode } from '$lib/constants';
import { AppwriteException } from '@aw-labs/appwrite-console';
const isDevelopment =
import.meta.env.DEV || import.meta.env?.VITE_VERCEL_ENV?.toString() === 'preview';
@@ -31,6 +32,15 @@ export function trackEvent(name: string, data: object = null): void {
}
}
export function trackError(exception: AppwriteException, event: Submit): void {
if (exception instanceof AppwriteException && exception.type) {
trackEvent(Submit.Error, {
type: exception.type,
form: event
});
}
}
export function trackPageView(path: string) {
if (!isTrackingAllowed()) {
return;
@@ -83,3 +93,109 @@ function isTrackingAllowed() {
return true;
}
}
export enum Submit {
Error = 'submit_error',
AccountCreate = 'submit_account_create',
AccountLogin = 'submit_account_login',
AccountLogout = 'submit_account_logout',
AccountRecover = 'submit_account_recover',
AccountUpdateName = 'submit_account_update_name',
AccountUpdateEmail = 'submit_account_update_email',
AccountUpdatePassword = 'submit_account_update_password',
AccountDelete = 'submit_account_delete',
AccountDeleteSession = 'submit_account_delete_session',
AccountDeleteAllSessions = 'submit_account_delete_all_sessions',
UserCreate = 'submit_user_create',
UserDelete = 'submit_user_delete',
UserUpdateEmail = 'submit_user_update_email',
UserUpdateName = 'submit_user_update_name',
UserUpdatePassword = 'submit_user_update_password',
UserUpdatePhone = 'submit_user_update_phone',
UserUpdatePreferences = 'submit_user_update_preferences',
UserUpdateStatus = 'submit_user_update_status',
UserUpdateVerificationEmail = 'submit_user_update_verification_email',
UserUpdateVerificationPhone = 'submit_user_update_verification_phone',
OrganizationCreate = 'submit_organization_create',
OrganizationDelete = 'submit_organization_delete',
OrganizationUpdateName = 'submit_organization_update_name',
ProjectCreate = 'submit_project_create',
ProjectDelete = 'submit_project_delete',
ProjectUpdateName = 'submit_project_update_name',
ProjectService = 'submit_project_service',
MemberCreate = 'submit_member_create',
MemberDelete = 'submit_member_delete',
MembershipUpdateStatus = 'submit_membership_update_status',
ProviderUpdate = 'submit_provider_update',
TeamCreate = 'submit_team_create',
TeamDelete = 'submit_team_delete',
TeamUpdateName = 'submit_team_update_name',
AuthLimitUpdate = 'submit_auth_limit_update',
AuthStatusUpdate = 'submit_auth_status_update',
SessionsLengthUpdate = 'submit_sessions_length_update',
SessionsLimitUpdate = 'submit_sessions_limit_update',
SessionDelete = 'submit_session_delete',
SessionDeleteAll = 'submit_session_delete_all',
DatabaseCreate = 'submit_database_create',
DatabaseDelete = 'submit_database_delete',
DatabaseUpdateName = 'submit_database_update_name',
AttributeCreate = 'submit_attribute_create',
AttributeDelete = 'submit_attribute_delete',
DocumentCreate = 'submit_document_create',
DocumentDelete = 'submit_document_delete',
DocumentUpdate = 'submit_document_update',
DocumentUpdatePermissions = 'submit_document_update_permissions',
IndexCreate = 'submit_index_create',
IndexDelete = 'submit_index_delete',
CollectionCreate = 'submit_collection_create',
CollectionDelete = 'submit_collection_delete',
CollectionUpdateName = 'submit_collection_update_name',
CollectionUpdatePermissions = 'submit_collection_update_permissions',
CollectionUpdateSecurity = 'submit_collection_update_security',
CollectionUpdateEnabled = 'submit_collection_update_enabled',
FunctionCreate = 'submit_function_create',
FunctionDelete = 'submit_function_delete',
FunctionUpdateName = 'submit_function_update_name',
FunctionUpdatePermissions = 'submit_function_update_permissions',
FunctionUpdateSchedule = 'submit_function_update_schedule',
FunctionUpdateTimeout = 'submit_function_update_timeout',
FunctionUpdateEvents = 'submit_function_update_events',
DeploymentCreate = 'submit_deployment_create',
DeploymentDelete = 'submit_deployment_delete',
DeploymentUpdate = 'submit_deployment_update',
ExecutionCreate = 'submit_execution_create',
VariableCreate = 'submit_variable_create',
VariableDelete = 'submit_variable_delete',
VariableUpdate = 'submit_variable_update',
KeyCreate = 'submit_key_create',
KeyDelete = 'submit_key_delete',
KeyUpdateName = 'submit_key_update_name',
KeyUpdateScopes = 'submit_key_update_scopes',
KeyUpdateExpire = 'submit_key_update_expire',
PlatformCreate = 'submit_platform_create',
PlatformDelete = 'submit_platform_delete',
PlatformUpdate = 'submit_platform_update',
DomainCreate = 'submit_domain_create',
DomainDelete = 'submit_domain_delete',
DomainUpdateVerification = 'submit_domain_update_verification',
WebhookCreate = 'submit_webhook_create',
WebhookDelete = 'submit_webhook_delete',
WebhookUpdateSignature = 'submit_webhook_update_signature',
WebhookUpdateUrl = 'submit_webhook_update_url',
WebhookUpdateEvents = 'submit_webhook_update_events',
WebhookUpdateName = 'submit_webhook_update_name',
WebhookUpdateSecurity = 'submit_webhook_update_security',
BucketCreate = 'submit_bucket_create',
BucketDelete = 'submit_bucket_delete',
BucketUpdateEnabled = 'submit_bucket_update_enabled',
BucketUpdateName = 'submit_bucket_update_name',
BucketUpdatePermissions = 'submit_bucket_update_permissions',
BucketUpdateSecurity = 'submit_bucket_update_security',
BucketUpdateFileSecurity = 'submit_bucket_update_file_security',
BucketUpdateSize = 'submit_bucket_update_size',
BucketUpdateCompression = 'submit_bucket_update_compression',
BucketUpdateExtensions = 'submit_bucket_update_extensions',
FileCreate = 'submit_file_create',
FileDelete = 'submit_file_delete',
FileUpdatePermissions = 'submit_file_update_permissions'
}
+2 -2
View File
@@ -19,7 +19,7 @@
let showFeedback = false;
import { slide } from 'svelte/transition';
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent } from '$lib/actions/analytics';
import { sdkForConsole } from '$lib/stores/sdk';
import { goto } from '$app/navigation';
@@ -36,7 +36,7 @@
async function logout() {
await sdkForConsole.account.deleteSession('current');
trackEvent('submit_account_logout');
trackEvent(Submit.AccountLogout);
await goto(`${base}/login`);
}
+7 -4
View File
@@ -10,7 +10,7 @@
import Delete from './delete.svelte';
import { invalidate } from '$app/navigation';
import { Dependencies } from '$lib/constants';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
let name: string = null,
email: string = null,
@@ -32,12 +32,13 @@
message: 'Name has been updated',
type: 'success'
});
trackEvent('submit_account_update_name');
trackEvent(Submit.AccountUpdateName);
} catch (error) {
addNotification({
message: error.message,
type: 'error'
});
trackError(error, Submit.AccountUpdateName);
}
}
async function updateEmail() {
@@ -48,12 +49,13 @@
message: 'Email has been updated',
type: 'success'
});
trackEvent('submit_account_update_email');
trackEvent(Submit.AccountUpdateEmail);
} catch (error) {
addNotification({
message: error.message,
type: 'error'
});
trackError(error, Submit.AccountUpdateEmail);
}
}
@@ -65,12 +67,13 @@
message: 'Password has been updated',
type: 'success'
});
trackEvent('submit_account_update_password');
trackEvent(Submit.AccountUpdatePassword);
} catch (error) {
addNotification({
message: error.message,
type: 'error'
});
trackError(error, Submit.AccountUpdatePassword);
}
}
</script>
+3 -2
View File
@@ -1,6 +1,6 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Modal } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button } from '$lib/elements/forms';
@@ -18,12 +18,13 @@
type: 'success',
message: `Account was deleted `
});
trackEvent('submit_account_delete');
trackEvent(Submit.AccountDelete);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.AccountDelete);
}
};
</script>
+2 -2
View File
@@ -2,7 +2,7 @@
import { goto } from '$app/navigation';
import { base } from '$app/paths';
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent } from '$lib/actions/analytics';
import { Tab, Tabs } from '$lib/components';
import { Button } from '$lib/elements/forms';
import { isTabSelected } from '$lib/helpers/load';
@@ -39,7 +39,7 @@
async function logout() {
await sdkForConsole.account.deleteSession('current');
trackEvent('submit_account_logout');
trackEvent(Submit.AccountLogout);
await goto(`${base}/login`);
}
</script>
@@ -17,7 +17,7 @@
import { Dependencies } from '$lib/constants';
import type { Models } from '@aw-labs/appwrite-console';
import type { PageData } from './$types';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent } from '$lib/actions/analytics';
import { base } from '$app/paths';
export let data: PageData;
@@ -28,7 +28,7 @@
const logout = async (session: Models.Session) => {
await sdkForConsole.account.deleteSession(session.$id);
trackEvent('submit_account_delete_session');
trackEvent(Submit.AccountDeleteSession);
if (session.current) {
await goto(`${base}/login`);
}
@@ -36,7 +36,7 @@
};
const logoutAll = async () => {
await sdkForConsole.account.deleteSessions();
trackEvent('submit_account_delete_all_sessions');
trackEvent(Submit.AccountDeleteAllSessions);
await goto(`${base}/login`);
invalidate(Dependencies.ACCOUNT_SESSIONS);
};
+5 -4
View File
@@ -7,7 +7,7 @@
import { createEventDispatcher } from 'svelte';
import { goto, invalidate } from '$app/navigation';
import { Dependencies } from '$lib/constants';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
export let show = false;
@@ -28,12 +28,13 @@
type: 'success',
message: `${name} has been created`
});
trackEvent('submit_organization_create');
trackEvent(Submit.OrganizationCreate);
name = null;
id = null;
show = false;
} catch ({ message }) {
error = message;
} catch (e) {
error = e.message;
trackError(e, Submit.OrganizationCreate);
}
};
</script>
+5 -4
View File
@@ -1,6 +1,6 @@
<script lang="ts">
import { goto, invalidate } from '$app/navigation';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Card } from '$lib/components';
import CustomId from '$lib/components/customId.svelte';
import { Dependencies } from '$lib/constants';
@@ -29,13 +29,14 @@
);
await invalidate(Dependencies.ACCOUNT);
goto(`/console/project-${project.$id}`);
trackEvent('submit_project_create');
} catch ({ message }) {
trackEvent(Submit.ProjectCreate);
} catch (error) {
loading = false;
addNotification({
message,
message: error.message,
type: 'error'
});
trackError(error, Submit.ProjectCreate);
}
}
@@ -8,7 +8,7 @@
import { organization } from '$lib/stores/organization';
import { invalidate } from '$app/navigation';
import { Dependencies } from '$lib/constants';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
export let showCreate = false;
@@ -32,10 +32,11 @@
type: 'success',
message: `Invite has been sent to ${email}`
});
trackEvent('submit_member_create');
trackEvent(Submit.MemberCreate);
dispatch('created', team);
} catch ({ message }) {
error = message;
} catch (e) {
error = e.message;
trackError(e, Submit.MemberCreate);
}
};
@@ -1,6 +1,6 @@
<script lang="ts">
import { goto } from '$app/navigation';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Modal, CustomId } from '$lib/components';
import { Pill } from '$lib/elements';
import { InputText, Button, FormList } from '$lib/elements/forms';
@@ -29,15 +29,16 @@
'default'
);
dispatch('created', project);
trackEvent('submit_project_create');
trackEvent(Submit.ProjectCreate);
addNotification({
type: 'success',
message: `${name} has been created`
});
await goto(`/console/project-${project.$id}`);
} catch ({ message }) {
} catch (e) {
isCreating = false;
error = message;
error = e.message;
trackError(e, Submit.ProjectCreate);
}
}
</script>
@@ -8,7 +8,7 @@
import type { Models } from '@aw-labs/appwrite-console';
import { createEventDispatcher } from 'svelte';
import { user } from '$lib/stores/user';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
const dispatch = createEventDispatcher();
@@ -30,12 +30,13 @@
type: 'success',
message: `${selectedMember.userName} was deleted from ${selectedMember.teamName}`
});
trackEvent('submit_member_delete');
trackEvent(Submit.MemberDelete);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.MemberDelete);
}
};
@@ -7,7 +7,7 @@
import { goto, invalidate } from '$app/navigation';
import { base } from '$app/paths';
import { Dependencies } from '$lib/constants';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
export let showDelete = false;
@@ -18,7 +18,7 @@
type: 'success',
message: `${$organization.name} has been deleted`
});
trackEvent('submit_organization_delete');
trackEvent(Submit.OrganizationDelete);
if ($organizationList?.total > 1) {
await invalidate(Dependencies.ACCOUNT);
goto(`${base}/console/`);
@@ -32,6 +32,7 @@
type: 'error',
message: error.message
});
trackError(error, Submit.OrganizationDelete);
}
};
</script>
@@ -21,7 +21,7 @@
import Delete from '../../deleteMember.svelte';
import type { Models } from '@aw-labs/appwrite-console';
import type { PageData } from './$types';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
export let data: PageData;
@@ -43,12 +43,13 @@
type: 'success',
message: `Invite has been sent to ${member.userEmail}`
});
trackEvent('submit_member_create');
trackEvent(Submit.MemberCreate);
} catch (error) {
addNotification({
type: 'error',
message: error
});
trackError(error, Submit.MemberCreate);
}
};
</script>
@@ -9,7 +9,7 @@
import { Dependencies } from '$lib/constants';
import { onMount } from 'svelte';
import Delete from '../deleteOrganization.svelte';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
let name: string;
let showDelete = false;
@@ -26,12 +26,13 @@
message: 'Name has been updated',
type: 'success'
});
trackEvent('submit_organization_update_name');
trackEvent(Submit.OrganizationUpdateName);
} catch (error) {
addNotification({
message: error.message,
type: 'error'
});
trackError(error, Submit.OrganizationUpdateName);
}
}
@@ -8,7 +8,7 @@
import { onMount } from 'svelte';
import { invalidate } from '$app/navigation';
import { Dependencies } from '$lib/constants';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
export let provider: Provider;
@@ -42,14 +42,15 @@
provider.enabled ? 'enabled' : 'disabled'
}`
});
trackEvent('submit_provider_update', {
trackEvent(Submit.ProviderUpdate, {
provider,
enabled
});
provider = null;
invalidate(Dependencies.PROJECT);
} catch ({ message }) {
error = message;
} catch (e) {
error = e.message;
trackError(e, Submit.ProviderUpdate);
}
};
@@ -8,7 +8,7 @@
import { onMount } from 'svelte';
import { invalidate } from '$app/navigation';
import { Dependencies } from '$lib/constants';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
export let provider: Provider;
@@ -40,14 +40,15 @@
provider.enabled ? 'enabled' : 'disabled'
}`
});
trackEvent('submit_provider_update', {
trackEvent(Submit.ProviderUpdate, {
provider,
enabled
});
provider = null;
invalidate(Dependencies.PROJECT);
} catch ({ message }) {
error = message;
} catch (e) {
error = e.message;
trackError(e, Submit.ProviderUpdate);
}
};
@@ -8,7 +8,7 @@
import { onMount } from 'svelte';
import { invalidate } from '$app/navigation';
import { Dependencies } from '$lib/constants';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
export let provider: Provider;
@@ -40,14 +40,15 @@
provider.enabled ? 'enabled' : 'disabled'
}`
});
trackEvent('submit_provider_update', {
trackEvent(Submit.ProviderUpdate, {
provider,
enabled
});
provider = null;
invalidate(Dependencies.PROJECT);
} catch ({ message }) {
error = message;
} catch (e) {
error = e.message;
trackError(e, Submit.ProviderUpdate);
}
};
@@ -1,5 +1,5 @@
<script lang="ts">
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Modal, CustomId } from '$lib/components';
import { Pill } from '$lib/elements';
import { InputText, Button, FormList } from '$lib/elements/forms';
@@ -24,10 +24,11 @@
type: 'success',
message: `${team.name} has been created`
});
trackEvent('submit_team_create');
trackEvent(Submit.TeamCreate);
dispatch('created', team);
} catch ({ message }) {
error = message;
} catch (e) {
error = e.message;
trackError(e, Submit.TeamCreate);
}
};
@@ -1,5 +1,5 @@
<script lang="ts">
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Modal, CustomId } from '$lib/components';
import { Pill } from '$lib/elements/';
import {
@@ -38,10 +38,11 @@
type: 'success',
message: `${user.name ? user.name : 'User'} has been created`
});
trackEvent('submit_user_create');
trackEvent(Submit.UserCreate);
dispatch('created', user);
} catch ({ message }) {
error = message;
} catch (e) {
error = e.message;
trackError(e, Submit.UserCreate);
}
};
@@ -8,7 +8,7 @@
import { onMount } from 'svelte';
import { invalidate } from '$app/navigation';
import { Dependencies } from '$lib/constants';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
export let provider: Provider;
@@ -40,14 +40,15 @@
provider.enabled ? 'enabled' : 'disabled'
}`
});
trackEvent('submit_provider_update', {
trackEvent(Submit.ProviderUpdate, {
provider,
enabled
});
provider = null;
invalidate(Dependencies.PROJECT);
} catch ({ message }) {
error = message;
} catch (e) {
error = e.message;
trackError(e, Submit.ProviderUpdate);
}
};
@@ -8,7 +8,7 @@
import { onMount } from 'svelte';
import { invalidate } from '$app/navigation';
import { Dependencies } from '$lib/constants';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
export let provider: Provider;
@@ -41,14 +41,15 @@
provider.enabled ? 'enabled' : 'disabled'
}`
});
trackEvent('submit_provider_update', {
trackEvent(Submit.ProviderUpdate, {
provider,
enabled
});
provider = null;
invalidate(Dependencies.PROJECT);
} catch ({ message }) {
error = message;
} catch (e) {
error = e.message;
trackError(e, Submit.ProviderUpdate);
}
};
</script>
@@ -8,7 +8,7 @@
import { onMount } from 'svelte';
import { invalidate } from '$app/navigation';
import { Dependencies } from '$lib/constants';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
export let provider: Provider;
@@ -41,14 +41,15 @@
provider.enabled ? 'enabled' : 'disabled'
}`
});
trackEvent('submit_provider_update', {
trackEvent(Submit.ProviderUpdate, {
provider,
enabled
});
provider = null;
invalidate(Dependencies.PROJECT);
} catch ({ message }) {
error = message;
} catch (e) {
error = e.message;
trackError(e, Submit.ProviderUpdate);
}
};
@@ -8,7 +8,7 @@
import { onMount } from 'svelte';
import { invalidate } from '$app/navigation';
import { Dependencies } from '$lib/constants';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
export let provider: Provider;
@@ -44,14 +44,15 @@
provider.enabled ? 'enabled' : 'disabled'
}`
});
trackEvent('submit_provider_update', {
trackEvent(Submit.ProviderUpdate, {
provider,
enabled
});
provider = null;
invalidate(Dependencies.PROJECT);
} catch ({ message }) {
error = message;
} catch (e) {
error = e.message;
trackError(e, Submit.ProviderUpdate);
}
};
@@ -9,7 +9,7 @@
import { clickOnEnter } from '$lib/helpers/a11y';
import { invalidate } from '$app/navigation';
import { Dependencies } from '$lib/constants';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { timeToSeconds } from '$lib/helpers/timeConversion';
import { writable } from 'svelte/store';
@@ -53,12 +53,13 @@
type: 'success',
message: 'Updated project users limit successfully'
});
trackEvent('submit_auth_limit_update');
trackEvent(Submit.AuthLimitUpdate);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.AuthLimitUpdate);
}
}
async function updateSessionLength() {
@@ -74,12 +75,13 @@
type: 'success',
message: 'Updated project users limit successfully'
});
trackEvent('submit_session_length_update');
trackEvent(Submit.SessionsLengthUpdate);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.SessionsLengthUpdate);
}
}
async function updateSessionsLimit() {
@@ -90,12 +92,13 @@
type: 'success',
message: 'Sessions limit has been updated'
});
trackEvent('submit_sessions_limit_update');
trackEvent(Submit.SessionsLimitUpdate);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.SessionsLimitUpdate);
}
}
@@ -11,7 +11,7 @@
import { app } from '$lib/stores/app';
import { page } from '$app/stores';
import type { Provider } from '$lib/stores/oauth-providers';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
const projectId = $page.params.project;
@@ -29,7 +29,7 @@
box.value ? 'enabled' : 'disabled'
}`
});
trackEvent('submit_auth_status_update', {
trackEvent(Submit.AuthStatusUpdate, {
method: box.method,
value: box.value
});
@@ -39,6 +39,7 @@
type: 'error',
message: error.message
});
trackError(error, Submit.AuthStatusUpdate);
}
}
@@ -11,7 +11,7 @@
import { Dependencies } from '$lib/constants';
import { invalidate } from '$app/navigation';
import DeleteTeam from './deleteTeam.svelte';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
let showDelete = false;
let teamName: string = null;
@@ -28,12 +28,13 @@
message: 'Name has been updated',
type: 'success'
});
trackEvent('submit_team_update_name');
trackEvent(Submit.TeamUpdateName);
} catch (error) {
addNotification({
message: error.message,
type: 'error'
});
trackError(error, Submit.TeamUpdateName);
}
}
</script>
@@ -1,6 +1,6 @@
<script lang="ts">
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Modal, Alert } from '$lib/components';
import { Button, InputEmail, InputText, InputTags, FormList } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
@@ -30,13 +30,14 @@
type: 'success',
message: `${name ? name : email} created successfully`
});
trackEvent('submit_member_create');
trackEvent(Submit.MemberCreate);
email = name = '';
roles = [];
showCreate = false;
dispatch('created', user);
} catch ({ message }) {
error = message;
} catch (e) {
error = e.message;
trackError(e, Submit.MemberCreate);
}
};
</script>
@@ -2,7 +2,7 @@
import { goto } from '$app/navigation';
import { base } from '$app/paths';
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Modal } from '$lib/components';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
@@ -23,7 +23,7 @@
);
showDelete = false;
dispatch('deleted');
trackEvent('submit_member_delete');
trackEvent(Submit.MemberDelete);
await goto(
`${base}/console/project-${$page.params.project}/auth/teams/team-${selectedMembership.teamId}/members`
);
@@ -32,6 +32,7 @@
type: 'error',
message: error.message
});
trackError(error, Submit.MemberDelete);
}
};
</script>
@@ -2,7 +2,7 @@
import { goto } from '$app/navigation';
import { base } from '$app/paths';
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Modal } from '$lib/components';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
@@ -16,13 +16,14 @@
try {
await sdkForProject.teams.delete(team.$id);
showDelete = false;
trackEvent('submit_team_delete');
trackEvent(Submit.TeamDelete);
await goto(`${base}/console/project-${$page.params.project}/auth/teams`);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.TeamDelete);
}
};
</script>
@@ -1,7 +1,7 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Modal } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button } from '$lib/elements/forms';
@@ -20,12 +20,13 @@
type: 'success',
message: 'All sessions have been deleted'
});
trackEvent('submit_session_delete_all');
trackEvent(Submit.SessionDeleteAll);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.SessionDeleteAll);
}
};
</script>
@@ -2,7 +2,7 @@
import { goto, invalidate } from '$app/navigation';
import { base } from '$app/paths';
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Modal } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button } from '$lib/elements/forms';
@@ -26,7 +26,7 @@
type: 'success',
message: `Membership has been deleted`
});
trackEvent('submit_member_delete');
trackEvent(Submit.MemberDelete);
await goto(
`${base}/console/project-${$page.params.project}/auth/user-${selectedMembership.userId}/memberships`
);
@@ -35,6 +35,7 @@
type: 'error',
message: error.message
});
trackError(error, Submit.MemberDelete);
}
};
</script>
@@ -1,7 +1,7 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Modal } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button } from '$lib/elements/forms';
@@ -19,12 +19,13 @@
type: 'success',
message: 'Session has been deleted'
});
trackEvent('submit_session_delete');
trackEvent(Submit.SessionDelete);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.SessionDelete);
}
};
</script>
@@ -8,7 +8,7 @@
import { sdkForProject } from '$lib/stores/sdk';
import { user } from './store';
import { project } from '../../store';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
export let showDelete = false;
@@ -20,13 +20,14 @@
type: 'success',
message: `${$user.name ? $user.name : 'User'} has been deleted`
});
trackEvent('submit_user_delete');
trackEvent(Submit.UserDelete);
await goto(`${base}/console/project-${$page.params.project}/auth`);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.UserDelete);
}
};
</script>
@@ -1,6 +1,6 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { CardGrid, Heading } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, Form, InputEmail } from '$lib/elements/forms';
@@ -22,12 +22,13 @@
message: 'Email has been updated',
type: 'success'
});
trackEvent('submit_user_update_email');
trackEvent(Submit.UserUpdateEmail);
} catch (error) {
addNotification({
message: error.message,
type: 'error'
});
trackError(error, Submit.UserUpdateEmail);
}
}
</script>
@@ -1,6 +1,6 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { CardGrid, Heading } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, Form, InputText } from '$lib/elements/forms';
@@ -22,12 +22,13 @@
message: 'Name has been updated',
type: 'success'
});
trackEvent('submit_user_update_name');
trackEvent(Submit.UserUpdateName);
} catch (error) {
addNotification({
message: error.message,
type: 'error'
});
trackError(error, Submit.UserUpdateName);
}
}
</script>
@@ -1,5 +1,5 @@
<script lang="ts">
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { CardGrid, Heading } from '$lib/components';
import { Button, Form, InputPassword } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
@@ -16,12 +16,13 @@
message: 'Password has been updated',
type: 'success'
});
trackEvent('submit_user_update_password');
trackEvent(Submit.UserUpdatePassword);
} catch (error) {
addNotification({
message: error.message,
type: 'error'
});
trackError(error, Submit.UserUpdatePassword);
}
}
</script>
@@ -1,6 +1,6 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { CardGrid, Heading } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, Form, InputPhone } from '$lib/elements/forms';
@@ -22,12 +22,13 @@
message: 'Phone has been updated',
type: 'success'
});
trackEvent('submit_user_update_phone');
trackEvent(Submit.UserUpdatePhone);
} catch (error) {
addNotification({
message: error.message,
type: 'error'
});
trackError(error, Submit.UserUpdatePhone);
}
}
</script>
@@ -1,6 +1,6 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { CardGrid, Heading } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, Form } from '$lib/elements/forms';
@@ -43,12 +43,13 @@
message: 'Preferences have been updated',
type: 'success'
});
trackEvent('submit_user_update_preferences');
trackEvent(Submit.UserUpdatePreferences);
} catch (error) {
addNotification({
message: error.message,
type: 'error'
});
trackError(error, Submit.UserUpdatePreferences);
}
}
</script>
@@ -1,6 +1,6 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { AvatarInitials, CardGrid, DropList, DropListItem, Heading } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Pill } from '$lib/elements';
@@ -23,12 +23,13 @@
}`,
type: 'success'
});
trackEvent('submit_user_update_verification_email');
trackEvent(Submit.UserUpdateVerificationEmail);
} catch (error) {
addNotification({
message: error.message,
type: 'error'
});
trackError(error, Submit.UserUpdateVerificationEmail);
}
}
async function updateVerificationPhone() {
@@ -42,12 +43,13 @@
}`,
type: 'success'
});
trackEvent('submit_user_update_verification_phone');
trackEvent(Submit.UserUpdateVerificationPhone);
} catch (error) {
addNotification({
message: error.message,
type: 'error'
});
trackError(error, Submit.UserUpdateVerificationPhone);
}
}
async function updateStatus() {
@@ -60,12 +62,13 @@
}`,
type: 'success'
});
trackEvent('submit_user_update_status');
trackEvent(Submit.UserUpdateStatus);
} catch (error) {
addNotification({
message: error.message,
type: 'error'
});
trackError(error, Submit.UserUpdateStatus);
}
}
</script>
@@ -1,4 +1,5 @@
<script lang="ts">
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Modal, CustomId } from '$lib/components';
import { Pill } from '$lib/elements';
import { Button, InputText, FormList } from '$lib/elements/forms';
@@ -23,12 +24,14 @@
type: 'success',
message: `${name} has been created`
});
trackEvent(Submit.DatabaseCreate);
name = id = null;
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.DatabaseCreate);
}
};
</script>
@@ -9,7 +9,7 @@
import type { Attributes } from '../store';
import { sdkForProject } from '$lib/stores/sdk';
import { Dependencies } from '$lib/constants';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
export let showDelete = false;
export let selectedAttribute: Attributes;
@@ -28,7 +28,7 @@
type: 'success',
message: `Attribute has been deleted`
});
trackEvent('submit_attribute_delete');
trackEvent(Submit.AttributeDelete);
await goto(
`${base}/console/project-${$page.params.project}/databases/database-${databaseId}/collection-${$page.params.collection}/attributes`
);
@@ -37,6 +37,7 @@
type: 'error',
message: error.message
});
trackError(error, Submit.AttributeDelete);
}
};
</script>
@@ -8,7 +8,7 @@
import { addNotification } from '$lib/stores/notifications';
import { base } from '$app/paths';
import type { Attributes } from './store';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
export let showCreate = false;
@@ -36,12 +36,13 @@
message: `Attribute ${key} has been created`
});
showCreate = false;
trackEvent('submit_attribute_create');
trackEvent(Submit.AttributeCreate);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.AttributeCreate);
}
}
@@ -12,7 +12,7 @@
import { createDocument } from './wizard/store';
import type { WizardStepsType } from '$lib/layout/wizard.svelte';
import { Dependencies } from '$lib/constants';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
const databaseId = $page.params.database;
const collectionId = $page.params.collection;
@@ -44,7 +44,7 @@
message: 'Document has been created',
type: 'success'
});
trackEvent('submit_document_create');
trackEvent(Submit.DocumentCreate);
invalidate(Dependencies.DOCUMENTS);
createDocument.reset();
@@ -54,6 +54,7 @@
message: error.message,
type: 'error'
});
trackError(error, Submit.DocumentCreate);
}
}
@@ -12,7 +12,7 @@
import { Permissions } from '$lib/components/permissions';
import { invalidate } from '$app/navigation';
import { Dependencies } from '$lib/constants';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { collection } from '../store';
let showDelete = false;
@@ -35,12 +35,13 @@
message: 'Permissions have been updated',
type: 'success'
});
trackEvent('submit_document_update_permission');
trackEvent(Submit.DocumentUpdatePermissions);
} catch (error) {
addNotification({
message: error.message,
type: 'error'
});
trackError(error, Submit.DocumentUpdatePermissions);
}
}
@@ -2,7 +2,7 @@
import { goto } from '$app/navigation';
import { base } from '$app/paths';
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Modal } from '$lib/components';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
@@ -25,7 +25,7 @@
type: 'success',
message: `Document has been deleted`
});
trackEvent('submit_document_delete');
trackEvent(Submit.DocumentDelete);
await goto(
`${base}/console/project-${$page.params.project}/databases/database-${$page.params.database}/collection-${$page.params.collection}`
);
@@ -34,6 +34,7 @@
type: 'error',
message: error.message
});
trackError(error, Submit.DocumentDelete);
}
};
</script>
@@ -11,7 +11,7 @@
import type { Models } from '@aw-labs/appwrite-console';
import { Dependencies } from '$lib/constants';
import { invalidate } from '$app/navigation';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import AttributeForm from './attributeForm.svelte';
let disableUpdate = true;
@@ -62,9 +62,7 @@
currentDoc = JSON.stringify($work);
invalidate(Dependencies.DOCUMENT);
trackEvent('submit_document_update', {
type: 'android'
});
trackEvent(Submit.DocumentUpdate);
disableUpdate = true;
addNotification({
message: 'Document was updated!',
@@ -75,6 +73,7 @@
message: error.message,
type: 'error'
});
trackError(error, Submit.DocumentUpdate);
}
}
</script>
@@ -2,7 +2,7 @@
import { goto, invalidate } from '$app/navigation';
import { base } from '$app/paths';
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Modal } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, FormList, InputSelect, InputText } from '$lib/elements/forms';
@@ -80,12 +80,13 @@
message: 'Index has been created',
type: 'success'
});
trackEvent('submit_index_create');
trackEvent(Submit.IndexCreate);
} catch (error) {
addNotification({
message: error.message,
type: 'error'
});
trackError(error, Submit.IndexCreate);
} finally {
showCreateIndex = false;
creating = false;
@@ -7,7 +7,7 @@
import type { Models } from '@aw-labs/appwrite-console';
import { createEventDispatcher } from 'svelte';
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
export let showDelete = false;
export let selectedIndex: Models.Index;
@@ -28,12 +28,13 @@
message: `Index has been deleted`
});
dispatch('deleted');
trackEvent('submit_index_delete');
trackEvent(Submit.IndexDelete);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.IndexDelete);
}
};
</script>
@@ -2,7 +2,7 @@
import { goto } from '$app/navigation';
import { base } from '$app/paths';
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Modal } from '$lib/components';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
@@ -21,7 +21,7 @@
type: 'success',
message: `${$collection.name} has been deleted`
});
trackEvent('submit_collection_delete');
trackEvent(Submit.CollectionDelete);
await goto(
`${base}/console/project-${$page.params.project}/databases/database-${$page.params.database}`
);
@@ -30,6 +30,7 @@
type: 'error',
message: error.message
});
trackError(error, Submit.CollectionDelete);
}
};
</script>
@@ -1,7 +1,7 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { CardGrid, Heading } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, Form, InputText } from '$lib/elements/forms';
@@ -33,12 +33,13 @@
message: 'Name has been updated',
type: 'success'
});
trackEvent('submit_collection_update_name');
trackEvent(Submit.CollectionUpdateName);
} catch (error) {
addNotification({
message: error.message,
type: 'error'
});
trackError(error, Submit.CollectionUpdateName);
}
}
</script>
@@ -1,7 +1,7 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { CardGrid, Heading } from '$lib/components';
import { Permissions } from '$lib/components/permissions';
import { Dependencies } from '$lib/constants';
@@ -38,12 +38,13 @@
message: 'Permissions have been updated',
type: 'success'
});
trackEvent('submit_collection_update_permissions');
trackEvent(Submit.CollectionUpdatePermissions);
} catch (error) {
addNotification({
message: error.message,
type: 'error'
});
trackError(error, Submit.CollectionUpdatePermissions);
}
}
@@ -1,7 +1,7 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { CardGrid, Heading } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, FormList, InputSwitch } from '$lib/elements/forms';
@@ -33,12 +33,13 @@
message: 'Security has been updated',
type: 'success'
});
trackEvent('submit_collection_update_security');
trackEvent(Submit.CollectionUpdateSecurity);
} catch (error) {
addNotification({
message: error.message,
type: 'error'
});
trackError(error, Submit.CollectionUpdateSecurity);
}
}
</script>
@@ -1,7 +1,7 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { CardGrid, Heading } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, InputSwitch } from '$lib/elements/forms';
@@ -34,12 +34,13 @@
message: `${$collection.name} has been updated`,
type: 'success'
});
trackEvent('submit_collection_update_enabled');
trackEvent(Submit.CollectionUpdateEnabled);
} catch (error) {
addNotification({
message: error.message,
type: 'error'
});
trackError(error, Submit.CollectionUpdateEnabled);
}
}
</script>
@@ -1,6 +1,6 @@
<script lang="ts">
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Modal, CustomId } from '$lib/components';
import { Pill } from '$lib/elements';
@@ -32,12 +32,13 @@
message: `${name} has been created`
});
name = id = null;
trackEvent('submit_database_create');
trackEvent(Submit.CollectionCreate);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.CollectionCreate);
}
};
</script>
@@ -2,7 +2,7 @@
import { goto } from '$app/navigation';
import { base } from '$app/paths';
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
import { Modal } from '$lib/components';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
@@ -21,12 +21,13 @@
message: `${$database.name} has been deleted`
});
await goto(`${base}/console/project-${$page.params.project}/databases`);
trackEvent('submit_database_delete');
trackEvent(Submit.DatabaseDelete);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.DatabaseDelete);
}
};
</script>
@@ -11,7 +11,7 @@
import { invalidate } from '$app/navigation';
import { Dependencies } from '$lib/constants';
import Delete from '../delete.svelte';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
let showDelete = false;
let showError: false | 'name' | 'email' | 'password' = false;
@@ -37,9 +37,10 @@
message: 'Name has been updated',
type: 'success'
});
trackEvent('submit_database_update_name');
trackEvent(Submit.DatabaseUpdateName);
} catch (error) {
addError('name', error.message, 'error');
trackError(error, Submit.DatabaseUpdateName);
}
}
</script>
@@ -15,7 +15,7 @@
import { Dependencies } from '$lib/constants';
import { base } from '$app/paths';
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
const projectId = $page.params.project;
@@ -43,13 +43,14 @@
message: `${$createFunction.name} has been created`,
type: 'success'
});
trackEvent('submit_function_create');
trackEvent(Submit.FunctionCreate);
wizard.hide();
} catch (error) {
addNotification({
message: error.message,
type: 'error'
});
trackError(error, Submit.FunctionCreate);
}
}
@@ -1,5 +1,5 @@
<script lang="ts">
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Modal } from '$lib/components';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
@@ -24,12 +24,13 @@
message: `Deployment has been activated`
});
dispatch('activated');
trackEvent('submit_deployment_update');
trackEvent(Submit.DeploymentUpdate);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.DeploymentUpdate);
}
};
</script>
@@ -10,7 +10,7 @@
import { invalidate } from '$app/navigation';
import { Dependencies } from '$lib/constants';
import { func } from './store';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { app } from '$lib/stores/app';
export let showCreate = false;
@@ -101,12 +101,13 @@
files = entrypoint = active = null;
showCreate = false;
dispatch('created');
trackEvent('submit_deployment_create');
trackEvent(Submit.DeploymentCreate);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.DeploymentCreate);
}
}
@@ -1,6 +1,6 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Modal } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button } from '$lib/elements/forms';
@@ -23,12 +23,13 @@
type: 'success',
message: `Deployment has been deleted`
});
trackEvent('submit_deployment_delete');
trackEvent(Submit.DeploymentDelete);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.DeploymentDelete);
}
};
</script>
@@ -2,7 +2,7 @@
import { afterNavigate, goto } from '$app/navigation';
import { base } from '$app/paths';
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Code, Modal } from '$lib/components';
import { Button } from '$lib/elements/forms';
import { InputTextarea, FormList, InputChoice } from '$lib/elements/forms';
@@ -43,12 +43,13 @@
type: 'success',
message: `Function has been executed`
});
trackEvent('submit_execution_create');
trackEvent(Submit.ExecutionCreate);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.ExecutionCreate);
} finally {
submitting = false;
}
@@ -2,7 +2,7 @@
import { invalidate } from '$app/navigation';
import { base } from '$app/paths';
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Box, CardGrid, DropList, DropListItem, Empty, Output, Secret } from '$lib/components';
import Heading from '$lib/components/heading.svelte';
import { Roles } from '$lib/components/permissions';
@@ -68,12 +68,13 @@
message: 'Name has been updated',
type: 'success'
});
trackEvent('submit_function_update_name');
trackEvent(Submit.FunctionUpdateName);
} catch (error) {
addNotification({
message: error.message,
type: 'error'
});
trackError(error, Submit.FunctionUpdateName);
}
}
@@ -93,12 +94,13 @@
message: 'Permissions have been updated',
type: 'success'
});
trackEvent('submit_function_update_permissions');
trackEvent(Submit.FunctionUpdatePermissions);
} catch (error) {
addNotification({
message: error.message,
type: 'error'
});
trackError(error, Submit.FunctionUpdatePermissions);
}
}
@@ -119,12 +121,13 @@
type: 'success',
message: 'Cron Schedule has been updated'
});
trackEvent('submit_function_update_schedule');
trackEvent(Submit.FunctionUpdateSchedule);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.FunctionUpdateSchedule);
}
}
@@ -145,12 +148,13 @@
type: 'success',
message: 'Timeout has been updated'
});
trackEvent('submit_function_update_timeout');
trackEvent(Submit.FunctionUpdateTimeout);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.FunctionUpdateTimeout);
}
}
@@ -165,12 +169,13 @@
type: 'success',
message: `${$func.name} variables have been updated`
});
trackEvent('submit_variable_create');
trackEvent(Submit.VariableCreate);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.VariableCreate);
}
}
@@ -190,12 +195,13 @@
type: 'success',
message: `${$func.name} variables have been updated`
});
trackEvent('submit_variable_update');
trackEvent(Submit.VariableUpdate);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.VariableUpdate);
}
}
async function handleVariableDeleted(variable: Models.Variable) {
@@ -206,12 +212,13 @@
type: 'success',
message: `Variable has been deleted`
});
trackEvent('submit_variable_delete');
trackEvent(Submit.VariableDelete);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.VariableDelete);
}
}
@@ -2,7 +2,7 @@
import { goto } from '$app/navigation';
import { base } from '$app/paths';
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Modal } from '$lib/components';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
@@ -20,12 +20,13 @@
message: `Function has been deleted`
});
await goto(`${base}/console/project-${$page.params.project}/functions`);
trackEvent('submit_function_delete');
trackEvent(Submit.FunctionDelete);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.FunctionDelete);
}
};
</script>
@@ -5,7 +5,7 @@
import { invalidate } from '$app/navigation';
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Dependencies } from '$lib/constants';
import Form from '$lib/elements/forms/form.svelte';
import { TableCell, TableCellText } from '$lib/elements/table';
@@ -43,12 +43,13 @@
message: 'Permissions have been updated',
type: 'success'
});
trackEvent('submit_function_update_events');
trackEvent(Submit.FunctionUpdateEvents);
} catch (error) {
addNotification({
message: error.message,
type: 'error'
});
trackError(error, Submit.FunctionUpdateEvents);
}
}
@@ -1,6 +1,6 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { CardGrid, Heading, Secret } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, Form, FormList, InputText } from '$lib/elements/forms';
@@ -37,7 +37,7 @@
$key.expire
);
invalidate(Dependencies.KEY);
trackEvent('submit_key_update_name');
trackEvent(Submit.KeyUpdateName);
addNotification({
type: 'success',
message: 'API Key name has been updated'
@@ -47,6 +47,7 @@
type: 'error',
message: error.message
});
trackError(error, Submit.KeyUpdateName);
}
}
@@ -60,7 +61,7 @@
$key.expire
);
invalidate(Dependencies.KEY);
trackEvent('submit_key_update_scopes');
trackEvent(Submit.KeyUpdateScopes);
addNotification({
type: 'success',
message: 'API Key scopes have been updated'
@@ -70,6 +71,7 @@
type: 'error',
message: error.message
});
trackError(error, Submit.KeyUpdateScopes);
}
}
</script>
@@ -1,6 +1,7 @@
<script lang="ts">
import { goto, invalidate } from '$app/navigation';
import { base } from '$app/paths';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Modal } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button } from '$lib/elements/forms';
@@ -19,6 +20,7 @@
type: 'success',
message: `${$key.name} has been deleted`
});
trackEvent(Submit.KeyDelete);
await invalidate(Dependencies.KEYS);
await goto(`${base}/console/project-${$project.$id}/overview/keys`);
} catch (error) {
@@ -26,6 +28,7 @@
type: 'error',
message: error.message
});
trackError(error, Submit.KeyDelete);
}
}
</script>
@@ -1,6 +1,6 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Alert, CardGrid, Heading } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, Form, FormList } from '$lib/elements/forms';
@@ -23,7 +23,7 @@
expiration
);
invalidate(Dependencies.KEY);
trackEvent('submit_key_update_expire');
trackEvent(Submit.KeyUpdateExpire);
addNotification({
type: 'success',
message: 'API Key expiration has been updated'
@@ -33,6 +33,7 @@
type: 'error',
message: error.message
});
trackError(error, Submit.KeyUpdateExpire);
}
}
@@ -12,7 +12,7 @@
import { onDestroy } from 'svelte';
import { onboarding } from '../../store';
import { Dependencies } from '$lib/constants';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
async function onFinish() {
try {
@@ -25,13 +25,14 @@
if ($onboarding) {
invalidate(Dependencies.PROJECT);
}
trackEvent('submit_key_create');
trackEvent(Submit.KeyCreate);
goto(`/console/project-${$page.params.project}/overview/keys/${$id}`);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.KeyCreate);
}
}
@@ -1,6 +1,6 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { CardGrid, Heading } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, Form, FormList, InputText } from '$lib/elements/forms';
@@ -27,7 +27,7 @@
$platform.hostname
);
invalidate(Dependencies.PLATFORM);
trackEvent('submit_platform_update', {
trackEvent(Submit.PlatformUpdate, {
type: 'android'
});
addNotification({
@@ -39,6 +39,7 @@
type: 'error',
message: error.message
});
trackError(error, Submit.PlatformUpdate);
}
};
</script>
@@ -1,6 +1,6 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { CardGrid, Heading } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, Form, FormList, InputText } from '$lib/elements/forms';
@@ -27,7 +27,7 @@
$platform.hostname
);
invalidate(Dependencies.PLATFORM);
trackEvent('submit_platform_update', {
trackEvent(Submit.PlatformUpdate, {
type: 'apple-ios'
});
addNotification({
@@ -39,6 +39,7 @@
type: 'error',
message: error.message
});
trackError(error, Submit.PlatformUpdate);
}
};
</script>
@@ -1,6 +1,6 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { CardGrid, Heading } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, Form, FormList, InputText } from '$lib/elements/forms';
@@ -27,7 +27,7 @@
$platform.hostname
);
invalidate(Dependencies.PLATFORM);
trackEvent('submit_platform_update', {
trackEvent(Submit.PlatformUpdate, {
type: 'apple-macos'
});
addNotification({
@@ -39,6 +39,7 @@
type: 'error',
message: error.message
});
trackError(error, Submit.PlatformUpdate);
}
};
</script>
@@ -1,6 +1,6 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { CardGrid, Heading } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, Form, FormList, InputText } from '$lib/elements/forms';
@@ -27,7 +27,7 @@
$platform.hostname
);
invalidate(Dependencies.PLATFORM);
trackEvent('submit_platform_update', {
trackEvent(Submit.PlatformUpdate, {
type: 'apple-tvos'
});
addNotification({
@@ -39,6 +39,7 @@
type: 'error',
message: error.message
});
trackError(error, Submit.PlatformUpdate);
}
};
</script>
@@ -1,6 +1,6 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { CardGrid, Heading } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, Form, FormList, InputText } from '$lib/elements/forms';
@@ -27,7 +27,7 @@
$platform.hostname
);
invalidate(Dependencies.PLATFORM);
trackEvent('submit_platform_update', {
trackEvent(Submit.PlatformUpdate, {
type: 'apple-watchos'
});
addNotification({
@@ -39,6 +39,7 @@
type: 'error',
message: error.message
});
trackError(error, Submit.PlatformUpdate);
}
};
</script>
@@ -1,6 +1,7 @@
<script lang="ts">
import { goto, invalidate } from '$app/navigation';
import { base } from '$app/paths';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Modal } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button } from '$lib/elements/forms';
@@ -19,6 +20,7 @@
type: 'success',
message: `${$platform.name} has been deleted`
});
trackEvent(Submit.PlatformDelete);
await invalidate(Dependencies.PLATFORMS);
await goto(`${base}/console/project-${$project.$id}/overview/platforms`);
} catch (error) {
@@ -26,6 +28,7 @@
type: 'error',
message: error.message
});
trackError(error, Submit.PlatformDelete);
}
};
</script>
@@ -1,6 +1,6 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { CardGrid, Heading } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, Form, FormList, InputText } from '$lib/elements/forms';
@@ -27,7 +27,7 @@
$platform.hostname
);
invalidate(Dependencies.PLATFORM);
trackEvent('submit_platform_update', {
trackEvent(Submit.PlatformUpdate, {
type: 'flutter-android'
});
addNotification({
@@ -39,6 +39,7 @@
type: 'error',
message: error.message
});
trackError(error, Submit.PlatformUpdate);
}
};
</script>
@@ -1,6 +1,6 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { CardGrid, Heading } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, Form, FormList, InputText } from '$lib/elements/forms';
@@ -27,7 +27,7 @@
$platform.hostname
);
invalidate(Dependencies.PLATFORM);
trackEvent('submit_platform_update', {
trackEvent(Submit.PlatformUpdate, {
type: 'flutter-ios'
});
addNotification({
@@ -39,6 +39,7 @@
type: 'error',
message: error.message
});
trackError(error, Submit.PlatformUpdate);
}
};
</script>
@@ -1,6 +1,6 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { CardGrid, Heading } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, Form, FormList, InputText } from '$lib/elements/forms';
@@ -27,7 +27,7 @@
$platform.hostname
);
invalidate(Dependencies.PLATFORM);
trackEvent('submit_platform_update', {
trackEvent(Submit.PlatformUpdate, {
type: 'flutter-linux'
});
addNotification({
@@ -39,6 +39,7 @@
type: 'error',
message: error.message
});
trackError(error, Submit.PlatformUpdate);
}
};
</script>
@@ -1,6 +1,6 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { CardGrid, Heading } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, Form, FormList, InputText } from '$lib/elements/forms';
@@ -27,7 +27,7 @@
$platform.hostname
);
invalidate(Dependencies.PLATFORM);
trackEvent('submit_platform_update', {
trackEvent(Submit.PlatformUpdate, {
type: 'flutter-macos'
});
addNotification({
@@ -39,6 +39,7 @@
type: 'error',
message: error.message
});
trackError(error, Submit.PlatformUpdate);
}
};
</script>
@@ -1,6 +1,6 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { CardGrid, Heading } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, Form, FormList, InputText } from '$lib/elements/forms';
@@ -27,7 +27,7 @@
$platform.hostname
);
invalidate(Dependencies.PLATFORM);
trackEvent('submit_platform_update', {
trackEvent(Submit.PlatformUpdate, {
type: 'flutter-windows'
});
addNotification({
@@ -39,6 +39,7 @@
type: 'error',
message: error.message
});
trackError(error, Submit.PlatformUpdate);
}
};
</script>
@@ -8,7 +8,7 @@
import { app } from '$lib/stores/app';
import Light from './light.svg';
import Dark from './dark.svg';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent } from '$lib/actions/analytics';
$wizard.media = $app.themeInUse === 'dark' ? Dark : Light;
@@ -37,7 +37,7 @@
undefined
);
trackEvent('submit_platform_create', {
trackEvent(Submit.PlatformCreate, {
type: 'android'
});
@@ -9,7 +9,7 @@
import { app } from '$lib/stores/app';
import Light from './light.svg';
import Dark from './dark.svg';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent } from '$lib/actions/analytics';
$wizard.media = $app.themeInUse === 'dark' ? Dark : Light;
@@ -47,7 +47,7 @@
undefined
);
trackEvent('submit_platform_create', {
trackEvent(Submit.PlatformCreate, {
type: platform
});
@@ -9,7 +9,7 @@
import { app } from '$lib/stores/app';
import Light from './light.svg';
import Dark from './dark.svg';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent } from '$lib/actions/analytics';
$wizard.media = $app.themeInUse === 'dark' ? Dark : Light;
@@ -102,7 +102,7 @@
platform === Platform.Web ? $createPlatform.hostname : undefined
);
trackEvent('submit_platform_create', {
trackEvent(Submit.PlatformCreate, {
type: platform
});
@@ -10,7 +10,7 @@
import { app } from '$lib/stores/app';
import Light from './light.svg';
import Dark from './dark.svg';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent } from '$lib/actions/analytics';
const projectId = $page.params.project;
const suggestions = ['*.vercel.app', '*.netlify.app', '*.gitpod.io'];
@@ -39,7 +39,7 @@
$createPlatform.hostname
);
trackEvent('submit_platform_create', {
trackEvent(Submit.PlatformCreate, {
type: 'web'
});
@@ -13,7 +13,7 @@
import Delete from './deleteProject.svelte';
import { base } from '$app/paths';
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
let name: string = null;
let showDelete = false;
@@ -34,12 +34,13 @@
type: 'success',
message: 'Project name has been updated'
});
trackEvent('submit_project_update_name');
trackEvent(Submit.ProjectUpdateName);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.ProjectUpdateName);
}
}
@@ -63,7 +64,7 @@
service.value ? 'enabled' : 'disabled'
}`
});
trackEvent('submit_project_service', {
trackEvent(Submit.ProjectService, {
method: service.method,
value: service.value
});
@@ -72,6 +73,7 @@
type: 'error',
message: error.message
});
trackError(error, Submit.ProjectService);
}
}
@@ -1,7 +1,7 @@
<script lang="ts">
import { goto } from '$app/navigation';
import { base } from '$app/paths';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Modal } from '$lib/components';
import { Button, FormList, InputPassword, InputText } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
@@ -21,13 +21,14 @@
type: 'success',
message: `${$project.name} has been deleted`
});
trackEvent('submit_project_delete');
trackEvent(Submit.ProjectDelete);
await goto(`${base}/console`);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.ProjectDelete);
}
};
</script>
@@ -22,7 +22,7 @@
import type { PageData } from './$types';
import Create from '../create.svelte';
import Delete from '../delete.svelte';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
export let data: PageData;
@@ -47,12 +47,13 @@
}
await sdkForConsole.projects.updateDomainVerification(projectId, domainId);
invalidate(Dependencies.DOMAINS);
trackEvent('submit_domain_update_verification');
trackEvent(Submit.DomainUpdateVerification);
} catch (error) {
addNotification({
message: error.message,
type: 'error'
});
trackError(error, Submit.DomainUpdateVerification);
} finally {
isVerifying[domainId] = false;
}
@@ -7,7 +7,7 @@
import { invalidate } from '$app/navigation';
import { Dependencies } from '$lib/constants';
import type { Models } from '@aw-labs/appwrite-console';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
export let showDelete = false;
export let selectedDomain: Models.Domain;
@@ -21,12 +21,13 @@
type: 'success',
message: `${selectedDomain.domain} has been deleted`
});
trackEvent('submit_domain_delete');
trackEvent(Submit.DomainDelete);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.DomainDelete);
}
};
</script>
@@ -1,5 +1,5 @@
<script lang="ts">
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent } from '$lib/actions/analytics';
import { FormList, InputDomain } from '$lib/elements/forms';
import { WizardStep } from '$lib/layout';
import { sdkForConsole } from '$lib/stores/sdk';
@@ -14,7 +14,7 @@
const { $id } = await sdkForConsole.projects.createDomain(projectId, $domain.domain);
$domain.$id = $id;
trackEvent('submit_domain_create');
trackEvent(Submit.DomainCreate);
};
</script>
@@ -1,7 +1,7 @@
<script lang="ts">
import { goto, invalidate } from '$app/navigation';
import { base } from '$app/paths';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Modal } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button } from '$lib/elements/forms';
@@ -21,13 +21,14 @@
type: 'success',
message: `${$webhook.name} has been deleted`
});
trackEvent('submit_webhook_delete');
trackEvent(Submit.WebhookDelete);
await goto(`${base}/console/project-${$project.$id}/settings/webhooks`);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.WebhookDelete);
}
}
</script>
@@ -1,7 +1,7 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Modal } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button } from '$lib/elements/forms';
@@ -21,12 +21,13 @@
type: 'success',
message: 'Key has been regenerated'
});
trackEvent('submit_webhook_update_signature');
trackEvent(Submit.WebhookUpdateSignature);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.WebhookUpdateSignature);
}
}
</script>
@@ -1,7 +1,7 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { CardGrid, Empty, EventModal, Heading } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, Form } from '$lib/elements/forms';
@@ -41,12 +41,13 @@
type: 'success',
message: 'Webhook events have been updated'
});
trackEvent('submit_webhook_update_events');
trackEvent(Submit.WebhookUpdateEvents);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.WebhookUpdateEvents);
}
}
@@ -1,7 +1,7 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { CardGrid, Heading } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, Form, FormList, InputText } from '$lib/elements/forms';
@@ -34,12 +34,13 @@
type: 'success',
message: 'Webhook name has been updated'
});
trackEvent('submit_webhook_update_name');
trackEvent(Submit.WebhookUpdateName);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.WebhookUpdateName);
}
}
</script>
@@ -1,7 +1,7 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { CardGrid, Heading } from '$lib/components';
import { Dependencies } from '$lib/constants';
import {
@@ -45,12 +45,13 @@
type: 'success',
message: 'Webhook security has been updated'
});
trackEvent('submit_webhook_update_security');
trackEvent(Submit.WebhookUpdateSecurity);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.WebhookUpdateSecurity);
}
}
</script>
@@ -1,7 +1,7 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { CardGrid, Heading } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, Form, FormList, InputText } from '$lib/elements/forms';
@@ -34,12 +34,13 @@
type: 'success',
message: 'Webhook url has been updated'
});
trackEvent('submit_webhook_update_url');
trackEvent(Submit.WebhookUpdateUrl);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.WebhookUpdateUrl);
}
}
</script>
@@ -12,7 +12,7 @@
import type { WizardStepsType } from '$lib/layout/wizard.svelte';
import { invalidate } from '$app/navigation';
import { Dependencies } from '$lib/constants';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
const projectId = $page.params.project;
const create = async () => {
@@ -32,12 +32,13 @@
type: 'success'
});
wizard.hide();
trackEvent('submit_webhook_create');
trackEvent(Submit.WebhookCreate);
} catch (error) {
addNotification({
message: error.message,
type: 'error'
});
trackError(error, Submit.WebhookCreate);
}
};
@@ -35,7 +35,7 @@
import type { PageData } from './$types';
import { invalidate } from '$app/navigation';
import { Dependencies, PAGE_LIMIT } from '$lib/constants';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
export let data: PageData;
@@ -65,12 +65,13 @@
await sdkForProject.storage.deleteFile(file.bucketId, file.$id);
uploader.removeFile(file);
invalidate(Dependencies.FILES);
trackEvent('submit_file_delete');
trackEvent(Submit.FileDelete);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.FileDelete);
}
}
</script>
@@ -8,7 +8,7 @@
import { bucket } from './store';
import { Permissions } from '$lib/components/permissions';
import { addNotification } from '$lib/stores/notifications';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
export let showCreate = false;
@@ -27,15 +27,15 @@
await uploader.uploadFile(bucketId, id, files[0], permissions);
files = null;
showCustomId = false;
// uploader.addFile(file);
dispatch('created');
addNotification({
type: 'success',
message: `File has been uploaded`
});
trackEvent('submit_file_create');
} catch ({ message }) {
error = message;
trackEvent(Submit.FileCreate);
} catch (e) {
error = e.message;
trackError(e, Submit.FileCreate);
}
}
@@ -2,7 +2,7 @@
import { goto } from '$app/navigation';
import { base } from '$app/paths';
import { page } from '$app/stores';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Modal } from '$lib/components';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
@@ -20,12 +20,13 @@
message: `${$bucket.name} has been deleted`
});
await goto(`${base}/console/project-${$page.params.project}/storage`);
trackEvent('submit_bucket_delete');
trackEvent(Submit.BucketDelete);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.BucketDelete);
}
};
</script>
@@ -1,5 +1,5 @@
<script lang="ts">
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Modal } from '$lib/components';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
@@ -21,12 +21,13 @@
type: 'success',
message: `${file.name} has been deleted`
});
trackEvent('submit_file_delete');
trackEvent(Submit.FileDelete);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.FileDelete);
}
};
</script>
@@ -14,7 +14,7 @@
import Delete from './deleteFile.svelte';
import { invalidate } from '$app/navigation';
import { Dependencies } from '$lib/constants';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { bucket } from '../store';
let showFileAlert = true;
@@ -54,12 +54,13 @@
message: 'Permissions have been updated',
type: 'success'
});
trackEvent('submit_file_update_permissions');
trackEvent(Submit.FileUpdatePermissions);
} catch (error) {
addNotification({
message: error.message,
type: 'error'
});
trackError(error, Submit.FileUpdatePermissions);
}
}
</script>
Loaded 100 of 107 files, more files were not shown because too many files have changed in this diff. Show more