Set Response Limit to 50 when an In-App Survey is Created and Fix Doc Feedback survey

Set Response Limit to 50 when an In-App Survey is Created and Fix Doc Feedback survey
This commit is contained in:
Johannes
2023-08-09 18:14:34 +02:00
committed by GitHub
3 changed files with 11 additions and 6 deletions

View File

@@ -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?
<Popover open={isOpen} onOpenChange={setIsOpen}>
<div className="mt-2 inline-flex space-x-3 md:ml-4 md:mt-0">
{["Yes 👍", " No 👎"].map((option) => (
{["Yes 👍", "No 👎"].map((option) => (
<PopoverTrigger
key={option}
className="rounded border border-slate-200 bg-slate-50 px-4 py-2 text-slate-900 hover:bg-slate-100 hover:text-slate-600 focus:outline-none focus:ring-2 focus:ring-neutral-900 focus:ring-offset-1 dark:border-slate-700 dark:bg-slate-700 dark:text-slate-300 dark:hover:bg-slate-600 dark:hover:text-slate-300"

View File

@@ -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);

View File

@@ -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`);