Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions src/lib/profiles/index.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ export type Profile = {
cookies: string;
pricing: string;
};
support: {
technical: string[];
};
};

export const base: Profile = {
Expand Down Expand Up @@ -130,6 +133,27 @@ export const base: Profile = {
cookies: 'https://appwrite.io/cookies',
privacy: 'https://appwrite.io/privacy',
pricing: 'https://appwrite.io/pricing'
},
support: {
technical: [
'Auth',
'Databases',
'Storage',
'Functions',
'Realtime',
'Messaging',
'Migrations',
'Webhooks',
'SDKs',
'Console',
'Backups',
'Blocked project',
'Domains',
'Outage',
'Platforms',
'Sites',
'Other'
]
}
};

Expand Down Expand Up @@ -195,6 +219,17 @@ export const studio: Profile = {
cookies: 'https://imagine.dev/cookies',
privacy: 'https://imagine.dev/privacy',
pricing: 'https://imagine.dev/pricing'
},
support: {
technical: [
'AI issue',
'Generation error',
'Preview not working',
'Auth',
'Databases',
'Storage',
'Other'
]
}
};

Expand Down
3 changes: 2 additions & 1 deletion src/lib/stores/feedback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { get, writable } from 'svelte/store';
import { Submit, trackEvent } from '$lib/actions/analytics';
import FeedbackNps from '$lib/components/feedback/feedbackNPS.svelte';
import FeedbackGeneral from '$lib/components/feedback/feedbackGeneral.svelte';
import type { Profile } from '$lib/profiles/index.svelte';
import { resolvedProfile, type Profile } from '$lib/profiles/index.svelte';

export type Feedback = {
elapsed: number;
Expand Down Expand Up @@ -147,6 +147,7 @@ function createFeedbackStore() {
customFields,
firstname: (name || 'Unknown').slice(0, 40),
metaFields: {
platform: resolvedProfile.platform,
source: get(feedback).source,
orgId,
projectId,
Expand Down
4 changes: 4 additions & 0 deletions src/lib/stores/support.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { writable } from 'svelte/store';
import type { ErrorParams } from '$lib/studio/studio-widget';

export const lastError = writable<ErrorParams>(null);
7 changes: 6 additions & 1 deletion src/lib/studio/studio-widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,11 @@ export function hideStudio() {
component.style.width = '';
restoreBodyScroll();
}

export type ErrorParams = {
traceId?: string;
message: string;
isChatError: boolean;
} | null;
export async function initImagine(
region: string,
projectId: string,
Expand All @@ -289,6 +293,7 @@ export async function initImagine(
onProjectNameChange: () => void;
onAddDomain: () => void | Promise<void>;
onManageDomains: (primaryDomain?: string) => void | Promise<void>;
onError: (params: ErrorParams) => void | Promise<void>;
onUpgrade: () => void | Promise<void>;
}
) {
Expand Down
6 changes: 5 additions & 1 deletion src/lib/studio/studio.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import { resolve } from '$app/paths';
import { get } from 'svelte/store';
import { organization as organizationStore } from '$lib/stores/organization';
import { lastError } from '$lib/stores/support';

const {
region,
Expand Down Expand Up @@ -46,9 +47,12 @@
onProjectNameChange: () => {
invalidate(Dependencies.PROJECT);
},
onAddDomain: async () => {
onAddDomain: () => {
showAddDomainsWizard = true;
},
onError: (error) => {
lastError.set(error);
},
onManageDomains: (primaryDomain) => {
if (primaryDomain) {
primaryDomainForSite = primaryDomain;
Expand Down
26 changes: 6 additions & 20 deletions src/routes/(console)/supportWizard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import { VARS } from '$lib/system';
import { IconCheckCircle, IconXCircle, IconInfo } from '@appwrite.io/pink-icons-svelte';
import { resolvedProfile } from '$lib/profiles/index.svelte';
import { lastError } from '$lib/stores/support';

let projectOptions = $state<Array<{ value: string; label: string }>>([]);

Expand All @@ -48,25 +49,7 @@
'Other'
],
billing: ['Invoice', 'Plans', 'Payment methods', 'Downgrade', 'Refund', 'Usage', 'Other'],
technical: [
'Auth',
'Databases',
'Storage',
'Functions',
'Realtime',
'Messaging',
'Migrations',
'Webhooks',
'SDKs',
'Console',
'Backups',
'Blocked project',
'Domains',
'Outage',
'Platforms',
'Sites',
'Other'
]
technical: resolvedProfile.support.technical
};

// Severity options
Expand Down Expand Up @@ -134,7 +117,10 @@
{ id: '48491', value: $supportData?.project ?? '' },
{ id: '56023', value: $supportData?.severity ?? '' },
{ id: '56024', value: $organization?.billingPlan ?? '' }
]
],
metaFields: {
error: $lastError
}
})
});
trackEvent(Submit.SupportTicket);
Expand Down
Loading