Skip to content

Commit 3e58cc3

Browse files
Merge pull request #2713 from appwrite/fix-feedback-support
2 parents 75eacb2 + ea93083 commit 3e58cc3

6 files changed

Lines changed: 58 additions & 23 deletions

File tree

src/lib/profiles/index.svelte.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ export type Profile = {
7070
cookies: string;
7171
pricing: string;
7272
};
73+
support: {
74+
technical: string[];
75+
};
7376
};
7477

7578
export const base: Profile = {
@@ -130,6 +133,27 @@ export const base: Profile = {
130133
cookies: 'https://appwrite.io/cookies',
131134
privacy: 'https://appwrite.io/privacy',
132135
pricing: 'https://appwrite.io/pricing'
136+
},
137+
support: {
138+
technical: [
139+
'Auth',
140+
'Databases',
141+
'Storage',
142+
'Functions',
143+
'Realtime',
144+
'Messaging',
145+
'Migrations',
146+
'Webhooks',
147+
'SDKs',
148+
'Console',
149+
'Backups',
150+
'Blocked project',
151+
'Domains',
152+
'Outage',
153+
'Platforms',
154+
'Sites',
155+
'Other'
156+
]
133157
}
134158
};
135159

@@ -195,6 +219,17 @@ export const studio: Profile = {
195219
cookies: 'https://imagine.dev/cookies',
196220
privacy: 'https://imagine.dev/privacy',
197221
pricing: 'https://imagine.dev/pricing'
222+
},
223+
support: {
224+
technical: [
225+
'AI issue',
226+
'Generation error',
227+
'Preview not working',
228+
'Auth',
229+
'Databases',
230+
'Storage',
231+
'Other'
232+
]
198233
}
199234
};
200235

src/lib/stores/feedback.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { get, writable } from 'svelte/store';
55
import { Submit, trackEvent } from '$lib/actions/analytics';
66
import FeedbackNps from '$lib/components/feedback/feedbackNPS.svelte';
77
import FeedbackGeneral from '$lib/components/feedback/feedbackGeneral.svelte';
8-
import type { Profile } from '$lib/profiles/index.svelte';
8+
import { resolvedProfile, type Profile } from '$lib/profiles/index.svelte';
99

1010
export type Feedback = {
1111
elapsed: number;
@@ -147,6 +147,7 @@ function createFeedbackStore() {
147147
customFields,
148148
firstname: (name || 'Unknown').slice(0, 40),
149149
metaFields: {
150+
platform: resolvedProfile.platform,
150151
source: get(feedback).source,
151152
orgId,
152153
projectId,

src/lib/stores/support.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { writable } from 'svelte/store';
2+
import type { ErrorParams } from '$lib/studio/studio-widget';
3+
4+
export const lastError = writable<ErrorParams>(null);

src/lib/studio/studio-widget.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,11 @@ export function hideStudio() {
280280
component.style.width = '';
281281
restoreBodyScroll();
282282
}
283-
283+
export type ErrorParams = {
284+
traceId?: string;
285+
message: string;
286+
isChatError: boolean;
287+
} | null;
284288
export async function initImagine(
285289
region: string,
286290
projectId: string,
@@ -289,6 +293,7 @@ export async function initImagine(
289293
onProjectNameChange: () => void;
290294
onAddDomain: () => void | Promise<void>;
291295
onManageDomains: (primaryDomain?: string) => void | Promise<void>;
296+
onError: (params: ErrorParams) => void | Promise<void>;
292297
onUpgrade: () => void | Promise<void>;
293298
}
294299
) {

src/lib/studio/studio.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import { resolve } from '$app/paths';
1717
import { get } from 'svelte/store';
1818
import { organization as organizationStore } from '$lib/stores/organization';
19+
import { lastError } from '$lib/stores/support';
1920
2021
const {
2122
region,
@@ -46,9 +47,12 @@
4647
onProjectNameChange: () => {
4748
invalidate(Dependencies.PROJECT);
4849
},
49-
onAddDomain: async () => {
50+
onAddDomain: () => {
5051
showAddDomainsWizard = true;
5152
},
53+
onError: (error) => {
54+
lastError.set(error);
55+
},
5256
onManageDomains: (primaryDomain) => {
5357
if (primaryDomain) {
5458
primaryDomainForSite = primaryDomain;

src/routes/(console)/supportWizard.svelte

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import { VARS } from '$lib/system';
2727
import { IconCheckCircle, IconXCircle, IconInfo } from '@appwrite.io/pink-icons-svelte';
2828
import { resolvedProfile } from '$lib/profiles/index.svelte';
29+
import { lastError } from '$lib/stores/support';
2930
3031
let projectOptions = $state<Array<{ value: string; label: string }>>([]);
3132
@@ -48,25 +49,7 @@
4849
'Other'
4950
],
5051
billing: ['Invoice', 'Plans', 'Payment methods', 'Downgrade', 'Refund', 'Usage', 'Other'],
51-
technical: [
52-
'Auth',
53-
'Databases',
54-
'Storage',
55-
'Functions',
56-
'Realtime',
57-
'Messaging',
58-
'Migrations',
59-
'Webhooks',
60-
'SDKs',
61-
'Console',
62-
'Backups',
63-
'Blocked project',
64-
'Domains',
65-
'Outage',
66-
'Platforms',
67-
'Sites',
68-
'Other'
69-
]
52+
technical: resolvedProfile.support.technical
7053
};
7154
7255
// Severity options
@@ -134,7 +117,10 @@
134117
{ id: '48491', value: $supportData?.project ?? '' },
135118
{ id: '56023', value: $supportData?.severity ?? '' },
136119
{ id: '56024', value: $organization?.billingPlan ?? '' }
137-
]
120+
],
121+
metaFields: {
122+
error: $lastError
123+
}
138124
})
139125
});
140126
trackEvent(Submit.SupportTicket);

0 commit comments

Comments
 (0)