mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-06 05:40:02 -06:00
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:
@@ -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"
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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`);
|
||||
|
||||
Reference in New Issue
Block a user