From 5b0557bc2869bdfc36542e5bdad261708a1c23af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keviin=20=C3=85berg=20Kultalahti?= Date: Wed, 21 Jul 2021 12:28:38 +0200 Subject: [PATCH] Adds last bits to NPS feedback form --- .../src/components/deploy/DeployModal.svelte | 11 +----- .../NPSFeedbackForm.svelte} | 18 +++++++--- .../builder/app/[application]/_layout.svelte | 34 +++++++++++++++---- 3 files changed, 41 insertions(+), 22 deletions(-) rename packages/builder/src/components/{deploy/Feedback.svelte => feedback/NPSFeedbackForm.svelte} (89%) diff --git a/packages/builder/src/components/deploy/DeployModal.svelte b/packages/builder/src/components/deploy/DeployModal.svelte index b88ec0a49c..4daa16c7c4 100644 --- a/packages/builder/src/components/deploy/DeployModal.svelte +++ b/packages/builder/src/components/deploy/DeployModal.svelte @@ -1,9 +1,6 @@ - - - - + /> + import analytics from "analytics" + import { createEventDispatcher } from "svelte" + import { fly } from "svelte/transition" import { ActionButton, RadioGroup, @@ -21,6 +24,8 @@ "Documentation", ] + const dispatch = createEventDispatcher() + // Data to send off let rating let improvements @@ -31,20 +36,23 @@ step = 1 } - function submitFeedback() { + function submitFeedback(ev) { // 1. Submit feedback // 2. dispatch event to parent and publish event // 3. Store cookie, flip user flag - console.log({ + + analytics.submitFeedback({ rating, improvements, comment, }) + + dispatch("submitted") } -
-