mirror of
https://github.com/formbricks/formbricks.git
synced 2025-12-30 10:19:51 -06:00
refactor: removes old types (#1288)
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
This commit is contained in:
committed by
GitHub
parent
7fd89daca9
commit
f70cda6e11
@@ -1,9 +1,9 @@
|
||||
import type { CTAQuestion } from "@formbricks/types/questions";
|
||||
import { TSurveyCTAQuestion } from "@formbricks/types/surveys";
|
||||
import Headline from "./Headline";
|
||||
import HtmlBody from "./HtmlBody";
|
||||
|
||||
interface CTAQuestionProps {
|
||||
question: CTAQuestion;
|
||||
question: TSurveyCTAQuestion;
|
||||
onSubmit: (data: { [x: string]: any }) => void;
|
||||
lastQuestion: boolean;
|
||||
brandColor: string;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import PreviewSurvey from "./PreviewSurvey";
|
||||
import { findTemplateByName } from "./templates";
|
||||
import type { Template } from "@formbricks/types/templates";
|
||||
import { TTemplate } from "@formbricks/types/surveys";
|
||||
|
||||
interface DemoPreviewProps {
|
||||
template: string;
|
||||
@@ -10,7 +10,7 @@ interface DemoPreviewProps {
|
||||
|
||||
const DemoPreview: React.FC<DemoPreviewProps> = ({ template }) => {
|
||||
const [activeQuestionId, setActiveQuestionId] = useState<string | null>(null);
|
||||
const selectedTemplate: Template | undefined = findTemplateByName(template);
|
||||
const selectedTemplate: TTemplate | undefined = findTemplateByName(template);
|
||||
|
||||
useEffect(() => {
|
||||
if (selectedTemplate) {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import type { Template } from "@formbricks/types/templates";
|
||||
import { TTemplate } from "@formbricks/types/surveys";
|
||||
import { useEffect, useState } from "react";
|
||||
import PreviewSurvey from "./PreviewSurvey";
|
||||
import TemplateList from "./TemplateList";
|
||||
import { templates } from "./templates";
|
||||
|
||||
export default function SurveyTemplatesPage({}) {
|
||||
const [activeTemplate, setActiveTemplate] = useState<Template | null>(null);
|
||||
const [activeTemplate, setActiveTemplate] = useState<TTemplate | null>(null);
|
||||
const [activeQuestionId, setActiveQuestionId] = useState<string | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { useState, useEffect } from "react";
|
||||
import { cn } from "@formbricks/lib/cn";
|
||||
import type { MultipleChoiceMultiQuestion } from "@formbricks/types/questions";
|
||||
import { TSurveyMultipleChoiceMultiQuestion } from "@formbricks/types/surveys";
|
||||
import Headline from "./Headline";
|
||||
import Subheader from "./Subheader";
|
||||
|
||||
interface MultipleChoiceMultiProps {
|
||||
question: MultipleChoiceMultiQuestion;
|
||||
question: TSurveyMultipleChoiceMultiQuestion;
|
||||
onSubmit: (data: { [x: string]: any }) => void;
|
||||
lastQuestion: boolean;
|
||||
brandColor: string;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { cn } from "@formbricks/lib/cn";
|
||||
import type { MultipleChoiceSingleQuestion } from "@formbricks/types/questions";
|
||||
import { TSurveyMultipleChoiceSingleQuestion } from "@formbricks/types/surveys";
|
||||
import { useState } from "react";
|
||||
import Headline from "./Headline";
|
||||
import Subheader from "./Subheader";
|
||||
|
||||
interface MultipleChoiceSingleProps {
|
||||
question: MultipleChoiceSingleQuestion;
|
||||
question: TSurveyMultipleChoiceSingleQuestion;
|
||||
onSubmit: (data: { [x: string]: any }) => void;
|
||||
lastQuestion: boolean;
|
||||
brandColor: string;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { useState } from "react";
|
||||
import { cn } from "@formbricks/lib/cn";
|
||||
import type { NPSQuestion } from "@formbricks/types/questions";
|
||||
import { TSurveyNPSQuestion } from "@formbricks/types/surveys";
|
||||
import Headline from "./Headline";
|
||||
import Subheader from "./Subheader";
|
||||
|
||||
interface NPSQuestionProps {
|
||||
question: NPSQuestion;
|
||||
question: TSurveyNPSQuestion;
|
||||
onSubmit: (data: { [x: string]: any }) => void;
|
||||
lastQuestion: boolean;
|
||||
brandColor: string;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import type { OpenTextQuestion } from "@formbricks/types/questions";
|
||||
import { TSurveyOpenTextQuestion } from "@formbricks/types/surveys";
|
||||
import { useState } from "react";
|
||||
import Headline from "./Headline";
|
||||
import Subheader from "./Subheader";
|
||||
|
||||
interface OpenTextQuestionProps {
|
||||
question: OpenTextQuestion;
|
||||
question: TSurveyOpenTextQuestion;
|
||||
onSubmit: (data: { [x: string]: any }) => void;
|
||||
lastQuestion: boolean;
|
||||
brandColor: string;
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
import { useState } from "react";
|
||||
import Modal from "./Modal";
|
||||
import QuestionConditional from "./QuestionConditional";
|
||||
import type { Question } from "@formbricks/types/questions";
|
||||
import { Survey } from "@formbricks/types/surveys";
|
||||
import { TSurveyQuestion, TSurvey } from "@formbricks/types/surveys";
|
||||
import ThankYouCard from "./ThankYouCard";
|
||||
|
||||
interface PreviewSurveyProps {
|
||||
localSurvey?: Survey;
|
||||
localSurvey?: TSurvey;
|
||||
setActiveQuestionId: (id: string | null) => void;
|
||||
activeQuestionId?: string | null;
|
||||
questions: Question[];
|
||||
questions: TSurveyQuestion[];
|
||||
brandColor: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { QuestionType, type Question } from "@formbricks/types/questions";
|
||||
import { TSurveyQuestion, TSurveyQuestionType } from "@formbricks/types/surveys";
|
||||
import OpenTextQuestion from "./OpenTextQuestion";
|
||||
import MultipleChoiceSingleQuestion from "./MultipleChoiceSingleQuestion";
|
||||
import MultipleChoiceMultiQuestion from "./MultipleChoiceMultiQuestion";
|
||||
@@ -7,7 +7,7 @@ import CTAQuestion from "./CTAQuestion";
|
||||
import RatingQuestion from "./RatingQuestion";
|
||||
|
||||
interface QuestionConditionalProps {
|
||||
question: Question;
|
||||
question: TSurveyQuestion;
|
||||
onSubmit: (data: { [x: string]: any }) => void;
|
||||
lastQuestion: boolean;
|
||||
brandColor: string;
|
||||
@@ -19,42 +19,42 @@ export default function QuestionConditional({
|
||||
lastQuestion,
|
||||
brandColor,
|
||||
}: QuestionConditionalProps) {
|
||||
return question.type === QuestionType.OpenText ? (
|
||||
return question.type === TSurveyQuestionType.OpenText ? (
|
||||
<OpenTextQuestion
|
||||
question={question}
|
||||
onSubmit={onSubmit}
|
||||
lastQuestion={lastQuestion}
|
||||
brandColor={brandColor}
|
||||
/>
|
||||
) : question.type === QuestionType.MultipleChoiceSingle ? (
|
||||
) : question.type === TSurveyQuestionType.MultipleChoiceSingle ? (
|
||||
<MultipleChoiceSingleQuestion
|
||||
question={question}
|
||||
onSubmit={onSubmit}
|
||||
lastQuestion={lastQuestion}
|
||||
brandColor={brandColor}
|
||||
/>
|
||||
) : question.type === QuestionType.MultipleChoiceMulti ? (
|
||||
) : question.type === TSurveyQuestionType.MultipleChoiceMulti ? (
|
||||
<MultipleChoiceMultiQuestion
|
||||
question={question}
|
||||
onSubmit={onSubmit}
|
||||
lastQuestion={lastQuestion}
|
||||
brandColor={brandColor}
|
||||
/>
|
||||
) : question.type === QuestionType.NPS ? (
|
||||
) : question.type === TSurveyQuestionType.NPS ? (
|
||||
<NPSQuestion
|
||||
question={question}
|
||||
onSubmit={onSubmit}
|
||||
lastQuestion={lastQuestion}
|
||||
brandColor={brandColor}
|
||||
/>
|
||||
) : question.type === QuestionType.CTA ? (
|
||||
) : question.type === TSurveyQuestionType.CTA ? (
|
||||
<CTAQuestion
|
||||
question={question}
|
||||
onSubmit={onSubmit}
|
||||
lastQuestion={lastQuestion}
|
||||
brandColor={brandColor}
|
||||
/>
|
||||
) : question.type === QuestionType.Rating ? (
|
||||
) : question.type === TSurveyQuestionType.Rating ? (
|
||||
<RatingQuestion
|
||||
question={question}
|
||||
onSubmit={onSubmit}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import type { RatingQuestion } from "@formbricks/types/questions";
|
||||
import { TSurveyRatingQuestion } from "@formbricks/types/surveys";
|
||||
import { useState } from "react";
|
||||
import { cn } from "@formbricks/lib/cn";
|
||||
import Headline from "./Headline";
|
||||
import Subheader from "./Subheader";
|
||||
|
||||
interface RatingQuestionProps {
|
||||
question: RatingQuestion;
|
||||
question: TSurveyRatingQuestion;
|
||||
onSubmit: (data: { [x: string]: any }) => void;
|
||||
lastQuestion: boolean;
|
||||
brandColor: string;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import type { Template } from "@formbricks/types/templates";
|
||||
import { TTemplate } from "@formbricks/types/surveys";
|
||||
import { useEffect, useState } from "react";
|
||||
import { cn } from "@formbricks/lib/cn";
|
||||
import { templates } from "./templates";
|
||||
|
||||
type TemplateList = {
|
||||
onTemplateClick: (template: Template) => void;
|
||||
activeTemplate: Template | null;
|
||||
onTemplateClick: (template: TTemplate) => void;
|
||||
activeTemplate: TTemplate | null;
|
||||
};
|
||||
|
||||
const ALL_CATEGORY_NAME = "All";
|
||||
@@ -50,7 +50,7 @@ export default function TemplateList({ onTemplateClick, activeTemplate }: Templa
|
||||
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2">
|
||||
{templates
|
||||
.filter((template) => selectedFilter === ALL_CATEGORY_NAME || template.category === selectedFilter)
|
||||
.map((template: Template) => (
|
||||
.map((template: TTemplate) => (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
|
||||
@@ -23,8 +23,8 @@ import {
|
||||
} from "@formbricks/ui/icons";
|
||||
|
||||
import { createId } from "@paralleldrive/cuid2";
|
||||
import type { Template } from "@formbricks/types/templates";
|
||||
import { QuestionType } from "@formbricks/types/questions";
|
||||
import { TTemplate } from "@formbricks/types/surveys";
|
||||
import { TSurveyQuestionType } from "@formbricks/types/surveys";
|
||||
|
||||
const thankYouCardDefault = {
|
||||
enabled: true,
|
||||
@@ -32,7 +32,7 @@ const thankYouCardDefault = {
|
||||
subheader: "We appreciate your feedback.",
|
||||
};
|
||||
|
||||
export const customSurvey: Template = {
|
||||
export const customSurvey: TTemplate = {
|
||||
name: "Start from scratch",
|
||||
description: "Create a survey without template.",
|
||||
icon: null,
|
||||
@@ -41,10 +41,11 @@ export const customSurvey: Template = {
|
||||
questions: [
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.OpenText,
|
||||
type: TSurveyQuestionType.OpenText,
|
||||
headline: "Custom Survey",
|
||||
subheader: "This is an example survey.",
|
||||
placeholder: "Type your answer here...",
|
||||
inputType: "text",
|
||||
longAnswer: true,
|
||||
required: true,
|
||||
},
|
||||
@@ -53,7 +54,7 @@ export const customSurvey: Template = {
|
||||
},
|
||||
};
|
||||
|
||||
export const templates: Template[] = [
|
||||
export const templates: TTemplate[] = [
|
||||
{
|
||||
name: "Product Market Fit (Superhuman)",
|
||||
icon: PMFIcon,
|
||||
@@ -65,7 +66,7 @@ export const templates: Template[] = [
|
||||
questions: [
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.MultipleChoiceSingle,
|
||||
type: TSurveyQuestionType.MultipleChoiceSingle,
|
||||
headline: "How disappointed would you be if you could no longer use Formbricks?",
|
||||
subheader: "Please select one of the following options:",
|
||||
required: true,
|
||||
@@ -87,7 +88,7 @@ export const templates: Template[] = [
|
||||
},
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.MultipleChoiceSingle,
|
||||
type: TSurveyQuestionType.MultipleChoiceSingle,
|
||||
headline: "What is your role?",
|
||||
subheader: "Please select one of the following options:",
|
||||
required: true,
|
||||
@@ -117,22 +118,25 @@ export const templates: Template[] = [
|
||||
},
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.OpenText,
|
||||
type: TSurveyQuestionType.OpenText,
|
||||
headline: "What type of people do you think would most benefit from Formbricks?",
|
||||
inputType: "text",
|
||||
longAnswer: true,
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.OpenText,
|
||||
type: TSurveyQuestionType.OpenText,
|
||||
headline: "What is the main benefit your receive from Formbricks?",
|
||||
inputType: "text",
|
||||
longAnswer: true,
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.OpenText,
|
||||
type: TSurveyQuestionType.OpenText,
|
||||
headline: "How can we improve our service for you?",
|
||||
inputType: "text",
|
||||
subheader: "Please be as specific as possible.",
|
||||
longAnswer: true,
|
||||
required: true,
|
||||
@@ -152,7 +156,7 @@ export const templates: Template[] = [
|
||||
questions: [
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.MultipleChoiceSingle,
|
||||
type: TSurveyQuestionType.MultipleChoiceSingle,
|
||||
headline: "What is your role?",
|
||||
subheader: "Please select one of the following options:",
|
||||
required: true,
|
||||
@@ -182,7 +186,7 @@ export const templates: Template[] = [
|
||||
},
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.MultipleChoiceSingle,
|
||||
type: TSurveyQuestionType.MultipleChoiceSingle,
|
||||
headline: "What's your company size?",
|
||||
subheader: "Please select one of the following options:",
|
||||
required: true,
|
||||
@@ -212,7 +216,7 @@ export const templates: Template[] = [
|
||||
},
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.MultipleChoiceSingle,
|
||||
type: TSurveyQuestionType.MultipleChoiceSingle,
|
||||
headline: "How did you hear about us first?",
|
||||
subheader: "Please select one of the following options:",
|
||||
required: true,
|
||||
@@ -254,7 +258,7 @@ export const templates: Template[] = [
|
||||
questions: [
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.MultipleChoiceSingle,
|
||||
type: TSurveyQuestionType.MultipleChoiceSingle,
|
||||
headline: "What do you value most about our service?",
|
||||
subheader: "Please select one of the following options:",
|
||||
required: true,
|
||||
@@ -280,7 +284,7 @@ export const templates: Template[] = [
|
||||
},
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.MultipleChoiceSingle,
|
||||
type: TSurveyQuestionType.MultipleChoiceSingle,
|
||||
headline: "What should we improve on?",
|
||||
subheader: "Please select one of the following options:",
|
||||
required: true,
|
||||
@@ -306,9 +310,10 @@ export const templates: Template[] = [
|
||||
},
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.OpenText,
|
||||
type: TSurveyQuestionType.OpenText,
|
||||
headline: "Would you like to add something?",
|
||||
subheader: "Feel free to speak your mind, we do too.",
|
||||
inputType: "text",
|
||||
longAnswer: true,
|
||||
required: false,
|
||||
},
|
||||
@@ -326,7 +331,7 @@ export const templates: Template[] = [
|
||||
questions: [
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.MultipleChoiceSingle,
|
||||
type: TSurveyQuestionType.MultipleChoiceSingle,
|
||||
headline: "How did you hear about us first?",
|
||||
subheader: "Please select one of the following options:",
|
||||
required: true,
|
||||
@@ -368,7 +373,7 @@ export const templates: Template[] = [
|
||||
questions: [
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.MultipleChoiceSingle,
|
||||
type: TSurveyQuestionType.MultipleChoiceSingle,
|
||||
headline: "Why did you cancel your subscription?",
|
||||
subheader: "We're sorry to see you leave. Please help us do better:",
|
||||
required: true,
|
||||
@@ -398,9 +403,10 @@ export const templates: Template[] = [
|
||||
},
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.OpenText,
|
||||
type: TSurveyQuestionType.OpenText,
|
||||
headline: "How can we win you back?",
|
||||
subheader: "Feel free to speak your mind, we do too.",
|
||||
inputType: "text",
|
||||
longAnswer: true,
|
||||
required: false,
|
||||
},
|
||||
@@ -418,7 +424,7 @@ export const templates: Template[] = [
|
||||
questions: [
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.MultipleChoiceSingle,
|
||||
type: TSurveyQuestionType.MultipleChoiceSingle,
|
||||
headline: "Why did you stop your trial?",
|
||||
subheader: "Help us understand you better:",
|
||||
required: true,
|
||||
@@ -448,15 +454,17 @@ export const templates: Template[] = [
|
||||
},
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.OpenText,
|
||||
type: TSurveyQuestionType.OpenText,
|
||||
headline: "Any details to share?",
|
||||
inputType: "text",
|
||||
longAnswer: true,
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.OpenText,
|
||||
type: TSurveyQuestionType.OpenText,
|
||||
headline: "How are you solving your problem instead?",
|
||||
inputType: "text",
|
||||
subheader: "Please name alternative tools:",
|
||||
longAnswer: true,
|
||||
required: false,
|
||||
@@ -475,7 +483,7 @@ export const templates: Template[] = [
|
||||
questions: [
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.MultipleChoiceSingle,
|
||||
type: TSurveyQuestionType.MultipleChoiceSingle,
|
||||
headline: "How easy was it to change your plan?",
|
||||
required: true,
|
||||
shuffleOption: "none",
|
||||
@@ -504,7 +512,7 @@ export const templates: Template[] = [
|
||||
},
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.MultipleChoiceSingle,
|
||||
type: TSurveyQuestionType.MultipleChoiceSingle,
|
||||
headline: "Is the pricing information easy to understand?",
|
||||
required: true,
|
||||
shuffleOption: "none",
|
||||
@@ -537,7 +545,7 @@ export const templates: Template[] = [
|
||||
questions: [
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.MultipleChoiceSingle,
|
||||
type: TSurveyQuestionType.MultipleChoiceSingle,
|
||||
headline: "Were you able to accomplish what you came here to do today?",
|
||||
required: true,
|
||||
shuffleOption: "none",
|
||||
@@ -558,7 +566,7 @@ export const templates: Template[] = [
|
||||
},
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.Rating,
|
||||
type: TSurveyQuestionType.Rating,
|
||||
headline: "How easy was it to achieve your goal?",
|
||||
required: true,
|
||||
lowerLabel: "Very difficult",
|
||||
@@ -568,8 +576,9 @@ export const templates: Template[] = [
|
||||
},
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.OpenText,
|
||||
type: TSurveyQuestionType.OpenText,
|
||||
headline: "What did you come here to do today?",
|
||||
inputType: "text",
|
||||
longAnswer: true,
|
||||
required: false,
|
||||
},
|
||||
@@ -588,7 +597,7 @@ export const templates: Template[] = [
|
||||
questions: [
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.MultipleChoiceSingle,
|
||||
type: TSurveyQuestionType.MultipleChoiceSingle,
|
||||
headline: "What's your primary goal for using Formbricks?",
|
||||
required: true,
|
||||
shuffleOption: "none",
|
||||
@@ -625,7 +634,7 @@ export const templates: Template[] = [
|
||||
questions: [
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.Rating,
|
||||
type: TSurveyQuestionType.Rating,
|
||||
headline: "How easy was it to achieve your goal?",
|
||||
required: true,
|
||||
lowerLabel: "Very difficult",
|
||||
@@ -635,8 +644,9 @@ export const templates: Template[] = [
|
||||
},
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.OpenText,
|
||||
type: TSurveyQuestionType.OpenText,
|
||||
headline: "Wanna add something?",
|
||||
inputType: "text",
|
||||
subheader: "This really helps us do better!",
|
||||
longAnswer: true,
|
||||
required: false,
|
||||
@@ -655,7 +665,7 @@ export const templates: Template[] = [
|
||||
questions: [
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.Rating,
|
||||
type: TSurveyQuestionType.Rating,
|
||||
headline: "How important is this feature for you?",
|
||||
required: true,
|
||||
lowerLabel: "Not important",
|
||||
@@ -678,7 +688,7 @@ export const templates: Template[] = [
|
||||
questions: [
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.MultipleChoiceSingle,
|
||||
type: TSurveyQuestionType.MultipleChoiceSingle,
|
||||
headline: "How disappointed would you be if you could no longer use Formbricks?",
|
||||
subheader: "Please select one of the following options:",
|
||||
required: true,
|
||||
@@ -700,8 +710,9 @@ export const templates: Template[] = [
|
||||
},
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.OpenText,
|
||||
type: TSurveyQuestionType.OpenText,
|
||||
headline: "How can we improve our service for you?",
|
||||
inputType: "text",
|
||||
subheader: "Please be as specific as possible.",
|
||||
longAnswer: true,
|
||||
required: true,
|
||||
@@ -720,7 +731,7 @@ export const templates: Template[] = [
|
||||
questions: [
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.MultipleChoiceSingle,
|
||||
type: TSurveyQuestionType.MultipleChoiceSingle,
|
||||
headline: "What's on your mind, boss?",
|
||||
subheader: "Thanks for sharing. We'll get back to you asap.",
|
||||
required: true,
|
||||
@@ -738,8 +749,9 @@ export const templates: Template[] = [
|
||||
},
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.OpenText,
|
||||
type: TSurveyQuestionType.OpenText,
|
||||
headline: "Give us the juicy details:",
|
||||
inputType: "text",
|
||||
longAnswer: true,
|
||||
required: true,
|
||||
},
|
||||
@@ -757,7 +769,7 @@ export const templates: Template[] = [
|
||||
questions: [
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.MultipleChoiceSingle,
|
||||
type: TSurveyQuestionType.MultipleChoiceSingle,
|
||||
headline: "How easy was it to set this integration up?",
|
||||
required: true,
|
||||
shuffleOption: "none",
|
||||
@@ -786,8 +798,9 @@ export const templates: Template[] = [
|
||||
},
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.OpenText,
|
||||
type: TSurveyQuestionType.OpenText,
|
||||
headline: "Which product would you like to integrate next?",
|
||||
inputType: "text",
|
||||
subheader: "We keep building integrations. Yours can be next:",
|
||||
longAnswer: true,
|
||||
required: false,
|
||||
@@ -806,7 +819,7 @@ export const templates: Template[] = [
|
||||
questions: [
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.MultipleChoiceSingle,
|
||||
type: TSurveyQuestionType.MultipleChoiceSingle,
|
||||
headline: "Which other tools are you using?",
|
||||
required: true,
|
||||
shuffleOption: "none",
|
||||
@@ -835,8 +848,9 @@ export const templates: Template[] = [
|
||||
},
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.OpenText,
|
||||
type: TSurveyQuestionType.OpenText,
|
||||
headline: "If you chose other, please clarify:",
|
||||
inputType: "text",
|
||||
longAnswer: true,
|
||||
required: false,
|
||||
},
|
||||
@@ -854,7 +868,7 @@ export const templates: Template[] = [
|
||||
questions: [
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.MultipleChoiceSingle,
|
||||
type: TSurveyQuestionType.MultipleChoiceSingle,
|
||||
headline: "Was this page helpful?",
|
||||
required: true,
|
||||
shuffleOption: "none",
|
||||
@@ -871,14 +885,16 @@ export const templates: Template[] = [
|
||||
},
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.OpenText,
|
||||
type: TSurveyQuestionType.OpenText,
|
||||
headline: "Please elaborate:",
|
||||
inputType: "text",
|
||||
longAnswer: true,
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.OpenText,
|
||||
type: TSurveyQuestionType.OpenText,
|
||||
inputType: "url",
|
||||
headline: "Page URL",
|
||||
longAnswer: true,
|
||||
required: false,
|
||||
@@ -897,7 +913,7 @@ export const templates: Template[] = [
|
||||
questions: [
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.CTA,
|
||||
type: TSurveyQuestionType.CTA,
|
||||
headline: "Do you have 15 min to talk to us? 🙏",
|
||||
html: "You're one of our power users. We would love to interview you briefly!",
|
||||
buttonLabel: "Book interview",
|
||||
@@ -920,7 +936,7 @@ export const templates: Template[] = [
|
||||
questions: [
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.CTA,
|
||||
type: TSurveyQuestionType.CTA,
|
||||
headline: "You're one of our most valued customers! Please write a review for us.",
|
||||
buttonLabel: "Write review",
|
||||
buttonUrl: "https://formbricks.com/github",
|
||||
@@ -941,7 +957,7 @@ export const templates: Template[] = [
|
||||
questions: [
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.NPS,
|
||||
type: TSurveyQuestionType.NPS,
|
||||
headline: "How likely are you to recommend Formbricks to a friend or colleague?",
|
||||
required: false,
|
||||
lowerLabel: "Not likely",
|
||||
@@ -961,7 +977,7 @@ export const templates: Template[] = [
|
||||
questions: [
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.MultipleChoiceSingle,
|
||||
type: TSurveyQuestionType.MultipleChoiceSingle,
|
||||
headline: "How many hours does your team save per week by using Formbricks?",
|
||||
required: true,
|
||||
shuffleOption: "none",
|
||||
@@ -998,7 +1014,7 @@ export const templates: Template[] = [
|
||||
questions: [
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.Rating,
|
||||
type: TSurveyQuestionType.Rating,
|
||||
headline: "How satisfied are you with the features of Formbricks?",
|
||||
required: true,
|
||||
lowerLabel: "Not satisfied",
|
||||
@@ -1008,8 +1024,9 @@ export const templates: Template[] = [
|
||||
},
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.OpenText,
|
||||
type: TSurveyQuestionType.OpenText,
|
||||
headline: "What's the #1 thing you'd like to change in Formbricks?",
|
||||
inputType: "text",
|
||||
longAnswer: true,
|
||||
required: false,
|
||||
},
|
||||
@@ -1027,7 +1044,7 @@ export const templates: Template[] = [
|
||||
questions: [
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.Rating,
|
||||
type: TSurveyQuestionType.Rating,
|
||||
headline: "How easy was it to achieve ... ?",
|
||||
required: true,
|
||||
lowerLabel: "Not easy",
|
||||
@@ -1037,8 +1054,9 @@ export const templates: Template[] = [
|
||||
},
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.OpenText,
|
||||
type: TSurveyQuestionType.OpenText,
|
||||
headline: "What is one thing we could do better?",
|
||||
inputType: "text",
|
||||
longAnswer: true,
|
||||
required: false,
|
||||
},
|
||||
@@ -1056,7 +1074,7 @@ export const templates: Template[] = [
|
||||
questions: [
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.MultipleChoiceSingle,
|
||||
type: TSurveyQuestionType.MultipleChoiceSingle,
|
||||
headline: "Do you have all the info you need to give Formbricks a try?",
|
||||
required: true,
|
||||
shuffleOption: "none",
|
||||
@@ -1077,14 +1095,15 @@ export const templates: Template[] = [
|
||||
},
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.OpenText,
|
||||
type: TSurveyQuestionType.OpenText,
|
||||
headline: "What’s missing or unclear to you about Formbricks?",
|
||||
inputType: "text",
|
||||
longAnswer: true,
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
id: createId(),
|
||||
type: QuestionType.CTA,
|
||||
type: TSurveyQuestionType.CTA,
|
||||
headline: "Thanks for your answer! Get 25% off your first 6 months:",
|
||||
required: false,
|
||||
buttonLabel: "Get discount",
|
||||
@@ -1097,6 +1116,6 @@ export const templates: Template[] = [
|
||||
},
|
||||
];
|
||||
|
||||
export const findTemplateByName = (name: string): Template | undefined => {
|
||||
export const findTemplateByName = (name: string): TTemplate | undefined => {
|
||||
return templates.find((template) => template.name === name);
|
||||
};
|
||||
|
||||
@@ -5,7 +5,7 @@ import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth";
|
||||
import { createActionClass, deleteActionClass, updateActionClass } from "@formbricks/lib/actionClass/service";
|
||||
import { canUserAccessActionClass } from "@formbricks/lib/actionClass/auth";
|
||||
import { getServerSession } from "next-auth";
|
||||
import { TActionClassInput } from "@formbricks/types/v1/actionClasses";
|
||||
import { TActionClassInput } from "@formbricks/types/actionClasses";
|
||||
|
||||
import {
|
||||
getActionCountInLast24Hours,
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
getActionCountInLastHour,
|
||||
} from "@formbricks/lib/action/service";
|
||||
import { getSurveysByActionClassId } from "@formbricks/lib/survey/service";
|
||||
import { AuthorizationError } from "@formbricks/types/v1/errors";
|
||||
import { AuthorizationError } from "@formbricks/types/errors";
|
||||
|
||||
export async function deleteActionClassAction(environmentId, actionClassId: string) {
|
||||
const session = await getServerSession(authOptions);
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Label } from "@formbricks/ui/Label";
|
||||
import { convertDateTimeStringShort } from "@formbricks/lib/time";
|
||||
import { capitalizeFirstLetter } from "@/app/lib/utils";
|
||||
import { CodeBracketIcon, CursorArrowRaysIcon, SparklesIcon } from "@heroicons/react/24/solid";
|
||||
import { TActionClass } from "@formbricks/types/v1/actionClasses";
|
||||
import { TActionClass } from "@formbricks/types/actionClasses";
|
||||
import { useEffect, useState } from "react";
|
||||
import {
|
||||
getActionCountInLastHourAction,
|
||||
|
||||
@@ -5,7 +5,7 @@ import { CursorArrowRaysIcon } from "@heroicons/react/24/solid";
|
||||
import { useState } from "react";
|
||||
import AddNoCodeActionModal from "./AddNoCodeActionModal";
|
||||
import ActionDetailModal from "./ActionDetailModal";
|
||||
import { TActionClass } from "@formbricks/types/v1/actionClasses";
|
||||
import { TActionClass } from "@formbricks/types/actionClasses";
|
||||
|
||||
export default function ActionClassesTable({
|
||||
environmentId,
|
||||
|
||||
@@ -2,7 +2,7 @@ import ModalWithTabs from "@formbricks/ui/ModalWithTabs";
|
||||
import { CodeBracketIcon, CursorArrowRaysIcon, SparklesIcon } from "@heroicons/react/24/solid";
|
||||
import EventActivityTab from "./ActionActivityTab";
|
||||
import ActionSettingsTab from "./ActionSettingsTab";
|
||||
import { TActionClass } from "@formbricks/types/v1/actionClasses";
|
||||
import { TActionClass } from "@formbricks/types/actionClasses";
|
||||
|
||||
interface ActionDetailModalProps {
|
||||
environmentId: string;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { timeSinceConditionally } from "@formbricks/lib/time";
|
||||
import { TActionClass } from "@formbricks/types/v1/actionClasses";
|
||||
import { TActionClass } from "@formbricks/types/actionClasses";
|
||||
import { CodeBracketIcon, CursorArrowRaysIcon, SparklesIcon } from "@heroicons/react/24/solid";
|
||||
|
||||
export default function ActionClassDataRow({ actionClass }: { actionClass: TActionClass }) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { DeleteDialog } from "@formbricks/ui/DeleteDialog";
|
||||
import type { NoCodeConfig } from "@formbricks/types/events";
|
||||
import { TNoCodeConfig } from "@formbricks/types/actionClasses";
|
||||
import { Button } from "@formbricks/ui/Button";
|
||||
import { Input } from "@formbricks/ui/Input";
|
||||
import { Label } from "@formbricks/ui/Label";
|
||||
@@ -11,7 +11,7 @@ import { useState } from "react";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { toast } from "react-hot-toast";
|
||||
import { testURLmatch } from "../lib/testURLmatch";
|
||||
import { TActionClassInput, TActionClassNoCodeConfig } from "@formbricks/types/v1/actionClasses";
|
||||
import { TActionClassInput, TActionClassNoCodeConfig } from "@formbricks/types/actionClasses";
|
||||
import { CssSelector } from "@/app/(app)/environments/[environmentId]/(actionsAndAttributes)/actions/components/CssSelector";
|
||||
import { PageUrlSelector } from "@/app/(app)/environments/[environmentId]/(actionsAndAttributes)/actions/components/PageUrlSelector";
|
||||
import { InnerHtmlSelector } from "@/app/(app)/environments/[environmentId]/(actionsAndAttributes)/actions/components/InnerHtmlSelector";
|
||||
@@ -79,7 +79,7 @@ export default function ActionSettingsTab({ environmentId, actionClass, setOpen
|
||||
if (data.name === "") throw new Error("Please give your action a name");
|
||||
if (!isPageUrl && !isCssSelector && !isInnerHtml) throw new Error("Please select atleast one selector");
|
||||
|
||||
const filteredNoCodeConfig = filterNoCodeConfig(data.noCodeConfig as NoCodeConfig);
|
||||
const filteredNoCodeConfig = filterNoCodeConfig(data.noCodeConfig as TNoCodeConfig);
|
||||
const updatedData: TActionClassInput = {
|
||||
...data,
|
||||
environmentId,
|
||||
|
||||
@@ -9,11 +9,7 @@ import { useState } from "react";
|
||||
import { useForm } from "react-hook-form";
|
||||
import toast from "react-hot-toast";
|
||||
import { testURLmatch } from "../lib/testURLmatch";
|
||||
import {
|
||||
TActionClassInput,
|
||||
TActionClassNoCodeConfig,
|
||||
TActionClass,
|
||||
} from "@formbricks/types/v1/actionClasses";
|
||||
import { TActionClassInput, TActionClassNoCodeConfig, TActionClass } from "@formbricks/types/actionClasses";
|
||||
import { CssSelector } from "@/app/(app)/environments/[environmentId]/(actionsAndAttributes)/actions/components/CssSelector";
|
||||
import { PageUrlSelector } from "@/app/(app)/environments/[environmentId]/(actionsAndAttributes)/actions/components/PageUrlSelector";
|
||||
import { InnerHtmlSelector } from "@/app/(app)/environments/[environmentId]/(actionsAndAttributes)/actions/components/InnerHtmlSelector";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use server";
|
||||
|
||||
import { getServerSession } from "next-auth";
|
||||
import { AuthorizationError } from "@formbricks/types/v1/errors";
|
||||
import { AuthorizationError } from "@formbricks/types/errors";
|
||||
import { authOptions } from "@formbricks/lib/authOptions";
|
||||
import { getSurveysByAttributeClassId } from "@formbricks/lib/survey/service";
|
||||
import { canUserAccessAttributeClass } from "@formbricks/lib/attributeClass/auth";
|
||||
|
||||
@@ -4,7 +4,7 @@ import { GetActiveInactiveSurveysAction } from "@/app/(app)/environments/[enviro
|
||||
import LoadingSpinner from "@formbricks/ui/LoadingSpinner";
|
||||
import { capitalizeFirstLetter } from "@/app/lib/utils";
|
||||
import { convertDateTimeStringShort } from "@formbricks/lib/time";
|
||||
import { TAttributeClass } from "@formbricks/types/v1/attributeClasses";
|
||||
import { TAttributeClass } from "@formbricks/types/attributeClasses";
|
||||
import { ErrorComponent } from "@formbricks/ui/ErrorComponent";
|
||||
import { Label } from "@formbricks/ui/Label";
|
||||
import { TagIcon } from "@heroicons/react/24/solid";
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useState } from "react";
|
||||
import AttributeDetailModal from "./AttributeDetailModal";
|
||||
import UploadAttributesModal from "./UploadAttributesModal";
|
||||
import { useMemo } from "react";
|
||||
import { TAttributeClass } from "@formbricks/types/v1/attributeClasses";
|
||||
import { TAttributeClass } from "@formbricks/types/attributeClasses";
|
||||
|
||||
export default function AttributeClassesTable({
|
||||
attributeClasses,
|
||||
|
||||
@@ -2,7 +2,7 @@ import ModalWithTabs from "@formbricks/ui/ModalWithTabs";
|
||||
import { TagIcon } from "@heroicons/react/24/solid";
|
||||
import AttributeActivityTab from "./AttributeActivityTab";
|
||||
import AttributeSettingsTab from "./AttributeSettingsTab";
|
||||
import { TAttributeClass } from "@formbricks/types/v1/attributeClasses";
|
||||
import { TAttributeClass } from "@formbricks/types/attributeClasses";
|
||||
|
||||
interface AttributeDetailModalProps {
|
||||
open: boolean;
|
||||
|
||||
@@ -10,7 +10,7 @@ import { createShortUrl } from "@formbricks/lib/shortUrl/service";
|
||||
import { canUserAccessSurvey } from "@formbricks/lib/survey/auth";
|
||||
import { deleteSurvey, duplicateSurvey } from "@formbricks/lib/survey/service";
|
||||
import { createTeam, getTeamByEnvironmentId } from "@formbricks/lib/team/service";
|
||||
import { AuthenticationError, AuthorizationError, ResourceNotFoundError } from "@formbricks/types/v1/errors";
|
||||
import { AuthenticationError, AuthorizationError, ResourceNotFoundError } from "@formbricks/types/errors";
|
||||
import { Team } from "@prisma/client";
|
||||
import { Prisma as prismaClient } from "@prisma/client/";
|
||||
import { getServerSession } from "next-auth";
|
||||
|
||||
@@ -22,9 +22,9 @@ import { formbricksLogout } from "@/app/lib/formbricks";
|
||||
import { capitalizeFirstLetter, truncate } from "@/app/lib/utils";
|
||||
import formbricks from "@formbricks/js";
|
||||
import { cn } from "@formbricks/lib/cn";
|
||||
import { TEnvironment } from "@formbricks/types/v1/environment";
|
||||
import { TProduct } from "@formbricks/types/v1/product";
|
||||
import { TTeam } from "@formbricks/types/v1/teams";
|
||||
import { TEnvironment } from "@formbricks/types/environment";
|
||||
import { TProduct } from "@formbricks/types/product";
|
||||
import { TTeam } from "@formbricks/types/teams";
|
||||
import { CustomersIcon, DashboardIcon, FilterIcon, FormIcon, SettingsIcon } from "@formbricks/ui/icons";
|
||||
import { Popover, PopoverContent, PopoverTrigger } from "@formbricks/ui/Popover";
|
||||
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@formbricks/ui/Tooltip";
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
"use client";
|
||||
|
||||
import { timeSince } from "@formbricks/lib/time";
|
||||
import { TEnvironment } from "@formbricks/types/v1/environment";
|
||||
import { TSurvey } from "@formbricks/types/v1/surveys";
|
||||
import { TEnvironment } from "@formbricks/types/environment";
|
||||
import { TSurvey } from "@formbricks/types/surveys";
|
||||
import { Button } from "@formbricks/ui/Button";
|
||||
import { DeleteDialog } from "@formbricks/ui/DeleteDialog";
|
||||
import AddIntegrationModal, {
|
||||
@@ -12,8 +12,8 @@ import { deleteIntegrationAction } from "@/app/(app)/environments/[environmentId
|
||||
import { useState } from "react";
|
||||
import { toast } from "react-hot-toast";
|
||||
import EmptySpaceFiller from "@formbricks/ui/EmptySpaceFiller";
|
||||
import { TIntegrationAirtable } from "@formbricks/types/v1/integration/airtable";
|
||||
import { TIntegrationItem } from "@formbricks/types/v1/integration";
|
||||
import { TIntegrationAirtable } from "@formbricks/types/integration/airtable";
|
||||
import { TIntegrationItem } from "@formbricks/types/integration";
|
||||
interface handleModalProps {
|
||||
airtableIntegration: TIntegrationAirtable;
|
||||
environment: TEnvironment;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { getAirtableTables } from "@formbricks/lib/airtable/service";
|
||||
import { createOrUpdateIntegration, deleteIntegration } from "@formbricks/lib/integration/service";
|
||||
import { TIntegrationInput } from "@formbricks/types/v1/integration";
|
||||
import { TIntegrationInput } from "@formbricks/types/integration";
|
||||
|
||||
export async function upsertIntegrationAction(environmentId: string, integrationData: TIntegrationInput) {
|
||||
return await createOrUpdateIntegration(environmentId, integrationData);
|
||||
|
||||
@@ -5,8 +5,8 @@ import {
|
||||
TIntegrationAirtable,
|
||||
TIntegrationAirtableConfigData,
|
||||
TIntegrationAirtableInput,
|
||||
} from "@formbricks/types/v1/integration/airtable";
|
||||
import { TSurvey } from "@formbricks/types/v1/surveys";
|
||||
} from "@formbricks/types/integration/airtable";
|
||||
import { TSurvey } from "@formbricks/types/surveys";
|
||||
import { Alert, AlertDescription, AlertTitle } from "@formbricks/ui/Alert";
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@formbricks/ui/Select";
|
||||
import { Button } from "@formbricks/ui/Button";
|
||||
@@ -21,7 +21,7 @@ import { useEffect, useState } from "react";
|
||||
import { Control, Controller, UseFormSetValue, useForm } from "react-hook-form";
|
||||
import { toast } from "react-hot-toast";
|
||||
import { upsertIntegrationAction } from "../actions";
|
||||
import { TIntegrationItem } from "@formbricks/types/v1/integration";
|
||||
import { TIntegrationItem } from "@formbricks/types/integration";
|
||||
|
||||
type EditModeProps =
|
||||
| { isEditMode: false; defaultData?: never }
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
import Connect from "./Connect";
|
||||
import Home from "../Home";
|
||||
import { useState } from "react";
|
||||
import { TSurvey } from "@formbricks/types/v1/surveys";
|
||||
import { TEnvironment } from "@formbricks/types/v1/environment";
|
||||
import { TIntegrationAirtable } from "@formbricks/types/v1/integration/airtable";
|
||||
import { TIntegrationItem } from "@formbricks/types/v1/integration";
|
||||
import { TSurvey } from "@formbricks/types/surveys";
|
||||
import { TEnvironment } from "@formbricks/types/environment";
|
||||
import { TIntegrationAirtable } from "@formbricks/types/integration/airtable";
|
||||
import { TIntegrationItem } from "@formbricks/types/integration";
|
||||
|
||||
interface AirtableWrapperProps {
|
||||
environmentId: string;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { TIntegrationAirtableTables } from "@formbricks/types/v1/integration/airtable";
|
||||
import { TIntegrationAirtableTables } from "@formbricks/types/integration/airtable";
|
||||
|
||||
export const fetchTables = async (environmentId: string, baseId: string) => {
|
||||
const res = await fetch(`/api/v1/integrations/airtable/tables?baseId=${baseId}`, {
|
||||
|
||||
@@ -4,8 +4,8 @@ import { AIR_TABLE_CLIENT_ID, WEBAPP_URL } from "@formbricks/lib/constants";
|
||||
import { getEnvironment } from "@formbricks/lib/environment/service";
|
||||
import { getIntegrations } from "@formbricks/lib/integration/service";
|
||||
import { getSurveys } from "@formbricks/lib/survey/service";
|
||||
import { TIntegrationItem } from "@formbricks/types/v1/integration";
|
||||
import { TIntegrationAirtable } from "@formbricks/types/v1/integration/airtable";
|
||||
import { TIntegrationItem } from "@formbricks/types/integration";
|
||||
import { TIntegrationAirtable } from "@formbricks/types/integration/airtable";
|
||||
import GoBackButton from "@formbricks/ui/GoBackButton";
|
||||
|
||||
export default async function Airtable({ params }) {
|
||||
|
||||
@@ -7,8 +7,8 @@ import { getServerSession } from "next-auth";
|
||||
|
||||
import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth";
|
||||
import { canUserAccessIntegration } from "@formbricks/lib/integration/auth";
|
||||
import { AuthorizationError } from "@formbricks/types/v1/errors";
|
||||
import { TIntegrationGoogleSheetsInput } from "@formbricks/types/v1/integration/googleSheet";
|
||||
import { AuthorizationError } from "@formbricks/types/errors";
|
||||
import { TIntegrationGoogleSheetsInput } from "@formbricks/types/integration/googleSheet";
|
||||
|
||||
export async function createOrUpdateIntegrationAction(
|
||||
environmentId: string,
|
||||
|
||||
@@ -3,8 +3,8 @@ import {
|
||||
TIntegrationGoogleSheets,
|
||||
TIntegrationGoogleSheetsConfigData,
|
||||
TIntegrationGoogleSheetsInput,
|
||||
} from "@formbricks/types/v1/integration/googleSheet";
|
||||
import { TSurvey } from "@formbricks/types/v1/surveys";
|
||||
} from "@formbricks/types/integration/googleSheet";
|
||||
import { TSurvey } from "@formbricks/types/surveys";
|
||||
import { Button } from "@formbricks/ui/Button";
|
||||
import { Checkbox } from "@formbricks/ui/Checkbox";
|
||||
import { Label } from "@formbricks/ui/Label";
|
||||
@@ -16,7 +16,7 @@ import { useEffect, useState } from "react";
|
||||
import { useForm } from "react-hook-form";
|
||||
import toast from "react-hot-toast";
|
||||
import GoogleSheetLogo from "../images/google-sheets-small.png";
|
||||
import { TIntegrationItem } from "@formbricks/types/v1/integration";
|
||||
import { TIntegrationItem } from "@formbricks/types/integration";
|
||||
|
||||
interface AddWebhookModalProps {
|
||||
environmentId: string;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
"use client";
|
||||
|
||||
import { refreshSheetAction } from "@/app/(app)/environments/[environmentId]/integrations/google-sheets/actions";
|
||||
import { TEnvironment } from "@formbricks/types/v1/environment";
|
||||
import { TIntegrationItem } from "@formbricks/types/v1/integration";
|
||||
import { TEnvironment } from "@formbricks/types/environment";
|
||||
import { TIntegrationItem } from "@formbricks/types/integration";
|
||||
import {
|
||||
TIntegrationGoogleSheets,
|
||||
TIntegrationGoogleSheetsConfigData,
|
||||
} from "@formbricks/types/v1/integration/googleSheet";
|
||||
import { TSurvey } from "@formbricks/types/v1/surveys";
|
||||
} from "@formbricks/types/integration/googleSheet";
|
||||
import { TSurvey } from "@formbricks/types/surveys";
|
||||
import { useState } from "react";
|
||||
import AddIntegrationModal from "./AddIntegrationModal";
|
||||
import Connect from "./Connect";
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
import { deleteIntegrationAction } from "@/app/(app)/environments/[environmentId]/integrations/google-sheets/actions";
|
||||
import { timeSince } from "@formbricks/lib/time";
|
||||
import { TEnvironment } from "@formbricks/types/v1/environment";
|
||||
import { TEnvironment } from "@formbricks/types/environment";
|
||||
import {
|
||||
TIntegrationGoogleSheets,
|
||||
TIntegrationGoogleSheetsConfigData,
|
||||
} from "@formbricks/types/v1/integration/googleSheet";
|
||||
} from "@formbricks/types/integration/googleSheet";
|
||||
import { Button } from "@formbricks/ui/Button";
|
||||
import { DeleteDialog } from "@formbricks/ui/DeleteDialog";
|
||||
import EmptySpaceFiller from "@formbricks/ui/EmptySpaceFiller";
|
||||
|
||||
@@ -9,8 +9,8 @@ import { getEnvironment } from "@formbricks/lib/environment/service";
|
||||
import { getSpreadSheets } from "@formbricks/lib/googleSheet/service";
|
||||
import { getIntegrations } from "@formbricks/lib/integration/service";
|
||||
import { getSurveys } from "@formbricks/lib/survey/service";
|
||||
import { TIntegrationItem } from "@formbricks/types/v1/integration";
|
||||
import { TIntegrationGoogleSheets } from "@formbricks/types/v1/integration/googleSheet";
|
||||
import { TIntegrationItem } from "@formbricks/types/integration";
|
||||
import { TIntegrationGoogleSheets } from "@formbricks/types/integration/googleSheet";
|
||||
import GoBackButton from "@formbricks/ui/GoBackButton";
|
||||
|
||||
export default async function GoogleSheet({ params }) {
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
import { authOptions } from "@formbricks/lib/authOptions";
|
||||
import { createWebhook, deleteWebhook, updateWebhook } from "@formbricks/lib/webhook/service";
|
||||
import { TWebhook, TWebhookInput } from "@formbricks/types/v1/webhooks";
|
||||
import { TWebhook, TWebhookInput } from "@formbricks/types/webhooks";
|
||||
import { getServerSession } from "next-auth";
|
||||
import { AuthorizationError } from "@formbricks/types/v1/errors";
|
||||
import { AuthorizationError } from "@formbricks/types/errors";
|
||||
import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth";
|
||||
import { canUserAccessWebhook } from "@formbricks/lib/webhook/auth";
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@ import { triggers } from "@/app/(app)/environments/[environmentId]/integrations/
|
||||
import { testEndpoint } from "@/app/(app)/environments/[environmentId]/integrations/webhooks/components/testEndpoint";
|
||||
import { Modal } from "@formbricks/ui/Modal";
|
||||
import { createWebhookAction } from "../actions";
|
||||
import { TPipelineTrigger } from "@formbricks/types/v1/pipelines";
|
||||
import { TSurvey } from "@formbricks/types/v1/surveys";
|
||||
import { TWebhookInput } from "@formbricks/types/v1/webhooks";
|
||||
import { TPipelineTrigger } from "@formbricks/types/pipelines";
|
||||
import { TSurvey } from "@formbricks/types/surveys";
|
||||
import { TWebhookInput } from "@formbricks/types/webhooks";
|
||||
import { Button } from "@formbricks/ui/Button";
|
||||
import { Input } from "@formbricks/ui/Input";
|
||||
import { Label } from "@formbricks/ui/Label";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { TPipelineTrigger } from "@formbricks/types/v1/pipelines";
|
||||
import { TPipelineTrigger } from "@formbricks/types/pipelines";
|
||||
|
||||
export const triggers = [
|
||||
{ title: "Response Created", value: "responseCreated" as TPipelineTrigger },
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from "react";
|
||||
import { Checkbox } from "@formbricks/ui/Checkbox";
|
||||
import { TSurvey } from "@formbricks/types/v1/surveys";
|
||||
import { TSurvey } from "@formbricks/types/surveys";
|
||||
|
||||
interface SurveyCheckboxGroupProps {
|
||||
surveys: TSurvey[];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from "react";
|
||||
import { Checkbox } from "@formbricks/ui/Checkbox";
|
||||
import { TPipelineTrigger } from "@formbricks/types/v1/pipelines";
|
||||
import { TPipelineTrigger } from "@formbricks/types/pipelines";
|
||||
|
||||
interface TriggerCheckboxGroupProps {
|
||||
triggers: { title: string; value: TPipelineTrigger }[];
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import ModalWithTabs from "@formbricks/ui/ModalWithTabs";
|
||||
import { TWebhook } from "@formbricks/types/v1/webhooks";
|
||||
import { TWebhook } from "@formbricks/types/webhooks";
|
||||
import WebhookOverviewTab from "@/app/(app)/environments/[environmentId]/integrations/webhooks/components/WebhookOverviewTab";
|
||||
import WebhookSettingsTab from "@/app/(app)/environments/[environmentId]/integrations/webhooks/components/WebhookSettingsTab";
|
||||
import { TSurvey } from "@formbricks/types/v1/surveys";
|
||||
import { TSurvey } from "@formbricks/types/surveys";
|
||||
import { Webhook } from "lucide-react";
|
||||
|
||||
interface WebhookModalProps {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Label } from "@formbricks/ui/Label";
|
||||
import { convertDateTimeStringShort } from "@formbricks/lib/time";
|
||||
import { TWebhook } from "@formbricks/types/v1/webhooks";
|
||||
import { TSurvey } from "@formbricks/types/v1/surveys";
|
||||
import { TWebhook } from "@formbricks/types/webhooks";
|
||||
import { TSurvey } from "@formbricks/types/surveys";
|
||||
import { capitalizeFirstLetter } from "@/app/lib/utils";
|
||||
|
||||
interface ActivityTabProps {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { capitalizeFirstLetter } from "@/app/lib/utils";
|
||||
import { timeSinceConditionally } from "@formbricks/lib/time";
|
||||
import { TSurvey } from "@formbricks/types/v1/surveys";
|
||||
import { TWebhook } from "@formbricks/types/v1/webhooks";
|
||||
import { TSurvey } from "@formbricks/types/surveys";
|
||||
import { TWebhook } from "@formbricks/types/webhooks";
|
||||
import { Badge } from "@formbricks/ui/Badge";
|
||||
|
||||
const renderSelectedSurveysText = (webhook: TWebhook, allSurveys: TSurvey[]) => {
|
||||
|
||||
@@ -10,10 +10,10 @@ import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { toast } from "react-hot-toast";
|
||||
import { TWebhook, TWebhookInput } from "@formbricks/types/v1/webhooks";
|
||||
import { TWebhook, TWebhookInput } from "@formbricks/types/webhooks";
|
||||
import { deleteWebhookAction, updateWebhookAction } from "../actions";
|
||||
import { TPipelineTrigger } from "@formbricks/types/v1/pipelines";
|
||||
import { TSurvey } from "@formbricks/types/v1/surveys";
|
||||
import { TPipelineTrigger } from "@formbricks/types/pipelines";
|
||||
import { TSurvey } from "@formbricks/types/surveys";
|
||||
import { testEndpoint } from "@/app/(app)/environments/[environmentId]/integrations/webhooks/components/testEndpoint";
|
||||
import { triggers } from "@/app/(app)/environments/[environmentId]/integrations/webhooks/components/HardcodedTriggers";
|
||||
import TriggerCheckboxGroup from "@/app/(app)/environments/[environmentId]/integrations/webhooks/components/TriggerCheckboxGroup";
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
import { Button } from "@formbricks/ui/Button";
|
||||
import { useState } from "react";
|
||||
import { TWebhook } from "@formbricks/types/v1/webhooks";
|
||||
import { TWebhook } from "@formbricks/types/webhooks";
|
||||
import AddWebhookModal from "@/app/(app)/environments/[environmentId]/integrations/webhooks/components/AddWebhookModal";
|
||||
import { TSurvey } from "@formbricks/types/v1/surveys";
|
||||
import { TSurvey } from "@formbricks/types/surveys";
|
||||
import WebhookModal from "@/app/(app)/environments/[environmentId]/integrations/webhooks/components/WebhookDetailModal";
|
||||
import { Webhook } from "lucide-react";
|
||||
import EmptySpaceFiller from "@formbricks/ui/EmptySpaceFiller";
|
||||
import { TEnvironment } from "@formbricks/types/v1/environment";
|
||||
import { TEnvironment } from "@formbricks/types/environment";
|
||||
|
||||
export default function WebhookTable({
|
||||
environment,
|
||||
|
||||
@@ -7,7 +7,7 @@ import FormbricksClient from "../../components/FormbricksClient";
|
||||
import { ResponseFilterProvider } from "@/app/(app)/environments/[environmentId]/components/ResponseFilterContext";
|
||||
import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth";
|
||||
import { IS_FORMBRICKS_CLOUD } from "@formbricks/lib/constants";
|
||||
import { AuthorizationError } from "@formbricks/types/v1/errors";
|
||||
import { AuthorizationError } from "@formbricks/types/errors";
|
||||
|
||||
export default async function EnvironmentLayout({ children, params }) {
|
||||
const session = await getServerSession(authOptions);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { authOptions } from "@formbricks/lib/authOptions";
|
||||
import { getServerSession } from "next-auth";
|
||||
import { AuthorizationError } from "@formbricks/types/v1/errors";
|
||||
import { AuthorizationError } from "@formbricks/types/errors";
|
||||
import { deletePerson } from "@formbricks/lib/person/service";
|
||||
import { canUserAccessPerson } from "@formbricks/lib/person/auth";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import EmptySpaceFiller from "@formbricks/ui/EmptySpaceFiller";
|
||||
import { ActivityItemContent, ActivityItemIcon, ActivityItemPopover } from "./ActivityItemComponents";
|
||||
import { TActivityFeedItem } from "@formbricks/types/v1/activity";
|
||||
import { TEnvironment } from "@formbricks/types/v1/environment";
|
||||
import { TActivityFeedItem } from "@formbricks/types/activity";
|
||||
import { TEnvironment } from "@formbricks/types/environment";
|
||||
|
||||
interface ActivityFeedProps {
|
||||
activities: TActivityFeedItem[];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { capitalizeFirstLetter } from "@/app/lib/utils";
|
||||
import { TActivityFeedItem } from "@formbricks/types/v1/activity";
|
||||
import { TActivityFeedItem } from "@formbricks/types/activity";
|
||||
import { Popover, PopoverContent, PopoverTrigger } from "@formbricks/ui/Popover";
|
||||
import { Label } from "@formbricks/ui/Label";
|
||||
import {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
"use client";
|
||||
|
||||
import ActivityFeed from "@/app/(app)/environments/[environmentId]/people/[personId]/components/ActivityFeed";
|
||||
import { TActivityFeedItem } from "@formbricks/types/v1/activity";
|
||||
import { TEnvironment } from "@formbricks/types/v1/environment";
|
||||
import { TActivityFeedItem } from "@formbricks/types/activity";
|
||||
import { TEnvironment } from "@formbricks/types/environment";
|
||||
import { ArrowsUpDownIcon } from "@heroicons/react/24/outline";
|
||||
import { useState } from "react";
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ import ResponseTimeline from "@/app/(app)/environments/[environmentId]/people/[p
|
||||
import { authOptions } from "@formbricks/lib/authOptions";
|
||||
import { getResponsesByPersonId } from "@formbricks/lib/response/service";
|
||||
import { getSurveys } from "@formbricks/lib/survey/service";
|
||||
import { TEnvironment } from "@formbricks/types/v1/environment";
|
||||
import { TSurvey } from "@formbricks/types/v1/surveys";
|
||||
import { TTag } from "@formbricks/types/v1/tags";
|
||||
import { TEnvironment } from "@formbricks/types/environment";
|
||||
import { TSurvey } from "@formbricks/types/surveys";
|
||||
import { TTag } from "@formbricks/types/tags";
|
||||
import { getServerSession } from "next-auth";
|
||||
|
||||
export default async function ResponseSection({
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
"use client";
|
||||
|
||||
import ResponseFeed from "@/app/(app)/environments/[environmentId]/people/[personId]/components/ResponsesFeed";
|
||||
import { TResponse } from "@formbricks/types/v1/responses";
|
||||
import { TSurvey } from "@formbricks/types/v1/surveys";
|
||||
import { TEnvironment } from "@formbricks/types/v1/environment";
|
||||
import { TResponse } from "@formbricks/types/responses";
|
||||
import { TSurvey } from "@formbricks/types/surveys";
|
||||
import { TEnvironment } from "@formbricks/types/environment";
|
||||
import { ArrowsUpDownIcon } from "@heroicons/react/24/outline";
|
||||
import { useState, useEffect } from "react";
|
||||
import { TTag } from "@formbricks/types/v1/tags";
|
||||
import { TProfile } from "@formbricks/types/v1/profile";
|
||||
import { TTag } from "@formbricks/types/tags";
|
||||
import { TProfile } from "@formbricks/types/profile";
|
||||
|
||||
export default function ResponseTimeline({
|
||||
surveys,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import EmptySpaceFiller from "@formbricks/ui/EmptySpaceFiller";
|
||||
import { TEnvironment } from "@formbricks/types/v1/environment";
|
||||
import { TProfile } from "@formbricks/types/v1/profile";
|
||||
import { TResponse } from "@formbricks/types/v1/responses";
|
||||
import { TSurvey } from "@formbricks/types/v1/surveys";
|
||||
import { TTag } from "@formbricks/types/v1/tags";
|
||||
import { TEnvironment } from "@formbricks/types/environment";
|
||||
import { TProfile } from "@formbricks/types/profile";
|
||||
import { TResponse } from "@formbricks/types/responses";
|
||||
import { TSurvey } from "@formbricks/types/surveys";
|
||||
import { TTag } from "@formbricks/types/tags";
|
||||
import SingleResponseCard from "@formbricks/ui/SingleResponseCard";
|
||||
|
||||
export default async function ResponseFeed({
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
ActivityItemIcon,
|
||||
ActivityItemPopover,
|
||||
} from "@/app/(app)/environments/[environmentId]/people/[personId]/components/ActivityItemComponents";
|
||||
import { TActivityFeedItem } from "@formbricks/types/v1/activity";
|
||||
import { TActivityFeedItem } from "@formbricks/types/activity";
|
||||
import { BackIcon } from "@formbricks/ui/icons";
|
||||
import { ArrowsUpDownIcon } from "@heroicons/react/24/outline";
|
||||
import { TrashIcon } from "lucide-react";
|
||||
|
||||
@@ -5,7 +5,7 @@ import { truncateMiddle } from "@/app/lib/utils";
|
||||
import { ITEMS_PER_PAGE, REVALIDATION_INTERVAL } from "@formbricks/lib/constants";
|
||||
import { getEnvironment } from "@formbricks/lib/environment/service";
|
||||
import { getPeople, getPeopleCount } from "@formbricks/lib/person/service";
|
||||
import { TPerson } from "@formbricks/types/v1/people";
|
||||
import { TPerson } from "@formbricks/types/people";
|
||||
import { PersonAvatar } from "@formbricks/ui/Avatars";
|
||||
import { Pagination } from "@formbricks/ui/Pagination";
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@ import { authOptions } from "@formbricks/lib/authOptions";
|
||||
import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth";
|
||||
import { deleteApiKey, createApiKey } from "@formbricks/lib/apiKey/service";
|
||||
import { canUserAccessApiKey } from "@formbricks/lib/apiKey/auth";
|
||||
import { TApiKeyCreateInput } from "@formbricks/types/v1/apiKeys";
|
||||
import { TApiKeyCreateInput } from "@formbricks/types/apiKeys";
|
||||
import { getServerSession } from "next-auth";
|
||||
import { AuthorizationError } from "@formbricks/types/v1/errors";
|
||||
import { AuthorizationError } from "@formbricks/types/errors";
|
||||
|
||||
export async function deleteApiKeyAction(id: string) {
|
||||
const session = await getServerSession(authOptions);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { DeleteDialog } from "@formbricks/ui/DeleteDialog";
|
||||
import { capitalizeFirstLetter } from "@/app/lib/utils";
|
||||
import { timeSince } from "@formbricks/lib/time";
|
||||
import { TApiKey } from "@formbricks/types/v1/apiKeys";
|
||||
import { TApiKey } from "@formbricks/types/apiKeys";
|
||||
import { Button } from "@formbricks/ui/Button";
|
||||
import { TrashIcon } from "@heroicons/react/24/outline";
|
||||
import { useState } from "react";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { TTeam } from "@formbricks/types/v1/teams";
|
||||
import { TTeam } from "@formbricks/types/teams";
|
||||
import { Button } from "@formbricks/ui/Button";
|
||||
import { Badge } from "@formbricks/ui/Badge";
|
||||
import { CheckIcon } from "@heroicons/react/24/outline";
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
"use client";
|
||||
|
||||
import { truncate } from "@/app/lib/utils";
|
||||
import { TProduct } from "@formbricks/types/v1/product";
|
||||
import { TTeam } from "@formbricks/types/v1/teams";
|
||||
import { TProduct } from "@formbricks/types/product";
|
||||
import { TTeam } from "@formbricks/types/teams";
|
||||
import { Popover, PopoverContent, PopoverTrigger } from "@formbricks/ui/Popover";
|
||||
import { ChevronDownIcon } from "@heroicons/react/20/solid";
|
||||
import { FaDiscord } from "react-icons/fa6";
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
import { authOptions } from "@formbricks/lib/authOptions";
|
||||
import { updateProduct } from "@formbricks/lib/product/service";
|
||||
import { TProductUpdateInput } from "@formbricks/types/v1/product";
|
||||
import { TProductUpdateInput } from "@formbricks/types/product";
|
||||
import { getServerSession } from "next-auth";
|
||||
import { AuthorizationError } from "@formbricks/types/v1/errors";
|
||||
import { AuthorizationError } from "@formbricks/types/errors";
|
||||
import { canUserAccessProduct } from "@formbricks/lib/product/auth";
|
||||
|
||||
export async function updateProductAction(productId: string, inputProduct: Partial<TProductUpdateInput>) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { TProduct, TProductUpdateInput } from "@formbricks/types/v1/product";
|
||||
import { TProduct, TProductUpdateInput } from "@formbricks/types/product";
|
||||
import { Button } from "@formbricks/ui/Button";
|
||||
import { ColorPicker } from "@formbricks/ui/ColorPicker";
|
||||
import { Label } from "@formbricks/ui/Label";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { cn } from "@formbricks/lib/cn";
|
||||
import { TProduct } from "@formbricks/types/v1/product";
|
||||
import { TProduct } from "@formbricks/types/product";
|
||||
import { ColorPicker } from "@formbricks/ui/ColorPicker";
|
||||
import { Button } from "@formbricks/ui/Button";
|
||||
import { Switch } from "@formbricks/ui/Switch";
|
||||
|
||||
@@ -5,8 +5,8 @@ import { RadioGroup, RadioGroupItem } from "@formbricks/ui/RadioGroup";
|
||||
import { Button } from "@formbricks/ui/Button";
|
||||
import { Label } from "@formbricks/ui/Label";
|
||||
import { getPlacementStyle } from "@/app/lib/preview";
|
||||
import { PlacementType } from "@formbricks/types/js";
|
||||
import { TProduct, TProductUpdateInput } from "@formbricks/types/v1/product";
|
||||
import { TPlacement } from "@formbricks/types/common";
|
||||
import { TProduct, TProductUpdateInput } from "@formbricks/types/product";
|
||||
import { useState } from "react";
|
||||
import toast from "react-hot-toast";
|
||||
import { updateProductAction } from "../actions";
|
||||
@@ -24,7 +24,7 @@ interface EditPlacementProps {
|
||||
}
|
||||
|
||||
export function EditPlacement({ product }: EditPlacementProps) {
|
||||
const [currentPlacement, setCurrentPlacement] = useState<PlacementType>(product.placement);
|
||||
const [currentPlacement, setCurrentPlacement] = useState<TPlacement>(product.placement);
|
||||
const [overlay, setOverlay] = useState(product.darkOverlay ? "darkOverlay" : "lightOverlay");
|
||||
const [clickOutside, setClickOutside] = useState(product.clickOutsideClose ? "allow" : "disallow");
|
||||
const [updatingPlacement, setUpdatingPlacement] = useState(false);
|
||||
@@ -51,7 +51,7 @@ export function EditPlacement({ product }: EditPlacementProps) {
|
||||
return (
|
||||
<div className="w-full items-center">
|
||||
<div className="flex">
|
||||
<RadioGroup onValueChange={(e) => setCurrentPlacement(e as PlacementType)} value={currentPlacement}>
|
||||
<RadioGroup onValueChange={(e) => setCurrentPlacement(e as TPlacement)} value={currentPlacement}>
|
||||
{placements.map((placement) => (
|
||||
<div key={placement.value} className="flex items-center space-x-2 whitespace-nowrap">
|
||||
<RadioGroupItem id={placement.value} value={placement.value} disabled={placement.disabled} />
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { updateProductAction } from "../actions";
|
||||
import { TProduct, TProductUpdateInput } from "@formbricks/types/v1/product";
|
||||
import { TProduct, TProductUpdateInput } from "@formbricks/types/product";
|
||||
import { Label } from "@formbricks/ui/Label";
|
||||
import { Switch } from "@formbricks/ui/Switch";
|
||||
import { useState } from "react";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { authOptions } from "@formbricks/lib/authOptions";
|
||||
import { createInviteToken } from "@formbricks/lib/jwt";
|
||||
import { AuthenticationError, AuthorizationError, ValidationError } from "@formbricks/types/v1/errors";
|
||||
import { AuthenticationError, AuthorizationError, ValidationError } from "@formbricks/types/errors";
|
||||
import {
|
||||
deleteInvite,
|
||||
getInvite,
|
||||
@@ -18,8 +18,8 @@ import {
|
||||
updateMembership,
|
||||
} from "@formbricks/lib/membership/service";
|
||||
import { deleteTeam, updateTeam } from "@formbricks/lib/team/service";
|
||||
import { TInviteUpdateInput } from "@formbricks/types/v1/invites";
|
||||
import { TMembershipRole, TMembershipUpdateInput } from "@formbricks/types/v1/memberships";
|
||||
import { TInviteUpdateInput } from "@formbricks/types/invites";
|
||||
import { TMembershipRole, TMembershipUpdateInput } from "@formbricks/types/memberships";
|
||||
import { getServerSession } from "next-auth";
|
||||
import { hasTeamAccess, hasTeamAuthority, hasTeamOwnership, isOwner } from "@formbricks/lib/auth";
|
||||
import { INVITE_DISABLED } from "@formbricks/lib/constants";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { deleteTeamAction } from "@/app/(app)/environments/[environmentId]/settings/members/actions";
|
||||
import { DeleteDialog } from "@formbricks/ui/DeleteDialog";
|
||||
import { TTeam } from "@formbricks/types/v1/teams";
|
||||
import { TTeam } from "@formbricks/types/teams";
|
||||
import { Button } from "@formbricks/ui/Button";
|
||||
import { Input } from "@formbricks/ui/Input";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { TTeam } from "@formbricks/types/v1/teams";
|
||||
import { TTeam } from "@formbricks/types/teams";
|
||||
import React from "react";
|
||||
import MembersInfo from "@/app/(app)/environments/[environmentId]/settings/members/components/EditMemberships/MembersInfo";
|
||||
import { getMembersByTeamId } from "@formbricks/lib/membership/service";
|
||||
import { getInvitesByTeamId } from "@formbricks/lib/invite/service";
|
||||
import { TMembership } from "@formbricks/types/v1/memberships";
|
||||
import { TMembership } from "@formbricks/types/memberships";
|
||||
|
||||
type EditMembershipsProps = {
|
||||
team: TTeam;
|
||||
|
||||
@@ -8,9 +8,9 @@ import {
|
||||
resendInviteAction,
|
||||
} from "@/app/(app)/environments/[environmentId]/settings/members/actions";
|
||||
import { DeleteDialog } from "@formbricks/ui/DeleteDialog";
|
||||
import { TInvite } from "@formbricks/types/v1/invites";
|
||||
import { TMember } from "@formbricks/types/v1/memberships";
|
||||
import { TTeam } from "@formbricks/types/v1/teams";
|
||||
import { TInvite } from "@formbricks/types/invites";
|
||||
import { TMember } from "@formbricks/types/memberships";
|
||||
import { TTeam } from "@formbricks/types/teams";
|
||||
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@formbricks/ui/Tooltip";
|
||||
import { PaperAirplaneIcon, ShareIcon, TrashIcon } from "@heroicons/react/24/outline";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import MemberActions from "@/app/(app)/environments/[environmentId]/settings/members/components/EditMemberships/MemberActions";
|
||||
import MembershipRole from "@/app/(app)/environments/[environmentId]/settings/members/components/EditMemberships/MembershipRole";
|
||||
import { isInviteExpired } from "@/app/lib/utils";
|
||||
import { TInvite } from "@formbricks/types/v1/invites";
|
||||
import { TMember, TMembershipRole } from "@formbricks/types/v1/memberships";
|
||||
import { TTeam } from "@formbricks/types/v1/teams";
|
||||
import { TInvite } from "@formbricks/types/invites";
|
||||
import { TMember, TMembershipRole } from "@formbricks/types/memberships";
|
||||
import { TTeam } from "@formbricks/types/teams";
|
||||
import { Badge } from "@formbricks/ui/Badge";
|
||||
import { ProfileAvatar } from "@formbricks/ui/Avatars";
|
||||
import React from "react";
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
updateMembershipAction,
|
||||
} from "@/app/(app)/environments/[environmentId]/settings/members/actions";
|
||||
import { MEMBERSHIP_ROLES, capitalizeFirstLetter } from "@/app/lib/utils";
|
||||
import { TMembershipRole } from "@formbricks/types/v1/memberships";
|
||||
import { TMembershipRole } from "@formbricks/types/memberships";
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
|
||||
@@ -7,8 +7,8 @@ import {
|
||||
} from "@/app/(app)/environments/[environmentId]/settings/members/actions";
|
||||
import CustomDialog from "@formbricks/ui/CustomDialog";
|
||||
import CreateTeamModal from "@formbricks/ui/CreateTeamModal";
|
||||
import { TMembershipRole } from "@formbricks/types/v1/memberships";
|
||||
import { TTeam } from "@formbricks/types/v1/teams";
|
||||
import { TMembershipRole } from "@formbricks/types/memberships";
|
||||
import { TTeam } from "@formbricks/types/teams";
|
||||
import { Button } from "@formbricks/ui/Button";
|
||||
import { useRouter } from "next/navigation";
|
||||
import React, { useState } from "react";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { updateTeamNameAction } from "@/app/(app)/environments/[environmentId]/settings/members/actions";
|
||||
import { TTeam } from "@formbricks/types/v1/teams";
|
||||
import { TTeam } from "@formbricks/types/teams";
|
||||
import { Button } from "@formbricks/ui/Button";
|
||||
import { Input } from "@formbricks/ui/Input";
|
||||
import { Label } from "@formbricks/ui/Label";
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
"use server";
|
||||
import { authOptions } from "@formbricks/lib/authOptions";
|
||||
import { AuthorizationError } from "@formbricks/types/v1/errors";
|
||||
import { AuthorizationError } from "@formbricks/types/errors";
|
||||
import { getServerSession } from "next-auth";
|
||||
import { prisma } from "@formbricks/database";
|
||||
import { NotificationSettings } from "@formbricks/types/users";
|
||||
import { TUserNotificationSettings } from "@formbricks/types/users";
|
||||
|
||||
export async function updateNotificationSettingsAction(notificationSettings: NotificationSettings) {
|
||||
export async function updateNotificationSettingsAction(notificationSettings: TUserNotificationSettings) {
|
||||
const session = await getServerSession(authOptions);
|
||||
if (!session) {
|
||||
throw new AuthorizationError("Not authenticated");
|
||||
|
||||
@@ -4,12 +4,12 @@ import { Switch } from "@formbricks/ui/Switch";
|
||||
import { useRouter } from "next/navigation";
|
||||
import toast from "react-hot-toast";
|
||||
import { updateNotificationSettingsAction } from "../actions";
|
||||
import { NotificationSettings } from "@formbricks/types/users";
|
||||
import { TUserNotificationSettings } from "@formbricks/types/users";
|
||||
import { useState } from "react";
|
||||
|
||||
interface NotificationSwitchProps {
|
||||
surveyOrProductId: string;
|
||||
notificationSettings: NotificationSettings;
|
||||
notificationSettings: TUserNotificationSettings;
|
||||
notificationType: "alert" | "weeklySummary";
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { authOptions } from "@formbricks/lib/authOptions";
|
||||
import SettingsCard from "@/app/(app)/environments/[environmentId]/settings/components/SettingsCard";
|
||||
import { prisma } from "@formbricks/database";
|
||||
import { NotificationSettings } from "@formbricks/types/users";
|
||||
import { TUserNotificationSettings } from "@formbricks/types/users";
|
||||
import { getServerSession } from "next-auth";
|
||||
import SettingsTitle from "../components/SettingsTitle";
|
||||
import EditAlerts from "./components/EditAlerts";
|
||||
@@ -31,7 +31,10 @@ async function getUser(userId: string | undefined): Promise<User> {
|
||||
return user;
|
||||
}
|
||||
|
||||
function cleanNotificationSettings(notificationSettings: NotificationSettings, memberships: Membership[]) {
|
||||
function cleanNotificationSettings(
|
||||
notificationSettings: TUserNotificationSettings,
|
||||
memberships: Membership[]
|
||||
) {
|
||||
const newNotificationSettings = { alert: {}, weeklySummary: {} };
|
||||
for (const membership of memberships) {
|
||||
for (const product of membership.team.products) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { NotificationSettings } from "@formbricks/types/users";
|
||||
import { TUserNotificationSettings } from "@formbricks/types/users";
|
||||
|
||||
export interface Membership {
|
||||
team: {
|
||||
@@ -20,5 +20,5 @@ export interface Membership {
|
||||
|
||||
export interface User {
|
||||
id: string;
|
||||
notificationSettings: NotificationSettings;
|
||||
notificationSettings: TUserNotificationSettings;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
"use server";
|
||||
|
||||
import { deleteProduct, getProducts, updateProduct } from "@formbricks/lib/product/service";
|
||||
import { TProduct, TProductUpdateInput } from "@formbricks/types/v1/product";
|
||||
import { TProduct, TProductUpdateInput } from "@formbricks/types/product";
|
||||
import { getServerSession } from "next-auth";
|
||||
import { AuthenticationError, AuthorizationError, ResourceNotFoundError } from "@formbricks/types/v1/errors";
|
||||
import { AuthenticationError, AuthorizationError, ResourceNotFoundError } from "@formbricks/types/errors";
|
||||
import { getEnvironment } from "@formbricks/lib/environment/service";
|
||||
import { TEnvironment } from "@formbricks/types/v1/environment";
|
||||
import { TEnvironment } from "@formbricks/types/environment";
|
||||
import { getTeamByEnvironmentId } from "@formbricks/lib/team/service";
|
||||
import { getMembershipByUserIdTeamId } from "@formbricks/lib/membership/service";
|
||||
import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getProducts } from "@formbricks/lib/product/service";
|
||||
import { getTeamByEnvironmentId } from "@formbricks/lib/team/service";
|
||||
import { TProduct } from "@formbricks/types/v1/product";
|
||||
import { TProduct } from "@formbricks/types/product";
|
||||
import DeleteProductRender from "@/app/(app)/environments/[environmentId]/settings/product/components/DeleteProductRender";
|
||||
import { getServerSession } from "next-auth";
|
||||
import { authOptions } from "@formbricks/lib/authOptions";
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { deleteProductAction } from "@/app/(app)/environments/[environmentId]/settings/product/actions";
|
||||
import { DeleteDialog } from "@formbricks/ui/DeleteDialog";
|
||||
import { truncate } from "@/app/lib/utils";
|
||||
import { TProduct } from "@formbricks/types/v1/product";
|
||||
import { TProduct } from "@formbricks/types/product";
|
||||
import { Button } from "@formbricks/ui/Button";
|
||||
import { useRouter } from "next/navigation";
|
||||
import React, { useState } from "react";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { updateProductAction } from "../actions";
|
||||
import { TProduct } from "@formbricks/types/v1/product";
|
||||
import { TProduct } from "@formbricks/types/product";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { SubmitHandler, useForm } from "react-hook-form";
|
||||
import toast from "react-hot-toast";
|
||||
|
||||
@@ -7,7 +7,7 @@ import { useRouter } from "next/navigation";
|
||||
import { Button } from "@formbricks/ui/Button";
|
||||
import { Input } from "@formbricks/ui/Input";
|
||||
import { Label } from "@formbricks/ui/Label";
|
||||
import { TProduct } from "@formbricks/types/v1/product";
|
||||
import { TProduct } from "@formbricks/types/product";
|
||||
import { updateProductAction } from "../actions";
|
||||
|
||||
type EditWaitingTimeFormValues = {
|
||||
|
||||
@@ -4,8 +4,8 @@ import { disableTwoFactorAuth, enableTwoFactorAuth, setupTwoFactorAuth } from "@
|
||||
import { getServerSession } from "next-auth";
|
||||
import { authOptions } from "@formbricks/lib/authOptions";
|
||||
import { updateProfile, deleteProfile } from "@formbricks/lib/profile/service";
|
||||
import { TProfileUpdateInput } from "@formbricks/types/v1/profile";
|
||||
import { AuthorizationError } from "@formbricks/types/v1/errors";
|
||||
import { TProfileUpdateInput } from "@formbricks/types/profile";
|
||||
import { AuthorizationError } from "@formbricks/types/errors";
|
||||
|
||||
export async function updateProfileAction(data: Partial<TProfileUpdateInput>) {
|
||||
const session = await getServerSession(authOptions);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import DisableTwoFactorModal from "@/app/(app)/environments/[environmentId]/settings/profile/components/DisableTwoFactorModal";
|
||||
import EnableTwoFactorModal from "@/app/(app)/environments/[environmentId]/settings/profile/components/EnableTwoFactorModal";
|
||||
import { TProfile } from "@formbricks/types/v1/profile";
|
||||
import { TProfile } from "@formbricks/types/profile";
|
||||
import { Switch } from "@formbricks/ui/Switch";
|
||||
import React, { useState } from "react";
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Label } from "@formbricks/ui/Label";
|
||||
import { useForm, SubmitHandler } from "react-hook-form";
|
||||
import toast from "react-hot-toast";
|
||||
import { updateProfileAction } from "../actions";
|
||||
import { TProfile } from "@formbricks/types/v1/profile";
|
||||
import { TProfile } from "@formbricks/types/profile";
|
||||
|
||||
type FormData = {
|
||||
name: string;
|
||||
|
||||
@@ -4,7 +4,7 @@ import { deleteTag, mergeTags, updateTagName } from "@formbricks/lib/tag/service
|
||||
import { canUserAccessTag } from "@formbricks/lib/tag/auth";
|
||||
import { authOptions } from "@formbricks/lib/authOptions";
|
||||
import { getServerSession } from "next-auth";
|
||||
import { AuthorizationError } from "@formbricks/types/v1/errors";
|
||||
import { AuthorizationError } from "@formbricks/types/errors";
|
||||
|
||||
export const deleteTagAction = async (tagId: string) => {
|
||||
const session = await getServerSession(authOptions);
|
||||
|
||||
@@ -4,8 +4,8 @@ import MergeTagsCombobox from "@/app/(app)/environments/[environmentId]/settings
|
||||
import EmptySpaceFiller from "@formbricks/ui/EmptySpaceFiller";
|
||||
import LoadingSpinner from "@formbricks/ui/LoadingSpinner";
|
||||
import { cn } from "@formbricks/lib/cn";
|
||||
import { TEnvironment } from "@formbricks/types/v1/environment";
|
||||
import { TTag, TTagsCount } from "@formbricks/types/v1/tags";
|
||||
import { TEnvironment } from "@formbricks/types/environment";
|
||||
import { TTag, TTagsCount } from "@formbricks/types/tags";
|
||||
import { Button } from "@formbricks/ui/Button";
|
||||
import { Input } from "@formbricks/ui/Input";
|
||||
import React, { useState } from "react";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { TEnvironment } from "@formbricks/types/v1/environment";
|
||||
import { TEnvironment } from "@formbricks/types/environment";
|
||||
import { Button } from "@formbricks/ui/Button";
|
||||
import { Unplug } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
|
||||
@@ -4,7 +4,7 @@ import { addTagToRespone, deleteTagOnResponse } from "@formbricks/lib/tagOnRespo
|
||||
import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth";
|
||||
import { authOptions } from "@formbricks/lib/authOptions";
|
||||
import { getServerSession } from "next-auth";
|
||||
import { AuthorizationError } from "@formbricks/types/v1/errors";
|
||||
import { AuthorizationError } from "@formbricks/types/errors";
|
||||
import { canUserAccessTagOnResponse } from "@formbricks/lib/tagOnResponse/auth";
|
||||
|
||||
export const createTagAction = async (environmentId: string, tagName: string) => {
|
||||
|
||||
@@ -6,14 +6,14 @@ import ResponseTimeline from "@/app/(app)/environments/[environmentId]/surveys/[
|
||||
import ContentWrapper from "@formbricks/ui/ContentWrapper";
|
||||
import { useResponseFilter } from "@/app/(app)/environments/[environmentId]/components/ResponseFilterContext";
|
||||
import { getFilterResponses } from "@/app/lib/surveys/surveys";
|
||||
import { TResponse } from "@formbricks/types/v1/responses";
|
||||
import { TSurvey } from "@formbricks/types/v1/surveys";
|
||||
import { TResponse } from "@formbricks/types/responses";
|
||||
import { TSurvey } from "@formbricks/types/surveys";
|
||||
import { useSearchParams } from "next/navigation";
|
||||
import { useEffect, useMemo } from "react";
|
||||
import { TEnvironment } from "@formbricks/types/v1/environment";
|
||||
import { TProduct } from "@formbricks/types/v1/product";
|
||||
import { TTag } from "@formbricks/types/v1/tags";
|
||||
import { TProfile } from "@formbricks/types/v1/profile";
|
||||
import { TEnvironment } from "@formbricks/types/environment";
|
||||
import { TProduct } from "@formbricks/types/product";
|
||||
import { TTag } from "@formbricks/types/tags";
|
||||
import { TProfile } from "@formbricks/types/profile";
|
||||
|
||||
interface ResponsePageProps {
|
||||
environment: TEnvironment;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
"use client";
|
||||
import EmptyInAppSurveys from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/components/EmptyInAppSurveys";
|
||||
import EmptySpaceFiller from "@formbricks/ui/EmptySpaceFiller";
|
||||
import { TEnvironment } from "@formbricks/types/v1/environment";
|
||||
import { TProfile } from "@formbricks/types/v1/profile";
|
||||
import { TResponse } from "@formbricks/types/v1/responses";
|
||||
import { TSurvey } from "@formbricks/types/v1/surveys";
|
||||
import { TTag } from "@formbricks/types/v1/tags";
|
||||
import { TEnvironment } from "@formbricks/types/environment";
|
||||
import { TProfile } from "@formbricks/types/profile";
|
||||
import { TResponse } from "@formbricks/types/responses";
|
||||
import { TSurvey } from "@formbricks/types/surveys";
|
||||
import { TTag } from "@formbricks/types/tags";
|
||||
import SingleResponseCard from "@formbricks/ui/SingleResponseCard";
|
||||
|
||||
interface ResponseTimelineProps {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { generateSurveySingleUseId } from "@/app/lib/singleUseSurveys";
|
||||
import { authOptions } from "@formbricks/lib/authOptions";
|
||||
import { sendEmbedSurveyPreviewEmail } from "@formbricks/lib/emails/emails";
|
||||
import { canUserAccessSurvey } from "@formbricks/lib/survey/auth";
|
||||
import { AuthenticationError, AuthorizationError } from "@formbricks/types/v1/errors";
|
||||
import { AuthenticationError, AuthorizationError } from "@formbricks/types/errors";
|
||||
import { getServerSession } from "next-auth";
|
||||
|
||||
type TSendEmailActionArgs = {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import Headline from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/Headline";
|
||||
import type { QuestionSummary } from "@formbricks/types/responses";
|
||||
import { TSurveyCTAQuestion } from "@formbricks/types/v1/surveys";
|
||||
import type { TSurveyQuestionSummary } from "@formbricks/types/surveys";
|
||||
import { TSurveyCTAQuestion } from "@formbricks/types/surveys";
|
||||
import { ProgressBar } from "@formbricks/ui/ProgressBar";
|
||||
import { InboxStackIcon } from "@heroicons/react/24/solid";
|
||||
import { useMemo } from "react";
|
||||
import { questionTypes } from "@/app/lib/questions";
|
||||
|
||||
interface CTASummaryProps {
|
||||
questionSummary: QuestionSummary<TSurveyCTAQuestion>;
|
||||
questionSummary: TSurveyQuestionSummary<TSurveyCTAQuestion>;
|
||||
}
|
||||
|
||||
interface ChoiceResult {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import type { QuestionSummary } from "@formbricks/types/responses";
|
||||
import type { TSurveyQuestionSummary } from "@formbricks/types/surveys";
|
||||
import { ProgressBar } from "@formbricks/ui/ProgressBar";
|
||||
import { InboxStackIcon } from "@heroicons/react/24/solid";
|
||||
import { useMemo } from "react";
|
||||
import { TSurveyConsentQuestion } from "@formbricks/types/v1/surveys";
|
||||
import { TSurveyConsentQuestion } from "@formbricks/types/surveys";
|
||||
import { questionTypes } from "@/app/lib/questions";
|
||||
import Headline from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/Headline";
|
||||
|
||||
interface ConsentSummaryProps {
|
||||
questionSummary: QuestionSummary<TSurveyConsentQuestion>;
|
||||
questionSummary: TSurveyQuestionSummary<TSurveyConsentQuestion>;
|
||||
}
|
||||
|
||||
interface ChoiceResult {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import Headline from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/Headline";
|
||||
import { getPersonIdentifier } from "@formbricks/lib/person/util";
|
||||
import { timeSince } from "@formbricks/lib/time";
|
||||
import { TEnvironment } from "@formbricks/types/v1/environment";
|
||||
import { TResponse } from "@formbricks/types/v1/responses";
|
||||
import { TSurvey } from "@formbricks/types/v1/surveys";
|
||||
import { TEnvironment } from "@formbricks/types/environment";
|
||||
import { TResponse } from "@formbricks/types/responses";
|
||||
import { TSurvey } from "@formbricks/types/surveys";
|
||||
import { PersonAvatar } from "@formbricks/ui/Avatars";
|
||||
import { ChatBubbleBottomCenterTextIcon, InboxStackIcon } from "@heroicons/react/24/solid";
|
||||
import { Link } from "lucide-react";
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
"use client";
|
||||
|
||||
import { TSurvey } from "@formbricks/types/v1/surveys";
|
||||
import { TSurvey } from "@formbricks/types/surveys";
|
||||
import { Button } from "@formbricks/ui/Button";
|
||||
import { ShareIcon } from "@heroicons/react/24/outline";
|
||||
import { useState } from "react";
|
||||
import clsx from "clsx";
|
||||
import { TProduct } from "@formbricks/types/v1/product";
|
||||
import { TProduct } from "@formbricks/types/product";
|
||||
import ShareEmbedSurvey from "./ShareEmbedSurvey";
|
||||
import { TProfile } from "@formbricks/types/v1/profile";
|
||||
import { TProfile } from "@formbricks/types/profile";
|
||||
|
||||
interface LinkSurveyShareButtonProps {
|
||||
survey: TSurvey;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { generateSingleUseIdAction } from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/actions";
|
||||
import { truncateMiddle } from "@/app/lib/utils";
|
||||
import { cn } from "@formbricks/lib/cn";
|
||||
import { TSurvey } from "@formbricks/types/v1/surveys";
|
||||
import { TSurvey } from "@formbricks/types/surveys";
|
||||
import { Button } from "@formbricks/ui/Button";
|
||||
import { ArrowPathIcon } from "@heroicons/react/24/outline";
|
||||
import { DocumentDuplicateIcon, EyeIcon } from "@heroicons/react/24/solid";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { QuestionType } from "@formbricks/types/questions";
|
||||
import type { QuestionSummary } from "@formbricks/types/responses";
|
||||
import { TSurveyQuestionType } from "@formbricks/types/surveys";
|
||||
import type { TSurveyQuestionSummary } from "@formbricks/types/surveys";
|
||||
import { ProgressBar } from "@formbricks/ui/ProgressBar";
|
||||
import { PersonAvatar } from "@formbricks/ui/Avatars";
|
||||
import { InboxStackIcon } from "@heroicons/react/24/solid";
|
||||
@@ -9,12 +9,14 @@ import { getPersonIdentifier } from "@formbricks/lib/person/util";
|
||||
import {
|
||||
TSurveyMultipleChoiceMultiQuestion,
|
||||
TSurveyMultipleChoiceSingleQuestion,
|
||||
} from "@formbricks/types/v1/surveys";
|
||||
} from "@formbricks/types/surveys";
|
||||
import { questionTypes } from "@/app/lib/questions";
|
||||
import Headline from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/Headline";
|
||||
|
||||
interface MultipleChoiceSummaryProps {
|
||||
questionSummary: QuestionSummary<TSurveyMultipleChoiceMultiQuestion | TSurveyMultipleChoiceSingleQuestion>;
|
||||
questionSummary: TSurveyQuestionSummary<
|
||||
TSurveyMultipleChoiceMultiQuestion | TSurveyMultipleChoiceSingleQuestion
|
||||
>;
|
||||
environmentId: string;
|
||||
surveyType: string;
|
||||
}
|
||||
@@ -39,7 +41,7 @@ export default function MultipleChoiceSummary({
|
||||
environmentId,
|
||||
surveyType,
|
||||
}: MultipleChoiceSummaryProps) {
|
||||
const isSingleChoice = questionSummary.question.type === QuestionType.MultipleChoiceSingle;
|
||||
const isSingleChoice = questionSummary.question.type === TSurveyQuestionType.MultipleChoiceSingle;
|
||||
|
||||
const questionTypeInfo = questionTypes.find((type) => type.id === questionSummary.question.type);
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import Headline from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/Headline";
|
||||
import type { QuestionSummary } from "@formbricks/types/responses";
|
||||
import { TSurveyNPSQuestion } from "@formbricks/types/v1/surveys";
|
||||
import type { TSurveyQuestionSummary } from "@formbricks/types/surveys";
|
||||
import { TSurveyNPSQuestion } from "@formbricks/types/surveys";
|
||||
import { ProgressBar, HalfCircle } from "@formbricks/ui/ProgressBar";
|
||||
import { InboxStackIcon } from "@heroicons/react/24/solid";
|
||||
import { useMemo } from "react";
|
||||
import { questionTypes } from "@/app/lib/questions";
|
||||
|
||||
interface NPSSummaryProps {
|
||||
questionSummary: QuestionSummary<TSurveyNPSQuestion>;
|
||||
questionSummary: TSurveyQuestionSummary<TSurveyNPSQuestion>;
|
||||
}
|
||||
|
||||
interface Result {
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { getPersonIdentifier } from "@formbricks/lib/person/util";
|
||||
import Headline from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/Headline";
|
||||
import { timeSince } from "@formbricks/lib/time";
|
||||
import type { QuestionSummary } from "@formbricks/types/responses";
|
||||
import { TSurveyOpenTextQuestion } from "@formbricks/types/v1/surveys";
|
||||
import type { TSurveyQuestionSummary } from "@formbricks/types/surveys";
|
||||
import { TSurveyOpenTextQuestion } from "@formbricks/types/surveys";
|
||||
import { PersonAvatar } from "@formbricks/ui/Avatars";
|
||||
import { InboxStackIcon } from "@heroicons/react/24/solid";
|
||||
import Link from "next/link";
|
||||
import { questionTypes } from "@/app/lib/questions";
|
||||
|
||||
interface OpenTextSummaryProps {
|
||||
questionSummary: QuestionSummary<TSurveyOpenTextQuestion>;
|
||||
questionSummary: TSurveyQuestionSummary<TSurveyOpenTextQuestion>;
|
||||
environmentId: string;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user