From b1de718c4ba7136f476e4abc4aed72302a1408db Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Wed, 14 Aug 2024 17:19:32 +0530 Subject: [PATCH 1/9] remove: name and email fields. --- src/lib/stores/feedback.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/lib/stores/feedback.ts b/src/lib/stores/feedback.ts index 7f9b6b2004..579628ea8f 100644 --- a/src/lib/stores/feedback.ts +++ b/src/lib/stores/feedback.ts @@ -15,8 +15,6 @@ export type Feedback = { export type FeedbackData = { message: string; - name?: string; - email?: string; value?: number; }; @@ -47,8 +45,6 @@ export const selectedFeedback = writable(); function createFeedbackDataStore() { const { set, subscribe, update } = writable({ message: '', - name: '', - email: '', value: null }); return { @@ -58,8 +54,6 @@ function createFeedbackDataStore() { reset: () => { update((feedbackData) => { feedbackData.message = ''; - feedbackData.name = ''; - feedbackData.email = ''; feedbackData.value = null; return feedbackData; }); @@ -113,8 +107,10 @@ function createFeedbackStore() { submitFeedback: async ( subject: string, message: string, - firstname?: string, + name?: string, email?: string, + billingPlan?: string, + currentPage?: string, value?: number ) => { if (!VARS.GROWTH_ENDPOINT) return; @@ -127,7 +123,9 @@ function createFeedbackStore() { subject, message, email, - firstname: firstname ? firstname : undefined, + billingPlan, + currentPage, + name: name ? name : undefined, customFields: value ? [{ id: '40655', value }] : undefined }) }); From 4f560dfde658c06777f06764019da1d21fddac64 Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Wed, 14 Aug 2024 17:21:04 +0530 Subject: [PATCH 2/9] remove: form fields. --- src/lib/components/feedback/feedbackGeneral.svelte | 8 +------- src/lib/components/feedback/feedbackNPS.svelte | 12 +----------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/src/lib/components/feedback/feedbackGeneral.svelte b/src/lib/components/feedback/feedbackGeneral.svelte index 183921a56f..642cbf6bb6 100644 --- a/src/lib/components/feedback/feedbackGeneral.svelte +++ b/src/lib/components/feedback/feedbackGeneral.svelte @@ -1,15 +1,9 @@ - - - import { FormList, InputTextarea, InputText, InputEmail } from '$lib/elements/forms'; + import { FormList, InputTextarea } from '$lib/elements/forms'; import { feedbackData } from '$lib/stores/feedback'; import Evaluation from './evaluation.svelte'; @@ -16,15 +16,5 @@ required bind:value={$feedbackData.message} showLabel={false} /> - - {/if} From 4fb6dcd3240eb3a1157b8fb85a4467ca5c40a8e1 Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Wed, 14 Aug 2024 17:21:46 +0530 Subject: [PATCH 3/9] update: feedback submission. --- src/lib/components/feedback/feedback.svelte | 10 ++++++++-- src/routes/console/wizard/feedback/step1.svelte | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/lib/components/feedback/feedback.svelte b/src/lib/components/feedback/feedback.svelte index db063755a7..0a3d17b7cc 100644 --- a/src/lib/components/feedback/feedback.svelte +++ b/src/lib/components/feedback/feedback.svelte @@ -6,7 +6,10 @@ feedbackOptions, feedbackData } from '$lib/stores/feedback'; + import { user } from '$lib/stores/user'; + import { organization } from '$lib/stores/organization'; import { addNotification } from '$lib/stores/notifications'; + import { page } from '$app/stores'; $: $selectedFeedback = feedbackOptions.find((option) => option.type === $feedback.type); @@ -15,8 +18,11 @@ await feedback.submitFeedback( `feedback-${$feedback.type}`, $feedbackData.message, - $feedbackData.name, - $feedbackData.email + $user.name, + $user.email, + $organization.billingPlan, + $page.url.href, + $feedbackData.value ); addNotification({ type: 'success', diff --git a/src/routes/console/wizard/feedback/step1.svelte b/src/routes/console/wizard/feedback/step1.svelte index c767a19db1..17219cc26c 100644 --- a/src/routes/console/wizard/feedback/step1.svelte +++ b/src/routes/console/wizard/feedback/step1.svelte @@ -6,7 +6,10 @@ feedbackOptions, feedback } from '$lib/stores/feedback'; + import { user } from '$lib/stores/user'; + import { organization } from '$lib/stores/organization'; import { addNotification } from '$lib/stores/notifications'; + import { page } from '$app/stores'; $: $selectedFeedback = feedbackOptions.find((option) => option.type === $feedback.type); @@ -15,8 +18,11 @@ await feedback.submitFeedback( `feedback-${$feedback.type}`, $feedbackData.message, - $feedbackData.name, - $feedbackData.email + $user.name, + $user.email, + $organization.billingPlan, + $page.url.href, + $feedbackData.value ); addNotification({ type: 'success', From 41caed5649758da48220631e3a97f6d5970e65d4 Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Wed, 14 Aug 2024 17:22:02 +0530 Subject: [PATCH 4/9] fix: typos. --- .../project-[project]/settings/migrations/exportModal.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/console/project-[project]/settings/migrations/exportModal.svelte b/src/routes/console/project-[project]/settings/migrations/exportModal.svelte index 246876a429..1d87b13a2d 100644 --- a/src/routes/console/project-[project]/settings/migrations/exportModal.svelte +++ b/src/routes/console/project-[project]/settings/migrations/exportModal.svelte @@ -55,7 +55,7 @@ await feedback.submitFeedback(`feedback-${$feedback.type}`, message); } catch (error) { console.error( - 'Feedback cound bot be submitted, but we continue to reditect to do export.' + 'Feedback could not be submitted, but we continue to redirect to do export.' ); console.error(error); } From b659b1692a52f419306dc1935f6d51fbc58b7cef Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Sun, 18 Aug 2024 14:46:04 +0530 Subject: [PATCH 5/9] add: current page to custom fields. --- src/lib/stores/feedback.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/lib/stores/feedback.ts b/src/lib/stores/feedback.ts index 579628ea8f..129cf64a67 100644 --- a/src/lib/stores/feedback.ts +++ b/src/lib/stores/feedback.ts @@ -104,11 +104,13 @@ function createFeedbackStore() { return feedback; }); }, + // TODO: update growth server to accept `billingPlan` and other keys. submitFeedback: async ( subject: string, message: string, name?: string, email?: string, + // @ts-ignore billingPlan?: string, currentPage?: string, value?: number @@ -123,10 +125,12 @@ function createFeedbackStore() { subject, message, email, - billingPlan, - currentPage, - name: name ? name : undefined, - customFields: value ? [{ id: '40655', value }] : undefined + // billingPlan, + firstname: name ? name : undefined, + customFields: [ + { id: '47364', currentPage }, + ...(value ? [{ id: '40655', value }] : []) + ] }) }); if (response.status >= 400) { From 1c2e81828bb33e780c0a1ebaf35f2d1d0836f78b Mon Sep 17 00:00:00 2001 From: Darshan Date: Tue, 10 Sep 2024 14:47:06 +0530 Subject: [PATCH 6/9] address internal comment. --- src/lib/stores/feedback.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/stores/feedback.ts b/src/lib/stores/feedback.ts index 287ee095a5..c10b49e614 100644 --- a/src/lib/stores/feedback.ts +++ b/src/lib/stores/feedback.ts @@ -126,7 +126,7 @@ function createFeedbackStore() { message, email, // billingPlan, - firstname: name ? name : undefined, + firstname: name || 'Unknown', customFields: [ { id: '47364', currentPage }, ...(value ? [{ id: '40655', value }] : []) From 10baba3b925243e1146f1505bba09cdf64ffc735 Mon Sep 17 00:00:00 2001 From: Darshan Date: Tue, 10 Sep 2024 15:29:53 +0530 Subject: [PATCH 7/9] remove: // @ts-ignore --- src/lib/stores/feedback.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lib/stores/feedback.ts b/src/lib/stores/feedback.ts index c10b49e614..0589a4bf03 100644 --- a/src/lib/stores/feedback.ts +++ b/src/lib/stores/feedback.ts @@ -110,7 +110,6 @@ function createFeedbackStore() { message: string, name?: string, email?: string, - // @ts-ignore billingPlan?: string, currentPage?: string, value?: number From 7260322555dbf4896e8cf6e39793b5b99de85876 Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Wed, 11 Sep 2024 11:40:43 +0530 Subject: [PATCH 8/9] fix: svelte check fix. --- src/lib/stores/feedback.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/stores/feedback.ts b/src/lib/stores/feedback.ts index 0589a4bf03..f586df983f 100644 --- a/src/lib/stores/feedback.ts +++ b/src/lib/stores/feedback.ts @@ -110,6 +110,8 @@ function createFeedbackStore() { message: string, name?: string, email?: string, + // eslint-disable-next-line + // @ts-expect-error billingPlan?: string, currentPage?: string, value?: number From b125a4feee008283d58c3d2c9fda2d3bbde5aa1c Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Wed, 11 Sep 2024 11:44:08 +0530 Subject: [PATCH 9/9] fix: svelte check fix. --- src/lib/layout/footer.svelte | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/lib/layout/footer.svelte b/src/lib/layout/footer.svelte index 89e130d74d..9e92cff650 100644 --- a/src/lib/layout/footer.svelte +++ b/src/lib/layout/footer.svelte @@ -1,6 +1,4 @@