From 5520edb2c5efc816b5b97322672af151b60ec4bb Mon Sep 17 00:00:00 2001 From: ShubhamPalriwala Date: Wed, 9 Aug 2023 18:43:50 +0530 Subject: [PATCH 1/2] feat: set response limit to 50 if the created survey is in-app --- .../environments/[environmentId]/surveys/SurveyStarter.tsx | 5 ++++- .../[environmentId]/surveys/templates/TemplateList.tsx | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/SurveyStarter.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/SurveyStarter.tsx index 21f23f8135..5572a70a02 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/SurveyStarter.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/SurveyStarter.tsx @@ -22,9 +22,12 @@ export default function SurveyStarter({ const router = useRouter(); const newSurveyFromTemplate = async (template: Template) => { setIsCreateSurveyLoading(true); + const surveyType = environment?.widgetSetupCompleted ? "web" : "link"; + const autoComplete = surveyType === "web" ? 50 : null; const augmentedTemplate = { ...template.preset, - type: environment?.widgetSetupCompleted ? "web" : "link", + type: surveyType, + autoComplete, }; try { const survey = await createSurveyAction(environmentId, augmentedTemplate); diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/templates/TemplateList.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/templates/TemplateList.tsx index 3080d3a973..40c4ce36bd 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/templates/TemplateList.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/templates/TemplateList.tsx @@ -71,9 +71,12 @@ export default function TemplateList({ const addSurvey = async (activeTemplate) => { setLoading(true); + const surveyType = environment?.widgetSetupCompleted ? "web" : "link"; + const autoComplete = surveyType === "web" ? 50 : null; const augmentedTemplate = { ...activeTemplate.preset, - type: environment?.widgetSetupCompleted ? "web" : "link", + type: surveyType, + autoComplete, }; const survey = await createSurveyAction(environmentId, augmentedTemplate); router.push(`/environments/${environmentId}/surveys/${survey.id}/edit`); From dc085c41c0493cf8e7b61b9efa50f001c31297c5 Mon Sep 17 00:00:00 2001 From: Johannes Date: Wed, 9 Aug 2023 18:12:38 +0200 Subject: [PATCH 2/2] Merge branch 'main' of github.com:formbricks/formbricks into shubham/for-1119-tweak-set-default-for-in-app-surveys-to-limit-to-50 --- apps/formbricks-com/components/docs/DocsFeedback.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/formbricks-com/components/docs/DocsFeedback.tsx b/apps/formbricks-com/components/docs/DocsFeedback.tsx index e650eee7f3..a12363a109 100644 --- a/apps/formbricks-com/components/docs/DocsFeedback.tsx +++ b/apps/formbricks-com/components/docs/DocsFeedback.tsx @@ -1,8 +1,7 @@ +import { Button, Popover, PopoverContent, PopoverTrigger } from "@formbricks/ui"; +import { useRouter } from "next/router"; import { useState } from "react"; import { handleFeedbackSubmit, updateFeedback } from "../../lib/handleFeedbackSubmit"; -import { Popover, PopoverTrigger, PopoverContent } from "@formbricks/ui"; -import { Button } from "@formbricks/ui"; -import { useRouter } from "next/router"; export const DocsFeedback: React.FC = () => { const router = useRouter(); @@ -26,7 +25,7 @@ export const DocsFeedback: React.FC = () => { Is everything on this page clear?
- {["Yes 👍", " No 👎"].map((option) => ( + {["Yes 👍", "No 👎"].map((option) => (