From c4258bfe3c114f4d8b9ab7a8746978b68fbbd024 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keviin=20=C3=85berg=20Kultalahti?= Date: Mon, 19 Jul 2021 09:28:34 +0200 Subject: [PATCH 01/12] implements nps form component --- .../src/components/deploy/DeployModal.svelte | 3 + .../src/components/deploy/Feedback.svelte | 129 ++++++++++ packages/server/yarn.lock | 141 ---------- packages/standard-components/yarn.lock | 241 +----------------- 4 files changed, 135 insertions(+), 379 deletions(-) create mode 100644 packages/builder/src/components/deploy/Feedback.svelte diff --git a/packages/builder/src/components/deploy/DeployModal.svelte b/packages/builder/src/components/deploy/DeployModal.svelte index 6e1b5f76e9..b88ec0a49c 100644 --- a/packages/builder/src/components/deploy/DeployModal.svelte +++ b/packages/builder/src/components/deploy/DeployModal.svelte @@ -2,6 +2,7 @@ import { onMount, onDestroy } from "svelte" import { Button, Modal, notifications, ModalContent } from "@budibase/bbui" import FeedbackIframe from "../feedback/FeedbackIframe.svelte" + import Feedback from "./Feedback.svelte" import { store } from "builderStore" import api from "builderStore/api" import analytics from "analytics" @@ -92,6 +93,8 @@ onDestroy(() => clearInterval(poll)) + + + import { + ActionButton, + RadioGroup, + TextArea, + ButtonGroup, + Button, + Heading, + Detail, + Divider, + Layout, + } from "@budibase/bbui" + let step = 0 + let ratings = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + let options = [ + "Importing / managing data", + "Designing", + "Automations", + "Managing users / groups", + "Deployment / hosting", + "Documentation", + ] + + // Data to send off + let rating + let improvements + let comment + + function selectNumber(n) { + rating = n + step = 1 + } + + function submitFeedback() { + // 1. Submit feedback + // 2. dispatch event to parent and publish event + // 3. Store cookie, flip user flag + console.log({ + rating, + improvements, + comment, + }) + } + + +
+