mirror of
https://github.com/formbricks/formbricks.git
synced 2025-12-30 18:30:32 -06:00
fix: raw html issues (#6813)
This commit is contained in:
committed by
GitHub
parent
12e703c02b
commit
e965ad4b97
@@ -13,6 +13,7 @@ import {
|
||||
TIntegrationNotionDatabase,
|
||||
} from "@formbricks/types/integration/notion";
|
||||
import { TSurvey, TSurveyQuestionTypeEnum } from "@formbricks/types/surveys/types";
|
||||
import { getTextContent } from "@formbricks/types/surveys/validation";
|
||||
import { createOrUpdateIntegrationAction } from "@/app/(app)/environments/[environmentId]/project/integrations/actions";
|
||||
import {
|
||||
ERRORS,
|
||||
@@ -122,7 +123,7 @@ export const AddIntegrationModal = ({
|
||||
const questions = selectedSurvey
|
||||
? replaceHeadlineRecall(selectedSurvey, "default")?.questions.map((q) => ({
|
||||
id: q.id,
|
||||
name: getLocalizedValue(q.headline, "default"),
|
||||
name: getTextContent(getLocalizedValue(q.headline, "default")),
|
||||
type: q.type,
|
||||
}))
|
||||
: [];
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import { HandshakeIcon, Undo2Icon } from "lucide-react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { TSurveyEndings } from "@formbricks/types/surveys/types";
|
||||
import { getTextContent } from "@formbricks/types/surveys/validation";
|
||||
import { getLocalizedValue } from "@/lib/i18n/utils";
|
||||
import {
|
||||
Select,
|
||||
@@ -41,7 +42,7 @@ export const EndingCardSelector = ({ endings, value, onChange }: EndingCardSelec
|
||||
{/* Custom endings */}
|
||||
{endingCards.map((ending) => (
|
||||
<SelectItem key={ending.id} value={ending.id}>
|
||||
{getLocalizedValue(ending.headline, "default")}
|
||||
{getTextContent(getLocalizedValue(ending.headline, "default"))}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectGroup>
|
||||
|
||||
@@ -4,6 +4,7 @@ import { ArrowRightIcon } from "lucide-react";
|
||||
import { ReactElement, useMemo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { TSurvey, TSurveyLogic, TSurveyQuestion } from "@formbricks/types/surveys/types";
|
||||
import { getTextContent } from "@formbricks/types/surveys/validation";
|
||||
import { getLocalizedValue } from "@/lib/i18n/utils";
|
||||
import { LogicEditorActions } from "@/modules/survey/editor/components/logic-editor-actions";
|
||||
import { LogicEditorConditions } from "@/modules/survey/editor/components/logic-editor-conditions";
|
||||
@@ -48,7 +49,7 @@ export function LogicEditor({
|
||||
const ques = localSurvey.questions[i];
|
||||
options.push({
|
||||
icon: QUESTIONS_ICON_MAP[ques.type],
|
||||
label: getLocalizedValue(ques.headline, "default"),
|
||||
label: getTextContent(getLocalizedValue(ques.headline, "default")),
|
||||
value: ques.id,
|
||||
});
|
||||
}
|
||||
@@ -57,7 +58,8 @@ export function LogicEditor({
|
||||
options.push({
|
||||
label:
|
||||
ending.type === "endScreen"
|
||||
? getLocalizedValue(ending.headline, "default") || t("environments.surveys.edit.end_screen_card")
|
||||
? getTextContent(getLocalizedValue(ending.headline, "default")) ||
|
||||
t("environments.surveys.edit.end_screen_card")
|
||||
: ending.label || t("environments.surveys.edit.redirect_thank_you_card"),
|
||||
value: ending.id,
|
||||
});
|
||||
|
||||
@@ -594,7 +594,7 @@ export const getMatchValueProps = (
|
||||
const questionOptions = openTextQuestions.map((question) => {
|
||||
return {
|
||||
icon: getQuestionIconMapping(t)[question.type],
|
||||
label: getLocalizedValue(question.headline, "default"),
|
||||
label: getTextContent(getLocalizedValue(question.headline, "default")),
|
||||
value: question.id,
|
||||
meta: {
|
||||
type: "question",
|
||||
@@ -691,7 +691,7 @@ export const getMatchValueProps = (
|
||||
const questionOptions = allowedQuestions.map((question) => {
|
||||
return {
|
||||
icon: getQuestionIconMapping(t)[question.type],
|
||||
label: getLocalizedValue(question.headline, "default"),
|
||||
label: getTextContent(getLocalizedValue(question.headline, "default")),
|
||||
value: question.id,
|
||||
meta: {
|
||||
type: "question",
|
||||
@@ -765,7 +765,7 @@ export const getMatchValueProps = (
|
||||
const questionOptions = allowedQuestions.map((question) => {
|
||||
return {
|
||||
icon: getQuestionIconMapping(t)[question.type],
|
||||
label: getLocalizedValue(question.headline, "default"),
|
||||
label: getTextContent(getLocalizedValue(question.headline, "default")),
|
||||
value: question.id,
|
||||
meta: {
|
||||
type: "question",
|
||||
@@ -845,7 +845,7 @@ export const getMatchValueProps = (
|
||||
const questionOptions = allowedQuestions.map((question) => {
|
||||
return {
|
||||
icon: getQuestionIconMapping(t)[question.type],
|
||||
label: getLocalizedValue(question.headline, "default"),
|
||||
label: getTextContent(getLocalizedValue(question.headline, "default")),
|
||||
value: question.id,
|
||||
meta: {
|
||||
type: "question",
|
||||
|
||||
@@ -18,6 +18,7 @@ import toast from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { TSurveyFollowUpAction, TSurveyFollowUpTrigger } from "@formbricks/database/types/survey-follow-up";
|
||||
import { TSurvey, TSurveyQuestionTypeEnum } from "@formbricks/types/surveys/types";
|
||||
import { getTextContent } from "@formbricks/types/surveys/validation";
|
||||
import { TUserLocale } from "@formbricks/types/user";
|
||||
import { getLocalizedValue } from "@/lib/i18n/utils";
|
||||
import { recallToHeadline } from "@/lib/utils/recall";
|
||||
@@ -140,9 +141,9 @@ export const FollowUpModal = ({
|
||||
|
||||
return [
|
||||
...openTextAndContactQuestions.map((question) => ({
|
||||
label: recallToHeadline(question.headline, localSurvey, false, selectedLanguageCode)[
|
||||
selectedLanguageCode
|
||||
],
|
||||
label: getTextContent(
|
||||
recallToHeadline(question.headline, localSurvey, false, selectedLanguageCode)[selectedLanguageCode]
|
||||
),
|
||||
id: question.id,
|
||||
type:
|
||||
question.type === TSurveyQuestionTypeEnum.OpenText
|
||||
@@ -517,7 +518,9 @@ export const FollowUpModal = ({
|
||||
const getEndingLabel = (): string => {
|
||||
if (ending.type === "endScreen") {
|
||||
return (
|
||||
getLocalizedValue(ending.headline, selectedLanguageCode) || "Ending"
|
||||
getTextContent(
|
||||
getLocalizedValue(ending.headline, selectedLanguageCode)
|
||||
) || "Ending"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user