mirror of
https://github.com/formbricks/formbricks.git
synced 2026-05-13 19:38:37 -05:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c092f005b6 |
@@ -168,9 +168,6 @@ SLACK_CLIENT_SECRET=
|
||||
# Enterprise License Key
|
||||
ENTERPRISE_LICENSE_KEY=
|
||||
|
||||
# Internal Environment (production, staging) - used for internal staging environment
|
||||
# ENVIRONMENT=production
|
||||
|
||||
# Automatically assign new users to a specific organization and role within that organization
|
||||
# Insert an existing organization id or generate a valid CUID for a new one at https://www.getuniqueid.com/cuid (e.g. cjld2cjxh0000qzrmn831i7rn)
|
||||
# (Role Management is an Enterprise feature)
|
||||
|
||||
-1
@@ -213,7 +213,6 @@ export const SurveyAnalysisCTA = ({
|
||||
isFormbricksCloud={isFormbricksCloud}
|
||||
isReadOnly={isReadOnly}
|
||||
isStorageConfigured={isStorageConfigured}
|
||||
projectCustomScripts={project.customHeadScripts}
|
||||
/>
|
||||
)}
|
||||
<SuccessMessage environment={environment} survey={survey} />
|
||||
|
||||
+1
-21
@@ -3,7 +3,6 @@
|
||||
import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
|
||||
import {
|
||||
Code2Icon,
|
||||
CodeIcon,
|
||||
Link2Icon,
|
||||
MailIcon,
|
||||
QrCodeIcon,
|
||||
@@ -19,7 +18,6 @@ import { TSurvey } from "@formbricks/types/surveys/types";
|
||||
import { TUser } from "@formbricks/types/user";
|
||||
import { AnonymousLinksTab } from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/shareEmbedModal/anonymous-links-tab";
|
||||
import { AppTab } from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/shareEmbedModal/app-tab";
|
||||
import { CustomHtmlTab } from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/shareEmbedModal/custom-html-tab";
|
||||
import { DynamicPopupTab } from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/shareEmbedModal/dynamic-popup-tab";
|
||||
import { EmailTab } from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/shareEmbedModal/email-tab";
|
||||
import { LinkSettingsTab } from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/shareEmbedModal/link-settings-tab";
|
||||
@@ -53,7 +51,6 @@ interface ShareSurveyModalProps {
|
||||
isFormbricksCloud: boolean;
|
||||
isReadOnly: boolean;
|
||||
isStorageConfigured: boolean;
|
||||
projectCustomScripts?: string | null;
|
||||
}
|
||||
|
||||
export const ShareSurveyModal = ({
|
||||
@@ -68,7 +65,6 @@ export const ShareSurveyModal = ({
|
||||
isFormbricksCloud,
|
||||
isReadOnly,
|
||||
isStorageConfigured,
|
||||
projectCustomScripts,
|
||||
}: ShareSurveyModalProps) => {
|
||||
const environmentId = survey.environmentId;
|
||||
const [surveyUrl, setSurveyUrl] = useState<string>(getSurveyUrl(survey, publicDomain, "default"));
|
||||
@@ -195,24 +191,9 @@ export const ShareSurveyModal = ({
|
||||
componentType: PrettyUrlTab,
|
||||
componentProps: { publicDomain, isReadOnly },
|
||||
},
|
||||
{
|
||||
id: ShareSettingsType.CUSTOM_HTML,
|
||||
type: LinkTabsType.SHARE_SETTING,
|
||||
label: t("environments.surveys.share.custom_html.nav_title"),
|
||||
icon: CodeIcon,
|
||||
title: t("environments.surveys.share.custom_html.nav_title"),
|
||||
description: t("environments.surveys.share.custom_html.description"),
|
||||
componentType: CustomHtmlTab,
|
||||
componentProps: { projectCustomScripts, isReadOnly },
|
||||
},
|
||||
];
|
||||
|
||||
// Filter out tabs that should not be shown on Formbricks Cloud
|
||||
return isFormbricksCloud
|
||||
? tabs.filter(
|
||||
(tab) => tab.id !== ShareSettingsType.PRETTY_URL && tab.id !== ShareSettingsType.CUSTOM_HTML
|
||||
)
|
||||
: tabs;
|
||||
return isFormbricksCloud ? tabs.filter((tab) => tab.id !== ShareSettingsType.PRETTY_URL) : tabs;
|
||||
}, [
|
||||
t,
|
||||
survey,
|
||||
@@ -226,7 +207,6 @@ export const ShareSurveyModal = ({
|
||||
isFormbricksCloud,
|
||||
email,
|
||||
isStorageConfigured,
|
||||
projectCustomScripts,
|
||||
]);
|
||||
|
||||
const getDefaultActiveId = useCallback(() => {
|
||||
|
||||
-163
@@ -1,163 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { AlertTriangleIcon } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
import { useForm } from "react-hook-form";
|
||||
import toast from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { TSurvey } from "@formbricks/types/surveys/types";
|
||||
import { useSurvey } from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/context/survey-context";
|
||||
import { cn } from "@/lib/cn";
|
||||
import { updateSurveyAction } from "@/modules/survey/editor/actions";
|
||||
import { Alert, AlertDescription } from "@/modules/ui/components/alert";
|
||||
import { Button } from "@/modules/ui/components/button";
|
||||
import {
|
||||
FormControl,
|
||||
FormDescription,
|
||||
FormField,
|
||||
FormItem,
|
||||
FormLabel,
|
||||
FormProvider,
|
||||
} from "@/modules/ui/components/form";
|
||||
import { TabToggle } from "@/modules/ui/components/tab-toggle";
|
||||
|
||||
interface CustomHtmlTabProps {
|
||||
projectCustomScripts: string | null | undefined;
|
||||
isReadOnly: boolean;
|
||||
}
|
||||
|
||||
interface CustomHtmlFormData {
|
||||
customHeadScripts: string;
|
||||
customHeadScriptsMode: TSurvey["customHeadScriptsMode"];
|
||||
}
|
||||
|
||||
export const CustomHtmlTab = ({ projectCustomScripts, isReadOnly }: CustomHtmlTabProps) => {
|
||||
const { t } = useTranslation();
|
||||
const { survey } = useSurvey();
|
||||
const [isSaving, setIsSaving] = useState(false);
|
||||
|
||||
const form = useForm<CustomHtmlFormData>({
|
||||
defaultValues: {
|
||||
customHeadScripts: survey.customHeadScripts ?? "",
|
||||
customHeadScriptsMode: survey.customHeadScriptsMode ?? "add",
|
||||
},
|
||||
});
|
||||
|
||||
const {
|
||||
handleSubmit,
|
||||
watch,
|
||||
setValue,
|
||||
reset,
|
||||
formState: { isDirty },
|
||||
} = form;
|
||||
|
||||
const scriptsMode = watch("customHeadScriptsMode");
|
||||
|
||||
const onSubmit = async (data: CustomHtmlFormData) => {
|
||||
if (isSaving || isReadOnly) return;
|
||||
|
||||
setIsSaving(true);
|
||||
|
||||
const updatedSurvey: TSurvey = {
|
||||
...survey,
|
||||
customHeadScripts: data.customHeadScripts || null,
|
||||
customHeadScriptsMode: data.customHeadScriptsMode,
|
||||
};
|
||||
|
||||
const result = await updateSurveyAction(updatedSurvey);
|
||||
|
||||
if (result?.data) {
|
||||
toast.success(t("environments.surveys.share.custom_html.saved_successfully"));
|
||||
reset(data);
|
||||
} else {
|
||||
toast.error(t("common.something_went_wrong_please_try_again"));
|
||||
}
|
||||
|
||||
setIsSaving(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="px-1">
|
||||
<FormProvider {...form}>
|
||||
<form onSubmit={handleSubmit(onSubmit)} className="space-y-6">
|
||||
{/* Mode Toggle */}
|
||||
<div className="space-y-2">
|
||||
<FormLabel>{t("environments.surveys.share.custom_html.script_mode")}</FormLabel>
|
||||
<TabToggle
|
||||
id="custom-scripts-mode"
|
||||
options={[
|
||||
{ value: "add", label: t("environments.surveys.share.custom_html.add_to_workspace") },
|
||||
{ value: "replace", label: t("environments.surveys.share.custom_html.replace_workspace") },
|
||||
]}
|
||||
defaultSelected={scriptsMode ?? "add"}
|
||||
onChange={(value) => setValue("customHeadScriptsMode", value, { shouldDirty: true })}
|
||||
disabled={isReadOnly}
|
||||
/>
|
||||
<p className="text-sm text-slate-500">
|
||||
{scriptsMode === "add"
|
||||
? t("environments.surveys.share.custom_html.add_mode_description")
|
||||
: t("environments.surveys.share.custom_html.replace_mode_description")}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* Workspace Scripts Preview */}
|
||||
{projectCustomScripts && (
|
||||
<div className={scriptsMode === "replace" ? "opacity-50" : ""}>
|
||||
<FormLabel>{t("environments.surveys.share.custom_html.workspace_scripts_label")}</FormLabel>
|
||||
<div className="mt-2 max-h-32 overflow-auto rounded-md border border-slate-200 bg-slate-50 p-3">
|
||||
<pre className="font-mono text-xs whitespace-pre-wrap text-slate-600">
|
||||
{projectCustomScripts}
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{!projectCustomScripts && (
|
||||
<div className="rounded-md border border-slate-200 bg-slate-50 p-3">
|
||||
<p className="text-sm text-slate-500">
|
||||
{t("environments.surveys.share.custom_html.no_workspace_scripts")}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Survey Scripts */}
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="customHeadScripts"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("environments.surveys.share.custom_html.survey_scripts_label")}</FormLabel>
|
||||
<FormDescription>
|
||||
{t("environments.surveys.share.custom_html.survey_scripts_description")}
|
||||
</FormDescription>
|
||||
<FormControl>
|
||||
<textarea
|
||||
rows={8}
|
||||
placeholder={t("environments.surveys.share.custom_html.placeholder")}
|
||||
className={cn(
|
||||
"focus:border-brand-dark flex w-full rounded-md border border-slate-300 bg-white px-3 py-2 font-mono text-xs text-slate-800 placeholder:text-slate-400 focus:ring-2 focus:ring-slate-400 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50"
|
||||
)}
|
||||
{...field}
|
||||
disabled={isReadOnly}
|
||||
/>
|
||||
</FormControl>
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
{/* Save Button */}
|
||||
<Button type="submit" disabled={isSaving || isReadOnly || !isDirty}>
|
||||
{isSaving ? t("common.saving") : t("common.save")}
|
||||
</Button>
|
||||
{/* Security Warning */}
|
||||
<Alert variant="warning" className="flex items-start gap-2">
|
||||
<AlertTriangleIcon className="mt-0.5 h-4 w-4 shrink-0" />
|
||||
<AlertDescription>
|
||||
{t("environments.surveys.share.custom_html.security_warning")}
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
</form>
|
||||
</FormProvider>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
-1
@@ -13,7 +13,6 @@ export enum ShareViaType {
|
||||
export enum ShareSettingsType {
|
||||
LINK_SETTINGS = "link-settings",
|
||||
PRETTY_URL = "pretty-url",
|
||||
CUSTOM_HTML = "custom-html",
|
||||
}
|
||||
|
||||
export enum LinkTabsType {
|
||||
|
||||
+1
-3
@@ -21,7 +21,6 @@ import {
|
||||
ListOrderedIcon,
|
||||
MessageSquareTextIcon,
|
||||
MousePointerClickIcon,
|
||||
NetworkIcon,
|
||||
PieChartIcon,
|
||||
Rows3Icon,
|
||||
SmartphoneIcon,
|
||||
@@ -100,7 +99,6 @@ const elementIcons = {
|
||||
action: MousePointerClickIcon,
|
||||
country: FlagIcon,
|
||||
url: LinkIcon,
|
||||
ipAddress: NetworkIcon,
|
||||
|
||||
// others
|
||||
Language: LanguagesIcon,
|
||||
@@ -192,7 +190,7 @@ export const ElementsComboBox = ({ options, selected, onChangeValue }: ElementCo
|
||||
value={inputValue}
|
||||
onValueChange={setInputValue}
|
||||
placeholder={open ? `${t("common.search")}...` : t("common.select_filter")}
|
||||
className="max-w-full grow border-none p-0 pl-2 text-sm shadow-none ring-offset-transparent outline-none focus:border-none focus:shadow-none focus:ring-offset-0 focus:outline-none"
|
||||
className="max-w-full grow border-none p-0 pl-2 text-sm shadow-none outline-none ring-offset-transparent focus:border-none focus:shadow-none focus:outline-none focus:ring-offset-0"
|
||||
/>
|
||||
)}
|
||||
<Button
|
||||
|
||||
@@ -82,7 +82,6 @@ const mockPipelineInput = {
|
||||
},
|
||||
country: "USA",
|
||||
action: "Action Name",
|
||||
ipAddress: "203.0.113.7",
|
||||
} as TResponseMeta,
|
||||
personAttributes: {},
|
||||
singleUseId: null,
|
||||
@@ -347,7 +346,7 @@ describe("handleIntegrations", () => {
|
||||
expect(airtableWriteData).toHaveBeenCalledTimes(1);
|
||||
// Adjust expectations for metadata and recalled question
|
||||
const expectedMetadataString =
|
||||
"Source: web\nURL: http://example.com\nBrowser: Chrome\nOS: Mac OS\nDevice: Desktop\nCountry: USA\nAction: Action Name\nIP Address: 203.0.113.7";
|
||||
"Source: web\nURL: http://example.com\nBrowser: Chrome\nOS: Mac OS\nDevice: Desktop\nCountry: USA\nAction: Action Name";
|
||||
expect(airtableWriteData).toHaveBeenCalledWith(
|
||||
mockAirtableIntegration.config.key,
|
||||
mockAirtableIntegration.config.data[0],
|
||||
|
||||
@@ -31,7 +31,6 @@ const convertMetaObjectToString = (metadata: TResponseMeta): string => {
|
||||
if (metadata.userAgent?.device) result.push(`Device: ${metadata.userAgent.device}`);
|
||||
if (metadata.country) result.push(`Country: ${metadata.country}`);
|
||||
if (metadata.action) result.push(`Action: ${metadata.action}`);
|
||||
if (metadata.ipAddress) result.push(`IP Address: ${metadata.ipAddress}`);
|
||||
|
||||
// Join all the elements in the result array with a newline for formatting
|
||||
return result.join("\n");
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { PipelineTriggers, Webhook } from "@prisma/client";
|
||||
import { headers } from "next/headers";
|
||||
import { v7 as uuidv7 } from "uuid";
|
||||
import { prisma } from "@formbricks/database";
|
||||
import { logger } from "@formbricks/logger";
|
||||
import { ResourceNotFoundError } from "@formbricks/types/errors";
|
||||
@@ -9,7 +8,6 @@ import { ZPipelineInput } from "@/app/api/(internal)/pipeline/types/pipelines";
|
||||
import { responses } from "@/app/lib/api/response";
|
||||
import { transformErrorToDetails } from "@/app/lib/api/validator";
|
||||
import { CRON_SECRET } from "@/lib/constants";
|
||||
import { generateStandardWebhookSignature } from "@/lib/crypto";
|
||||
import { getIntegrations } from "@/lib/integration/service";
|
||||
import { getOrganizationByEnvironmentId } from "@/lib/organization/service";
|
||||
import { getResponseCountBySurveyId } from "@/lib/response/service";
|
||||
@@ -92,50 +90,28 @@ export const POST = async (request: Request) => {
|
||||
]);
|
||||
};
|
||||
|
||||
const webhookPromises = webhooks.map((webhook) => {
|
||||
const body = JSON.stringify({
|
||||
webhookId: webhook.id,
|
||||
event,
|
||||
data: {
|
||||
...response,
|
||||
survey: {
|
||||
title: survey.name,
|
||||
type: survey.type,
|
||||
status: survey.status,
|
||||
createdAt: survey.createdAt,
|
||||
updatedAt: survey.updatedAt,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
// Generate Standard Webhooks headers
|
||||
const webhookMessageId = uuidv7();
|
||||
const webhookTimestamp = Math.floor(Date.now() / 1000);
|
||||
|
||||
const requestHeaders: Record<string, string> = {
|
||||
"content-type": "application/json",
|
||||
"webhook-id": webhookMessageId,
|
||||
"webhook-timestamp": webhookTimestamp.toString(),
|
||||
};
|
||||
|
||||
// Add signature if webhook has a secret configured
|
||||
if (webhook.secret) {
|
||||
requestHeaders["webhook-signature"] = generateStandardWebhookSignature(
|
||||
webhookMessageId,
|
||||
webhookTimestamp,
|
||||
body,
|
||||
webhook.secret
|
||||
);
|
||||
}
|
||||
|
||||
return fetchWithTimeout(webhook.url, {
|
||||
const webhookPromises = webhooks.map((webhook) =>
|
||||
fetchWithTimeout(webhook.url, {
|
||||
method: "POST",
|
||||
headers: requestHeaders,
|
||||
body,
|
||||
headers: { "content-type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
webhookId: webhook.id,
|
||||
event,
|
||||
data: {
|
||||
...response,
|
||||
survey: {
|
||||
title: survey.name,
|
||||
type: survey.type,
|
||||
status: survey.status,
|
||||
createdAt: survey.createdAt,
|
||||
updatedAt: survey.updatedAt,
|
||||
},
|
||||
},
|
||||
}),
|
||||
}).catch((error) => {
|
||||
logger.error({ error, url: request.url }, `Webhook call to ${webhook.url} failed`);
|
||||
});
|
||||
});
|
||||
})
|
||||
);
|
||||
|
||||
if (event === "responseFinished") {
|
||||
// Fetch integrations and responseCount in parallel
|
||||
|
||||
@@ -11,7 +11,6 @@ import { transformErrorToDetails } from "@/app/lib/api/validator";
|
||||
import { withV1ApiWrapper } from "@/app/lib/api/with-api-logging";
|
||||
import { sendToPipeline } from "@/app/lib/pipelines";
|
||||
import { getSurvey } from "@/lib/survey/service";
|
||||
import { getClientIpFromHeaders } from "@/lib/utils/client-ip";
|
||||
import { getIsContactsEnabled } from "@/modules/ee/license-check/lib/utils";
|
||||
import { createQuotaFullObject } from "@/modules/ee/quotas/lib/helpers";
|
||||
import { validateFileUploads } from "@/modules/storage/utils";
|
||||
@@ -137,13 +136,6 @@ export const POST = withV1ApiWrapper({
|
||||
action: responseInputData?.meta?.action,
|
||||
};
|
||||
|
||||
// Capture IP address if the survey has IP capture enabled
|
||||
// Server-derived IP always overwrites any client-provided value
|
||||
if (survey.isCaptureIpEnabled) {
|
||||
const ipAddress = await getClientIpFromHeaders();
|
||||
meta.ipAddress = ipAddress;
|
||||
}
|
||||
|
||||
response = await createResponseWithQuotaEvaluation({
|
||||
...responseInputData,
|
||||
meta,
|
||||
|
||||
@@ -19,10 +19,6 @@ vi.mock("@/lib/utils/validate", () => ({
|
||||
validateInputs: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock("@/lib/crypto", () => ({
|
||||
generateWebhookSecret: vi.fn(() => "whsec_test_secret_1234567890"),
|
||||
}));
|
||||
|
||||
describe("createWebhook", () => {
|
||||
afterEach(() => {
|
||||
cleanup();
|
||||
@@ -63,7 +59,6 @@ describe("createWebhook", () => {
|
||||
source: webhookInput.source,
|
||||
surveyIds: webhookInput.surveyIds,
|
||||
triggers: webhookInput.triggers,
|
||||
secret: "whsec_test_secret_1234567890",
|
||||
environment: {
|
||||
connect: {
|
||||
id: webhookInput.environmentId,
|
||||
@@ -149,7 +144,6 @@ describe("createWebhook", () => {
|
||||
source: webhookInput.source,
|
||||
surveyIds: webhookInput.surveyIds,
|
||||
triggers: webhookInput.triggers,
|
||||
secret: "whsec_test_secret_1234567890",
|
||||
environment: {
|
||||
connect: {
|
||||
id: webhookInput.environmentId,
|
||||
|
||||
@@ -4,15 +4,12 @@ import { ZId, ZOptionalNumber } from "@formbricks/types/common";
|
||||
import { DatabaseError, InvalidInputError } from "@formbricks/types/errors";
|
||||
import { TWebhookInput, ZWebhookInput } from "@/app/api/v1/webhooks/types/webhooks";
|
||||
import { ITEMS_PER_PAGE } from "@/lib/constants";
|
||||
import { generateWebhookSecret } from "@/lib/crypto";
|
||||
import { validateInputs } from "@/lib/utils/validate";
|
||||
|
||||
export const createWebhook = async (webhookInput: TWebhookInput): Promise<Webhook> => {
|
||||
validateInputs([webhookInput, ZWebhookInput]);
|
||||
|
||||
try {
|
||||
const secret = generateWebhookSecret();
|
||||
|
||||
const createdWebhook = await prisma.webhook.create({
|
||||
data: {
|
||||
url: webhookInput.url,
|
||||
@@ -20,7 +17,6 @@ export const createWebhook = async (webhookInput: TWebhookInput): Promise<Webhoo
|
||||
source: webhookInput.source,
|
||||
surveyIds: webhookInput.surveyIds || [],
|
||||
triggers: webhookInput.triggers || [],
|
||||
secret,
|
||||
environment: {
|
||||
connect: {
|
||||
id: webhookInput.environmentId,
|
||||
|
||||
@@ -10,7 +10,6 @@ import { transformErrorToDetails } from "@/app/lib/api/validator";
|
||||
import { sendToPipeline } from "@/app/lib/pipelines";
|
||||
import { getSurvey } from "@/lib/survey/service";
|
||||
import { getElementsFromBlocks } from "@/lib/survey/utils";
|
||||
import { getClientIpFromHeaders } from "@/lib/utils/client-ip";
|
||||
import { validateOtherOptionLengthForMultipleChoice } from "@/modules/api/v2/lib/element";
|
||||
import { getIsContactsEnabled } from "@/modules/ee/license-check/lib/utils";
|
||||
import { createQuotaFullObject } from "@/modules/ee/quotas/lib/helpers";
|
||||
@@ -120,13 +119,6 @@ export const POST = async (request: Request, context: Context): Promise<Response
|
||||
action: responseInputData?.meta?.action,
|
||||
};
|
||||
|
||||
// Capture IP address if the survey has IP capture enabled
|
||||
// Server-derived IP always overwrites any client-provided value
|
||||
if (survey.isCaptureIpEnabled) {
|
||||
const ipAddress = await getClientIpFromHeaders();
|
||||
meta.ipAddress = ipAddress;
|
||||
}
|
||||
|
||||
response = await createResponseWithQuotaEvaluation({
|
||||
...responseInputData,
|
||||
meta,
|
||||
|
||||
@@ -4913,7 +4913,6 @@ export const previewSurvey = (projectName: string, t: TFunction): TSurvey => {
|
||||
showLanguageSwitch: false,
|
||||
followUps: [],
|
||||
isBackButtonHidden: false,
|
||||
isCaptureIpEnabled: false,
|
||||
metadata: {},
|
||||
questions: [], // Required for build-time type checking (Zod defaults to [] at runtime)
|
||||
slug: null,
|
||||
|
||||
+13
-68
@@ -170,7 +170,6 @@ checksums:
|
||||
common/docs: 1563fcb5ddb5037b0709ccd3dd384a92
|
||||
common/documentation: 1563fcb5ddb5037b0709ccd3dd384a92
|
||||
common/domain: 402d46965eacc3af4c5df92e53e95712
|
||||
common/done: ffd408fa29d5bc9039ef8ea1b9b699bb
|
||||
common/download: 56b7d0834952b39ee394b44bd8179178
|
||||
common/draft: e8a92958ad300aacfe46c2bf6644927e
|
||||
common/duplicate: 27756566785c2b8463e21582c4bb619b
|
||||
@@ -212,6 +211,7 @@ checksums:
|
||||
common/imprint: c4e5f2a1994d3cc5896b200709cc499c
|
||||
common/in_progress: 3de9afebcb9d4ce8ac42e14995f79ffd
|
||||
common/inactive_surveys: 324b8e1844739cdc2a3bc71aef143a76
|
||||
common/input_type: df4865b5d0a598a8d7f563dcec104df5
|
||||
common/integration: 40d02f65c4356003e0e90ffb944907d2
|
||||
common/integrations: 0ccce343287704cd90150c32e2fcad36
|
||||
common/invalid_date: 4c18c82f7317d4a02f8d5fef611e82b7
|
||||
@@ -235,11 +235,13 @@ checksums:
|
||||
common/look_and_feel: 9125503712626d495cedec7a79f1418c
|
||||
common/manage: a3d40c0267b81ae53c9598eaeb05087d
|
||||
common/marketing: fcf0f06f8b64b458c7ca6d95541a3cc8
|
||||
common/maximum: 4c07541dd1f093775bdc61b559cca6c8
|
||||
common/member: 1606dc30b369856b9dba1fe9aec425d2
|
||||
common/members: 0932e80cba1e3e0a7f52bb67ff31da32
|
||||
common/members_and_teams: bf5c3fadcb9fc23533ec1532b805ac08
|
||||
common/membership_not_found: 7ac63584af23396aace9992ad919ffd4
|
||||
common/metadata: 695d4f7da261ba76e3be4de495491028
|
||||
common/minimum: d9759235086d0169928b3c1401115e22
|
||||
common/mobile_overlay_app_works_best_on_desktop: 4509f7bfbb4edbd42e534042d6cb7e72
|
||||
common/mobile_overlay_surveys_look_good: 6d73b635018b4a5a89cce58e1d2497f5
|
||||
common/mobile_overlay_title: 42f52259b7527989fb3a3240f5352a8b
|
||||
@@ -292,7 +294,7 @@ checksums:
|
||||
common/placeholder: 88c2c168aff12ca70148fcb5f6b4c7b1
|
||||
common/please_select_at_least_one_survey: fb1cbeb670480115305e23444c347e50
|
||||
common/please_select_at_least_one_trigger: e88e64a1010a039745e80ed2e30951fe
|
||||
common/please_upgrade_your_plan: 03d54a21ecd27723c72a13644837e5ed
|
||||
common/please_upgrade_your_plan: bfe98d41cd7383ad42169785d8c818fc
|
||||
common/preview: 3173ee1f0f1d4e50665ca4a84c38e15d
|
||||
common/preview_survey: 7409e9c118e3e5d5f2a86201c2b354f2
|
||||
common/privacy: 7459744a63ef8af4e517a09024bd7c08
|
||||
@@ -734,26 +736,20 @@ checksums:
|
||||
environments/integrations/webhooks/add_webhook: 20ba6e981d4237490d9da86dade7f7d2
|
||||
environments/integrations/webhooks/add_webhook_description: 85466a73d6a55476319c0c980b6f2aff
|
||||
environments/integrations/webhooks/all_current_and_new_surveys: 4c0e0e94bf2dea0cf58568d11cfbb71d
|
||||
environments/integrations/webhooks/copy_secret_now: 23d6da66a541e7c22eb06729b6eac376
|
||||
environments/integrations/webhooks/created_by_third_party: b40197eabbbce500b80b44268b8b1ee9
|
||||
environments/integrations/webhooks/discord_webhook_not_supported: 23432534f908b2ba63a517fb1f9bbe0e
|
||||
environments/integrations/webhooks/empty_webhook_message: 4c4d8709576a38cb8eb59866331d2405
|
||||
environments/integrations/webhooks/endpoint_pinged: 3b1fce00e61d4b9d2bdca390649c58b6
|
||||
environments/integrations/webhooks/endpoint_pinged_error: 96c312fe8214757c4a934cdfbe177027
|
||||
environments/integrations/webhooks/learn_to_verify: 25b2a035e2109170b28f4e16db76ad39
|
||||
environments/integrations/webhooks/please_check_console: 7b1787e82a0d762df02c011ebb1650ea
|
||||
environments/integrations/webhooks/please_enter_a_url: c24c74d0ce7ed3a6b858aadbc82108fe
|
||||
environments/integrations/webhooks/response_created: 8c43b1b6d748f6096f6f8d9232a3c469
|
||||
environments/integrations/webhooks/response_finished: 71764de45369a08aacc290af629fa298
|
||||
environments/integrations/webhooks/response_updated: 0b178ffeb39b615db0db036a685f118b
|
||||
environments/integrations/webhooks/secret_copy_warning: 55ac31fc9ee192a66093ba4b6ccd0a91
|
||||
environments/integrations/webhooks/secret_description: e9ab6e0fd78d49c3e25ee649c62061bd
|
||||
environments/integrations/webhooks/signing_secret: 91594fa8588e4232e155a65d07419bf7
|
||||
environments/integrations/webhooks/source: 6e87903ef260da661b2bf6d858ba68ca
|
||||
environments/integrations/webhooks/test_endpoint: 9ce47af3f982224071e16d5a17190a60
|
||||
environments/integrations/webhooks/triggers: 66488f38662a4199fb8a18967239c992
|
||||
environments/integrations/webhooks/webhook_added_successfully: 2d8e8d7a158ea8e4b65e67900363527b
|
||||
environments/integrations/webhooks/webhook_created: ffb4449a8d50bb83097485ddabb73562
|
||||
environments/integrations/webhooks/webhook_delete_confirmation: b5bae9856effd32053669c0e0a22479f
|
||||
environments/integrations/webhooks/webhook_deleted_successfully: fcefd247ec76a372002d2cffac3c5b0f
|
||||
environments/integrations/webhooks/webhook_name_placeholder: ffa3274cf83d8dc05c882fbf61c48f8f
|
||||
@@ -1092,6 +1088,7 @@ checksums:
|
||||
environments/surveys/edit/adjust_survey_closed_message_description: e906aebd9af6451a2a39c73287927299
|
||||
environments/surveys/edit/adjust_the_theme_in_the: bccdafda8af5871513266f668b55d690
|
||||
environments/surveys/edit/all_other_answers_will_continue_to: 9a5d09eea42ff5fd1c18cc58a14dcabd
|
||||
environments/surveys/edit/allow_file_type: ec4f1e0c5b764990c3b1560d0d8dc2af
|
||||
environments/surveys/edit/allow_multi_select: 7b4b83f7a0205e2a0a8971671a69a174
|
||||
environments/surveys/edit/allow_multiple_files: dbd99f9d1026e4f7c5a5d03f71ba379d
|
||||
environments/surveys/edit/allow_users_to_select_more_than_one_image: d683e0b538d1366400292a771f3fbd08
|
||||
@@ -1122,8 +1119,6 @@ checksums:
|
||||
environments/surveys/edit/cal_username: a4a9c739af909d975beb1bc4998feae9
|
||||
environments/surveys/edit/calculate: c5fcf8d3a38706ae2071b6f78339ec68
|
||||
environments/surveys/edit/capture_a_new_action_to_trigger_a_survey_on: 73410e9665a37bc4a9747db5d683d36c
|
||||
environments/surveys/edit/capture_ip_address: e950f924f1c0b52f8c5b06ca118e049f
|
||||
environments/surveys/edit/capture_ip_address_description: 932d1b4ad68594d06d4eaf0212f9570c
|
||||
environments/surveys/edit/capture_new_action: 0aa2a3c399b62b1a52307deedf4922e8
|
||||
environments/surveys/edit/card_arrangement_for_survey_type_derived: c06b9aaebcc11bc16e57a445b62361fc
|
||||
environments/surveys/edit/card_background_color: acd5d023e1d1a4471b053dce504c7a83
|
||||
@@ -1154,6 +1149,8 @@ checksums:
|
||||
environments/surveys/edit/change_the_question_color_of_the_survey: ab6942138a8c5fc6c8c3b9f8dd95e980
|
||||
environments/surveys/edit/changes_saved: 90aab363c9e96eaa1295a997c48f97f6
|
||||
environments/surveys/edit/changing_survey_type_will_remove_existing_distribution_channels: 9ce817be04f13f2f0db981145ec48df4
|
||||
environments/surveys/edit/character_limit_toggle_description: d15a6895eaaf4d4c7212d9240c6bf45d
|
||||
environments/surveys/edit/character_limit_toggle_title: fdc45bcc6335e5116aec895fecda0d87
|
||||
environments/surveys/edit/checkbox_label: 12a07d6bdf38e283a2e95892ec49b7f8
|
||||
environments/surveys/edit/choose_the_actions_which_trigger_the_survey: 773b311a148a112243f3b139506b9987
|
||||
environments/surveys/edit/choose_the_first_question_on_your_block: bdece06ca04f89d0c445ba1554dd5b80
|
||||
@@ -1173,6 +1170,7 @@ checksums:
|
||||
environments/surveys/edit/contact_fields: 0d4e3f4d2eb3481aabe3ac60a692fa74
|
||||
environments/surveys/edit/contains: 41c8c25407527a5336404313f4c8d650
|
||||
environments/surveys/edit/continue_to_settings: b9853a7eedb3ae295088268fe5a44824
|
||||
environments/surveys/edit/control_which_file_types_can_be_uploaded: 97144e65d91e2ca0114af923ba5924f4
|
||||
environments/surveys/edit/convert_to_multiple_choice: e5396019ae897f6ec4c4295394c115e3
|
||||
environments/surveys/edit/convert_to_single_choice: 8ecabfcb9276f29e6ac962ffcbc1ba64
|
||||
environments/surveys/edit/country: 73581fc33a1e83e6a56db73558e7b5c6
|
||||
@@ -1326,7 +1324,8 @@ checksums:
|
||||
environments/surveys/edit/key: 3d1065ab98a1c2f1210507fd5c7bf515
|
||||
environments/surveys/edit/last_name: 2c9a7de7738ca007ba9023c385149c26
|
||||
environments/surveys/edit/let_people_upload_up_to_25_files_at_the_same_time: 44110eeba2b63049a84d69927846ea3c
|
||||
environments/surveys/edit/limit_the_maximum_file_size: 6ae5944fe490b9acdaaee92b30381ec0
|
||||
environments/surveys/edit/limit_file_types: 2ee563bc98c65f565014945d6fef389c
|
||||
environments/surveys/edit/limit_the_maximum_file_size: f3f8682de34eaae30351d570805ba172
|
||||
environments/surveys/edit/limit_upload_file_size_to: 949c48d25ae45259cc19464e95752d29
|
||||
environments/surveys/edit/link_survey_description: f45569b5e6b78be6bc02bc6a46da948b
|
||||
environments/surveys/edit/load_segment: 5341d3de37ff10f7526152e38e25e3c5
|
||||
@@ -1372,6 +1371,7 @@ checksums:
|
||||
environments/surveys/edit/picture_idx: 55e053ad1ade5d17c582406706036028
|
||||
environments/surveys/edit/pin_can_only_contain_numbers: 417c854d44620a7229ebd9ab8cbb3613
|
||||
environments/surveys/edit/pin_must_be_a_four_digit_number: 9f9c8c55d99f7b24fbcf6e7e377b726f
|
||||
environments/surveys/edit/please_enter_a_file_extension: 60ad12bce720593482809c002a542a97
|
||||
environments/surveys/edit/please_enter_a_valid_url: 25d43dfb802c31cb59dc88453ea72fc4
|
||||
environments/surveys/edit/please_set_a_survey_trigger: 0358142df37dd1724f629008a1db453a
|
||||
environments/surveys/edit/please_specify: e1faa6cd085144f7339c7e74dc6fb366
|
||||
@@ -1447,7 +1447,6 @@ checksums:
|
||||
environments/surveys/edit/search_for_images: 8b1bc3561d126cc49a1ee185c07e7aaf
|
||||
environments/surveys/edit/seconds_after_trigger_the_survey_will_be_closed_if_no_response: 3584be059fe152e93895ef9885f8e8a7
|
||||
environments/surveys/edit/seconds_before_showing_the_survey: 4b03756dd5f06df732bf62b2c7968b82
|
||||
environments/surveys/edit/select_field: 45665a44f7d5707506364f17f28db3bf
|
||||
environments/surveys/edit/select_or_type_value: a99c307b2cc3f9f6f893babd546d7296
|
||||
environments/surveys/edit/select_ordering: c8f632a17fe78d8b7f87e82df9351ff9
|
||||
environments/surveys/edit/select_saved_action: de31ab9cbb2bb67a050df717de7cdde4
|
||||
@@ -1495,6 +1494,8 @@ checksums:
|
||||
environments/surveys/edit/the_survey_will_be_shown_once_even_if_person_doesnt_respond: 6062aaa5cf8e58e79b75b6b588ae9598
|
||||
environments/surveys/edit/then: 5e941fb7dd51a18651fcfb865edd5ba6
|
||||
environments/surveys/edit/this_action_will_remove_all_the_translations_from_this_survey: 3340c89696f10bdc01b9a1047ff0b987
|
||||
environments/surveys/edit/this_extension_is_already_added: 201d636539836c95958e28cecd8f3240
|
||||
environments/surveys/edit/this_file_type_is_not_supported: f365b9a2e05aa062ab0bc1af61f642e2
|
||||
environments/surveys/edit/three_points: d7f299aec752d7d690ef0ab6373327ae
|
||||
environments/surveys/edit/times: 5ab156c13df6bfd75c0b17ad0a92c78a
|
||||
environments/surveys/edit/to_keep_the_placement_over_all_surveys_consistent_you_can: 7a078e6a39d4c30b465137d2b6ef3e67
|
||||
@@ -1515,40 +1516,6 @@ checksums:
|
||||
environments/surveys/edit/upper_label: 1fa48bce3fade6ffc1a52d9fdddf9e17
|
||||
environments/surveys/edit/url_filters: e524879d2eb74463d7fd06a7e0f53421
|
||||
environments/surveys/edit/url_not_supported: af8a753467c617b596aadef1aaaed664
|
||||
environments/surveys/edit/validation/characters: e26d6bb531181ec1ed551e264bc86259
|
||||
environments/surveys/edit/validation/contains: 41c8c25407527a5336404313f4c8d650
|
||||
environments/surveys/edit/validation/does_not_contain: d618eb0f854f7efa0d7c644e6628fa42
|
||||
environments/surveys/edit/validation/email: a481cd9fba3e145252458ee1eaa9bd3b
|
||||
environments/surveys/edit/validation/file_extension_is: c102e4962dd7b8b17faec31ecda6c9bd
|
||||
environments/surveys/edit/validation/file_extension_is_not: e5067a8ad6b89cd979651c9d8ee7c614
|
||||
environments/surveys/edit/validation/is: 1940eeb4f6f0189788fde5403c6e9e9a
|
||||
environments/surveys/edit/validation/is_between: 5721c877c60f0005dc4ce78d4c0d3fdc
|
||||
environments/surveys/edit/validation/is_earlier_than: 3829d0a060cfc2c7f5f0281a55759612
|
||||
environments/surveys/edit/validation/is_greater_than: b9542ab0e0ea0ee18e82931b160b1385
|
||||
environments/surveys/edit/validation/is_later_than: 315eba60c6b8ca4cb3dd95c564ada456
|
||||
environments/surveys/edit/validation/is_less_than: 6109d595ba21497c59b1c91d7fd09a13
|
||||
environments/surveys/edit/validation/is_not: 8c7817ecdb08e6fa92fdf3487e0c8c9d
|
||||
environments/surveys/edit/validation/is_not_between: 4579a41b4e74d940eb036e13b3c63258
|
||||
environments/surveys/edit/validation/kb: 476c6cddd277e93a1bb7af4a763e95dc
|
||||
environments/surveys/edit/validation/max_length: 6edf9e1149c3893da102d9464138da22
|
||||
environments/surveys/edit/validation/max_selections: 6edf9e1149c3893da102d9464138da22
|
||||
environments/surveys/edit/validation/max_value: 6edf9e1149c3893da102d9464138da22
|
||||
environments/surveys/edit/validation/mb: dbcf612f2d898197a764a442747b5c06
|
||||
environments/surveys/edit/validation/min_length: 204dbf1f1b3aa34c8b981642b1694262
|
||||
environments/surveys/edit/validation/min_selections: 204dbf1f1b3aa34c8b981642b1694262
|
||||
environments/surveys/edit/validation/min_value: 204dbf1f1b3aa34c8b981642b1694262
|
||||
environments/surveys/edit/validation/minimum_options_ranked: 2dca1fb216c977a044987c65a0ca95c9
|
||||
environments/surveys/edit/validation/minimum_rows_answered: a8766a986cd73db0bb9daff49b271ed6
|
||||
environments/surveys/edit/validation/options_selected: a7f72a7059a49a2a6d5b90f7a2a8aa44
|
||||
environments/surveys/edit/validation/pattern: c6f01d7bc9baa21a40ea38fa986bd5a0
|
||||
environments/surveys/edit/validation/phone: bcd7bd37a475ab1f80ea4c5b4d4d0bb5
|
||||
environments/surveys/edit/validation/rank_all_options: a885523e9d7820c9b0529bca37e48ccc
|
||||
environments/surveys/edit/validation/select_file_extensions: 208ccb7bd4dde20b0d79bdd1fa763076
|
||||
environments/surveys/edit/validation/url: 4006a4d8dfac013758f0053f6aa67cdd
|
||||
environments/surveys/edit/validation_logic_and: 83bb027b15e28b3dc1d6e16c7fc86056
|
||||
environments/surveys/edit/validation_logic_or: 32c9f3998984fd32a2b5bc53f2d97429
|
||||
environments/surveys/edit/validation_rules: 0cd99f02684d633196c8b249e857d207
|
||||
environments/surveys/edit/validation_rules_description: a0a7cee05e18efd462148698e3a93399
|
||||
environments/surveys/edit/variable_is_used_in_logic_of_question_please_remove_it_from_logic_first: bd9d9c7cf0be671c4e8cf67e2ae6659e
|
||||
environments/surveys/edit/variable_is_used_in_quota_please_remove_it_from_quota_first: 0d36e5b2713f5450fe346e0af0aaa29c
|
||||
environments/surveys/edit/variable_name_is_already_taken_please_choose_another: 6da42fe8733c6379158bce9a176f76d7
|
||||
@@ -1602,7 +1569,6 @@ checksums:
|
||||
environments/surveys/responses/error_downloading_responses: 97a79108cfc854834d09cf14c300a291
|
||||
environments/surveys/responses/first_name: cf040a5d6a9fd696be400380cc99f54b
|
||||
environments/surveys/responses/how_to_identify_users: c886035d9d9a0cfc3fa9703972001044
|
||||
environments/surveys/responses/ip_address: 8f2b4d42a165a4c165eca4d7639ce57e
|
||||
environments/surveys/responses/last_name: 2c9a7de7738ca007ba9023c385149c26
|
||||
environments/surveys/responses/not_completed: df34eab65a6291f2c5e15a0e349c4eba
|
||||
environments/surveys/responses/os: a4c753bb2c004a58d02faeed6b4da476
|
||||
@@ -1643,20 +1609,6 @@ checksums:
|
||||
environments/surveys/share/anonymous_links/source_tracking: dcf85834f1ba490347a301ab55d32402
|
||||
environments/surveys/share/anonymous_links/url_encryption_description: 1509056fdae7b42fc85f1ee3c49de4c3
|
||||
environments/surveys/share/anonymous_links/url_encryption_label: 9c70fd3f64cf8cc5039b198d3af79d14
|
||||
environments/surveys/share/custom_html/add_mode_description: f48dcf53bce27cc40c3546547e8395cb
|
||||
environments/surveys/share/custom_html/add_to_workspace: af9cd24872f25cfc4231b926acc76d7c
|
||||
environments/surveys/share/custom_html/description: 0634048655de8b4b17b41d496e1ea457
|
||||
environments/surveys/share/custom_html/nav_title: 01f993f027ab277058eacb8a48ea7c01
|
||||
environments/surveys/share/custom_html/no_workspace_scripts: 7fc57f576c98e96ee73e7b489345d51a
|
||||
environments/surveys/share/custom_html/placeholder: 229eb1676a69311ff1dcc19c1a52c080
|
||||
environments/surveys/share/custom_html/replace_mode_description: 6eaf17275c02b0d5ac21255747f36271
|
||||
environments/surveys/share/custom_html/replace_workspace: b80e698cc8790246fea42453bfa4b09d
|
||||
environments/surveys/share/custom_html/saved_successfully: 14e7d2d646803ac1dd24cfa45c22606c
|
||||
environments/surveys/share/custom_html/script_mode: 60ed1102dd42ad14e272df5f6921b423
|
||||
environments/surveys/share/custom_html/security_warning: 5faa0f284d48110918a5e8a467e2bcb8
|
||||
environments/surveys/share/custom_html/survey_scripts_description: 948746d51db23b348164105c175391b3
|
||||
environments/surveys/share/custom_html/survey_scripts_label: 095d9fe768abe2bb32428184ee1c9b5a
|
||||
environments/surveys/share/custom_html/workspace_scripts_label: 3d9b6c09eae10a2bacb3ac96b4db4a19
|
||||
environments/surveys/share/dynamic_popup/alert_button: 8932096e3eee837beeb21dd4afd8b662
|
||||
environments/surveys/share/dynamic_popup/alert_description: 53d2ba39984a059a5eca4cb6cf9ba00d
|
||||
environments/surveys/share/dynamic_popup/alert_title: 813a9160940894da26ec2a09bbb1a7bf
|
||||
@@ -1868,13 +1820,6 @@ checksums:
|
||||
environments/workspace/app-connection/setup_alert_title: 9561cca2b391e0df81e8a982921ff2bb
|
||||
environments/workspace/app-connection/webapp_url: d64d8cc3c4c4ecce780d94755f7e4de9
|
||||
environments/workspace/general/cannot_delete_only_workspace: 853f32a75d92b06eaccc0d43d767c183
|
||||
environments/workspace/general/custom_scripts: a6a06a2e20764d76d3e22e5e17d98dbb
|
||||
environments/workspace/general/custom_scripts_card_description: 1585c47126e4b68f9f79f232631c67a1
|
||||
environments/workspace/general/custom_scripts_description: 1c477e711fc08850b2ab70d98ffe18d6
|
||||
environments/workspace/general/custom_scripts_label: 3b189dd62ae0cc35d616e04af90f0b38
|
||||
environments/workspace/general/custom_scripts_placeholder: 229eb1676a69311ff1dcc19c1a52c080
|
||||
environments/workspace/general/custom_scripts_updated_successfully: eabe8e6ededa86342d59093fe308c681
|
||||
environments/workspace/general/custom_scripts_warning: 5faa0f284d48110918a5e8a467e2bcb8
|
||||
environments/workspace/general/delete_workspace: 3badbc0f4b49644986fc19d8b2d8f317
|
||||
environments/workspace/general/delete_workspace_confirmation: 54a4ee78867537e0244c7170453cdb3f
|
||||
environments/workspace/general/delete_workspace_name_includes_surveys_responses_people_and_more: 11e9ac5a799fbec22495f92f42c40d98
|
||||
|
||||
+1
-131
@@ -1,11 +1,8 @@
|
||||
import * as crypto from "node:crypto";
|
||||
import * as crypto from "crypto";
|
||||
import { beforeEach, describe, expect, test, vi } from "vitest";
|
||||
import { logger } from "@formbricks/logger";
|
||||
// Import after unmocking
|
||||
import {
|
||||
generateStandardWebhookSignature,
|
||||
generateWebhookSecret,
|
||||
getWebhookSecretBytes,
|
||||
hashSecret,
|
||||
hashSha256,
|
||||
parseApiKeyV2,
|
||||
@@ -286,133 +283,6 @@ describe("Crypto Utils", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("Webhook Signature Functions", () => {
|
||||
describe("generateWebhookSecret", () => {
|
||||
test("should generate a secret with whsec_ prefix", () => {
|
||||
const secret = generateWebhookSecret();
|
||||
expect(secret.startsWith("whsec_")).toBe(true);
|
||||
});
|
||||
|
||||
test("should generate base64-encoded content after prefix", () => {
|
||||
const secret = generateWebhookSecret();
|
||||
const base64Part = secret.slice(6); // Remove "whsec_"
|
||||
|
||||
// Should be valid base64
|
||||
expect(() => Buffer.from(base64Part, "base64")).not.toThrow();
|
||||
|
||||
// Should decode to 32 bytes (256 bits)
|
||||
const decoded = Buffer.from(base64Part, "base64");
|
||||
expect(decoded.length).toBe(32);
|
||||
});
|
||||
|
||||
test("should generate unique secrets each time", () => {
|
||||
const secret1 = generateWebhookSecret();
|
||||
const secret2 = generateWebhookSecret();
|
||||
expect(secret1).not.toBe(secret2);
|
||||
});
|
||||
});
|
||||
|
||||
describe("getWebhookSecretBytes", () => {
|
||||
test("should decode whsec_ prefixed secret to bytes", () => {
|
||||
const secret = generateWebhookSecret();
|
||||
const bytes = getWebhookSecretBytes(secret);
|
||||
|
||||
expect(Buffer.isBuffer(bytes)).toBe(true);
|
||||
expect(bytes.length).toBe(32);
|
||||
});
|
||||
|
||||
test("should handle secret without whsec_ prefix", () => {
|
||||
const base64Secret = Buffer.from("test-secret-bytes-32-characters!").toString("base64");
|
||||
const bytes = getWebhookSecretBytes(base64Secret);
|
||||
|
||||
expect(Buffer.isBuffer(bytes)).toBe(true);
|
||||
expect(bytes.toString()).toBe("test-secret-bytes-32-characters!");
|
||||
});
|
||||
|
||||
test("should correctly decode a known secret", () => {
|
||||
// Create a known secret
|
||||
const knownBytes = Buffer.from("known-test-secret-for-testing!!");
|
||||
const secret = `whsec_${knownBytes.toString("base64")}`;
|
||||
|
||||
const decoded = getWebhookSecretBytes(secret);
|
||||
expect(decoded.toString()).toBe("known-test-secret-for-testing!!");
|
||||
});
|
||||
});
|
||||
|
||||
describe("generateStandardWebhookSignature", () => {
|
||||
test("should generate signature in v1,{base64} format", () => {
|
||||
const secret = generateWebhookSecret();
|
||||
const signature = generateStandardWebhookSignature("msg_123", 1704547200, '{"test":"data"}', secret);
|
||||
|
||||
expect(signature.startsWith("v1,")).toBe(true);
|
||||
const base64Part = signature.slice(3);
|
||||
expect(() => Buffer.from(base64Part, "base64")).not.toThrow();
|
||||
});
|
||||
|
||||
test("should generate deterministic signatures for same inputs", () => {
|
||||
const secret = "whsec_" + Buffer.from("test-secret-32-bytes-exactly!!!").toString("base64");
|
||||
const webhookId = "msg_test123";
|
||||
const timestamp = 1704547200;
|
||||
const payload = '{"event":"test"}';
|
||||
|
||||
const sig1 = generateStandardWebhookSignature(webhookId, timestamp, payload, secret);
|
||||
const sig2 = generateStandardWebhookSignature(webhookId, timestamp, payload, secret);
|
||||
|
||||
expect(sig1).toBe(sig2);
|
||||
});
|
||||
|
||||
test("should generate different signatures for different payloads", () => {
|
||||
const secret = "whsec_" + Buffer.from("test-secret-32-bytes-exactly!!!").toString("base64");
|
||||
const webhookId = "msg_test123";
|
||||
const timestamp = 1704547200;
|
||||
|
||||
const sig1 = generateStandardWebhookSignature(webhookId, timestamp, '{"event":"a"}', secret);
|
||||
const sig2 = generateStandardWebhookSignature(webhookId, timestamp, '{"event":"b"}', secret);
|
||||
|
||||
expect(sig1).not.toBe(sig2);
|
||||
});
|
||||
|
||||
test("should generate different signatures for different timestamps", () => {
|
||||
const secret = "whsec_" + Buffer.from("test-secret-32-bytes-exactly!!!").toString("base64");
|
||||
const webhookId = "msg_test123";
|
||||
const payload = '{"event":"test"}';
|
||||
|
||||
const sig1 = generateStandardWebhookSignature(webhookId, 1704547200, payload, secret);
|
||||
const sig2 = generateStandardWebhookSignature(webhookId, 1704547201, payload, secret);
|
||||
|
||||
expect(sig1).not.toBe(sig2);
|
||||
});
|
||||
|
||||
test("should generate different signatures for different webhook IDs", () => {
|
||||
const secret = "whsec_" + Buffer.from("test-secret-32-bytes-exactly!!!").toString("base64");
|
||||
const timestamp = 1704547200;
|
||||
const payload = '{"event":"test"}';
|
||||
|
||||
const sig1 = generateStandardWebhookSignature("msg_1", timestamp, payload, secret);
|
||||
const sig2 = generateStandardWebhookSignature("msg_2", timestamp, payload, secret);
|
||||
|
||||
expect(sig1).not.toBe(sig2);
|
||||
});
|
||||
|
||||
test("should produce verifiable signatures", () => {
|
||||
// This test verifies the signature can be verified using the same algorithm
|
||||
const secretBytes = Buffer.from("test-secret-32-bytes-exactly!!!");
|
||||
const secret = `whsec_${secretBytes.toString("base64")}`;
|
||||
const webhookId = "msg_verify";
|
||||
const timestamp = 1704547200;
|
||||
const payload = '{"event":"verify"}';
|
||||
|
||||
const signature = generateStandardWebhookSignature(webhookId, timestamp, payload, secret);
|
||||
|
||||
// Manually compute the expected signature
|
||||
const signedContent = `${webhookId}.${timestamp}.${payload}`;
|
||||
const expectedSig = crypto.createHmac("sha256", secretBytes).update(signedContent).digest("base64");
|
||||
|
||||
expect(signature).toBe(`v1,${expectedSig}`);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("GCM decryption failure logging", () => {
|
||||
// Test key - 32 bytes for AES-256
|
||||
const testKey = "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef";
|
||||
|
||||
+1
-52
@@ -1,5 +1,5 @@
|
||||
import { compare, hash } from "bcryptjs";
|
||||
import { createCipheriv, createDecipheriv, createHash, createHmac, randomBytes } from "node:crypto";
|
||||
import { createCipheriv, createDecipheriv, createHash, randomBytes } from "crypto";
|
||||
import { logger } from "@formbricks/logger";
|
||||
import { ENCRYPTION_KEY } from "@/lib/constants";
|
||||
|
||||
@@ -141,54 +141,3 @@ export const parseApiKeyV2 = (key: string): { secret: string } | null => {
|
||||
|
||||
return { secret };
|
||||
};
|
||||
|
||||
// Standard Webhooks secret prefix
|
||||
const WEBHOOK_SECRET_PREFIX = "whsec_";
|
||||
|
||||
/**
|
||||
* Generate a Standard Webhooks compliant secret
|
||||
* Following: https://github.com/standard-webhooks/standard-webhooks/blob/main/spec/standard-webhooks.md
|
||||
*
|
||||
* Format: whsec_ + base64(32 random bytes)
|
||||
* @returns A webhook secret in format "whsec_{base64_encoded_random_bytes}"
|
||||
*/
|
||||
export const generateWebhookSecret = (): string => {
|
||||
const secretBytes = randomBytes(32); // 256 bits of entropy
|
||||
return `${WEBHOOK_SECRET_PREFIX}${secretBytes.toString("base64")}`;
|
||||
};
|
||||
|
||||
/**
|
||||
* Decode a Standard Webhooks secret to get the raw bytes
|
||||
* Strips the whsec_ prefix and base64 decodes the rest
|
||||
*
|
||||
* @param secret The webhook secret (with or without whsec_ prefix)
|
||||
* @returns Buffer containing the raw secret bytes
|
||||
*/
|
||||
export const getWebhookSecretBytes = (secret: string): Buffer => {
|
||||
const base64Part = secret.startsWith(WEBHOOK_SECRET_PREFIX)
|
||||
? secret.slice(WEBHOOK_SECRET_PREFIX.length)
|
||||
: secret;
|
||||
return Buffer.from(base64Part, "base64");
|
||||
};
|
||||
|
||||
/**
|
||||
* Generate Standard Webhooks compliant signature
|
||||
* Following: https://github.com/standard-webhooks/standard-webhooks/blob/main/spec/standard-webhooks.md
|
||||
*
|
||||
* @param webhookId Unique message identifier
|
||||
* @param timestamp Unix timestamp in seconds
|
||||
* @param payload The request body as a string
|
||||
* @param secret The shared secret (whsec_ prefixed)
|
||||
* @returns The signature in format "v1,{base64_signature}"
|
||||
*/
|
||||
export const generateStandardWebhookSignature = (
|
||||
webhookId: string,
|
||||
timestamp: number,
|
||||
payload: string,
|
||||
secret: string
|
||||
): string => {
|
||||
const signedContent = `${webhookId}.${timestamp}.${payload}`;
|
||||
const secretBytes = getWebhookSecretBytes(secret);
|
||||
const signature = createHmac("sha256", secretBytes).update(signedContent).digest("base64");
|
||||
return `v1,${signature}`;
|
||||
};
|
||||
|
||||
@@ -23,7 +23,6 @@ export const env = createEnv({
|
||||
EMAIL_VERIFICATION_DISABLED: z.enum(["1", "0"]).optional(),
|
||||
ENCRYPTION_KEY: z.string(),
|
||||
ENTERPRISE_LICENSE_KEY: z.string().optional(),
|
||||
ENVIRONMENT: z.enum(["production", "staging"]).default("production"),
|
||||
GITHUB_ID: z.string().optional(),
|
||||
GITHUB_SECRET: z.string().optional(),
|
||||
GOOGLE_CLIENT_ID: z.string().optional(),
|
||||
@@ -152,7 +151,6 @@ export const env = createEnv({
|
||||
EMAIL_VERIFICATION_DISABLED: process.env.EMAIL_VERIFICATION_DISABLED,
|
||||
ENCRYPTION_KEY: process.env.ENCRYPTION_KEY,
|
||||
ENTERPRISE_LICENSE_KEY: process.env.ENTERPRISE_LICENSE_KEY,
|
||||
ENVIRONMENT: process.env.ENVIRONMENT,
|
||||
GITHUB_ID: process.env.GITHUB_ID,
|
||||
GITHUB_SECRET: process.env.GITHUB_SECRET,
|
||||
GOOGLE_CLIENT_ID: process.env.GOOGLE_CLIENT_ID,
|
||||
|
||||
@@ -21,7 +21,7 @@ export type TInstanceInfo = {
|
||||
export const getInstanceInfo = reactCache(async (): Promise<TInstanceInfo | null> => {
|
||||
try {
|
||||
const oldestOrg = await prisma.organization.findFirst({
|
||||
orderBy: [{ createdAt: "asc" }, { id: "asc" }],
|
||||
orderBy: { createdAt: "asc" },
|
||||
select: { id: true, createdAt: true },
|
||||
});
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ const selectProject = {
|
||||
environments: true,
|
||||
styling: true,
|
||||
logo: true,
|
||||
customHeadScripts: true,
|
||||
};
|
||||
|
||||
export const getUserProjects = reactCache(
|
||||
|
||||
@@ -208,7 +208,6 @@ const baseSurveyProperties = {
|
||||
},
|
||||
],
|
||||
isBackButtonHidden: false,
|
||||
isCaptureIpEnabled: false,
|
||||
endings: [
|
||||
{
|
||||
id: "umyknohldc7w26ocjdhaa62c",
|
||||
@@ -269,8 +268,6 @@ export const mockSyncSurveyOutput: SurveyMock = {
|
||||
showLanguageSwitch: null,
|
||||
metadata: {},
|
||||
slug: null,
|
||||
customHeadScripts: null,
|
||||
customHeadScriptsMode: null,
|
||||
};
|
||||
|
||||
export const mockSurveyOutput: SurveyMock = {
|
||||
@@ -295,8 +292,6 @@ export const mockSurveyOutput: SurveyMock = {
|
||||
showLanguageSwitch: null,
|
||||
...baseSurveyProperties,
|
||||
slug: null,
|
||||
customHeadScripts: null,
|
||||
customHeadScriptsMode: null,
|
||||
};
|
||||
|
||||
export const createSurveyInput: TSurveyCreateInput = {
|
||||
@@ -327,8 +322,6 @@ export const updateSurveyInput: TSurvey = {
|
||||
...baseSurveyProperties,
|
||||
...commonMockProperties,
|
||||
slug: null,
|
||||
customHeadScripts: null,
|
||||
customHeadScriptsMode: null,
|
||||
};
|
||||
|
||||
export const mockTransformedSurveyOutput = {
|
||||
@@ -581,6 +574,4 @@ export const mockSurveyWithLogic: TSurvey = {
|
||||
{ id: "siog1dabtpo3l0a3xoxw2922", type: "text", name: "var1", value: "lmao" },
|
||||
{ id: "km1srr55owtn2r7lkoh5ny1u", type: "number", name: "var2", value: 32 },
|
||||
],
|
||||
customHeadScripts: null,
|
||||
customHeadScriptsMode: null,
|
||||
};
|
||||
|
||||
@@ -56,7 +56,6 @@ export const selectSurvey = {
|
||||
isVerifyEmailEnabled: true,
|
||||
isSingleResponsePerEmailEnabled: true,
|
||||
isBackButtonHidden: true,
|
||||
isCaptureIpEnabled: true,
|
||||
redirectUrl: true,
|
||||
projectOverwrites: true,
|
||||
styling: true,
|
||||
@@ -66,8 +65,6 @@ export const selectSurvey = {
|
||||
showLanguageSwitch: true,
|
||||
recaptcha: true,
|
||||
metadata: true,
|
||||
customHeadScripts: true,
|
||||
customHeadScriptsMode: true,
|
||||
languages: {
|
||||
select: {
|
||||
default: true,
|
||||
@@ -566,7 +563,6 @@ export const updateSurveyInternal = async (
|
||||
...prismaSurvey, // Properties from prismaSurvey
|
||||
displayPercentage: Number(prismaSurvey.displayPercentage) || null,
|
||||
segment: surveySegment,
|
||||
customHeadScriptsMode: prismaSurvey.customHeadScriptsMode,
|
||||
};
|
||||
|
||||
return modifiedSurvey;
|
||||
@@ -787,7 +783,6 @@ export const loadNewSegmentInSurvey = async (surveyId: string, newSegmentId: str
|
||||
const modifiedSurvey: TSurvey = {
|
||||
...prismaSurvey, // Properties from prismaSurvey
|
||||
segment: surveySegment,
|
||||
customHeadScriptsMode: prismaSurvey.customHeadScriptsMode,
|
||||
};
|
||||
|
||||
return modifiedSurvey;
|
||||
|
||||
@@ -29,7 +29,6 @@ export const transformPrismaSurvey = <T extends TSurvey | TJsEnvironmentStateSur
|
||||
...surveyPrisma,
|
||||
displayPercentage: Number(surveyPrisma.displayPercentage) || null,
|
||||
segment,
|
||||
customHeadScriptsMode: surveyPrisma.customHeadScriptsMode,
|
||||
} as T;
|
||||
|
||||
return transformedSurvey;
|
||||
|
||||
+17
-76
@@ -197,7 +197,6 @@
|
||||
"docs": "Dokumentation",
|
||||
"documentation": "Dokumentation",
|
||||
"domain": "Domain",
|
||||
"done": "Fertig",
|
||||
"download": "Herunterladen",
|
||||
"draft": "Entwurf",
|
||||
"duplicate": "Duplikat",
|
||||
@@ -239,6 +238,7 @@
|
||||
"imprint": "Impressum",
|
||||
"in_progress": "Im Gange",
|
||||
"inactive_surveys": "Inaktive Umfragen",
|
||||
"input_type": "Eingabetyp",
|
||||
"integration": "Integration",
|
||||
"integrations": "Integrationen",
|
||||
"invalid_date": "Ungültiges Datum",
|
||||
@@ -262,11 +262,13 @@
|
||||
"look_and_feel": "Darstellung",
|
||||
"manage": "Verwalten",
|
||||
"marketing": "Marketing",
|
||||
"maximum": "Maximal",
|
||||
"member": "Mitglied",
|
||||
"members": "Mitglieder",
|
||||
"members_and_teams": "Mitglieder & Teams",
|
||||
"membership_not_found": "Mitgliedschaft nicht gefunden",
|
||||
"metadata": "Metadaten",
|
||||
"minimum": "Minimum",
|
||||
"mobile_overlay_app_works_best_on_desktop": "Formbricks funktioniert am besten auf einem größeren Bildschirm. Um Umfragen zu verwalten oder zu erstellen, wechsle zu einem anderen Gerät.",
|
||||
"mobile_overlay_surveys_look_good": "Keine Sorge – deine Umfragen sehen auf jedem Gerät und jeder Bildschirmgröße großartig aus!",
|
||||
"mobile_overlay_title": "Oops, Bildschirm zu klein erkannt!",
|
||||
@@ -319,7 +321,7 @@
|
||||
"placeholder": "Platzhalter",
|
||||
"please_select_at_least_one_survey": "Bitte wähle mindestens eine Umfrage aus",
|
||||
"please_select_at_least_one_trigger": "Bitte wähle mindestens einen Auslöser aus",
|
||||
"please_upgrade_your_plan": "Bitte aktualisieren Sie Ihren Plan",
|
||||
"please_upgrade_your_plan": "Bitte upgrade deinen Plan.",
|
||||
"preview": "Vorschau",
|
||||
"preview_survey": "Umfragevorschau",
|
||||
"privacy": "Datenschutz",
|
||||
@@ -781,26 +783,20 @@
|
||||
"add_webhook": "Webhook hinzufügen",
|
||||
"add_webhook_description": "Sende Umfragedaten an einen benutzerdefinierten Endpunkt",
|
||||
"all_current_and_new_surveys": "Alle aktuellen und neuen Umfragen",
|
||||
"copy_secret_now": "Signierungsschlüssel kopieren",
|
||||
"created_by_third_party": "Erstellt von einer dritten Partei",
|
||||
"discord_webhook_not_supported": "Discord-Webhooks werden derzeit nicht unterstützt.",
|
||||
"empty_webhook_message": "Deine Webhooks werden hier angezeigt, sobald Du sie hinzufügst ⏲️",
|
||||
"endpoint_pinged": "Juhu! Wir können den Webhook anpingen!",
|
||||
"endpoint_pinged_error": "Kann den Webhook nicht anpingen!",
|
||||
"learn_to_verify": "Erfahren Sie, wie Sie Webhook-Signaturen verifizieren",
|
||||
"please_check_console": "Bitte überprüfe die Konsole für weitere Details",
|
||||
"please_enter_a_url": "Bitte gib eine URL ein",
|
||||
"response_created": "Antwort erstellt",
|
||||
"response_finished": "Antwort abgeschlossen",
|
||||
"response_updated": "Antwort aktualisiert",
|
||||
"secret_copy_warning": "Bewahren Sie diesen Schlüssel sicher auf. Sie können ihn erneut in den Webhook-Einstellungen einsehen.",
|
||||
"secret_description": "Verwenden Sie diesen Schlüssel, um Webhook-Anfragen zu verifizieren. Siehe Dokumentation zur Signaturverifizierung.",
|
||||
"signing_secret": "Signierungsschlüssel",
|
||||
"source": "Quelle",
|
||||
"test_endpoint": "Test-Endpunkt",
|
||||
"triggers": "Auslöser",
|
||||
"webhook_added_successfully": "Webhook wurde erfolgreich hinzugefügt",
|
||||
"webhook_created": "Webhook erstellt",
|
||||
"webhook_delete_confirmation": "Bist Du sicher, dass Du diesen Webhook löschen möchtest? Dadurch werden dir keine weiteren Benachrichtigungen mehr gesendet.",
|
||||
"webhook_deleted_successfully": "Webhook erfolgreich gelöscht",
|
||||
"webhook_name_placeholder": "Optional: Benenne deinen Webhook zur einfachen Identifizierung",
|
||||
@@ -1163,6 +1159,7 @@
|
||||
"adjust_survey_closed_message_description": "Ändere die Nachricht, die Besucher sehen, wenn die Umfrage geschlossen ist.",
|
||||
"adjust_the_theme_in_the": "Passe das Thema an in den",
|
||||
"all_other_answers_will_continue_to": "Alle anderen Antworten werden weiterhin",
|
||||
"allow_file_type": "Dateityp begrenzen",
|
||||
"allow_multi_select": "Mehrfachauswahl erlauben",
|
||||
"allow_multiple_files": "Mehrere Dateien zulassen",
|
||||
"allow_users_to_select_more_than_one_image": "Erlaube Nutzern, mehr als ein Bild auszuwählen",
|
||||
@@ -1193,8 +1190,6 @@
|
||||
"cal_username": "Cal.com Benutzername oder Benutzername/Ereignis",
|
||||
"calculate": "Berechnen",
|
||||
"capture_a_new_action_to_trigger_a_survey_on": "Erfasse eine neue Aktion, um eine Umfrage auszulösen.",
|
||||
"capture_ip_address": "IP-Adresse erfassen",
|
||||
"capture_ip_address_description": "Speichern Sie die IP-Adresse des Befragten in den Antwort-Metadaten zur Duplikaterkennung und für Sicherheitszwecke",
|
||||
"capture_new_action": "Neue Aktion erfassen",
|
||||
"card_arrangement_for_survey_type_derived": "Kartenanordnung für {surveyTypeDerived} Umfragen",
|
||||
"card_background_color": "Hintergrundfarbe der Karte",
|
||||
@@ -1225,6 +1220,8 @@
|
||||
"change_the_question_color_of_the_survey": "Fragefarbe der Umfrage ändern.",
|
||||
"changes_saved": "Änderungen gespeichert.",
|
||||
"changing_survey_type_will_remove_existing_distribution_channels": "\"Das Ändern des Umfragetypen beeinflusst, wie er geteilt werden kann. Wenn Teilnehmer bereits Zugriffslinks für den aktuellen Typ haben, könnten sie das Zugriffsrecht nach dem Wechsel verlieren.\"",
|
||||
"character_limit_toggle_description": "Begrenzen Sie, wie kurz oder lang eine Antwort sein kann.",
|
||||
"character_limit_toggle_title": "Fügen Sie Zeichenbeschränkungen hinzu",
|
||||
"checkbox_label": "Checkbox-Beschriftung",
|
||||
"choose_the_actions_which_trigger_the_survey": "Aktionen auswählen, die die Umfrage auslösen.",
|
||||
"choose_the_first_question_on_your_block": "Wählen sie die erste frage in ihrem block",
|
||||
@@ -1244,6 +1241,7 @@
|
||||
"contact_fields": "Kontaktfelder",
|
||||
"contains": "enthält",
|
||||
"continue_to_settings": "Weiter zu den Einstellungen",
|
||||
"control_which_file_types_can_be_uploaded": "Steuere, welche Dateitypen hochgeladen werden können.",
|
||||
"convert_to_multiple_choice": "In Multiple-Choice umwandeln",
|
||||
"convert_to_single_choice": "In Einzelauswahl umwandeln",
|
||||
"country": "Land",
|
||||
@@ -1360,7 +1358,7 @@
|
||||
"hide_question_settings": "Frageeinstellungen ausblenden",
|
||||
"hostname": "Hostname",
|
||||
"how_funky_do_you_want_your_cards_in_survey_type_derived_surveys": "Wie funky sollen deine Karten in {surveyTypeDerived} Umfragen sein",
|
||||
"if_you_need_more_please": "Wenn Sie mehr benötigen, bitte",
|
||||
"if_you_need_more_please": "Wenn Du mehr brauchst, bitte",
|
||||
"if_you_really_want_that_answer_ask_until_you_get_it": "Weiterhin anzeigen, wenn ausgelöst, bis eine Antwort abgegeben wird.",
|
||||
"ignore_global_waiting_time": "Abkühlphase ignorieren",
|
||||
"ignore_global_waiting_time_description": "Diese Umfrage kann angezeigt werden, wenn ihre Bedingungen erfüllt sind, auch wenn kürzlich eine andere Umfrage angezeigt wurde.",
|
||||
@@ -1397,8 +1395,9 @@
|
||||
"key": "Schlüssel",
|
||||
"last_name": "Nachname",
|
||||
"let_people_upload_up_to_25_files_at_the_same_time": "Erlaube bis zu 25 Dateien gleichzeitig hochzuladen.",
|
||||
"limit_the_maximum_file_size": "Begrenzen Sie die maximale Dateigröße für Uploads.",
|
||||
"limit_upload_file_size_to": "Upload-Dateigröße begrenzen auf",
|
||||
"limit_file_types": "Dateitypen einschränken",
|
||||
"limit_the_maximum_file_size": "Maximale Dateigröße begrenzen",
|
||||
"limit_upload_file_size_to": "Maximale Dateigröße für Uploads",
|
||||
"link_survey_description": "Teile einen Link zu einer Umfrageseite oder bette ihn in eine Webseite oder E-Mail ein.",
|
||||
"load_segment": "Segment laden",
|
||||
"logic_error_warning": "Änderungen werden zu Logikfehlern führen",
|
||||
@@ -1410,8 +1409,8 @@
|
||||
"manage_languages": "Sprachen verwalten",
|
||||
"matrix_all_fields": "Alle Felder",
|
||||
"matrix_rows": "Zeilen",
|
||||
"max_file_size": "Maximale Dateigröße",
|
||||
"max_file_size_limit_is": "Die maximale Dateigrößenbeschränkung beträgt",
|
||||
"max_file_size": "Max. Dateigröße",
|
||||
"max_file_size_limit_is": "Max. Dateigröße ist",
|
||||
"move_question_to_block": "Frage in Block verschieben",
|
||||
"multiply": "Multiplizieren *",
|
||||
"needed_for_self_hosted_cal_com_instance": "Benötigt für eine selbstgehostete Cal.com-Instanz",
|
||||
@@ -1443,6 +1442,7 @@
|
||||
"picture_idx": "Bild {idx}",
|
||||
"pin_can_only_contain_numbers": "PIN darf nur Zahlen enthalten.",
|
||||
"pin_must_be_a_four_digit_number": "Die PIN muss eine vierstellige Zahl sein.",
|
||||
"please_enter_a_file_extension": "Bitte gib eine Dateierweiterung ein.",
|
||||
"please_enter_a_valid_url": "Bitte geben Sie eine gültige URL ein (z. B. https://beispiel.de)",
|
||||
"please_set_a_survey_trigger": "Bitte richte einen Umfrage-Trigger ein",
|
||||
"please_specify": "Bitte angeben",
|
||||
@@ -1520,7 +1520,6 @@
|
||||
"search_for_images": "Nach Bildern suchen",
|
||||
"seconds_after_trigger_the_survey_will_be_closed_if_no_response": "Sekunden nach dem Auslösen wird die Umfrage geschlossen, wenn keine Antwort erfolgt.",
|
||||
"seconds_before_showing_the_survey": "Sekunden, bevor die Umfrage angezeigt wird.",
|
||||
"select_field": "Feld auswählen",
|
||||
"select_or_type_value": "Auswählen oder Wert eingeben",
|
||||
"select_ordering": "Anordnung auswählen",
|
||||
"select_saved_action": "Gespeicherte Aktion auswählen",
|
||||
@@ -1568,6 +1567,8 @@
|
||||
"the_survey_will_be_shown_once_even_if_person_doesnt_respond": "Einmal anzeigen, auch wenn sie nicht antworten.",
|
||||
"then": "dann",
|
||||
"this_action_will_remove_all_the_translations_from_this_survey": "Diese Aktion entfernt alle Übersetzungen aus dieser Umfrage.",
|
||||
"this_extension_is_already_added": "Diese Erweiterung ist bereits hinzugefügt.",
|
||||
"this_file_type_is_not_supported": "Dieser Dateityp wird nicht unterstützt.",
|
||||
"three_points": "3 Punkte",
|
||||
"times": "Zeiten",
|
||||
"to_keep_the_placement_over_all_surveys_consistent_you_can": "Um die Platzierung über alle Umfragen hinweg konsistent zu halten, kannst du",
|
||||
@@ -1588,42 +1589,6 @@
|
||||
"upper_label": "Oberes Label",
|
||||
"url_filters": "URL-Filter",
|
||||
"url_not_supported": "URL nicht unterstützt",
|
||||
"validation": {
|
||||
"characters": "Zeichen",
|
||||
"contains": "enthält",
|
||||
"does_not_contain": "enthält nicht",
|
||||
"email": "Ist gültige E-Mail",
|
||||
"file_extension_is": "Dateierweiterung ist",
|
||||
"file_extension_is_not": "Dateierweiterung ist nicht",
|
||||
"is": "ist",
|
||||
"is_between": "ist zwischen",
|
||||
"is_earlier_than": "ist früher als",
|
||||
"is_greater_than": "ist größer als",
|
||||
"is_later_than": "ist später als",
|
||||
"is_less_than": "ist weniger als",
|
||||
"is_not": "ist nicht",
|
||||
"is_not_between": "ist nicht zwischen",
|
||||
"kb": "KB",
|
||||
"max_length": "Höchstens",
|
||||
"max_selections": "Höchstens",
|
||||
"max_value": "Höchstens",
|
||||
"mb": "MB",
|
||||
"min_length": "Mindestens",
|
||||
"min_selections": "Mindestens",
|
||||
"min_value": "Mindestens",
|
||||
"minimum_options_ranked": "Mindestanzahl bewerteter Optionen",
|
||||
"minimum_rows_answered": "Mindestanzahl beantworteter Zeilen",
|
||||
"options_selected": "Optionen ausgewählt",
|
||||
"pattern": "Entspricht Regex-Muster",
|
||||
"phone": "Ist gültige Telefonnummer",
|
||||
"rank_all_options": "Alle Optionen bewerten",
|
||||
"select_file_extensions": "Dateierweiterungen auswählen...",
|
||||
"url": "Ist gültige URL"
|
||||
},
|
||||
"validation_logic_and": "Alle sind wahr",
|
||||
"validation_logic_or": "mindestens eine ist wahr",
|
||||
"validation_rules": "Validierungsregeln",
|
||||
"validation_rules_description": "Nur Antworten akzeptieren, die die folgenden Kriterien erfüllen",
|
||||
"variable_is_used_in_logic_of_question_please_remove_it_from_logic_first": "{variable} wird in der Logik der Frage {questionIndex} verwendet. Bitte entferne es zuerst aus der Logik.",
|
||||
"variable_is_used_in_quota_please_remove_it_from_quota_first": "Variable \"{variableName}\" wird in der \"{quotaName}\" Quote verwendet",
|
||||
"variable_name_is_already_taken_please_choose_another": "Variablenname ist bereits vergeben, bitte wähle einen anderen.",
|
||||
@@ -1681,7 +1646,6 @@
|
||||
"error_downloading_responses": "Beim Herunterladen der Antworten ist ein Fehler aufgetreten",
|
||||
"first_name": "Vorname",
|
||||
"how_to_identify_users": "Wie man Benutzer identifiziert",
|
||||
"ip_address": "IP-Adresse",
|
||||
"last_name": "Nachname",
|
||||
"not_completed": "Nicht abgeschlossen ⏳",
|
||||
"os": "Betriebssystem",
|
||||
@@ -1726,22 +1690,6 @@
|
||||
"url_encryption_description": "Nur deaktivieren, wenn Sie eine benutzerdefinierte Einmal-ID setzen müssen.",
|
||||
"url_encryption_label": "Verschlüsselung der URL für einmalige Nutzung ID"
|
||||
},
|
||||
"custom_html": {
|
||||
"add_mode_description": "Umfrage-Skripte werden zusätzlich zu den Workspace-Skripten ausgeführt.",
|
||||
"add_to_workspace": "Zu Workspace-Skripten hinzufügen",
|
||||
"description": "Tracking-Skripte und Pixel zu dieser Umfrage hinzufügen",
|
||||
"nav_title": "Benutzerdefiniertes HTML",
|
||||
"no_workspace_scripts": "Keine Workspace-Skripte konfiguriert. Sie können diese in Workspace-Einstellungen → Allgemein hinzufügen.",
|
||||
"placeholder": "<!-- Fügen Sie hier Ihre Tracking-Skripte ein -->\n<script>\n // Google Tag Manager, Analytics, etc.\n</script>",
|
||||
"replace_mode_description": "Nur Umfrage-Skripte werden ausgeführt. Workspace-Skripte werden ignoriert. Leer lassen, um keine Skripte zu laden.",
|
||||
"replace_workspace": "Workspace-Skripte ersetzen",
|
||||
"saved_successfully": "Benutzerdefinierte Skripte erfolgreich gespeichert",
|
||||
"script_mode": "Skript-Modus",
|
||||
"security_warning": "Skripte werden mit vollem Browser-Zugriff ausgeführt. Fügen Sie nur Skripte aus vertrauenswürdigen Quellen hinzu.",
|
||||
"survey_scripts_description": "Benutzerdefiniertes HTML hinzufügen, das in den <head> dieser Umfrageseite eingefügt wird.",
|
||||
"survey_scripts_label": "Umfragespezifische Skripte",
|
||||
"workspace_scripts_label": "Workspace-Skripte (vererbt)"
|
||||
},
|
||||
"dynamic_popup": {
|
||||
"alert_button": "Umfrage bearbeiten",
|
||||
"alert_description": "Diese Umfrage ist derzeit als Link-Umfrage konfiguriert, die dynamische Pop-ups nicht unterstützt. Sie können dies im Tab ‚Einstellungen‘ im Umfrage-Editor ändern.",
|
||||
@@ -1981,13 +1929,6 @@
|
||||
},
|
||||
"general": {
|
||||
"cannot_delete_only_workspace": "Dies ist Ihr einziges Projekt, es kann nicht gelöscht werden. Erstellen Sie zuerst ein neues Projekt.",
|
||||
"custom_scripts": "Benutzerdefinierte Skripte",
|
||||
"custom_scripts_card_description": "Tracking-Skripte und Pixel zu allen Link-Umfragen in diesem Workspace hinzufügen.",
|
||||
"custom_scripts_description": "Skripte werden in den <head> aller Link-Umfrageseiten eingefügt.",
|
||||
"custom_scripts_label": "HTML-Skripte",
|
||||
"custom_scripts_placeholder": "<!-- Fügen Sie hier Ihre Tracking-Skripte ein -->\n<script>\n // Google Tag Manager, Analytics, etc.\n</script>",
|
||||
"custom_scripts_updated_successfully": "Benutzerdefinierte Skripte erfolgreich aktualisiert",
|
||||
"custom_scripts_warning": "Skripte werden mit vollem Browser-Zugriff ausgeführt. Fügen Sie nur Skripte aus vertrauenswürdigen Quellen hinzu.",
|
||||
"delete_workspace": "Projekt löschen",
|
||||
"delete_workspace_confirmation": "Sind Sie sicher, dass Sie {projectName} löschen möchten? Diese Aktion kann nicht rückgängig gemacht werden.",
|
||||
"delete_workspace_name_includes_surveys_responses_people_and_more": "{projectName} inkl. aller Umfragen, Antworten, Personen, Aktionen und Attribute löschen.",
|
||||
|
||||
+14
-71
@@ -197,7 +197,6 @@
|
||||
"docs": "Documentation",
|
||||
"documentation": "Documentation",
|
||||
"domain": "Domain",
|
||||
"done": "Done",
|
||||
"download": "Download",
|
||||
"draft": "Draft",
|
||||
"duplicate": "Duplicate",
|
||||
@@ -239,6 +238,7 @@
|
||||
"imprint": "Imprint",
|
||||
"in_progress": "In Progress",
|
||||
"inactive_surveys": "Inactive surveys",
|
||||
"input_type": "Input type",
|
||||
"integration": "integration",
|
||||
"integrations": "Integrations",
|
||||
"invalid_date": "Invalid date",
|
||||
@@ -262,11 +262,13 @@
|
||||
"look_and_feel": "Look & Feel",
|
||||
"manage": "Manage",
|
||||
"marketing": "Marketing",
|
||||
"maximum": "Maximum",
|
||||
"member": "Member",
|
||||
"members": "Members",
|
||||
"members_and_teams": "Members & Teams",
|
||||
"membership_not_found": "Membership not found",
|
||||
"metadata": "Metadata",
|
||||
"minimum": "Minimum",
|
||||
"mobile_overlay_app_works_best_on_desktop": "Formbricks works best on a bigger screen. To manage or build surveys, switch to another device.",
|
||||
"mobile_overlay_surveys_look_good": "Don't worry – your surveys look great on every device and screen size!",
|
||||
"mobile_overlay_title": "Oops, tiny screen detected!",
|
||||
@@ -319,7 +321,7 @@
|
||||
"placeholder": "Placeholder",
|
||||
"please_select_at_least_one_survey": "Please select at least one survey",
|
||||
"please_select_at_least_one_trigger": "Please select at least one trigger",
|
||||
"please_upgrade_your_plan": "Please upgrade your plan",
|
||||
"please_upgrade_your_plan": "Please upgrade your plan.",
|
||||
"preview": "Preview",
|
||||
"preview_survey": "Preview Survey",
|
||||
"privacy": "Privacy Policy",
|
||||
@@ -781,26 +783,20 @@
|
||||
"add_webhook": "Add Webhook",
|
||||
"add_webhook_description": "Send survey response data to a custom endpoint",
|
||||
"all_current_and_new_surveys": "All current and new surveys",
|
||||
"copy_secret_now": "Copy your signing secret",
|
||||
"created_by_third_party": "Created by a Third Party",
|
||||
"discord_webhook_not_supported": "Discord webhooks are currently not supported.",
|
||||
"empty_webhook_message": "Your webhooks will appear here as soon as you add them. ⏲️",
|
||||
"endpoint_pinged": "Yay! We are able to ping the webhook!",
|
||||
"endpoint_pinged_error": "Unable to ping the webhook!",
|
||||
"learn_to_verify": "Learn how to verify webhook signatures",
|
||||
"please_check_console": "Please check the console for more details",
|
||||
"please_enter_a_url": "Please enter a URL",
|
||||
"response_created": "Response Created",
|
||||
"response_finished": "Response Finished",
|
||||
"response_updated": "Response Updated",
|
||||
"secret_copy_warning": "Store this secret securely. You can view it again in webhook settings.",
|
||||
"secret_description": "Use this secret to verify webhook requests. See documentation for signature verification.",
|
||||
"signing_secret": "Signing Secret",
|
||||
"source": "Source",
|
||||
"test_endpoint": "Test Endpoint",
|
||||
"triggers": "Triggers",
|
||||
"webhook_added_successfully": "Webhook added successfully",
|
||||
"webhook_created": "Webhook Created",
|
||||
"webhook_delete_confirmation": "Are you sure you want to delete this Webhook? This will stop sending you any further notifications.",
|
||||
"webhook_deleted_successfully": "Webhook deleted successfully",
|
||||
"webhook_name_placeholder": "Optional: Label your webhook for easy identification",
|
||||
@@ -1163,6 +1159,7 @@
|
||||
"adjust_survey_closed_message_description": "Change the message visitors see when the survey is closed.",
|
||||
"adjust_the_theme_in_the": "Adjust the theme in the",
|
||||
"all_other_answers_will_continue_to": "All other answers will continue to",
|
||||
"allow_file_type": "Allow file type",
|
||||
"allow_multi_select": "Allow multi-select",
|
||||
"allow_multiple_files": "Allow multiple files",
|
||||
"allow_users_to_select_more_than_one_image": "Allow users to select more than one image",
|
||||
@@ -1193,8 +1190,6 @@
|
||||
"cal_username": "Cal.com username or username/event",
|
||||
"calculate": "Calculate",
|
||||
"capture_a_new_action_to_trigger_a_survey_on": "Capture a new action to trigger a survey on.",
|
||||
"capture_ip_address": "Capture IP address",
|
||||
"capture_ip_address_description": "Store the respondent's IP address in response metadata for duplicate detection and security purposes",
|
||||
"capture_new_action": "Capture new action",
|
||||
"card_arrangement_for_survey_type_derived": "Card Arrangement for {surveyTypeDerived} Surveys",
|
||||
"card_background_color": "Card background color",
|
||||
@@ -1225,6 +1220,8 @@
|
||||
"change_the_question_color_of_the_survey": "Change the question color of the survey.",
|
||||
"changes_saved": "Changes saved.",
|
||||
"changing_survey_type_will_remove_existing_distribution_channels": "Changing the survey type will affect how it can be shared. If respondents already have access links for the current type, they may lose access after the switch.",
|
||||
"character_limit_toggle_description": "Limit how short or long an answer can be.",
|
||||
"character_limit_toggle_title": "Add character limits",
|
||||
"checkbox_label": "Checkbox Label",
|
||||
"choose_the_actions_which_trigger_the_survey": "Choose the actions which trigger the survey.",
|
||||
"choose_the_first_question_on_your_block": "Choose the first question on your Block",
|
||||
@@ -1244,6 +1241,7 @@
|
||||
"contact_fields": "Contact Fields",
|
||||
"contains": "Contains",
|
||||
"continue_to_settings": "Continue to Settings",
|
||||
"control_which_file_types_can_be_uploaded": "Control which file types can be uploaded.",
|
||||
"convert_to_multiple_choice": "Convert to Multi-select",
|
||||
"convert_to_single_choice": "Convert to Single-select",
|
||||
"country": "Country",
|
||||
@@ -1397,7 +1395,8 @@
|
||||
"key": "Key",
|
||||
"last_name": "Last Name",
|
||||
"let_people_upload_up_to_25_files_at_the_same_time": "Let people upload up to 25 files at the same time.",
|
||||
"limit_the_maximum_file_size": "Limit the maximum file size for uploads.",
|
||||
"limit_file_types": "Limit file types",
|
||||
"limit_the_maximum_file_size": "Limit the maximum file size",
|
||||
"limit_upload_file_size_to": "Limit upload file size to",
|
||||
"link_survey_description": "Share a link to a survey page or embed it in a web page or email.",
|
||||
"load_segment": "Load segment",
|
||||
@@ -1443,6 +1442,7 @@
|
||||
"picture_idx": "Picture {idx}",
|
||||
"pin_can_only_contain_numbers": "PIN can only contain numbers.",
|
||||
"pin_must_be_a_four_digit_number": "PIN must be a four digit number.",
|
||||
"please_enter_a_file_extension": "Please enter a file extension.",
|
||||
"please_enter_a_valid_url": "Please enter a valid URL (e.g., https://example.com)",
|
||||
"please_set_a_survey_trigger": "Please set a survey trigger",
|
||||
"please_specify": "Please specify",
|
||||
@@ -1520,7 +1520,6 @@
|
||||
"search_for_images": "Search for images",
|
||||
"seconds_after_trigger_the_survey_will_be_closed_if_no_response": "seconds after trigger the survey will be closed if no response",
|
||||
"seconds_before_showing_the_survey": "seconds before showing the survey.",
|
||||
"select_field": "Select field",
|
||||
"select_or_type_value": "Select or type value",
|
||||
"select_ordering": "Select ordering",
|
||||
"select_saved_action": "Select saved action",
|
||||
@@ -1568,6 +1567,8 @@
|
||||
"the_survey_will_be_shown_once_even_if_person_doesnt_respond": "Show a single time, even if they don't respond.",
|
||||
"then": "Then",
|
||||
"this_action_will_remove_all_the_translations_from_this_survey": "This action will remove all the translations from this survey.",
|
||||
"this_extension_is_already_added": "This extension is already added.",
|
||||
"this_file_type_is_not_supported": "This file type is not supported.",
|
||||
"three_points": "3 points",
|
||||
"times": "times",
|
||||
"to_keep_the_placement_over_all_surveys_consistent_you_can": "To keep the placement over all surveys consistent, you can",
|
||||
@@ -1587,43 +1588,9 @@
|
||||
"upload_at_least_2_images": "Upload at least 2 images",
|
||||
"upper_label": "Upper Label",
|
||||
"url_filters": "URL Filters",
|
||||
"url_not_supported": "URL not supported",
|
||||
"validation": {
|
||||
"characters": "Characters",
|
||||
"contains": "Contains",
|
||||
"does_not_contain": "Does not contain",
|
||||
"email": "Is valid email",
|
||||
"file_extension_is": "File extension is",
|
||||
"file_extension_is_not": "File extension is not",
|
||||
"is": "Is",
|
||||
"is_between": "Is between",
|
||||
"is_earlier_than": "Is earlier than",
|
||||
"is_greater_than": "Is greater than",
|
||||
"is_later_than": "Is later than",
|
||||
"is_less_than": "Is less than",
|
||||
"is_not": "Is not",
|
||||
"is_not_between": "Is not between",
|
||||
"kb": "KB",
|
||||
"max_length": "At most",
|
||||
"max_selections": "At most",
|
||||
"max_value": "At most",
|
||||
"mb": "MB",
|
||||
"min_length": "At least",
|
||||
"min_selections": "At least",
|
||||
"min_value": "At least",
|
||||
"minimum_options_ranked": "Minimum options ranked",
|
||||
"minimum_rows_answered": "Minimum rows answered",
|
||||
"options_selected": "Options selected",
|
||||
"pattern": "Matches regex pattern",
|
||||
"phone": "Is valid phone",
|
||||
"rank_all_options": "Rank all options",
|
||||
"select_file_extensions": "Select file extensions...",
|
||||
"url": "Is valid URL"
|
||||
},
|
||||
"validation_logic_and": "All are true",
|
||||
"validation_logic_or": "any is true",
|
||||
"validation_rules": "Validation rules",
|
||||
"validation_rules_description": "Only accept responses that meet the following criteria",
|
||||
"url_not_supported": "URL not supported",
|
||||
"variable_is_used_in_logic_of_question_please_remove_it_from_logic_first": "{variable} is used in logic of question {questionIndex}. Please remove it from logic first.",
|
||||
"variable_is_used_in_quota_please_remove_it_from_quota_first": "Variable \"{variableName}\" is being used in \"{quotaName}\" quota",
|
||||
"variable_name_is_already_taken_please_choose_another": "Variable name is already taken, please choose another.",
|
||||
@@ -1681,7 +1648,6 @@
|
||||
"error_downloading_responses": "An error occurred while downloading responses",
|
||||
"first_name": "First Name",
|
||||
"how_to_identify_users": "How to identify users",
|
||||
"ip_address": "IP Address",
|
||||
"last_name": "Last Name",
|
||||
"not_completed": "Not Completed ⏳",
|
||||
"os": "OS",
|
||||
@@ -1726,22 +1692,6 @@
|
||||
"url_encryption_description": "Only disable if you need to set a custom single-use ID.",
|
||||
"url_encryption_label": "URL encryption of single-use ID"
|
||||
},
|
||||
"custom_html": {
|
||||
"add_mode_description": "Survey scripts will run in addition to workspace-level scripts.",
|
||||
"add_to_workspace": "Add to Workspace scripts",
|
||||
"description": "Add tracking scripts and pixels to this survey",
|
||||
"nav_title": "Custom HTML",
|
||||
"no_workspace_scripts": "No workspace-level scripts configured. You can add them in Workspace Settings → General.",
|
||||
"placeholder": "<!-- Paste your tracking scripts here -->\n<script>\n // Google Tag Manager, Analytics, etc.\n</script>",
|
||||
"replace_mode_description": "Only survey scripts will run. Workspace scripts will be ignored. Keep empty to not load any scripts.",
|
||||
"replace_workspace": "Replace Workspace scripts",
|
||||
"saved_successfully": "Custom scripts saved successfully",
|
||||
"script_mode": "Script Mode",
|
||||
"security_warning": "Scripts execute with full browser access. Only add scripts from trusted sources.",
|
||||
"survey_scripts_description": "Add custom HTML to inject into the <head> of this survey page.",
|
||||
"survey_scripts_label": "Survey-specific scripts",
|
||||
"workspace_scripts_label": "Workspace scripts (inherited)"
|
||||
},
|
||||
"dynamic_popup": {
|
||||
"alert_button": "Edit survey",
|
||||
"alert_description": "This survey is currently configured as a link survey, which does not support dynamic pop-ups. You can change this in the settings tab of the survey editor.",
|
||||
@@ -1981,13 +1931,6 @@
|
||||
},
|
||||
"general": {
|
||||
"cannot_delete_only_workspace": "This is your only workspace, it cannot be deleted. Create a new workspace first.",
|
||||
"custom_scripts": "Custom Scripts",
|
||||
"custom_scripts_card_description": "Add tracking scripts and pixels to all link surveys in this workspace.",
|
||||
"custom_scripts_description": "Scripts will be injected into the <head> of all link survey pages.",
|
||||
"custom_scripts_label": "HTML Scripts",
|
||||
"custom_scripts_placeholder": "<!-- Paste your tracking scripts here -->\n<script>\n // Google Tag Manager, Analytics, etc.\n</script>",
|
||||
"custom_scripts_updated_successfully": "Custom scripts updated successfully",
|
||||
"custom_scripts_warning": "Scripts execute with full browser access. Only add scripts from trusted sources.",
|
||||
"delete_workspace": "Delete Workspace",
|
||||
"delete_workspace_confirmation": "Are you sure you want to delete {projectName}? This action cannot be undone.",
|
||||
"delete_workspace_name_includes_surveys_responses_people_and_more": "Delete {projectName} incl. all surveys, responses, people, actions and attributes.",
|
||||
|
||||
+14
-73
@@ -197,7 +197,6 @@
|
||||
"docs": "Documentación",
|
||||
"documentation": "Documentación",
|
||||
"domain": "Dominio",
|
||||
"done": "Hecho",
|
||||
"download": "Descargar",
|
||||
"draft": "Borrador",
|
||||
"duplicate": "Duplicar",
|
||||
@@ -239,6 +238,7 @@
|
||||
"imprint": "Aviso legal",
|
||||
"in_progress": "En progreso",
|
||||
"inactive_surveys": "Encuestas inactivas",
|
||||
"input_type": "Tipo de entrada",
|
||||
"integration": "integración",
|
||||
"integrations": "Integraciones",
|
||||
"invalid_date": "Fecha no válida",
|
||||
@@ -262,11 +262,13 @@
|
||||
"look_and_feel": "Apariencia",
|
||||
"manage": "Gestionar",
|
||||
"marketing": "Marketing",
|
||||
"maximum": "Máximo",
|
||||
"member": "Miembro",
|
||||
"members": "Miembros",
|
||||
"members_and_teams": "Miembros y equipos",
|
||||
"membership_not_found": "Membresía no encontrada",
|
||||
"metadata": "Metadatos",
|
||||
"minimum": "Mínimo",
|
||||
"mobile_overlay_app_works_best_on_desktop": "Formbricks funciona mejor en una pantalla más grande. Para gestionar o crear encuestas, cambia a otro dispositivo.",
|
||||
"mobile_overlay_surveys_look_good": "No te preocupes – ¡tus encuestas se ven geniales en todos los dispositivos y tamaños de pantalla!",
|
||||
"mobile_overlay_title": "¡Ups, pantalla pequeña detectada!",
|
||||
@@ -319,7 +321,7 @@
|
||||
"placeholder": "Marcador de posición",
|
||||
"please_select_at_least_one_survey": "Por favor, selecciona al menos una encuesta",
|
||||
"please_select_at_least_one_trigger": "Por favor, selecciona al menos un disparador",
|
||||
"please_upgrade_your_plan": "Por favor, actualiza tu plan",
|
||||
"please_upgrade_your_plan": "Por favor, actualiza tu plan.",
|
||||
"preview": "Vista previa",
|
||||
"preview_survey": "Vista previa de la encuesta",
|
||||
"privacy": "Política de privacidad",
|
||||
@@ -781,26 +783,20 @@
|
||||
"add_webhook": "Añadir webhook",
|
||||
"add_webhook_description": "Envía datos de respuestas de encuestas a un endpoint personalizado",
|
||||
"all_current_and_new_surveys": "Todas las encuestas actuales y nuevas",
|
||||
"copy_secret_now": "Copia tu secreto de firma",
|
||||
"created_by_third_party": "Creado por un tercero",
|
||||
"discord_webhook_not_supported": "Los webhooks de Discord no son compatibles actualmente.",
|
||||
"empty_webhook_message": "Tus webhooks aparecerán aquí tan pronto como los añadas. ⏲️",
|
||||
"endpoint_pinged": "¡Genial! ¡Podemos hacer ping al webhook!",
|
||||
"endpoint_pinged_error": "¡No se puede hacer ping al webhook!",
|
||||
"learn_to_verify": "Aprende a verificar las firmas de webhook",
|
||||
"please_check_console": "Por favor, consulta la consola para más detalles",
|
||||
"please_enter_a_url": "Por favor, introduce una URL",
|
||||
"response_created": "Respuesta creada",
|
||||
"response_finished": "Respuesta finalizada",
|
||||
"response_updated": "Respuesta actualizada",
|
||||
"secret_copy_warning": "Almacena este secreto de forma segura. Puedes verlo de nuevo en la configuración del webhook.",
|
||||
"secret_description": "Usa este secreto para verificar las solicitudes del webhook. Consulta la documentación para la verificación de firma.",
|
||||
"signing_secret": "Secreto de firma",
|
||||
"source": "Origen",
|
||||
"test_endpoint": "Probar endpoint",
|
||||
"triggers": "Disparadores",
|
||||
"webhook_added_successfully": "Webhook añadido correctamente",
|
||||
"webhook_created": "Webhook creado",
|
||||
"webhook_delete_confirmation": "¿Estás seguro de que quieres eliminar este webhook? Esto detendrá el envío de futuras notificaciones.",
|
||||
"webhook_deleted_successfully": "Webhook eliminado correctamente",
|
||||
"webhook_name_placeholder": "Opcional: Etiqueta tu webhook para identificarlo fácilmente",
|
||||
@@ -1163,6 +1159,7 @@
|
||||
"adjust_survey_closed_message_description": "Cambiar el mensaje que ven los visitantes cuando la encuesta está cerrada.",
|
||||
"adjust_the_theme_in_the": "Ajustar el tema en el",
|
||||
"all_other_answers_will_continue_to": "Todas las demás respuestas continuarán",
|
||||
"allow_file_type": "Permitir tipo de archivo",
|
||||
"allow_multi_select": "Permitir selección múltiple",
|
||||
"allow_multiple_files": "Permitir múltiples archivos",
|
||||
"allow_users_to_select_more_than_one_image": "Permitir a los usuarios seleccionar más de una imagen",
|
||||
@@ -1193,8 +1190,6 @@
|
||||
"cal_username": "Nombre de usuario de Cal.com o nombre de usuario/evento",
|
||||
"calculate": "Calcular",
|
||||
"capture_a_new_action_to_trigger_a_survey_on": "Captura una nueva acción para activar una encuesta.",
|
||||
"capture_ip_address": "Capturar dirección IP",
|
||||
"capture_ip_address_description": "Almacenar la dirección IP del encuestado en los metadatos de respuesta para la detección de duplicados y fines de seguridad",
|
||||
"capture_new_action": "Capturar nueva acción",
|
||||
"card_arrangement_for_survey_type_derived": "Disposición de tarjetas para encuestas de tipo {surveyTypeDerived}",
|
||||
"card_background_color": "Color de fondo de la tarjeta",
|
||||
@@ -1225,6 +1220,8 @@
|
||||
"change_the_question_color_of_the_survey": "Cambiar el color de las preguntas de la encuesta.",
|
||||
"changes_saved": "Cambios guardados.",
|
||||
"changing_survey_type_will_remove_existing_distribution_channels": "Cambiar el tipo de encuesta afectará a cómo se puede compartir. Si los encuestados ya tienen enlaces de acceso para el tipo actual, podrían perder el acceso después del cambio.",
|
||||
"character_limit_toggle_description": "Limitar lo corta o larga que puede ser una respuesta.",
|
||||
"character_limit_toggle_title": "Añadir límites de caracteres",
|
||||
"checkbox_label": "Etiqueta de casilla de verificación",
|
||||
"choose_the_actions_which_trigger_the_survey": "Elige las acciones que activan la encuesta.",
|
||||
"choose_the_first_question_on_your_block": "Elige la primera pregunta en tu bloque",
|
||||
@@ -1244,6 +1241,7 @@
|
||||
"contact_fields": "Campos de contacto",
|
||||
"contains": "Contiene",
|
||||
"continue_to_settings": "Continuar a ajustes",
|
||||
"control_which_file_types_can_be_uploaded": "Controla qué tipos de archivos se pueden subir.",
|
||||
"convert_to_multiple_choice": "Convertir a selección múltiple",
|
||||
"convert_to_single_choice": "Convertir a selección única",
|
||||
"country": "País",
|
||||
@@ -1397,8 +1395,9 @@
|
||||
"key": "Clave",
|
||||
"last_name": "Apellido",
|
||||
"let_people_upload_up_to_25_files_at_the_same_time": "Permitir que las personas suban hasta 25 archivos al mismo tiempo.",
|
||||
"limit_the_maximum_file_size": "Limita el tamaño máximo de archivo para las subidas.",
|
||||
"limit_upload_file_size_to": "Limitar el tamaño de archivo de subida a",
|
||||
"limit_file_types": "Limitar tipos de archivo",
|
||||
"limit_the_maximum_file_size": "Limitar el tamaño máximo de archivo",
|
||||
"limit_upload_file_size_to": "Limitar tamaño de subida de archivos a",
|
||||
"link_survey_description": "Comparte un enlace a una página de encuesta o incrústala en una página web o correo electrónico.",
|
||||
"load_segment": "Cargar segmento",
|
||||
"logic_error_warning": "El cambio causará errores lógicos",
|
||||
@@ -1443,6 +1442,7 @@
|
||||
"picture_idx": "Imagen {idx}",
|
||||
"pin_can_only_contain_numbers": "El PIN solo puede contener números.",
|
||||
"pin_must_be_a_four_digit_number": "El PIN debe ser un número de cuatro dígitos.",
|
||||
"please_enter_a_file_extension": "Por favor, introduce una extensión de archivo.",
|
||||
"please_enter_a_valid_url": "Por favor, introduce una URL válida (p. ej., https://example.com)",
|
||||
"please_set_a_survey_trigger": "Establece un disparador de encuesta",
|
||||
"please_specify": "Por favor, especifica",
|
||||
@@ -1520,7 +1520,6 @@
|
||||
"search_for_images": "Buscar imágenes",
|
||||
"seconds_after_trigger_the_survey_will_be_closed_if_no_response": "segundos después de activarse, la encuesta se cerrará si no hay respuesta",
|
||||
"seconds_before_showing_the_survey": "segundos antes de mostrar la encuesta.",
|
||||
"select_field": "Seleccionar campo",
|
||||
"select_or_type_value": "Selecciona o escribe un valor",
|
||||
"select_ordering": "Seleccionar ordenación",
|
||||
"select_saved_action": "Seleccionar acción guardada",
|
||||
@@ -1568,6 +1567,8 @@
|
||||
"the_survey_will_be_shown_once_even_if_person_doesnt_respond": "Mostrar una sola vez, incluso si no responden.",
|
||||
"then": "Entonces",
|
||||
"this_action_will_remove_all_the_translations_from_this_survey": "Esta acción eliminará todas las traducciones de esta encuesta.",
|
||||
"this_extension_is_already_added": "Esta extensión ya está añadida.",
|
||||
"this_file_type_is_not_supported": "Este tipo de archivo no es compatible.",
|
||||
"three_points": "3 puntos",
|
||||
"times": "veces",
|
||||
"to_keep_the_placement_over_all_surveys_consistent_you_can": "Para mantener la ubicación coherente en todas las encuestas, puedes",
|
||||
@@ -1588,42 +1589,6 @@
|
||||
"upper_label": "Etiqueta superior",
|
||||
"url_filters": "Filtros de URL",
|
||||
"url_not_supported": "URL no compatible",
|
||||
"validation": {
|
||||
"characters": "Caracteres",
|
||||
"contains": "Contiene",
|
||||
"does_not_contain": "No contiene",
|
||||
"email": "Es un correo electrónico válido",
|
||||
"file_extension_is": "La extensión del archivo es",
|
||||
"file_extension_is_not": "La extensión del archivo no es",
|
||||
"is": "Es",
|
||||
"is_between": "Está entre",
|
||||
"is_earlier_than": "Es anterior a",
|
||||
"is_greater_than": "Es mayor que",
|
||||
"is_later_than": "Es posterior a",
|
||||
"is_less_than": "Es menor que",
|
||||
"is_not": "No es",
|
||||
"is_not_between": "No está entre",
|
||||
"kb": "KB",
|
||||
"max_length": "Como máximo",
|
||||
"max_selections": "Como máximo",
|
||||
"max_value": "Como máximo",
|
||||
"mb": "MB",
|
||||
"min_length": "Al menos",
|
||||
"min_selections": "Al menos",
|
||||
"min_value": "Al menos",
|
||||
"minimum_options_ranked": "Opciones mínimas clasificadas",
|
||||
"minimum_rows_answered": "Filas mínimas respondidas",
|
||||
"options_selected": "Opciones seleccionadas",
|
||||
"pattern": "Coincide con el patrón regex",
|
||||
"phone": "Es un teléfono válido",
|
||||
"rank_all_options": "Clasificar todas las opciones",
|
||||
"select_file_extensions": "Selecciona extensiones de archivo...",
|
||||
"url": "Es una URL válida"
|
||||
},
|
||||
"validation_logic_and": "Todas son verdaderas",
|
||||
"validation_logic_or": "alguna es verdadera",
|
||||
"validation_rules": "Reglas de validación",
|
||||
"validation_rules_description": "Solo aceptar respuestas que cumplan los siguientes criterios",
|
||||
"variable_is_used_in_logic_of_question_please_remove_it_from_logic_first": "{variable} se usa en la lógica de la pregunta {questionIndex}. Por favor, elimínala primero de la lógica.",
|
||||
"variable_is_used_in_quota_please_remove_it_from_quota_first": "La variable \"{variableName}\" se está utilizando en la cuota \"{quotaName}\"",
|
||||
"variable_name_is_already_taken_please_choose_another": "El nombre de la variable ya está en uso, por favor elige otro.",
|
||||
@@ -1681,7 +1646,6 @@
|
||||
"error_downloading_responses": "Se produjo un error al descargar las respuestas",
|
||||
"first_name": "Nombre",
|
||||
"how_to_identify_users": "Cómo identificar a los usuarios",
|
||||
"ip_address": "Dirección IP",
|
||||
"last_name": "Apellido",
|
||||
"not_completed": "No completado ⏳",
|
||||
"os": "Sistema operativo",
|
||||
@@ -1726,22 +1690,6 @@
|
||||
"url_encryption_description": "Desactiva solo si necesitas establecer un ID de uso único personalizado.",
|
||||
"url_encryption_label": "Cifrado URL del ID de uso único"
|
||||
},
|
||||
"custom_html": {
|
||||
"add_mode_description": "Los scripts de la encuesta se ejecutarán además de los scripts a nivel de espacio de trabajo.",
|
||||
"add_to_workspace": "Añadir a los scripts del espacio de trabajo",
|
||||
"description": "Añade scripts de seguimiento y píxeles a esta encuesta",
|
||||
"nav_title": "HTML personalizado",
|
||||
"no_workspace_scripts": "No hay scripts configurados a nivel de espacio de trabajo. Puedes añadirlos en Configuración del espacio de trabajo → General.",
|
||||
"placeholder": "<!-- Pega tus scripts de seguimiento aquí -->\n<script>\n // Google Tag Manager, Analytics, etc.\n</script>",
|
||||
"replace_mode_description": "Solo se ejecutarán los scripts de la encuesta. Los scripts del espacio de trabajo serán ignorados. Déjalo vacío para no cargar ningún script.",
|
||||
"replace_workspace": "Reemplazar scripts del espacio de trabajo",
|
||||
"saved_successfully": "Scripts personalizados guardados correctamente",
|
||||
"script_mode": "Modo de script",
|
||||
"security_warning": "Los scripts se ejecutan con acceso completo al navegador. Solo añade scripts de fuentes confiables.",
|
||||
"survey_scripts_description": "Añade HTML personalizado para inyectar en el <head> de esta página de encuesta.",
|
||||
"survey_scripts_label": "Scripts específicos de la encuesta",
|
||||
"workspace_scripts_label": "Scripts del espacio de trabajo (heredados)"
|
||||
},
|
||||
"dynamic_popup": {
|
||||
"alert_button": "Editar encuesta",
|
||||
"alert_description": "Esta encuesta está actualmente configurada como una encuesta de enlace, que no admite ventanas emergentes dinámicas. Puedes cambiar esto en la pestaña de ajustes del editor de encuestas.",
|
||||
@@ -1981,13 +1929,6 @@
|
||||
},
|
||||
"general": {
|
||||
"cannot_delete_only_workspace": "Este es tu único proyecto, no se puede eliminar. Crea primero un proyecto nuevo.",
|
||||
"custom_scripts": "Scripts personalizados",
|
||||
"custom_scripts_card_description": "Añade scripts de seguimiento y píxeles a todas las encuestas con enlace en este espacio de trabajo.",
|
||||
"custom_scripts_description": "Los scripts se inyectarán en el <head> de todas las páginas de encuestas con enlace.",
|
||||
"custom_scripts_label": "Scripts HTML",
|
||||
"custom_scripts_placeholder": "<!-- Pega tus scripts de seguimiento aquí -->\n<script>\n // Google Tag Manager, Analytics, etc.\n</script>",
|
||||
"custom_scripts_updated_successfully": "Scripts personalizados actualizados correctamente",
|
||||
"custom_scripts_warning": "Los scripts se ejecutan con acceso completo al navegador. Solo añade scripts de fuentes confiables.",
|
||||
"delete_workspace": "Eliminar proyecto",
|
||||
"delete_workspace_confirmation": "¿Estás seguro de que quieres eliminar {projectName}? Esta acción no se puede deshacer.",
|
||||
"delete_workspace_name_includes_surveys_responses_people_and_more": "Eliminar {projectName} incluyendo todas las encuestas, respuestas, personas, acciones y atributos.",
|
||||
|
||||
+16
-75
@@ -197,7 +197,6 @@
|
||||
"docs": "Documentation",
|
||||
"documentation": "Documentation",
|
||||
"domain": "Domaine",
|
||||
"done": "Terminé",
|
||||
"download": "Télécharger",
|
||||
"draft": "Brouillon",
|
||||
"duplicate": "Dupliquer",
|
||||
@@ -239,6 +238,7 @@
|
||||
"imprint": "Empreinte",
|
||||
"in_progress": "En cours",
|
||||
"inactive_surveys": "Sondages inactifs",
|
||||
"input_type": "Type d'entrée",
|
||||
"integration": "intégration",
|
||||
"integrations": "Intégrations",
|
||||
"invalid_date": "Date invalide",
|
||||
@@ -262,11 +262,13 @@
|
||||
"look_and_feel": "Apparence",
|
||||
"manage": "Gérer",
|
||||
"marketing": "Marketing",
|
||||
"maximum": "Max",
|
||||
"member": "Membre",
|
||||
"members": "Membres",
|
||||
"members_and_teams": "Membres & Équipes",
|
||||
"membership_not_found": "Abonnement non trouvé",
|
||||
"metadata": "Métadonnées",
|
||||
"minimum": "Min",
|
||||
"mobile_overlay_app_works_best_on_desktop": "Formbricks fonctionne mieux sur un écran plus grand. Pour gérer ou créer des sondages, passez à un autre appareil.",
|
||||
"mobile_overlay_surveys_look_good": "Ne t'inquiète pas – tes enquêtes sont superbes sur tous les appareils et tailles d'écran!",
|
||||
"mobile_overlay_title": "Oups, écran minuscule détecté!",
|
||||
@@ -319,7 +321,7 @@
|
||||
"placeholder": "Remplaçant",
|
||||
"please_select_at_least_one_survey": "Veuillez sélectionner au moins une enquête.",
|
||||
"please_select_at_least_one_trigger": "Veuillez sélectionner au moins un déclencheur.",
|
||||
"please_upgrade_your_plan": "Veuillez mettre à niveau votre plan",
|
||||
"please_upgrade_your_plan": "Veuillez mettre à niveau votre plan.",
|
||||
"preview": "Aperçu",
|
||||
"preview_survey": "Aperçu de l'enquête",
|
||||
"privacy": "Politique de confidentialité",
|
||||
@@ -781,26 +783,20 @@
|
||||
"add_webhook": "Ajouter un Webhook",
|
||||
"add_webhook_description": "Envoyer les données de réponse à l'enquête à un point de terminaison personnalisé",
|
||||
"all_current_and_new_surveys": "Tous les sondages actuels et nouveaux",
|
||||
"copy_secret_now": "Copiez votre secret de signature",
|
||||
"created_by_third_party": "Créé par un tiers",
|
||||
"discord_webhook_not_supported": "Les webhooks Discord ne sont actuellement pas pris en charge.",
|
||||
"empty_webhook_message": "Vos webhooks apparaîtront ici dès que vous les ajouterez. ⏲️",
|
||||
"endpoint_pinged": "Yay ! Nous pouvons pinger le webhook !",
|
||||
"endpoint_pinged_error": "Impossible de pinger le webhook !",
|
||||
"learn_to_verify": "Découvrez comment vérifier les signatures de webhook",
|
||||
"please_check_console": "Veuillez vérifier la console pour plus de détails.",
|
||||
"please_enter_a_url": "Veuillez entrer une URL.",
|
||||
"response_created": "Réponse créée",
|
||||
"response_finished": "Réponse terminée",
|
||||
"response_updated": "Réponse mise à jour",
|
||||
"secret_copy_warning": "Conservez ce secret en lieu sûr. Vous pourrez le consulter à nouveau dans les paramètres du webhook.",
|
||||
"secret_description": "Utilisez ce secret pour vérifier les requêtes webhook. Consultez la documentation pour la vérification de signature.",
|
||||
"signing_secret": "Secret de signature",
|
||||
"source": "Source",
|
||||
"test_endpoint": "Point de test",
|
||||
"triggers": "Déclencheurs",
|
||||
"webhook_added_successfully": "Webhook ajouté avec succès",
|
||||
"webhook_created": "Webhook créé",
|
||||
"webhook_delete_confirmation": "Êtes-vous sûr de vouloir supprimer ce Webhook ? Cela arrêtera l'envoi de toute notification future.",
|
||||
"webhook_deleted_successfully": "Webhook supprimé avec succès",
|
||||
"webhook_name_placeholder": "Optionnel : Étiquetez votre webhook pour une identification facile",
|
||||
@@ -1163,6 +1159,7 @@
|
||||
"adjust_survey_closed_message_description": "Modifiez le message que les visiteurs voient lorsque l'enquête est fermée.",
|
||||
"adjust_the_theme_in_the": "Ajustez le thème dans le",
|
||||
"all_other_answers_will_continue_to": "Toutes les autres réponses continueront à",
|
||||
"allow_file_type": "Autoriser le type de fichier",
|
||||
"allow_multi_select": "Autoriser la sélection multiple",
|
||||
"allow_multiple_files": "Autoriser plusieurs fichiers",
|
||||
"allow_users_to_select_more_than_one_image": "Permettre aux utilisateurs de sélectionner plusieurs images",
|
||||
@@ -1193,8 +1190,6 @@
|
||||
"cal_username": "Nom d'utilisateur Cal.com ou nom d'utilisateur/événement",
|
||||
"calculate": "Calculer",
|
||||
"capture_a_new_action_to_trigger_a_survey_on": "Capturez une nouvelle action pour déclencher une enquête.",
|
||||
"capture_ip_address": "Capturer l'adresse IP",
|
||||
"capture_ip_address_description": "Stocker l'adresse IP du répondant dans les métadonnées de réponse à des fins de détection des doublons et de sécurité",
|
||||
"capture_new_action": "Capturer une nouvelle action",
|
||||
"card_arrangement_for_survey_type_derived": "Disposition des cartes pour les enquêtes {surveyTypeDerived}",
|
||||
"card_background_color": "Couleur de fond de la carte",
|
||||
@@ -1225,6 +1220,8 @@
|
||||
"change_the_question_color_of_the_survey": "Vous pouvez modifier la couleur des questions d'une enquête.",
|
||||
"changes_saved": "Modifications enregistrées.",
|
||||
"changing_survey_type_will_remove_existing_distribution_channels": "Le changement du type de sondage affectera la façon dont il peut être partagé. Si les répondants ont déjà des liens d'accès pour le type actuel, ils peuvent perdre l'accès après le changement.",
|
||||
"character_limit_toggle_description": "Limitez la longueur des réponses.",
|
||||
"character_limit_toggle_title": "Ajouter des limites de caractères",
|
||||
"checkbox_label": "Étiquette de case à cocher",
|
||||
"choose_the_actions_which_trigger_the_survey": "Choisissez les actions qui déclenchent l'enquête.",
|
||||
"choose_the_first_question_on_your_block": "Choisissez la première question de votre bloc",
|
||||
@@ -1244,6 +1241,7 @@
|
||||
"contact_fields": "Champs de contact",
|
||||
"contains": "Contient",
|
||||
"continue_to_settings": "Continuer vers les paramètres",
|
||||
"control_which_file_types_can_be_uploaded": "Contrôlez quels types de fichiers peuvent être téléchargés.",
|
||||
"convert_to_multiple_choice": "Convertir en choix multiples",
|
||||
"convert_to_single_choice": "Convertir en choix unique",
|
||||
"country": "Pays",
|
||||
@@ -1360,7 +1358,7 @@
|
||||
"hide_question_settings": "Masquer les paramètres de la question",
|
||||
"hostname": "Nom d'hôte",
|
||||
"how_funky_do_you_want_your_cards_in_survey_type_derived_surveys": "À quel point voulez-vous que vos cartes soient funky dans les enquêtes {surveyTypeDerived}",
|
||||
"if_you_need_more_please": "Si vous avez besoin de plus, veuillez",
|
||||
"if_you_need_more_please": "Si vous en avez besoin de plus, s'il vous plaît",
|
||||
"if_you_really_want_that_answer_ask_until_you_get_it": "Continuer à afficher à chaque déclenchement jusqu'à ce qu'une réponse soit soumise.",
|
||||
"ignore_global_waiting_time": "Ignorer la période de refroidissement",
|
||||
"ignore_global_waiting_time_description": "Cette enquête peut s'afficher chaque fois que ses conditions sont remplies, même si une autre enquête a été affichée récemment.",
|
||||
@@ -1397,8 +1395,9 @@
|
||||
"key": "Clé",
|
||||
"last_name": "Nom de famille",
|
||||
"let_people_upload_up_to_25_files_at_the_same_time": "Permettre aux utilisateurs de télécharger jusqu'à 25 fichiers en même temps.",
|
||||
"limit_the_maximum_file_size": "Limiter la taille maximale des fichiers pour les téléversements.",
|
||||
"limit_upload_file_size_to": "Limiter la taille de téléversement des fichiers à",
|
||||
"limit_file_types": "Limiter les types de fichiers",
|
||||
"limit_the_maximum_file_size": "Limiter la taille maximale du fichier",
|
||||
"limit_upload_file_size_to": "Limiter la taille des fichiers téléchargés à",
|
||||
"link_survey_description": "Partagez un lien vers une page d'enquête ou intégrez-le dans une page web ou un e-mail.",
|
||||
"load_segment": "Segment de chargement",
|
||||
"logic_error_warning": "Changer causera des erreurs logiques",
|
||||
@@ -1411,7 +1410,7 @@
|
||||
"matrix_all_fields": "Tous les champs",
|
||||
"matrix_rows": "Lignes",
|
||||
"max_file_size": "Taille maximale du fichier",
|
||||
"max_file_size_limit_is": "La limite de taille maximale du fichier est",
|
||||
"max_file_size_limit_is": "La taille maximale du fichier est",
|
||||
"move_question_to_block": "Déplacer la question vers le bloc",
|
||||
"multiply": "Multiplier *",
|
||||
"needed_for_self_hosted_cal_com_instance": "Nécessaire pour une instance Cal.com auto-hébergée",
|
||||
@@ -1443,6 +1442,7 @@
|
||||
"picture_idx": "Image {idx}",
|
||||
"pin_can_only_contain_numbers": "Le code PIN ne peut contenir que des chiffres.",
|
||||
"pin_must_be_a_four_digit_number": "Le code PIN doit être un numéro à quatre chiffres.",
|
||||
"please_enter_a_file_extension": "Veuillez entrer une extension de fichier.",
|
||||
"please_enter_a_valid_url": "Veuillez entrer une URL valide (par exemple, https://example.com)",
|
||||
"please_set_a_survey_trigger": "Veuillez définir un déclencheur d'enquête.",
|
||||
"please_specify": "Veuillez préciser",
|
||||
@@ -1520,7 +1520,6 @@
|
||||
"search_for_images": "Rechercher des images",
|
||||
"seconds_after_trigger_the_survey_will_be_closed_if_no_response": "Les secondes après le déclenchement, l'enquête sera fermée si aucune réponse n'est donnée.",
|
||||
"seconds_before_showing_the_survey": "secondes avant de montrer l'enquête.",
|
||||
"select_field": "Sélectionner un champ",
|
||||
"select_or_type_value": "Sélectionnez ou saisissez une valeur",
|
||||
"select_ordering": "Choisir l'ordre",
|
||||
"select_saved_action": "Sélectionner une action enregistrée",
|
||||
@@ -1568,6 +1567,8 @@
|
||||
"the_survey_will_be_shown_once_even_if_person_doesnt_respond": "Afficher une seule fois, même si la personne ne répond pas.",
|
||||
"then": "Alors",
|
||||
"this_action_will_remove_all_the_translations_from_this_survey": "Cette action supprimera toutes les traductions de cette enquête.",
|
||||
"this_extension_is_already_added": "Cette extension est déjà ajoutée.",
|
||||
"this_file_type_is_not_supported": "Ce type de fichier n'est pas pris en charge.",
|
||||
"three_points": "3 points",
|
||||
"times": "fois",
|
||||
"to_keep_the_placement_over_all_surveys_consistent_you_can": "Pour maintenir la cohérence du placement sur tous les sondages, vous pouvez",
|
||||
@@ -1588,42 +1589,6 @@
|
||||
"upper_label": "Étiquette supérieure",
|
||||
"url_filters": "Filtres d'URL",
|
||||
"url_not_supported": "URL non supportée",
|
||||
"validation": {
|
||||
"characters": "Caractères",
|
||||
"contains": "Contient",
|
||||
"does_not_contain": "Ne contient pas",
|
||||
"email": "Est un e-mail valide",
|
||||
"file_extension_is": "L'extension de fichier est",
|
||||
"file_extension_is_not": "L'extension de fichier n'est pas",
|
||||
"is": "Est",
|
||||
"is_between": "Est entre",
|
||||
"is_earlier_than": "Est antérieur à",
|
||||
"is_greater_than": "Est supérieur à",
|
||||
"is_later_than": "Est postérieur à",
|
||||
"is_less_than": "Est inférieur à",
|
||||
"is_not": "N'est pas",
|
||||
"is_not_between": "N'est pas entre",
|
||||
"kb": "Ko",
|
||||
"max_length": "Au maximum",
|
||||
"max_selections": "Au maximum",
|
||||
"max_value": "Au maximum",
|
||||
"mb": "Mo",
|
||||
"min_length": "Au moins",
|
||||
"min_selections": "Au moins",
|
||||
"min_value": "Au moins",
|
||||
"minimum_options_ranked": "Nombre minimum d'options classées",
|
||||
"minimum_rows_answered": "Nombre minimum de lignes répondues",
|
||||
"options_selected": "Options sélectionnées",
|
||||
"pattern": "Correspond au modèle d'expression régulière",
|
||||
"phone": "Est un numéro de téléphone valide",
|
||||
"rank_all_options": "Classer toutes les options",
|
||||
"select_file_extensions": "Sélectionner les extensions de fichier...",
|
||||
"url": "Est une URL valide"
|
||||
},
|
||||
"validation_logic_and": "Toutes sont vraies",
|
||||
"validation_logic_or": "au moins une est vraie",
|
||||
"validation_rules": "Règles de validation",
|
||||
"validation_rules_description": "Accepter uniquement les réponses qui répondent aux critères suivants",
|
||||
"variable_is_used_in_logic_of_question_please_remove_it_from_logic_first": "{variable} est utilisé dans la logique de la question {questionIndex}. Veuillez d'abord le supprimer de la logique.",
|
||||
"variable_is_used_in_quota_please_remove_it_from_quota_first": "La variable \"{variableName}\" est utilisée dans le quota \"{quotaName}\"",
|
||||
"variable_name_is_already_taken_please_choose_another": "Le nom de la variable est déjà pris, veuillez en choisir un autre.",
|
||||
@@ -1681,7 +1646,6 @@
|
||||
"error_downloading_responses": "Une erreur s'est produite lors du téléchargement des réponses",
|
||||
"first_name": "Prénom",
|
||||
"how_to_identify_users": "Comment identifier les utilisateurs",
|
||||
"ip_address": "Adresse IP",
|
||||
"last_name": "Nom de famille",
|
||||
"not_completed": "Non terminé ⏳",
|
||||
"os": "Système d'exploitation",
|
||||
@@ -1726,22 +1690,6 @@
|
||||
"url_encryption_description": "Désactiver seulement si vous devez définir un identifiant unique personnalisé",
|
||||
"url_encryption_label": "Cryptage de l'identifiant à usage unique dans l'URL"
|
||||
},
|
||||
"custom_html": {
|
||||
"add_mode_description": "Les scripts de l'enquête s'exécuteront en plus des scripts au niveau de l'espace de travail.",
|
||||
"add_to_workspace": "Ajouter aux scripts de l'espace de travail",
|
||||
"description": "Ajouter des scripts de suivi et des pixels à cette enquête",
|
||||
"nav_title": "HTML personnalisé",
|
||||
"no_workspace_scripts": "Aucun script au niveau de l'espace de travail configuré. Vous pouvez les ajouter dans Paramètres de l'espace de travail → Général.",
|
||||
"placeholder": "<!-- Collez vos scripts de suivi ici -->\n<script>\n // Google Tag Manager, Analytics, etc.\n</script>",
|
||||
"replace_mode_description": "Seuls les scripts de l'enquête s'exécuteront. Les scripts de l'espace de travail seront ignorés. Laissez vide pour ne charger aucun script.",
|
||||
"replace_workspace": "Remplacer les scripts de l'espace de travail",
|
||||
"saved_successfully": "Scripts personnalisés enregistrés avec succès",
|
||||
"script_mode": "Mode de script",
|
||||
"security_warning": "Les scripts s'exécutent avec un accès complet au navigateur. Ajoutez uniquement des scripts provenant de sources fiables.",
|
||||
"survey_scripts_description": "Ajouter du HTML personnalisé à injecter dans le <head> de cette page d'enquête.",
|
||||
"survey_scripts_label": "Scripts spécifiques à l'enquête",
|
||||
"workspace_scripts_label": "Scripts de l'espace de travail (hérités)"
|
||||
},
|
||||
"dynamic_popup": {
|
||||
"alert_button": "Modifier enquête",
|
||||
"alert_description": "Ce sondage est actuellement configuré comme un sondage de lien, qui ne prend pas en charge les pop-ups dynamiques. Vous pouvez le modifier dans l'onglet des paramètres de l'éditeur de sondage.",
|
||||
@@ -1981,13 +1929,6 @@
|
||||
},
|
||||
"general": {
|
||||
"cannot_delete_only_workspace": "Il s'agit de votre seul projet, il ne peut pas être supprimé. Créez d'abord un nouveau projet.",
|
||||
"custom_scripts": "Scripts personnalisés",
|
||||
"custom_scripts_card_description": "Ajouter des scripts de suivi et des pixels à toutes les enquêtes par lien dans cet espace de travail.",
|
||||
"custom_scripts_description": "Les scripts seront injectés dans le <head> de toutes les pages d'enquête par lien.",
|
||||
"custom_scripts_label": "Scripts HTML",
|
||||
"custom_scripts_placeholder": "<!-- Collez vos scripts de suivi ici -->\n<script>\n // Google Tag Manager, Analytics, etc.\n</script>",
|
||||
"custom_scripts_updated_successfully": "Scripts personnalisés mis à jour avec succès",
|
||||
"custom_scripts_warning": "Les scripts s'exécutent avec un accès complet au navigateur. Ajoutez uniquement des scripts provenant de sources fiables.",
|
||||
"delete_workspace": "Supprimer le projet",
|
||||
"delete_workspace_confirmation": "Êtes-vous sûr de vouloir supprimer {projectName} ? Cette action ne peut pas être annulée.",
|
||||
"delete_workspace_name_includes_surveys_responses_people_and_more": "Supprimer {projectName} y compris toutes les enquêtes, réponses, personnes, actions et attributs.",
|
||||
|
||||
+14
-73
@@ -197,7 +197,6 @@
|
||||
"docs": "ドキュメント",
|
||||
"documentation": "ドキュメント",
|
||||
"domain": "ドメイン",
|
||||
"done": "完了",
|
||||
"download": "ダウンロード",
|
||||
"draft": "下書き",
|
||||
"duplicate": "複製",
|
||||
@@ -239,6 +238,7 @@
|
||||
"imprint": "企業情報",
|
||||
"in_progress": "進行中",
|
||||
"inactive_surveys": "非アクティブなフォーム",
|
||||
"input_type": "入力タイプ",
|
||||
"integration": "連携",
|
||||
"integrations": "連携",
|
||||
"invalid_date": "無効な日付です",
|
||||
@@ -262,11 +262,13 @@
|
||||
"look_and_feel": "デザイン",
|
||||
"manage": "管理",
|
||||
"marketing": "マーケティング",
|
||||
"maximum": "最大",
|
||||
"member": "メンバー",
|
||||
"members": "メンバー",
|
||||
"members_and_teams": "メンバー&チーム",
|
||||
"membership_not_found": "メンバーシップが見つかりません",
|
||||
"metadata": "メタデータ",
|
||||
"minimum": "最小",
|
||||
"mobile_overlay_app_works_best_on_desktop": "Formbricks は より 大きな 画面 で最適に 作動します。 フォーム を 管理または 構築する には、 別の デバイス に 切り替える 必要が あります。",
|
||||
"mobile_overlay_surveys_look_good": "ご安心ください - お使い の デバイス や 画面 サイズ に 関係なく、 フォーム は 素晴らしく 見えます!",
|
||||
"mobile_overlay_title": "おっと、 小さな 画面 が 検出されました!",
|
||||
@@ -319,7 +321,7 @@
|
||||
"placeholder": "プレースホルダー",
|
||||
"please_select_at_least_one_survey": "少なくとも1つのフォームを選択してください",
|
||||
"please_select_at_least_one_trigger": "少なくとも1つのトリガーを選択してください",
|
||||
"please_upgrade_your_plan": "プランをアップグレードしてください",
|
||||
"please_upgrade_your_plan": "プランをアップグレードしてください。",
|
||||
"preview": "プレビュー",
|
||||
"preview_survey": "フォームをプレビュー",
|
||||
"privacy": "プライバシーポリシー",
|
||||
@@ -781,26 +783,20 @@
|
||||
"add_webhook": "Webhook を追加",
|
||||
"add_webhook_description": "フォーム回答データを任意のエンドポイントへ送信",
|
||||
"all_current_and_new_surveys": "現在および新規のすべてのフォーム",
|
||||
"copy_secret_now": "署名シークレットをコピー",
|
||||
"created_by_third_party": "サードパーティによって作成",
|
||||
"discord_webhook_not_supported": "現在、Discord Webhook はサポートしていません。",
|
||||
"empty_webhook_message": "Webhook は追加するとここに表示されます。⏲️",
|
||||
"endpoint_pinged": "成功!Webhook に ping できました。",
|
||||
"endpoint_pinged_error": "Webhook への ping に失敗しました。",
|
||||
"learn_to_verify": "Webhook署名の検証方法を学ぶ",
|
||||
"please_check_console": "詳細はコンソールを確認してください",
|
||||
"please_enter_a_url": "URL を入力してください",
|
||||
"response_created": "回答作成",
|
||||
"response_finished": "回答完了",
|
||||
"response_updated": "回答更新",
|
||||
"secret_copy_warning": "このシークレットを安全に保管してください。Webhook 設定で再度確認できます。",
|
||||
"secret_description": "このシークレットを使用して Webhook リクエストを検証します。署名検証についてはドキュメントを参照してください。",
|
||||
"signing_secret": "署名シークレット",
|
||||
"source": "ソース",
|
||||
"test_endpoint": "エンドポイントをテスト",
|
||||
"triggers": "トリガー",
|
||||
"webhook_added_successfully": "Webhook を追加しました",
|
||||
"webhook_created": "Webhook を作成しました",
|
||||
"webhook_delete_confirmation": "このWebhookを削除してもよろしいですか?以後の通知は送信されません。",
|
||||
"webhook_deleted_successfully": "Webhook を削除しました",
|
||||
"webhook_name_placeholder": "任意: 識別しやすいようWebhookにラベルを付ける",
|
||||
@@ -1163,6 +1159,7 @@
|
||||
"adjust_survey_closed_message_description": "フォームがクローズしたときに訪問者が見るメッセージを変更します。",
|
||||
"adjust_the_theme_in_the": "テーマを",
|
||||
"all_other_answers_will_continue_to": "他のすべての回答は引き続き",
|
||||
"allow_file_type": "ファイルタイプを許可",
|
||||
"allow_multi_select": "複数選択を許可",
|
||||
"allow_multiple_files": "複数のファイルを許可",
|
||||
"allow_users_to_select_more_than_one_image": "ユーザーが複数の画像を選択できるようにする",
|
||||
@@ -1193,8 +1190,6 @@
|
||||
"cal_username": "Cal.comのユーザー名またはユーザー名/イベント",
|
||||
"calculate": "計算",
|
||||
"capture_a_new_action_to_trigger_a_survey_on": "フォームをトリガーする新しいアクションをキャプチャします。",
|
||||
"capture_ip_address": "IPアドレスを記録",
|
||||
"capture_ip_address_description": "重複検出とセキュリティ目的で、回答者のIPアドレスを回答メタデータに保存します",
|
||||
"capture_new_action": "新しいアクションをキャプチャ",
|
||||
"card_arrangement_for_survey_type_derived": "{surveyTypeDerived} フォームのカード配置",
|
||||
"card_background_color": "カードの背景色",
|
||||
@@ -1225,6 +1220,8 @@
|
||||
"change_the_question_color_of_the_survey": "フォームの質問の色を変更します。",
|
||||
"changes_saved": "変更を保存しました。",
|
||||
"changing_survey_type_will_remove_existing_distribution_channels": "フォームの種類を変更すると、共有方法に影響します。回答者が現在のタイプのアクセスリンクをすでに持っている場合、切り替え後にアクセスを失う可能性があります。",
|
||||
"character_limit_toggle_description": "回答の長さの上限・下限を設定します。",
|
||||
"character_limit_toggle_title": "文字数制限を追加",
|
||||
"checkbox_label": "チェックボックスのラベル",
|
||||
"choose_the_actions_which_trigger_the_survey": "フォームをトリガーするアクションを選択してください。",
|
||||
"choose_the_first_question_on_your_block": "ブロックの最初の質問を選択してください",
|
||||
@@ -1244,6 +1241,7 @@
|
||||
"contact_fields": "連絡先フィールド",
|
||||
"contains": "を含む",
|
||||
"continue_to_settings": "設定に進む",
|
||||
"control_which_file_types_can_be_uploaded": "アップロードできるファイルの種類を制御します。",
|
||||
"convert_to_multiple_choice": "複数選択に変換",
|
||||
"convert_to_single_choice": "単一選択に変換",
|
||||
"country": "国",
|
||||
@@ -1397,8 +1395,9 @@
|
||||
"key": "キー",
|
||||
"last_name": "姓",
|
||||
"let_people_upload_up_to_25_files_at_the_same_time": "一度に最大25個のファイルをアップロードできるようにする。",
|
||||
"limit_the_maximum_file_size": "アップロードの最大ファイルサイズを制限します。",
|
||||
"limit_upload_file_size_to": "アップロードファイルサイズの上限",
|
||||
"limit_file_types": "ファイルタイプを制限",
|
||||
"limit_the_maximum_file_size": "最大ファイルサイズを制限",
|
||||
"limit_upload_file_size_to": "アップロードファイルサイズを以下に制限",
|
||||
"link_survey_description": "フォームページへのリンクを共有するか、ウェブページやメールに埋め込みます。",
|
||||
"load_segment": "セグメントを読み込み",
|
||||
"logic_error_warning": "変更するとロジックエラーが発生します",
|
||||
@@ -1443,6 +1442,7 @@
|
||||
"picture_idx": "写真 {idx}",
|
||||
"pin_can_only_contain_numbers": "PINは数字のみでなければなりません。",
|
||||
"pin_must_be_a_four_digit_number": "PINは4桁の数字でなければなりません。",
|
||||
"please_enter_a_file_extension": "ファイル拡張子を入力してください。",
|
||||
"please_enter_a_valid_url": "有効な URL を入力してください (例:https://example.com)",
|
||||
"please_set_a_survey_trigger": "フォームのトリガーを設定してください",
|
||||
"please_specify": "具体的に指定してください",
|
||||
@@ -1520,7 +1520,6 @@
|
||||
"search_for_images": "画像を検索",
|
||||
"seconds_after_trigger_the_survey_will_be_closed_if_no_response": "トリガーから数秒後に回答がない場合、フォームは閉じられます",
|
||||
"seconds_before_showing_the_survey": "秒後にフォームを表示します。",
|
||||
"select_field": "フィールドを選択",
|
||||
"select_or_type_value": "値を選択または入力",
|
||||
"select_ordering": "順序を選択",
|
||||
"select_saved_action": "保存済みのアクションを選択",
|
||||
@@ -1568,6 +1567,8 @@
|
||||
"the_survey_will_be_shown_once_even_if_person_doesnt_respond": "回答がなくても1回だけ表示します。",
|
||||
"then": "その後",
|
||||
"this_action_will_remove_all_the_translations_from_this_survey": "このアクションは、このフォームからすべての翻訳を削除します。",
|
||||
"this_extension_is_already_added": "この拡張機能はすでに追加されています。",
|
||||
"this_file_type_is_not_supported": "このファイルタイプはサポートされていません。",
|
||||
"three_points": "3点",
|
||||
"times": "回",
|
||||
"to_keep_the_placement_over_all_surveys_consistent_you_can": "すべてのフォームの配置を一貫させるために、",
|
||||
@@ -1588,42 +1589,6 @@
|
||||
"upper_label": "上限ラベル",
|
||||
"url_filters": "URLフィルター",
|
||||
"url_not_supported": "URLはサポートされていません",
|
||||
"validation": {
|
||||
"characters": "文字数",
|
||||
"contains": "を含む",
|
||||
"does_not_contain": "を含まない",
|
||||
"email": "有効なメールアドレスである",
|
||||
"file_extension_is": "ファイル拡張子が次と一致",
|
||||
"file_extension_is_not": "ファイル拡張子が次と一致しない",
|
||||
"is": "である",
|
||||
"is_between": "の間である",
|
||||
"is_earlier_than": "より前である",
|
||||
"is_greater_than": "より大きい",
|
||||
"is_later_than": "より後である",
|
||||
"is_less_than": "より小さい",
|
||||
"is_not": "ではない",
|
||||
"is_not_between": "の間ではない",
|
||||
"kb": "KB",
|
||||
"max_length": "最大",
|
||||
"max_selections": "最大",
|
||||
"max_value": "最大",
|
||||
"mb": "MB",
|
||||
"min_length": "最小",
|
||||
"min_selections": "最小",
|
||||
"min_value": "最小",
|
||||
"minimum_options_ranked": "ランク付けされた最小オプション数",
|
||||
"minimum_rows_answered": "回答された最小行数",
|
||||
"options_selected": "選択されたオプション",
|
||||
"pattern": "正規表現パターンに一致する",
|
||||
"phone": "有効な電話番号である",
|
||||
"rank_all_options": "すべてのオプションをランク付け",
|
||||
"select_file_extensions": "ファイル拡張子を選択...",
|
||||
"url": "有効なURLである"
|
||||
},
|
||||
"validation_logic_and": "すべてが真である",
|
||||
"validation_logic_or": "いずれかが真",
|
||||
"validation_rules": "検証ルール",
|
||||
"validation_rules_description": "次の条件を満たす回答のみを受け付ける",
|
||||
"variable_is_used_in_logic_of_question_please_remove_it_from_logic_first": "{variable} は質問 {questionIndex} のロジックで使用されています。まず、ロジックから削除してください。",
|
||||
"variable_is_used_in_quota_please_remove_it_from_quota_first": "変数 \"{variableName}\" は \"{quotaName}\" クォータ で使用されています",
|
||||
"variable_name_is_already_taken_please_choose_another": "変数名はすでに使用されています。別の名前を選択してください。",
|
||||
@@ -1681,7 +1646,6 @@
|
||||
"error_downloading_responses": "回答のダウンロード中にエラーが発生しました",
|
||||
"first_name": "名",
|
||||
"how_to_identify_users": "ユーザーを識別する方法",
|
||||
"ip_address": "IPアドレス",
|
||||
"last_name": "姓",
|
||||
"not_completed": "未完了 ⏳",
|
||||
"os": "OS",
|
||||
@@ -1726,22 +1690,6 @@
|
||||
"url_encryption_description": "カスタムの単一使用IDを設定する必要がある場合にのみ無効にしてください。",
|
||||
"url_encryption_label": "単一使用IDのURL暗号化"
|
||||
},
|
||||
"custom_html": {
|
||||
"add_mode_description": "アンケートスクリプトは、ワークスペースレベルのスクリプトに加えて実行されます。",
|
||||
"add_to_workspace": "ワークスペーススクリプトに追加",
|
||||
"description": "このアンケートにトラッキングスクリプトとピクセルを追加",
|
||||
"nav_title": "カスタムHTML",
|
||||
"no_workspace_scripts": "ワークスペースレベルのスクリプトが設定されていません。ワークスペース設定→一般から追加できます。",
|
||||
"placeholder": "<!-- トラッキングスクリプトをここに貼り付けてください -->\n<script>\n // Google Tag Manager、Analyticsなど\n</script>",
|
||||
"replace_mode_description": "アンケートスクリプトのみが実行されます。ワークスペーススクリプトは無視されます。スクリプトを読み込まない場合は空のままにしてください。",
|
||||
"replace_workspace": "ワークスペーススクリプトを置き換え",
|
||||
"saved_successfully": "カスタムスクリプトを正常に保存しました",
|
||||
"script_mode": "スクリプトモード",
|
||||
"security_warning": "スクリプトはブラウザへの完全なアクセス権で実行されます。信頼できるソースからのスクリプトのみを追加してください。",
|
||||
"survey_scripts_description": "このアンケートページの<head>に挿入するカスタムHTMLを追加します。",
|
||||
"survey_scripts_label": "アンケート固有のスクリプト",
|
||||
"workspace_scripts_label": "ワークスペーススクリプト(継承)"
|
||||
},
|
||||
"dynamic_popup": {
|
||||
"alert_button": "フォームを編集",
|
||||
"alert_description": "このフォームは現在、動的なポップアップをサポートしていないリンクフォームとして設定されています。フォームエディターの設定タブでこれを変更できます。",
|
||||
@@ -1981,13 +1929,6 @@
|
||||
},
|
||||
"general": {
|
||||
"cannot_delete_only_workspace": "これは唯一のワークスペースのため、削除できません。まず新しいワークスペースを作成してください。",
|
||||
"custom_scripts": "カスタムスクリプト",
|
||||
"custom_scripts_card_description": "このワークスペース内のすべてのリンクアンケートにトラッキングスクリプトとピクセルを追加します。",
|
||||
"custom_scripts_description": "すべてのリンクアンケートページの<head>にスクリプトが挿入されます。",
|
||||
"custom_scripts_label": "HTMLスクリプト",
|
||||
"custom_scripts_placeholder": "<!-- トラッキングスクリプトをここに貼り付けてください -->\n<script>\n // Google Tag Manager、Analyticsなど\n</script>",
|
||||
"custom_scripts_updated_successfully": "カスタムスクリプトを正常に更新しました",
|
||||
"custom_scripts_warning": "スクリプトはブラウザへの完全なアクセス権で実行されます。信頼できるソースからのスクリプトのみを追加してください。",
|
||||
"delete_workspace": "ワークスペースを削除",
|
||||
"delete_workspace_confirmation": "{projectName}を削除してもよろしいですか?このアクションは元に戻せません。",
|
||||
"delete_workspace_name_includes_surveys_responses_people_and_more": "{projectName}をすべてのフォーム、回答、人物、アクション、属性を含めて削除します。",
|
||||
|
||||
+16
-75
@@ -197,7 +197,6 @@
|
||||
"docs": "Documentatie",
|
||||
"documentation": "Documentatie",
|
||||
"domain": "Domein",
|
||||
"done": "Klaar",
|
||||
"download": "Downloaden",
|
||||
"draft": "Voorlopige versie",
|
||||
"duplicate": "Duplicaat",
|
||||
@@ -239,6 +238,7 @@
|
||||
"imprint": "Afdruk",
|
||||
"in_progress": "In uitvoering",
|
||||
"inactive_surveys": "Inactieve enquêtes",
|
||||
"input_type": "Invoertype",
|
||||
"integration": "integratie",
|
||||
"integrations": "Integraties",
|
||||
"invalid_date": "Ongeldige datum",
|
||||
@@ -262,11 +262,13 @@
|
||||
"look_and_feel": "Kijk & voel",
|
||||
"manage": "Beheren",
|
||||
"marketing": "Marketing",
|
||||
"maximum": "Maximaal",
|
||||
"member": "Lid",
|
||||
"members": "Leden",
|
||||
"members_and_teams": "Leden & teams",
|
||||
"membership_not_found": "Lidmaatschap niet gevonden",
|
||||
"metadata": "Metagegevens",
|
||||
"minimum": "Minimum",
|
||||
"mobile_overlay_app_works_best_on_desktop": "Formbricks werkt het beste op een groter scherm. Schakel over naar een ander apparaat om enquêtes te beheren of samen te stellen.",
|
||||
"mobile_overlay_surveys_look_good": "Maakt u zich geen zorgen: uw enquêtes zien er geweldig uit op elk apparaat en schermformaat!",
|
||||
"mobile_overlay_title": "Oeps, klein scherm gedetecteerd!",
|
||||
@@ -319,7 +321,7 @@
|
||||
"placeholder": "Tijdelijke aanduiding",
|
||||
"please_select_at_least_one_survey": "Selecteer ten minste één enquête",
|
||||
"please_select_at_least_one_trigger": "Selecteer ten minste één trigger",
|
||||
"please_upgrade_your_plan": "Upgrade je abonnement",
|
||||
"please_upgrade_your_plan": "Upgrade uw abonnement.",
|
||||
"preview": "Voorbeeld",
|
||||
"preview_survey": "Voorbeeld van enquête",
|
||||
"privacy": "Privacybeleid",
|
||||
@@ -781,26 +783,20 @@
|
||||
"add_webhook": "Webhook toevoegen",
|
||||
"add_webhook_description": "Stuur enquêtereactiegegevens naar een aangepast eindpunt",
|
||||
"all_current_and_new_surveys": "Alle huidige en nieuwe onderzoeken",
|
||||
"copy_secret_now": "Kopieer je ondertekeningsgeheim",
|
||||
"created_by_third_party": "Gemaakt door een derde partij",
|
||||
"discord_webhook_not_supported": "Discord-webhooks worden momenteel niet ondersteund.",
|
||||
"empty_webhook_message": "Uw webhooks verschijnen hier zodra u ze toevoegt. ⏲️",
|
||||
"endpoint_pinged": "Jawel! We kunnen de webhook pingen!",
|
||||
"endpoint_pinged_error": "Kan de webhook niet pingen!",
|
||||
"learn_to_verify": "Leer hoe je webhook-handtekeningen kunt verifiëren",
|
||||
"please_check_console": "Controleer de console voor meer details",
|
||||
"please_enter_a_url": "Voer een URL in",
|
||||
"response_created": "Reactie gemaakt",
|
||||
"response_finished": "Reactie voltooid",
|
||||
"response_updated": "Reactie bijgewerkt",
|
||||
"secret_copy_warning": "Bewaar dit geheim veilig. Je kunt het opnieuw bekijken in de webhook-instellingen.",
|
||||
"secret_description": "Gebruik dit geheim om webhook-verzoeken te verifiëren. Zie de documentatie voor handtekeningverificatie.",
|
||||
"signing_secret": "Ondertekeningsgeheim",
|
||||
"source": "Bron",
|
||||
"test_endpoint": "Eindpunt testen",
|
||||
"triggers": "Triggers",
|
||||
"webhook_added_successfully": "Webhook succesvol toegevoegd",
|
||||
"webhook_created": "Webhook aangemaakt",
|
||||
"webhook_delete_confirmation": "Weet u zeker dat u deze webhook wilt verwijderen? Hierdoor worden er geen verdere meldingen meer verzonden.",
|
||||
"webhook_deleted_successfully": "Webhook is succesvol verwijderd",
|
||||
"webhook_name_placeholder": "Optioneel: Label uw webhook voor gemakkelijke identificatie",
|
||||
@@ -1163,6 +1159,7 @@
|
||||
"adjust_survey_closed_message_description": "Wijzig het bericht dat bezoekers zien wanneer de enquête wordt gesloten.",
|
||||
"adjust_the_theme_in_the": "Pas het thema aan in de",
|
||||
"all_other_answers_will_continue_to": "Alle andere antwoorden blijven hetzelfde",
|
||||
"allow_file_type": "Bestandstype toestaan",
|
||||
"allow_multi_select": "Multi-select toestaan",
|
||||
"allow_multiple_files": "Meerdere bestanden toestaan",
|
||||
"allow_users_to_select_more_than_one_image": "Sta gebruikers toe meer dan één afbeelding te selecteren",
|
||||
@@ -1193,8 +1190,6 @@
|
||||
"cal_username": "Cal.com-gebruikersnaam of gebruikersnaam/evenement",
|
||||
"calculate": "Berekenen",
|
||||
"capture_a_new_action_to_trigger_a_survey_on": "Leg een nieuwe actie vast om een enquête over te activeren.",
|
||||
"capture_ip_address": "IP-adres vastleggen",
|
||||
"capture_ip_address_description": "Sla het IP-adres van de respondent op in de metadata van het antwoord voor detectie van duplicaten en beveiligingsdoeleinden",
|
||||
"capture_new_action": "Leg nieuwe actie vast",
|
||||
"card_arrangement_for_survey_type_derived": "Kaartarrangement voor {surveyTypeDerived} enquêtes",
|
||||
"card_background_color": "Achtergrondkleur van de kaart",
|
||||
@@ -1225,6 +1220,8 @@
|
||||
"change_the_question_color_of_the_survey": "Verander de vraagkleur van de enquête.",
|
||||
"changes_saved": "Wijzigingen opgeslagen.",
|
||||
"changing_survey_type_will_remove_existing_distribution_channels": "Het wijzigen van het enquêtetype heeft invloed op de manier waarop deze kan worden gedeeld. Als respondenten al toegangslinks hebben voor het huidige type, verliezen ze mogelijk de toegang na de overstap.",
|
||||
"character_limit_toggle_description": "Beperk hoe kort of lang een antwoord mag zijn.",
|
||||
"character_limit_toggle_title": "Tekenlimieten toevoegen",
|
||||
"checkbox_label": "Selectievakje-label",
|
||||
"choose_the_actions_which_trigger_the_survey": "Kies de acties die de enquête activeren.",
|
||||
"choose_the_first_question_on_your_block": "Kies de eerste vraag in je blok",
|
||||
@@ -1244,6 +1241,7 @@
|
||||
"contact_fields": "Contactvelden",
|
||||
"contains": "Bevat",
|
||||
"continue_to_settings": "Ga verder naar Instellingen",
|
||||
"control_which_file_types_can_be_uploaded": "Bepaal welke bestandstypen kunnen worden geüpload.",
|
||||
"convert_to_multiple_choice": "Converteren naar Multi-select",
|
||||
"convert_to_single_choice": "Converteren naar Enkele selectie",
|
||||
"country": "Land",
|
||||
@@ -1360,7 +1358,7 @@
|
||||
"hide_question_settings": "Vraaginstellingen verbergen",
|
||||
"hostname": "Hostnaam",
|
||||
"how_funky_do_you_want_your_cards_in_survey_type_derived_surveys": "Hoe funky wil je je kaarten hebben in {surveyTypeDerived} Enquêtes",
|
||||
"if_you_need_more_please": "Als je meer nodig hebt,",
|
||||
"if_you_need_more_please": "Als u meer nodig heeft, alstublieft",
|
||||
"if_you_really_want_that_answer_ask_until_you_get_it": "Blijf tonen wanneer geactiveerd totdat een reactie is ingediend.",
|
||||
"ignore_global_waiting_time": "Afkoelperiode negeren",
|
||||
"ignore_global_waiting_time_description": "Deze enquête kan worden getoond wanneer aan de voorwaarden wordt voldaan, zelfs als er onlangs een andere enquête is getoond.",
|
||||
@@ -1397,8 +1395,9 @@
|
||||
"key": "Sleutel",
|
||||
"last_name": "Achternaam",
|
||||
"let_people_upload_up_to_25_files_at_the_same_time": "Laat mensen maximaal 25 bestanden tegelijk uploaden.",
|
||||
"limit_the_maximum_file_size": "Beperk de maximale bestandsgrootte voor uploads.",
|
||||
"limit_upload_file_size_to": "Beperk uploadbestandsgrootte tot",
|
||||
"limit_file_types": "Beperk bestandstypen",
|
||||
"limit_the_maximum_file_size": "Beperk de maximale bestandsgrootte",
|
||||
"limit_upload_file_size_to": "Beperk de uploadbestandsgrootte tot",
|
||||
"link_survey_description": "Deel een link naar een enquêtepagina of sluit deze in op een webpagina of e-mail.",
|
||||
"load_segment": "Laadsegment",
|
||||
"logic_error_warning": "Wijzigen zal logische fouten veroorzaken",
|
||||
@@ -1411,7 +1410,7 @@
|
||||
"matrix_all_fields": "Alle velden",
|
||||
"matrix_rows": "Rijen",
|
||||
"max_file_size": "Maximale bestandsgrootte",
|
||||
"max_file_size_limit_is": "Maximale bestandsgroottelimiet is",
|
||||
"max_file_size_limit_is": "De maximale bestandsgrootte is",
|
||||
"move_question_to_block": "Vraag naar blok verplaatsen",
|
||||
"multiply": "Vermenigvuldig *",
|
||||
"needed_for_self_hosted_cal_com_instance": "Nodig voor een zelf-gehoste Cal.com-instantie",
|
||||
@@ -1443,6 +1442,7 @@
|
||||
"picture_idx": "Afbeelding {idx}",
|
||||
"pin_can_only_contain_numbers": "De pincode kan alleen cijfers bevatten.",
|
||||
"pin_must_be_a_four_digit_number": "De pincode moet uit vier cijfers bestaan.",
|
||||
"please_enter_a_file_extension": "Voer een bestandsextensie in.",
|
||||
"please_enter_a_valid_url": "Voer een geldige URL in (bijvoorbeeld https://example.com)",
|
||||
"please_set_a_survey_trigger": "Stel een enquêtetrigger in",
|
||||
"please_specify": "Gelieve te specificeren",
|
||||
@@ -1520,7 +1520,6 @@
|
||||
"search_for_images": "Zoek naar afbeeldingen",
|
||||
"seconds_after_trigger_the_survey_will_be_closed_if_no_response": "seconden na trigger wordt de enquête gesloten als er geen reactie is",
|
||||
"seconds_before_showing_the_survey": "seconden voordat de enquête wordt weergegeven.",
|
||||
"select_field": "Selecteer veld",
|
||||
"select_or_type_value": "Selecteer of typ een waarde",
|
||||
"select_ordering": "Selecteer bestellen",
|
||||
"select_saved_action": "Selecteer opgeslagen actie",
|
||||
@@ -1568,6 +1567,8 @@
|
||||
"the_survey_will_be_shown_once_even_if_person_doesnt_respond": "Toon één keer, zelfs als ze niet reageren.",
|
||||
"then": "Dan",
|
||||
"this_action_will_remove_all_the_translations_from_this_survey": "Met deze actie worden alle vertalingen uit deze enquête verwijderd.",
|
||||
"this_extension_is_already_added": "Deze extensie is al toegevoegd.",
|
||||
"this_file_type_is_not_supported": "Dit bestandstype wordt niet ondersteund.",
|
||||
"three_points": "3 punten",
|
||||
"times": "keer",
|
||||
"to_keep_the_placement_over_all_surveys_consistent_you_can": "Om de plaatsing over alle enquêtes consistent te houden, kunt u dat doen",
|
||||
@@ -1588,42 +1589,6 @@
|
||||
"upper_label": "Bovenste etiket",
|
||||
"url_filters": "URL-filters",
|
||||
"url_not_supported": "URL niet ondersteund",
|
||||
"validation": {
|
||||
"characters": "Tekens",
|
||||
"contains": "Bevat",
|
||||
"does_not_contain": "Bevat niet",
|
||||
"email": "Is geldig e-mailadres",
|
||||
"file_extension_is": "Bestandsextensie is",
|
||||
"file_extension_is_not": "Bestandsextensie is niet",
|
||||
"is": "Is",
|
||||
"is_between": "Is tussen",
|
||||
"is_earlier_than": "Is eerder dan",
|
||||
"is_greater_than": "Is groter dan",
|
||||
"is_later_than": "Is later dan",
|
||||
"is_less_than": "Is minder dan",
|
||||
"is_not": "Is niet",
|
||||
"is_not_between": "Is niet tussen",
|
||||
"kb": "KB",
|
||||
"max_length": "Maximaal",
|
||||
"max_selections": "Maximaal",
|
||||
"max_value": "Maximaal",
|
||||
"mb": "MB",
|
||||
"min_length": "Minimaal",
|
||||
"min_selections": "Minimaal",
|
||||
"min_value": "Minimaal",
|
||||
"minimum_options_ranked": "Minimaal aantal gerangschikte opties",
|
||||
"minimum_rows_answered": "Minimaal aantal beantwoorde rijen",
|
||||
"options_selected": "Opties geselecteerd",
|
||||
"pattern": "Komt overeen met regex-patroon",
|
||||
"phone": "Is geldig telefoonnummer",
|
||||
"rank_all_options": "Rangschik alle opties",
|
||||
"select_file_extensions": "Selecteer bestandsextensies...",
|
||||
"url": "Is geldige URL"
|
||||
},
|
||||
"validation_logic_and": "Alle zijn waar",
|
||||
"validation_logic_or": "een is waar",
|
||||
"validation_rules": "Validatieregels",
|
||||
"validation_rules_description": "Accepteer alleen antwoorden die voldoen aan de volgende criteria",
|
||||
"variable_is_used_in_logic_of_question_please_remove_it_from_logic_first": "{variable} wordt gebruikt in de logica van vraag {questionIndex}. Verwijder het eerst uit de logica.",
|
||||
"variable_is_used_in_quota_please_remove_it_from_quota_first": "Variabele \"{variableName}\" wordt gebruikt in het \"{quotaName}\" quotum",
|
||||
"variable_name_is_already_taken_please_choose_another": "Variabelenaam is al in gebruik, kies een andere.",
|
||||
@@ -1681,7 +1646,6 @@
|
||||
"error_downloading_responses": "Er is een fout opgetreden bij het downloaden van de antwoorden",
|
||||
"first_name": "Voornaam",
|
||||
"how_to_identify_users": "Hoe gebruikers te identificeren",
|
||||
"ip_address": "IP-adres",
|
||||
"last_name": "Achternaam",
|
||||
"not_completed": "Niet voltooid ⏳",
|
||||
"os": "Besturingssysteem",
|
||||
@@ -1726,22 +1690,6 @@
|
||||
"url_encryption_description": "Schakel dit alleen uit als u een aangepaste ID voor eenmalig gebruik moet instellen.",
|
||||
"url_encryption_label": "URL-codering van ID voor eenmalig gebruik"
|
||||
},
|
||||
"custom_html": {
|
||||
"add_mode_description": "Enquêtescripts worden uitgevoerd naast scripts op werkruimteniveau.",
|
||||
"add_to_workspace": "Toevoegen aan werkruimtescripts",
|
||||
"description": "Voeg trackingscripts en pixels toe aan deze enquête",
|
||||
"nav_title": "Aangepaste HTML",
|
||||
"no_workspace_scripts": "Geen scripts op werkruimteniveau geconfigureerd. Je kunt ze toevoegen in Werkruimte-instellingen → Algemeen.",
|
||||
"placeholder": "<!-- Plak hier je trackingscripts -->\n<script>\n // Google Tag Manager, Analytics, etc.\n</script>",
|
||||
"replace_mode_description": "Alleen enquêtescripts worden uitgevoerd. Werkruimtescripts worden genegeerd. Laat leeg om geen scripts te laden.",
|
||||
"replace_workspace": "Werkruimtescripts vervangen",
|
||||
"saved_successfully": "Aangepaste scripts succesvol opgeslagen",
|
||||
"script_mode": "Scriptmodus",
|
||||
"security_warning": "Scripts worden uitgevoerd met volledige browsertoegang. Voeg alleen scripts toe van vertrouwde bronnen.",
|
||||
"survey_scripts_description": "Voeg aangepaste HTML toe om te injecteren in de <head> van deze enquêtepagina.",
|
||||
"survey_scripts_label": "Enquêtespecifieke scripts",
|
||||
"workspace_scripts_label": "Werkruimtescripts (overgenomen)"
|
||||
},
|
||||
"dynamic_popup": {
|
||||
"alert_button": "Enquête bewerken",
|
||||
"alert_description": "Deze enquête is momenteel geconfigureerd als een linkenquête, die geen dynamische pop-ups ondersteunt. U kunt dit wijzigen op het tabblad Instellingen van de enquête-editor.",
|
||||
@@ -1981,13 +1929,6 @@
|
||||
},
|
||||
"general": {
|
||||
"cannot_delete_only_workspace": "Dit is uw enige project, het kan niet worden verwijderd. Maak eerst een nieuw project aan.",
|
||||
"custom_scripts": "Aangepaste scripts",
|
||||
"custom_scripts_card_description": "Voeg trackingscripts en pixels toe aan alle linkenquêtes in deze werkruimte.",
|
||||
"custom_scripts_description": "Scripts worden geïnjecteerd in de <head> van alle linkenquêtepagina's.",
|
||||
"custom_scripts_label": "HTML-scripts",
|
||||
"custom_scripts_placeholder": "<!-- Plak hier je trackingscripts -->\n<script>\n // Google Tag Manager, Analytics, etc.\n</script>",
|
||||
"custom_scripts_updated_successfully": "Aangepaste scripts succesvol bijgewerkt",
|
||||
"custom_scripts_warning": "Scripts worden uitgevoerd met volledige browsertoegang. Voeg alleen scripts toe van vertrouwde bronnen.",
|
||||
"delete_workspace": "Project verwijderen",
|
||||
"delete_workspace_confirmation": "Weet u zeker dat u {projectName} wilt verwijderen? Deze actie kan niet ongedaan worden gemaakt.",
|
||||
"delete_workspace_name_includes_surveys_responses_people_and_more": "Verwijder {projectName} incl. alle enquêtes, reacties, mensen, acties en attributen.",
|
||||
|
||||
+15
-74
@@ -197,7 +197,6 @@
|
||||
"docs": "Documentação",
|
||||
"documentation": "Documentação",
|
||||
"domain": "Domínio",
|
||||
"done": "Concluído",
|
||||
"download": "baixar",
|
||||
"draft": "Rascunho",
|
||||
"duplicate": "Duplicar",
|
||||
@@ -239,6 +238,7 @@
|
||||
"imprint": "impressão",
|
||||
"in_progress": "Em andamento",
|
||||
"inactive_surveys": "Pesquisas inativas",
|
||||
"input_type": "Tipo de entrada",
|
||||
"integration": "integração",
|
||||
"integrations": "Integrações",
|
||||
"invalid_date": "Data inválida",
|
||||
@@ -262,11 +262,13 @@
|
||||
"look_and_feel": "Aparência e Experiência",
|
||||
"manage": "gerenciar",
|
||||
"marketing": "marketing",
|
||||
"maximum": "Máximo",
|
||||
"member": "Membros",
|
||||
"members": "Membros",
|
||||
"members_and_teams": "Membros e equipes",
|
||||
"membership_not_found": "Assinatura não encontrada",
|
||||
"metadata": "metadados",
|
||||
"minimum": "Mínimo",
|
||||
"mobile_overlay_app_works_best_on_desktop": "Formbricks funciona melhor em uma tela maior. Para gerenciar ou criar pesquisas, mude para outro dispositivo.",
|
||||
"mobile_overlay_surveys_look_good": "Não se preocupe – suas pesquisas ficam ótimas em qualquer dispositivo e tamanho de tela!",
|
||||
"mobile_overlay_title": "Eita, tela pequena detectada!",
|
||||
@@ -319,7 +321,7 @@
|
||||
"placeholder": "Espaço reservado",
|
||||
"please_select_at_least_one_survey": "Por favor, selecione pelo menos uma pesquisa",
|
||||
"please_select_at_least_one_trigger": "Por favor, selecione pelo menos um gatilho",
|
||||
"please_upgrade_your_plan": "Por favor, atualize seu plano",
|
||||
"please_upgrade_your_plan": "Por favor, atualize seu plano.",
|
||||
"preview": "Prévia",
|
||||
"preview_survey": "Prévia da Pesquisa",
|
||||
"privacy": "Política de Privacidade",
|
||||
@@ -781,26 +783,20 @@
|
||||
"add_webhook": "Adicionar Webhook",
|
||||
"add_webhook_description": "Enviar dados das respostas da pesquisa para um endpoint personalizado",
|
||||
"all_current_and_new_surveys": "Todas as pesquisas atuais e novas",
|
||||
"copy_secret_now": "Copie seu segredo de assinatura",
|
||||
"created_by_third_party": "Criado por um Terceiro",
|
||||
"discord_webhook_not_supported": "Webhooks do Discord não são suportados no momento.",
|
||||
"empty_webhook_message": "Seus webhooks vão aparecer aqui assim que você adicioná-los. ⏲️",
|
||||
"endpoint_pinged": "Uhul! Conseguimos pingar o webhook!",
|
||||
"endpoint_pinged_error": "Não consegui pingar o webhook!",
|
||||
"learn_to_verify": "Aprenda como verificar assinaturas de webhook",
|
||||
"please_check_console": "Por favor, verifica o console para mais detalhes",
|
||||
"please_enter_a_url": "Por favor, insira uma URL",
|
||||
"response_created": "Resposta Criada",
|
||||
"response_finished": "Resposta Finalizada",
|
||||
"response_updated": "Resposta Atualizada",
|
||||
"secret_copy_warning": "Armazene este segredo com segurança. Você pode visualizá-lo novamente nas configurações do webhook.",
|
||||
"secret_description": "Use este segredo para verificar requisições de webhook. Consulte a documentação para verificação de assinatura.",
|
||||
"signing_secret": "Segredo de assinatura",
|
||||
"source": "fonte",
|
||||
"test_endpoint": "Testar Ponto de Extremidade",
|
||||
"triggers": "gatilhos",
|
||||
"webhook_added_successfully": "Webhook adicionado com sucesso",
|
||||
"webhook_created": "Webhook criado",
|
||||
"webhook_delete_confirmation": "Tem certeza de que quer deletar esse Webhook? Isso vai parar de te enviar qualquer notificação.",
|
||||
"webhook_deleted_successfully": "Webhook deletado com sucesso",
|
||||
"webhook_name_placeholder": "Opcional: Dê um nome ao seu webhook para facilitar a identificação",
|
||||
@@ -1163,6 +1159,7 @@
|
||||
"adjust_survey_closed_message_description": "Mude a mensagem que os visitantes veem quando a pesquisa está fechada.",
|
||||
"adjust_the_theme_in_the": "Ajuste o tema no",
|
||||
"all_other_answers_will_continue_to": "Todas as outras respostas continuarão a",
|
||||
"allow_file_type": "Permitir tipo de arquivo",
|
||||
"allow_multi_select": "Permitir seleção múltipla",
|
||||
"allow_multiple_files": "Permitir vários arquivos",
|
||||
"allow_users_to_select_more_than_one_image": "Permitir que os usuários selecionem mais de uma imagem",
|
||||
@@ -1193,8 +1190,6 @@
|
||||
"cal_username": "Nome de usuário do Cal.com ou nome de usuário/evento",
|
||||
"calculate": "Calcular",
|
||||
"capture_a_new_action_to_trigger_a_survey_on": "Captura uma nova ação pra disparar uma pesquisa.",
|
||||
"capture_ip_address": "Capturar endereço IP",
|
||||
"capture_ip_address_description": "Armazenar o endereço IP do respondente nos metadados da resposta para fins de detecção de duplicatas e segurança",
|
||||
"capture_new_action": "Capturar nova ação",
|
||||
"card_arrangement_for_survey_type_derived": "Arranjo de Cartões para Pesquisas {surveyTypeDerived}",
|
||||
"card_background_color": "Cor de fundo do cartão",
|
||||
@@ -1225,6 +1220,8 @@
|
||||
"change_the_question_color_of_the_survey": "Muda a cor da pergunta da pesquisa.",
|
||||
"changes_saved": "Mudanças salvas.",
|
||||
"changing_survey_type_will_remove_existing_distribution_channels": "Alterar o tipo de pesquisa afetará a forma como ela pode ser compartilhada. Se os respondentes já tiverem links de acesso para o tipo atual, podem perder o acesso após a mudança.",
|
||||
"character_limit_toggle_description": "Limite o quão curta ou longa uma resposta pode ser.",
|
||||
"character_limit_toggle_title": "Adicionar limites de caracteres",
|
||||
"checkbox_label": "Rótulo da Caixa de Seleção",
|
||||
"choose_the_actions_which_trigger_the_survey": "Escolha as ações que disparam a pesquisa.",
|
||||
"choose_the_first_question_on_your_block": "Escolha a primeira pergunta do seu bloco",
|
||||
@@ -1244,6 +1241,7 @@
|
||||
"contact_fields": "Campos de Contato",
|
||||
"contains": "contém",
|
||||
"continue_to_settings": "Continuar para Configurações",
|
||||
"control_which_file_types_can_be_uploaded": "Controlar quais tipos de arquivos podem ser enviados.",
|
||||
"convert_to_multiple_choice": "Converter para Múltipla Escolha",
|
||||
"convert_to_single_choice": "Converter para Escolha Única",
|
||||
"country": "país",
|
||||
@@ -1397,8 +1395,9 @@
|
||||
"key": "chave",
|
||||
"last_name": "Sobrenome",
|
||||
"let_people_upload_up_to_25_files_at_the_same_time": "Deixe as pessoas fazerem upload de até 25 arquivos ao mesmo tempo.",
|
||||
"limit_the_maximum_file_size": "Limitar o tamanho máximo de arquivo para uploads.",
|
||||
"limit_upload_file_size_to": "Limitar tamanho de arquivo de upload para",
|
||||
"limit_file_types": "Limitar tipos de arquivos",
|
||||
"limit_the_maximum_file_size": "Limitar o tamanho máximo do arquivo",
|
||||
"limit_upload_file_size_to": "Limitar tamanho do arquivo de upload para",
|
||||
"link_survey_description": "Compartilhe um link para a página da pesquisa ou incorpore-a em uma página da web ou e-mail.",
|
||||
"load_segment": "segmento de carga",
|
||||
"logic_error_warning": "Mudar vai causar erros de lógica",
|
||||
@@ -1411,7 +1410,7 @@
|
||||
"matrix_all_fields": "Todos os campos",
|
||||
"matrix_rows": "Linhas",
|
||||
"max_file_size": "Tamanho máximo do arquivo",
|
||||
"max_file_size_limit_is": "O limite de tamanho máximo do arquivo é",
|
||||
"max_file_size_limit_is": "Tamanho máximo do arquivo é",
|
||||
"move_question_to_block": "Mover pergunta para o bloco",
|
||||
"multiply": "Multiplicar *",
|
||||
"needed_for_self_hosted_cal_com_instance": "Necessário para uma instância auto-hospedada do Cal.com",
|
||||
@@ -1443,6 +1442,7 @@
|
||||
"picture_idx": "Imagem {idx}",
|
||||
"pin_can_only_contain_numbers": "O PIN só pode conter números.",
|
||||
"pin_must_be_a_four_digit_number": "O PIN deve ser um número de quatro dígitos.",
|
||||
"please_enter_a_file_extension": "Por favor, insira uma extensão de arquivo.",
|
||||
"please_enter_a_valid_url": "Por favor, insira uma URL válida (ex.: https://example.com)",
|
||||
"please_set_a_survey_trigger": "Por favor, configure um gatilho para a pesquisa",
|
||||
"please_specify": "Por favor, especifique",
|
||||
@@ -1520,7 +1520,6 @@
|
||||
"search_for_images": "Buscar imagens",
|
||||
"seconds_after_trigger_the_survey_will_be_closed_if_no_response": "segundos após acionar, a pesquisa será encerrada se não houver resposta",
|
||||
"seconds_before_showing_the_survey": "segundos antes de mostrar a pesquisa.",
|
||||
"select_field": "Selecionar campo",
|
||||
"select_or_type_value": "Selecionar ou digitar valor",
|
||||
"select_ordering": "Selecionar pedido",
|
||||
"select_saved_action": "Selecionar ação salva",
|
||||
@@ -1568,6 +1567,8 @@
|
||||
"the_survey_will_be_shown_once_even_if_person_doesnt_respond": "Mostrar uma única vez, mesmo que não respondam.",
|
||||
"then": "Então",
|
||||
"this_action_will_remove_all_the_translations_from_this_survey": "Essa ação vai remover todas as traduções dessa pesquisa.",
|
||||
"this_extension_is_already_added": "Essa extensão já foi adicionada.",
|
||||
"this_file_type_is_not_supported": "Esse tipo de arquivo não é suportado.",
|
||||
"three_points": "3 pontos",
|
||||
"times": "times",
|
||||
"to_keep_the_placement_over_all_surveys_consistent_you_can": "Para manter a colocação consistente em todas as pesquisas, você pode",
|
||||
@@ -1588,42 +1589,6 @@
|
||||
"upper_label": "Etiqueta Superior",
|
||||
"url_filters": "Filtros de URL",
|
||||
"url_not_supported": "URL não suportada",
|
||||
"validation": {
|
||||
"characters": "Caracteres",
|
||||
"contains": "Contém",
|
||||
"does_not_contain": "Não contém",
|
||||
"email": "É um e-mail válido",
|
||||
"file_extension_is": "A extensão do arquivo é",
|
||||
"file_extension_is_not": "A extensão do arquivo não é",
|
||||
"is": "É",
|
||||
"is_between": "Está entre",
|
||||
"is_earlier_than": "É anterior a",
|
||||
"is_greater_than": "É maior que",
|
||||
"is_later_than": "É posterior a",
|
||||
"is_less_than": "É menor que",
|
||||
"is_not": "Não é",
|
||||
"is_not_between": "Não está entre",
|
||||
"kb": "KB",
|
||||
"max_length": "No máximo",
|
||||
"max_selections": "No máximo",
|
||||
"max_value": "No máximo",
|
||||
"mb": "MB",
|
||||
"min_length": "No mínimo",
|
||||
"min_selections": "No mínimo",
|
||||
"min_value": "No mínimo",
|
||||
"minimum_options_ranked": "Mínimo de opções classificadas",
|
||||
"minimum_rows_answered": "Mínimo de linhas respondidas",
|
||||
"options_selected": "Opções selecionadas",
|
||||
"pattern": "Corresponde ao padrão regex",
|
||||
"phone": "É um telefone válido",
|
||||
"rank_all_options": "Classificar todas as opções",
|
||||
"select_file_extensions": "Selecionar extensões de arquivo...",
|
||||
"url": "É uma URL válida"
|
||||
},
|
||||
"validation_logic_and": "Todas são verdadeiras",
|
||||
"validation_logic_or": "qualquer uma é verdadeira",
|
||||
"validation_rules": "Regras de validação",
|
||||
"validation_rules_description": "Aceitar apenas respostas que atendam aos seguintes critérios",
|
||||
"variable_is_used_in_logic_of_question_please_remove_it_from_logic_first": "{variable} está sendo usado na lógica da pergunta {questionIndex}. Por favor, remova-o da lógica primeiro.",
|
||||
"variable_is_used_in_quota_please_remove_it_from_quota_first": "Variável \"{variableName}\" está sendo usada na cota \"{quotaName}\"",
|
||||
"variable_name_is_already_taken_please_choose_another": "O nome da variável já está em uso, por favor escolha outro.",
|
||||
@@ -1681,7 +1646,6 @@
|
||||
"error_downloading_responses": "Ocorreu um erro ao baixar as respostas",
|
||||
"first_name": "Primeiro Nome",
|
||||
"how_to_identify_users": "Como identificar usuários",
|
||||
"ip_address": "Endereço IP",
|
||||
"last_name": "Sobrenome",
|
||||
"not_completed": "Não Concluído ⏳",
|
||||
"os": "sistema operacional",
|
||||
@@ -1726,22 +1690,6 @@
|
||||
"url_encryption_description": "Desative apenas se precisar definir um ID de uso único personalizado",
|
||||
"url_encryption_label": "Criptografia de URL de ID de uso único"
|
||||
},
|
||||
"custom_html": {
|
||||
"add_mode_description": "Os scripts da pesquisa serão executados além dos scripts do nível do workspace.",
|
||||
"add_to_workspace": "Adicionar aos scripts do workspace",
|
||||
"description": "Adicione scripts de rastreamento e pixels a esta pesquisa",
|
||||
"nav_title": "HTML personalizado",
|
||||
"no_workspace_scripts": "Nenhum script de nível de workspace configurado. Você pode adicioná-los em Configurações do Workspace → Geral.",
|
||||
"placeholder": "<!-- Cole seus scripts de rastreamento aqui -->\n<script>\n // Google Tag Manager, Analytics, etc.\n</script>",
|
||||
"replace_mode_description": "Apenas os scripts da pesquisa serão executados. Os scripts do workspace serão ignorados. Deixe vazio para não carregar nenhum script.",
|
||||
"replace_workspace": "Substituir scripts do workspace",
|
||||
"saved_successfully": "Scripts personalizados salvos com sucesso",
|
||||
"script_mode": "Modo de script",
|
||||
"security_warning": "Os scripts são executados com acesso total ao navegador. Adicione apenas scripts de fontes confiáveis.",
|
||||
"survey_scripts_description": "Adicione HTML personalizado para injetar no <head> desta página de pesquisa.",
|
||||
"survey_scripts_label": "Scripts específicos da pesquisa",
|
||||
"workspace_scripts_label": "Scripts do workspace (herdados)"
|
||||
},
|
||||
"dynamic_popup": {
|
||||
"alert_button": "Editar pesquisa",
|
||||
"alert_description": "Esta pesquisa está atualmente configurada como uma pesquisa de link, o que não suporta pop-ups dinâmicos. Você pode alterar isso na aba de configurações do editor de pesquisas.",
|
||||
@@ -1981,13 +1929,6 @@
|
||||
},
|
||||
"general": {
|
||||
"cannot_delete_only_workspace": "Este é seu único projeto, ele não pode ser excluído. Crie um novo projeto primeiro.",
|
||||
"custom_scripts": "Scripts personalizados",
|
||||
"custom_scripts_card_description": "Adicione scripts de rastreamento e pixels a todas as pesquisas de link neste workspace.",
|
||||
"custom_scripts_description": "Os scripts serão injetados no <head> de todas as páginas de pesquisa de link.",
|
||||
"custom_scripts_label": "Scripts HTML",
|
||||
"custom_scripts_placeholder": "<!-- Cole seus scripts de rastreamento aqui -->\n<script>\n // Google Tag Manager, Analytics, etc.\n</script>",
|
||||
"custom_scripts_updated_successfully": "Scripts personalizados atualizados com sucesso",
|
||||
"custom_scripts_warning": "Os scripts são executados com acesso total ao navegador. Adicione apenas scripts de fontes confiáveis.",
|
||||
"delete_workspace": "Excluir projeto",
|
||||
"delete_workspace_confirmation": "Tem certeza de que deseja excluir {projectName}? Essa ação não pode ser desfeita.",
|
||||
"delete_workspace_name_includes_surveys_responses_people_and_more": "Excluir {projectName} incluindo todas as pesquisas, respostas, pessoas, ações e atributos.",
|
||||
|
||||
+16
-75
@@ -197,7 +197,6 @@
|
||||
"docs": "Documentação",
|
||||
"documentation": "Documentação",
|
||||
"domain": "Domínio",
|
||||
"done": "Concluído",
|
||||
"download": "Transferir",
|
||||
"draft": "Rascunho",
|
||||
"duplicate": "Duplicar",
|
||||
@@ -239,6 +238,7 @@
|
||||
"imprint": "Impressão",
|
||||
"in_progress": "Em Progresso",
|
||||
"inactive_surveys": "Inquéritos inativos",
|
||||
"input_type": "Tipo de entrada",
|
||||
"integration": "integração",
|
||||
"integrations": "Integrações",
|
||||
"invalid_date": "Data inválida",
|
||||
@@ -262,11 +262,13 @@
|
||||
"look_and_feel": "Aparência e Sensação",
|
||||
"manage": "Gerir",
|
||||
"marketing": "Marketing",
|
||||
"maximum": "Máximo",
|
||||
"member": "Membro",
|
||||
"members": "Membros",
|
||||
"members_and_teams": "Membros e equipas",
|
||||
"membership_not_found": "Associação não encontrada",
|
||||
"metadata": "Metadados",
|
||||
"minimum": "Mínimo",
|
||||
"mobile_overlay_app_works_best_on_desktop": "Formbricks funciona melhor num ecrã maior. Para gerir ou criar inquéritos, mude de dispositivo.",
|
||||
"mobile_overlay_surveys_look_good": "Não se preocupe – os seus inquéritos têm uma ótima aparência em todos os dispositivos e tamanhos de ecrã!",
|
||||
"mobile_overlay_title": "Oops, ecrã pequeno detectado!",
|
||||
@@ -319,7 +321,7 @@
|
||||
"placeholder": "Espaço reservado",
|
||||
"please_select_at_least_one_survey": "Por favor, selecione pelo menos um inquérito",
|
||||
"please_select_at_least_one_trigger": "Por favor, selecione pelo menos um gatilho",
|
||||
"please_upgrade_your_plan": "Por favor, atualize o seu plano",
|
||||
"please_upgrade_your_plan": "Por favor, atualize o seu plano.",
|
||||
"preview": "Pré-visualização",
|
||||
"preview_survey": "Pré-visualização do inquérito",
|
||||
"privacy": "Política de Privacidade",
|
||||
@@ -781,26 +783,20 @@
|
||||
"add_webhook": "Adicionar Webhook",
|
||||
"add_webhook_description": "Enviar dados de resposta do inquérito para um endpoint personalizado",
|
||||
"all_current_and_new_surveys": "Todos os inquéritos atuais e novos",
|
||||
"copy_secret_now": "Copiar o seu segredo de assinatura",
|
||||
"created_by_third_party": "Criado por um Terceiro",
|
||||
"discord_webhook_not_supported": "Os webhooks do Discord não são atualmente suportados.",
|
||||
"empty_webhook_message": "Os seus webhooks aparecerão aqui assim que os adicionar. ⏲️",
|
||||
"endpoint_pinged": "Yay! Conseguimos aceder ao webhook!",
|
||||
"endpoint_pinged_error": "Não foi possível aceder ao webhook!",
|
||||
"learn_to_verify": "Aprenda a verificar assinaturas de webhook",
|
||||
"please_check_console": "Por favor, verifique a consola para mais detalhes",
|
||||
"please_enter_a_url": "Por favor, insira um URL",
|
||||
"response_created": "Resposta Criada",
|
||||
"response_finished": "Resposta Concluída",
|
||||
"response_updated": "Resposta Atualizada",
|
||||
"secret_copy_warning": "Armazene este segredo de forma segura. Pode visualizá-lo novamente nas definições do webhook.",
|
||||
"secret_description": "Use este segredo para verificar os pedidos do webhook. Consulte a documentação para verificação de assinatura.",
|
||||
"signing_secret": "Segredo de assinatura",
|
||||
"source": "Fonte",
|
||||
"test_endpoint": "Testar Endpoint",
|
||||
"triggers": "Disparadores",
|
||||
"webhook_added_successfully": "Webhook adicionado com sucesso",
|
||||
"webhook_created": "Webhook criado",
|
||||
"webhook_delete_confirmation": "Tem a certeza de que deseja eliminar este Webhook? Isto irá parar de lhe enviar quaisquer notificações futuras.",
|
||||
"webhook_deleted_successfully": "Webhook eliminado com sucesso",
|
||||
"webhook_name_placeholder": "Opcional: Rotule o seu webhook para fácil identificação",
|
||||
@@ -1163,6 +1159,7 @@
|
||||
"adjust_survey_closed_message_description": "Alterar a mensagem que os visitantes veem quando o inquérito está fechado.",
|
||||
"adjust_the_theme_in_the": "Ajustar o tema no",
|
||||
"all_other_answers_will_continue_to": "Todas as outras respostas continuarão a",
|
||||
"allow_file_type": "Permitir tipo de ficheiro",
|
||||
"allow_multi_select": "Permitir seleção múltipla",
|
||||
"allow_multiple_files": "Permitir vários ficheiros",
|
||||
"allow_users_to_select_more_than_one_image": "Permitir aos utilizadores selecionar mais do que uma imagem",
|
||||
@@ -1193,8 +1190,6 @@
|
||||
"cal_username": "Nome de utilizador do Cal.com ou nome de utilizador/evento",
|
||||
"calculate": "Calcular",
|
||||
"capture_a_new_action_to_trigger_a_survey_on": "Capturar uma nova ação para desencadear um inquérito.",
|
||||
"capture_ip_address": "Capturar endereço IP",
|
||||
"capture_ip_address_description": "Armazenar o endereço IP do inquirido nos metadados da resposta para deteção de duplicados e fins de segurança",
|
||||
"capture_new_action": "Capturar nova ação",
|
||||
"card_arrangement_for_survey_type_derived": "Arranjo de Cartões para Inquéritos {surveyTypeDerived}",
|
||||
"card_background_color": "Cor de fundo do cartão",
|
||||
@@ -1225,6 +1220,8 @@
|
||||
"change_the_question_color_of_the_survey": "Alterar a cor da pergunta do inquérito",
|
||||
"changes_saved": "Alterações guardadas.",
|
||||
"changing_survey_type_will_remove_existing_distribution_channels": "Alterar o tipo de inquérito afetará como ele pode ser partilhado. Se os respondentes já tiverem links de acesso para o tipo atual, podem perder o acesso após a mudança.",
|
||||
"character_limit_toggle_description": "Limitar o quão curta ou longa uma resposta pode ser.",
|
||||
"character_limit_toggle_title": "Adicionar limites de caracteres",
|
||||
"checkbox_label": "Rótulo da Caixa de Seleção",
|
||||
"choose_the_actions_which_trigger_the_survey": "Escolha as ações que desencadeiam o inquérito.",
|
||||
"choose_the_first_question_on_your_block": "Escolha a primeira pergunta no seu bloco",
|
||||
@@ -1244,6 +1241,7 @@
|
||||
"contact_fields": "Campos de Contacto",
|
||||
"contains": "Contém",
|
||||
"continue_to_settings": "Continuar para Definições",
|
||||
"control_which_file_types_can_be_uploaded": "Controlar quais tipos de ficheiros podem ser carregados.",
|
||||
"convert_to_multiple_choice": "Converter para Seleção Múltipla",
|
||||
"convert_to_single_choice": "Converter para Seleção Única",
|
||||
"country": "País",
|
||||
@@ -1397,8 +1395,9 @@
|
||||
"key": "Chave",
|
||||
"last_name": "Apelido",
|
||||
"let_people_upload_up_to_25_files_at_the_same_time": "Permitir que as pessoas carreguem até 25 ficheiros ao mesmo tempo.",
|
||||
"limit_the_maximum_file_size": "Limitar o tamanho máximo de ficheiro para carregamentos.",
|
||||
"limit_upload_file_size_to": "Limitar o tamanho de ficheiro de carregamento para",
|
||||
"limit_file_types": "Limitar tipos de ficheiros",
|
||||
"limit_the_maximum_file_size": "Limitar o tamanho máximo do ficheiro",
|
||||
"limit_upload_file_size_to": "Limitar tamanho do ficheiro carregado a",
|
||||
"link_survey_description": "Partilhe um link para uma página de inquérito ou incorpore-o numa página web ou email.",
|
||||
"load_segment": "Carregar segmento",
|
||||
"logic_error_warning": "A alteração causará erros de lógica",
|
||||
@@ -1410,8 +1409,8 @@
|
||||
"manage_languages": "Gerir Idiomas",
|
||||
"matrix_all_fields": "Todos os campos",
|
||||
"matrix_rows": "Linhas",
|
||||
"max_file_size": "Tamanho máximo de ficheiro",
|
||||
"max_file_size_limit_is": "O limite de tamanho máximo de ficheiro é",
|
||||
"max_file_size": "Tamanho máximo do ficheiro",
|
||||
"max_file_size_limit_is": "O limite do tamanho máximo do ficheiro é",
|
||||
"move_question_to_block": "Mover pergunta para o bloco",
|
||||
"multiply": "Multiplicar *",
|
||||
"needed_for_self_hosted_cal_com_instance": "Necessário para uma instância auto-hospedada do Cal.com",
|
||||
@@ -1443,6 +1442,7 @@
|
||||
"picture_idx": "Imagem {idx}",
|
||||
"pin_can_only_contain_numbers": "O PIN só pode conter números.",
|
||||
"pin_must_be_a_four_digit_number": "O PIN deve ser um número de quatro dígitos.",
|
||||
"please_enter_a_file_extension": "Por favor, insira uma extensão de ficheiro.",
|
||||
"please_enter_a_valid_url": "Por favor, insira um URL válido (por exemplo, https://example.com)",
|
||||
"please_set_a_survey_trigger": "Por favor, defina um desencadeador de inquérito",
|
||||
"please_specify": "Por favor, especifique",
|
||||
@@ -1520,7 +1520,6 @@
|
||||
"search_for_images": "Procurar imagens",
|
||||
"seconds_after_trigger_the_survey_will_be_closed_if_no_response": "segundos após o acionamento o inquérito será fechado se não houver resposta",
|
||||
"seconds_before_showing_the_survey": "segundos antes de mostrar o inquérito.",
|
||||
"select_field": "Selecionar campo",
|
||||
"select_or_type_value": "Selecionar ou digitar valor",
|
||||
"select_ordering": "Selecionar ordem",
|
||||
"select_saved_action": "Selecionar ação guardada",
|
||||
@@ -1568,6 +1567,8 @@
|
||||
"the_survey_will_be_shown_once_even_if_person_doesnt_respond": "Mostrar uma única vez, mesmo que não respondam.",
|
||||
"then": "Então",
|
||||
"this_action_will_remove_all_the_translations_from_this_survey": "Esta ação irá remover todas as traduções deste inquérito.",
|
||||
"this_extension_is_already_added": "Esta extensão já está adicionada.",
|
||||
"this_file_type_is_not_supported": "Este tipo de ficheiro não é suportado.",
|
||||
"three_points": "3 pontos",
|
||||
"times": "tempos",
|
||||
"to_keep_the_placement_over_all_surveys_consistent_you_can": "Para manter a colocação consistente em todos os questionários, pode",
|
||||
@@ -1588,42 +1589,6 @@
|
||||
"upper_label": "Etiqueta Superior",
|
||||
"url_filters": "Filtros de URL",
|
||||
"url_not_supported": "URL não suportado",
|
||||
"validation": {
|
||||
"characters": "Caracteres",
|
||||
"contains": "Contém",
|
||||
"does_not_contain": "Não contém",
|
||||
"email": "É um email válido",
|
||||
"file_extension_is": "A extensão do ficheiro é",
|
||||
"file_extension_is_not": "A extensão do ficheiro não é",
|
||||
"is": "É",
|
||||
"is_between": "Está entre",
|
||||
"is_earlier_than": "É anterior a",
|
||||
"is_greater_than": "É maior que",
|
||||
"is_later_than": "É posterior a",
|
||||
"is_less_than": "É menor que",
|
||||
"is_not": "Não é",
|
||||
"is_not_between": "Não está entre",
|
||||
"kb": "KB",
|
||||
"max_length": "No máximo",
|
||||
"max_selections": "No máximo",
|
||||
"max_value": "No máximo",
|
||||
"mb": "MB",
|
||||
"min_length": "Pelo menos",
|
||||
"min_selections": "Pelo menos",
|
||||
"min_value": "Pelo menos",
|
||||
"minimum_options_ranked": "Opções mínimas classificadas",
|
||||
"minimum_rows_answered": "Linhas mínimas respondidas",
|
||||
"options_selected": "Opções selecionadas",
|
||||
"pattern": "Coincide com o padrão regex",
|
||||
"phone": "É um telefone válido",
|
||||
"rank_all_options": "Classificar todas as opções",
|
||||
"select_file_extensions": "Selecionar extensões de ficheiro...",
|
||||
"url": "É um URL válido"
|
||||
},
|
||||
"validation_logic_and": "Todas são verdadeiras",
|
||||
"validation_logic_or": "qualquer uma é verdadeira",
|
||||
"validation_rules": "Regras de validação",
|
||||
"validation_rules_description": "Aceitar apenas respostas que cumpram os seguintes critérios",
|
||||
"variable_is_used_in_logic_of_question_please_remove_it_from_logic_first": "{variable} é usada na lógica da pergunta {questionIndex}. Por favor, remova-a da lógica primeiro.",
|
||||
"variable_is_used_in_quota_please_remove_it_from_quota_first": "Variável \"{variableName}\" está a ser utilizada na quota \"{quotaName}\"",
|
||||
"variable_name_is_already_taken_please_choose_another": "O nome da variável já está em uso, por favor escolha outro.",
|
||||
@@ -1681,7 +1646,6 @@
|
||||
"error_downloading_responses": "Ocorreu um erro ao transferir as respostas",
|
||||
"first_name": "Primeiro Nome",
|
||||
"how_to_identify_users": "Como identificar utilizadores",
|
||||
"ip_address": "Endereço IP",
|
||||
"last_name": "Apelido",
|
||||
"not_completed": "Não Concluído ⏳",
|
||||
"os": "SO",
|
||||
@@ -1726,22 +1690,6 @@
|
||||
"url_encryption_description": "Desative apenas se precisar definir um ID de uso único personalizado.",
|
||||
"url_encryption_label": "Encriptação do URL de ID de uso único"
|
||||
},
|
||||
"custom_html": {
|
||||
"add_mode_description": "Os scripts do inquérito serão executados para além dos scripts ao nível da área de trabalho.",
|
||||
"add_to_workspace": "Adicionar aos scripts da área de trabalho",
|
||||
"description": "Adicionar scripts de rastreamento e pixels a este inquérito",
|
||||
"nav_title": "HTML personalizado",
|
||||
"no_workspace_scripts": "Nenhum script ao nível da área de trabalho configurado. Pode adicioná-los em Definições da Área de Trabalho → Geral.",
|
||||
"placeholder": "<!-- Cole os seus scripts de rastreamento aqui -->\n<script>\n // Google Tag Manager, Analytics, etc.\n</script>",
|
||||
"replace_mode_description": "Apenas os scripts do inquérito serão executados. Os scripts da área de trabalho serão ignorados. Deixe vazio para não carregar nenhum script.",
|
||||
"replace_workspace": "Substituir scripts da área de trabalho",
|
||||
"saved_successfully": "Scripts personalizados guardados com sucesso",
|
||||
"script_mode": "Modo de script",
|
||||
"security_warning": "Os scripts são executados com acesso total ao navegador. Adicione apenas scripts de fontes fidedignas.",
|
||||
"survey_scripts_description": "Adicionar HTML personalizado para injetar no <head> desta página de inquérito.",
|
||||
"survey_scripts_label": "Scripts específicos do inquérito",
|
||||
"workspace_scripts_label": "Scripts da área de trabalho (herdados)"
|
||||
},
|
||||
"dynamic_popup": {
|
||||
"alert_button": "Editar inquérito",
|
||||
"alert_description": "Este questionário está atualmente configurado como um questionário de link, que não suporta pop-ups dinâmicos. Você pode alterar isso na aba de configurações do editor de questionários.",
|
||||
@@ -1981,13 +1929,6 @@
|
||||
},
|
||||
"general": {
|
||||
"cannot_delete_only_workspace": "Este é o seu único projeto, não pode ser eliminado. Crie primeiro um novo projeto.",
|
||||
"custom_scripts": "Scripts personalizados",
|
||||
"custom_scripts_card_description": "Adicionar scripts de rastreamento e pixels a todos os inquéritos de link nesta área de trabalho.",
|
||||
"custom_scripts_description": "Os scripts serão injetados no <head> de todas as páginas de inquéritos de link.",
|
||||
"custom_scripts_label": "Scripts HTML",
|
||||
"custom_scripts_placeholder": "<!-- Cole os seus scripts de rastreamento aqui -->\n<script>\n // Google Tag Manager, Analytics, etc.\n</script>",
|
||||
"custom_scripts_updated_successfully": "Scripts personalizados atualizados com sucesso",
|
||||
"custom_scripts_warning": "Os scripts são executados com acesso total ao navegador. Adicione apenas scripts de fontes fidedignas.",
|
||||
"delete_workspace": "Eliminar projeto",
|
||||
"delete_workspace_confirmation": "Tem a certeza de que pretende eliminar {projectName}? Esta ação não pode ser desfeita.",
|
||||
"delete_workspace_name_includes_surveys_responses_people_and_more": "Eliminar {projectName} incluindo todos os inquéritos, respostas, pessoas, ações e atributos.",
|
||||
|
||||
+16
-75
@@ -197,7 +197,6 @@
|
||||
"docs": "Documentație",
|
||||
"documentation": "Documentație",
|
||||
"domain": "Domeniu",
|
||||
"done": "Gata",
|
||||
"download": "Descărcare",
|
||||
"draft": "Schiță",
|
||||
"duplicate": "Duplicități",
|
||||
@@ -239,6 +238,7 @@
|
||||
"imprint": "Amprentă",
|
||||
"in_progress": "În progres",
|
||||
"inactive_surveys": "Sondaje inactive",
|
||||
"input_type": "Tipul de intrare",
|
||||
"integration": "integrare",
|
||||
"integrations": "Integrări",
|
||||
"invalid_date": "Dată invalidă",
|
||||
@@ -262,11 +262,13 @@
|
||||
"look_and_feel": "Aspect și Comportament",
|
||||
"manage": "Gestionați",
|
||||
"marketing": "Marketing",
|
||||
"maximum": "Maximum",
|
||||
"member": "Membru",
|
||||
"members": "Membri",
|
||||
"members_and_teams": "Membri și echipe",
|
||||
"membership_not_found": "Apartenența nu a fost găsită",
|
||||
"metadata": "Metadate",
|
||||
"minimum": "Minim",
|
||||
"mobile_overlay_app_works_best_on_desktop": "Formbricks funcționează cel mai bine pe un ecran mai mare. Pentru a gestiona sau crea chestionare, treceți la un alt dispozitiv.",
|
||||
"mobile_overlay_surveys_look_good": "Nu vă faceți griji – chestionarele dumneavoastră arată grozav pe orice dispozitiv și dimensiune a ecranului!",
|
||||
"mobile_overlay_title": "Ups, ecran mic detectat!",
|
||||
@@ -319,7 +321,7 @@
|
||||
"placeholder": "Marcaj substituent",
|
||||
"please_select_at_least_one_survey": "Vă rugăm să selectați cel puțin un sondaj",
|
||||
"please_select_at_least_one_trigger": "Vă rugăm să selectați cel puțin un declanșator",
|
||||
"please_upgrade_your_plan": "Vă rugăm să faceți upgrade la planul dumneavoastră",
|
||||
"please_upgrade_your_plan": "Vă rugăm să vă actualizați planul.",
|
||||
"preview": "Previzualizare",
|
||||
"preview_survey": "Previzualizare Chestionar",
|
||||
"privacy": "Politica de Confidențialitate",
|
||||
@@ -781,26 +783,20 @@
|
||||
"add_webhook": "Adaugă Webhook",
|
||||
"add_webhook_description": "Trimite datele de răspuns ale chestionarului la un punct final personalizat",
|
||||
"all_current_and_new_surveys": "Toate chestionarele curente și noi",
|
||||
"copy_secret_now": "Copiază secretul de semnare",
|
||||
"created_by_third_party": "Creat de o Parte Terță",
|
||||
"discord_webhook_not_supported": "Webhook-urile Discord nu sunt în prezent suportate.",
|
||||
"empty_webhook_message": "Webhook-urile tale vor apărea aici de îndată ce le vei adăuga. ⏲️",
|
||||
"endpoint_pinged": "Grozav! Am reușit să ping-ui webhooks-ul!",
|
||||
"endpoint_pinged_error": "Nu pot să ping-ui webhooks-ul!",
|
||||
"learn_to_verify": "Află cum să verifici semnăturile webhook",
|
||||
"please_check_console": "Vă rugăm să verificați consola pentru mai multe detalii",
|
||||
"please_enter_a_url": "Vă rugăm să introduceți un URL",
|
||||
"response_created": "Răspuns creat",
|
||||
"response_finished": "Răspuns finalizat",
|
||||
"response_updated": "Răspuns actualizat",
|
||||
"secret_copy_warning": "Păstrează acest secret în siguranță. Îl poți vizualiza din nou în setările webhook-ului.",
|
||||
"secret_description": "Folosește acest secret pentru a verifica cererile webhook. Vezi documentația pentru verificarea semnăturii.",
|
||||
"signing_secret": "Secret de semnare",
|
||||
"source": "Sursă",
|
||||
"test_endpoint": "Punct final de test",
|
||||
"triggers": "Declanșatori",
|
||||
"webhook_added_successfully": "Webhook adăugat cu succes",
|
||||
"webhook_created": "Webhook creat",
|
||||
"webhook_delete_confirmation": "Sigur doriți să ștergeți acest Webhook? Acest lucru va opri trimiterea oricăror notificări viitoare.",
|
||||
"webhook_deleted_successfully": "Webhook șters cu succes",
|
||||
"webhook_name_placeholder": "Opțional: Etichetează webhook-ul pentru identificare ușoară",
|
||||
@@ -1163,6 +1159,7 @@
|
||||
"adjust_survey_closed_message_description": "Schimbați mesajul pe care îl văd vizitatorii atunci când sondajul este închis.",
|
||||
"adjust_the_theme_in_the": "Ajustați tema în",
|
||||
"all_other_answers_will_continue_to": "Toate celelalte răspunsuri vor continua să",
|
||||
"allow_file_type": "Permite tipul de fișier",
|
||||
"allow_multi_select": "Permite selectare multiplă",
|
||||
"allow_multiple_files": "Permite fișiere multiple",
|
||||
"allow_users_to_select_more_than_one_image": "Permite utilizatorilor să selecteze mai mult de o imagine",
|
||||
@@ -1193,8 +1190,6 @@
|
||||
"cal_username": "Utilizator Cal.com sau utilizator/eveniment",
|
||||
"calculate": "Calculați",
|
||||
"capture_a_new_action_to_trigger_a_survey_on": "Capturează o acțiune nouă pentru a declanșa un sondaj.",
|
||||
"capture_ip_address": "Capturare adresă IP",
|
||||
"capture_ip_address_description": "Stochează adresa IP a respondentului în metadatele răspunsului pentru detectarea duplicatelor și în scopuri de securitate",
|
||||
"capture_new_action": "Capturați acțiune nouă",
|
||||
"card_arrangement_for_survey_type_derived": "Aranjament de carduri pentru sondaje de tip {surveyTypeDerived}",
|
||||
"card_background_color": "Culoarea de fundal a cardului",
|
||||
@@ -1225,6 +1220,8 @@
|
||||
"change_the_question_color_of_the_survey": "Schimbați culoarea întrebării chestionarului.",
|
||||
"changes_saved": "Modificările au fost salvate",
|
||||
"changing_survey_type_will_remove_existing_distribution_channels": "Schimbarea tipului chestionarului va afecta modul în care acesta poate fi distribuit. Dacă respondenții au deja linkuri de acces pentru tipul curent, aceștia ar putea pierde accesul după schimbare.",
|
||||
"character_limit_toggle_description": "Limitați cât de scurt sau lung poate fi un răspuns.",
|
||||
"character_limit_toggle_title": "Adăugați limite de caractere",
|
||||
"checkbox_label": "Etichetă casetă de selectare",
|
||||
"choose_the_actions_which_trigger_the_survey": "Alegeți acțiunile care declanșează sondajul.",
|
||||
"choose_the_first_question_on_your_block": "Alege prima întrebare din blocul tău",
|
||||
@@ -1244,6 +1241,7 @@
|
||||
"contact_fields": "Câmpuri de contact",
|
||||
"contains": "Conține",
|
||||
"continue_to_settings": "Continuă către Setări",
|
||||
"control_which_file_types_can_be_uploaded": "Controlează ce tipuri de fișiere pot fi încărcate.",
|
||||
"convert_to_multiple_choice": "Convertiți la selectare multiplă",
|
||||
"convert_to_single_choice": "Convertiți la selectare unică",
|
||||
"country": "Țară",
|
||||
@@ -1360,7 +1358,7 @@
|
||||
"hide_question_settings": "Ascunde setările întrebării",
|
||||
"hostname": "Nume gazdă",
|
||||
"how_funky_do_you_want_your_cards_in_survey_type_derived_surveys": "Cât de funky doriți să fie cardurile dumneavoastră în sondajele de tip {surveyTypeDerived}",
|
||||
"if_you_need_more_please": "Dacă aveți nevoie de mai mult, vă rugăm",
|
||||
"if_you_need_more_please": "Dacă aveți nevoie de mai multe, vă rugăm să",
|
||||
"if_you_really_want_that_answer_ask_until_you_get_it": "Continuă afișarea ori de câte ori este declanșat până când se trimite un răspuns.",
|
||||
"ignore_global_waiting_time": "Ignoră perioada de răcire",
|
||||
"ignore_global_waiting_time_description": "Acest sondaj poate fi afișat ori de câte ori condițiile sale sunt îndeplinite, chiar dacă un alt sondaj a fost afișat recent.",
|
||||
@@ -1397,8 +1395,9 @@
|
||||
"key": "Cheie",
|
||||
"last_name": "Nume de familie",
|
||||
"let_people_upload_up_to_25_files_at_the_same_time": "Permiteți utilizatorilor să încarce până la 25 de fișiere simultan.",
|
||||
"limit_the_maximum_file_size": "Limitați dimensiunea maximă a fișierului pentru încărcări.",
|
||||
"limit_upload_file_size_to": "Limitați dimensiunea fișierului încărcat la",
|
||||
"limit_file_types": "Limitare tipuri de fișiere",
|
||||
"limit_the_maximum_file_size": "Limitează dimensiunea maximă a fișierului",
|
||||
"limit_upload_file_size_to": "Limitați dimensiunea fișierului de încărcare la",
|
||||
"link_survey_description": "Partajați un link către o pagină de chestionar sau încorporați-l într-o pagină web sau email.",
|
||||
"load_segment": "Încarcă segment",
|
||||
"logic_error_warning": "Schimbarea va provoca erori de logică",
|
||||
@@ -1411,7 +1410,7 @@
|
||||
"matrix_all_fields": "Toate câmpurile",
|
||||
"matrix_rows": "Rânduri",
|
||||
"max_file_size": "Dimensiune maximă fișier",
|
||||
"max_file_size_limit_is": "Limita maximă pentru dimensiunea fișierului este",
|
||||
"max_file_size_limit_is": "Limita dimensiunii maxime a fișierului este",
|
||||
"move_question_to_block": "Mută întrebarea în bloc",
|
||||
"multiply": "Multiplicare",
|
||||
"needed_for_self_hosted_cal_com_instance": "Necesar pentru un exemplu autogăzduit Cal.com",
|
||||
@@ -1443,6 +1442,7 @@
|
||||
"picture_idx": "Poză {idx}",
|
||||
"pin_can_only_contain_numbers": "PIN-ul poate conține doar numere.",
|
||||
"pin_must_be_a_four_digit_number": "PIN-ul trebuie să fie un număr de patru cifre",
|
||||
"please_enter_a_file_extension": "Vă rugăm să introduceți o extensie de fișier.",
|
||||
"please_enter_a_valid_url": "Vă rugăm să introduceți un URL valid (de exemplu, https://example.com)",
|
||||
"please_set_a_survey_trigger": "Vă rugăm să setați un declanșator sondaj",
|
||||
"please_specify": "Vă rugăm să specificați",
|
||||
@@ -1520,7 +1520,6 @@
|
||||
"search_for_images": "Căutare de imagini",
|
||||
"seconds_after_trigger_the_survey_will_be_closed_if_no_response": "secunde după declanșare sondajul va fi închis dacă nu există niciun răspuns",
|
||||
"seconds_before_showing_the_survey": "secunde înainte de afișarea sondajului",
|
||||
"select_field": "Selectează câmpul",
|
||||
"select_or_type_value": "Selectați sau introduceți valoarea",
|
||||
"select_ordering": "Selectează ordonarea",
|
||||
"select_saved_action": "Selectați acțiunea salvată",
|
||||
@@ -1568,6 +1567,8 @@
|
||||
"the_survey_will_be_shown_once_even_if_person_doesnt_respond": "Afișează o singură dată, chiar dacă persoana nu răspunde.",
|
||||
"then": "Apoi",
|
||||
"this_action_will_remove_all_the_translations_from_this_survey": "Această acțiune va elimina toate traducerile din acest sondaj.",
|
||||
"this_extension_is_already_added": "Această extensie este deja adăugată.",
|
||||
"this_file_type_is_not_supported": "Acest tip de fișier nu este acceptat.",
|
||||
"three_points": "3 puncte",
|
||||
"times": "ori",
|
||||
"to_keep_the_placement_over_all_surveys_consistent_you_can": "Pentru a menține amplasarea consecventă pentru toate sondajele, puteți",
|
||||
@@ -1588,42 +1589,6 @@
|
||||
"upper_label": "Etichetă superioară",
|
||||
"url_filters": "Filtre URL",
|
||||
"url_not_supported": "URL nesuportat",
|
||||
"validation": {
|
||||
"characters": "Caractere",
|
||||
"contains": "Conține",
|
||||
"does_not_contain": "Nu conține",
|
||||
"email": "Este un email valid",
|
||||
"file_extension_is": "Extensia fișierului este",
|
||||
"file_extension_is_not": "Extensia fișierului nu este",
|
||||
"is": "Este",
|
||||
"is_between": "Este între",
|
||||
"is_earlier_than": "Este mai devreme decât",
|
||||
"is_greater_than": "Este mai mare decât",
|
||||
"is_later_than": "Este mai târziu decât",
|
||||
"is_less_than": "Este mai mic decât",
|
||||
"is_not": "Nu este",
|
||||
"is_not_between": "Nu este între",
|
||||
"kb": "KB",
|
||||
"max_length": "Cel mult",
|
||||
"max_selections": "Cel mult",
|
||||
"max_value": "Cel mult",
|
||||
"mb": "MB",
|
||||
"min_length": "Cel puțin",
|
||||
"min_selections": "Cel puțin",
|
||||
"min_value": "Cel puțin",
|
||||
"minimum_options_ranked": "Număr minim de opțiuni ordonate",
|
||||
"minimum_rows_answered": "Număr minim de rânduri completate",
|
||||
"options_selected": "Opțiuni selectate",
|
||||
"pattern": "Se potrivește cu un șablon regex",
|
||||
"phone": "Este un număr de telefon valid",
|
||||
"rank_all_options": "Ordonați toate opțiunile",
|
||||
"select_file_extensions": "Selectați extensiile de fișier...",
|
||||
"url": "Este un URL valid"
|
||||
},
|
||||
"validation_logic_and": "Toate sunt adevărate",
|
||||
"validation_logic_or": "oricare este adevărată",
|
||||
"validation_rules": "Reguli de validare",
|
||||
"validation_rules_description": "Acceptă doar răspunsurile care îndeplinesc următoarele criterii",
|
||||
"variable_is_used_in_logic_of_question_please_remove_it_from_logic_first": "{variable} este folosit în logica întrebării {questionIndex}. Vă rugăm să-l eliminați din logică mai întâi.",
|
||||
"variable_is_used_in_quota_please_remove_it_from_quota_first": "Variabila \"{variableName}\" este folosită în cota \"{quotaName}\"",
|
||||
"variable_name_is_already_taken_please_choose_another": "Numele variabilei este deja utilizat, vă rugăm să alegeți altul.",
|
||||
@@ -1681,7 +1646,6 @@
|
||||
"error_downloading_responses": "A apărut o eroare la descărcarea răspunsurilor",
|
||||
"first_name": "Prenume",
|
||||
"how_to_identify_users": "Cum să identifici utilizatorii",
|
||||
"ip_address": "Adresă IP",
|
||||
"last_name": "Nume de familie",
|
||||
"not_completed": "Necompletat ⏳",
|
||||
"os": "SO",
|
||||
@@ -1726,22 +1690,6 @@
|
||||
"url_encryption_description": "Dezactivați doar dacă trebuie să setați un ID unic personalizat.",
|
||||
"url_encryption_label": "Criptarea URL pentru ID unic de utilizare"
|
||||
},
|
||||
"custom_html": {
|
||||
"add_mode_description": "Scripturile sondajului vor rula în plus față de scripturile la nivel de spațiu de lucru.",
|
||||
"add_to_workspace": "Adaugă la scripturile spațiului de lucru",
|
||||
"description": "Adaugă scripturi de tracking și pixeli acestui sondaj",
|
||||
"nav_title": "HTML personalizat",
|
||||
"no_workspace_scripts": "Nu există scripturi la nivel de spațiu de lucru configurate. Le poți adăuga în Setări spațiu de lucru → General.",
|
||||
"placeholder": "<!-- Lipește aici scripturile tale de tracking -->\n<script>\n // Google Tag Manager, Analytics, etc.\n</script>",
|
||||
"replace_mode_description": "Vor rula doar scripturile sondajului. Scripturile spațiului de lucru vor fi ignorate. Lasă gol pentru a nu încărca niciun script.",
|
||||
"replace_workspace": "Înlocuiește scripturile spațiului de lucru",
|
||||
"saved_successfully": "Scripturile personalizate au fost salvate cu succes",
|
||||
"script_mode": "Modul script",
|
||||
"security_warning": "Scripturile se execută cu acces complet la browser. Adaugă doar scripturi din surse de încredere.",
|
||||
"survey_scripts_description": "Adaugă HTML personalizat pentru a fi injectat în <head> pe această pagină de sondaj.",
|
||||
"survey_scripts_label": "Scripturi specifice sondajului",
|
||||
"workspace_scripts_label": "Scripturi spațiu de lucru (moștenite)"
|
||||
},
|
||||
"dynamic_popup": {
|
||||
"alert_button": "Editează chestionar",
|
||||
"alert_description": "Acest sondaj este configurat în prezent ca un sondaj cu link, care nu suportă pop-up-uri dinamice. Puteți schimba acest lucru în fila de setări a editorului de sondaje.",
|
||||
@@ -1981,13 +1929,6 @@
|
||||
},
|
||||
"general": {
|
||||
"cannot_delete_only_workspace": "Acesta este singurul tău proiect, nu poate fi șters. Creează mai întâi un proiect nou.",
|
||||
"custom_scripts": "Scripturi personalizate",
|
||||
"custom_scripts_card_description": "Adaugă scripturi de tracking și pixeli tuturor sondajelor cu link din acest spațiu de lucru.",
|
||||
"custom_scripts_description": "Scripturile vor fi injectate în <head> pe toate paginile sondajelor cu link.",
|
||||
"custom_scripts_label": "Scripturi HTML",
|
||||
"custom_scripts_placeholder": "<!-- Lipește aici scripturile tale de tracking -->\n<script>\n // Google Tag Manager, Analytics, etc.\n</script>",
|
||||
"custom_scripts_updated_successfully": "Scripturile personalizate au fost actualizate cu succes",
|
||||
"custom_scripts_warning": "Scripturile se execută cu acces complet la browser. Adaugă doar scripturi din surse de încredere.",
|
||||
"delete_workspace": "Șterge proiectul",
|
||||
"delete_workspace_confirmation": "Sigur vrei să ștergi {projectName}? Această acțiune nu poate fi anulată.",
|
||||
"delete_workspace_name_includes_surveys_responses_people_and_more": "Șterge {projectName} incl. toate sondajele, răspunsurile, persoanele, acțiunile și atributele.",
|
||||
|
||||
+14
-73
@@ -197,7 +197,6 @@
|
||||
"docs": "Документация",
|
||||
"documentation": "Документация",
|
||||
"domain": "Домен",
|
||||
"done": "Готово",
|
||||
"download": "Скачать",
|
||||
"draft": "Черновик",
|
||||
"duplicate": "Дублировать",
|
||||
@@ -239,6 +238,7 @@
|
||||
"imprint": "Выходные данные",
|
||||
"in_progress": "В процессе",
|
||||
"inactive_surveys": "Неактивные опросы",
|
||||
"input_type": "Тип ввода",
|
||||
"integration": "интеграция",
|
||||
"integrations": "Интеграции",
|
||||
"invalid_date": "Неверная дата",
|
||||
@@ -262,11 +262,13 @@
|
||||
"look_and_feel": "Внешний вид",
|
||||
"manage": "Управление",
|
||||
"marketing": "Маркетинг",
|
||||
"maximum": "Максимум",
|
||||
"member": "Участник",
|
||||
"members": "Участники",
|
||||
"members_and_teams": "Участники и команды",
|
||||
"membership_not_found": "Участие не найдено",
|
||||
"metadata": "Метаданные",
|
||||
"minimum": "Минимум",
|
||||
"mobile_overlay_app_works_best_on_desktop": "Formbricks лучше всего работает на большом экране. Для управления или создания опросов перейдите на другое устройство.",
|
||||
"mobile_overlay_surveys_look_good": "Не волнуйтесь — ваши опросы отлично выглядят на любом устройстве и экране!",
|
||||
"mobile_overlay_title": "Ой, обнаружен маленький экран!",
|
||||
@@ -319,7 +321,7 @@
|
||||
"placeholder": "Заполнитель",
|
||||
"please_select_at_least_one_survey": "Пожалуйста, выберите хотя бы один опрос",
|
||||
"please_select_at_least_one_trigger": "Пожалуйста, выберите хотя бы один триггер",
|
||||
"please_upgrade_your_plan": "Пожалуйста, обновите ваш тарифный план",
|
||||
"please_upgrade_your_plan": "Пожалуйста, обновите ваш тарифный план.",
|
||||
"preview": "Предпросмотр",
|
||||
"preview_survey": "Предпросмотр опроса",
|
||||
"privacy": "Политика конфиденциальности",
|
||||
@@ -781,26 +783,20 @@
|
||||
"add_webhook": "Добавить webhook",
|
||||
"add_webhook_description": "Отправляйте данные ответов на опрос на пользовательский endpoint",
|
||||
"all_current_and_new_surveys": "Все текущие и новые опросы",
|
||||
"copy_secret_now": "Скопируйте ваш секрет подписи",
|
||||
"created_by_third_party": "Создано сторонней организацией",
|
||||
"discord_webhook_not_supported": "В настоящее время webhooks Discord не поддерживаются.",
|
||||
"empty_webhook_message": "Ваши webhooks появятся здесь, как только вы их добавите. ⏲️",
|
||||
"endpoint_pinged": "Ура! Нам удалось отправить ping на webhook!",
|
||||
"endpoint_pinged_error": "Не удалось отправить ping на webhook!",
|
||||
"learn_to_verify": "Узнайте, как проверить подписи вебхуков",
|
||||
"please_check_console": "Пожалуйста, проверьте консоль для получения подробностей",
|
||||
"please_enter_a_url": "Пожалуйста, введите URL",
|
||||
"response_created": "Ответ создан",
|
||||
"response_finished": "Ответ завершён",
|
||||
"response_updated": "Ответ обновлён",
|
||||
"secret_copy_warning": "Храните этот секрет в надёжном месте. Вы сможете просмотреть его снова в настройках webhook.",
|
||||
"secret_description": "Используйте этот секрет для проверки запросов webhook. Подробнее о проверке подписи — в документации.",
|
||||
"signing_secret": "Секрет подписи",
|
||||
"source": "Источник",
|
||||
"test_endpoint": "Тестировать endpoint",
|
||||
"triggers": "Триггеры",
|
||||
"webhook_added_successfully": "Webhook успешно добавлен",
|
||||
"webhook_created": "Webhook создан",
|
||||
"webhook_delete_confirmation": "Вы уверены, что хотите удалить этот webhook? Это прекратит отправку вам любых дальнейших уведомлений.",
|
||||
"webhook_deleted_successfully": "Webhook успешно удалён",
|
||||
"webhook_name_placeholder": "Необязательно: дайте метку вашему webhook для удобной идентификации",
|
||||
@@ -1163,6 +1159,7 @@
|
||||
"adjust_survey_closed_message_description": "Измените сообщение, которое видят посетители, когда опрос закрыт.",
|
||||
"adjust_the_theme_in_the": "Настройте тему в",
|
||||
"all_other_answers_will_continue_to": "Все остальные ответы будут продолжать",
|
||||
"allow_file_type": "Разрешить тип файла",
|
||||
"allow_multi_select": "Разрешить множественный выбор",
|
||||
"allow_multiple_files": "Разрешить несколько файлов",
|
||||
"allow_users_to_select_more_than_one_image": "Разрешить пользователям выбирать более одного изображения",
|
||||
@@ -1193,8 +1190,6 @@
|
||||
"cal_username": "Имя пользователя Cal.com или username/event",
|
||||
"calculate": "Вычислить",
|
||||
"capture_a_new_action_to_trigger_a_survey_on": "Захватить новое действие для запуска опроса.",
|
||||
"capture_ip_address": "Сохранять IP-адрес",
|
||||
"capture_ip_address_description": "Сохранять IP-адрес респондента в метаданных ответа для обнаружения дубликатов и обеспечения безопасности",
|
||||
"capture_new_action": "Захватить новое действие",
|
||||
"card_arrangement_for_survey_type_derived": "Расположение карточек для опросов типа {surveyTypeDerived}",
|
||||
"card_background_color": "Цвет фона карточки",
|
||||
@@ -1225,6 +1220,8 @@
|
||||
"change_the_question_color_of_the_survey": "Изменить цвет вопросов в опросе.",
|
||||
"changes_saved": "Изменения сохранены.",
|
||||
"changing_survey_type_will_remove_existing_distribution_channels": "Изменение типа опроса повлияет на способы его распространения. Если у респондентов уже есть ссылки для доступа к текущему типу, после смены они могут потерять доступ.",
|
||||
"character_limit_toggle_description": "Ограничьте минимальную и максимальную длину ответа.",
|
||||
"character_limit_toggle_title": "Добавить ограничения на количество символов",
|
||||
"checkbox_label": "Метка флажка",
|
||||
"choose_the_actions_which_trigger_the_survey": "Выберите действия, которые запускают опрос.",
|
||||
"choose_the_first_question_on_your_block": "Выберите первый вопрос в вашем блоке",
|
||||
@@ -1244,6 +1241,7 @@
|
||||
"contact_fields": "Поля контакта",
|
||||
"contains": "Содержит",
|
||||
"continue_to_settings": "Перейти к настройкам",
|
||||
"control_which_file_types_can_be_uploaded": "Управляйте типами файлов, которые можно загружать.",
|
||||
"convert_to_multiple_choice": "Преобразовать в мультивыбор",
|
||||
"convert_to_single_choice": "Преобразовать в одиночный выбор",
|
||||
"country": "Страна",
|
||||
@@ -1360,7 +1358,7 @@
|
||||
"hide_question_settings": "Скрыть настройки вопроса",
|
||||
"hostname": "Имя хоста",
|
||||
"how_funky_do_you_want_your_cards_in_survey_type_derived_surveys": "Насколько необычными вы хотите сделать карточки в опросах типа {surveyTypeDerived}",
|
||||
"if_you_need_more_please": "Если вам нужно больше, пожалуйста",
|
||||
"if_you_need_more_please": "Если нужно больше, пожалуйста",
|
||||
"if_you_really_want_that_answer_ask_until_you_get_it": "Показывать каждый раз при срабатывании, пока не будет получен ответ.",
|
||||
"ignore_global_waiting_time": "Игнорировать период ожидания",
|
||||
"ignore_global_waiting_time_description": "Этот опрос может отображаться при выполнении условий, даже если недавно уже был показан другой опрос.",
|
||||
@@ -1397,7 +1395,8 @@
|
||||
"key": "Ключ",
|
||||
"last_name": "Фамилия",
|
||||
"let_people_upload_up_to_25_files_at_the_same_time": "Разрешить загружать до 25 файлов одновременно.",
|
||||
"limit_the_maximum_file_size": "Ограничьте максимальный размер загружаемых файлов.",
|
||||
"limit_file_types": "Ограничить типы файлов",
|
||||
"limit_the_maximum_file_size": "Ограничить максимальный размер файла",
|
||||
"limit_upload_file_size_to": "Ограничить размер загружаемого файла до",
|
||||
"link_survey_description": "Поделитесь ссылкой на страницу опроса или вставьте её на веб-страницу или в электронное письмо.",
|
||||
"load_segment": "Загрузить сегмент",
|
||||
@@ -1443,6 +1442,7 @@
|
||||
"picture_idx": "Изображение {idx}",
|
||||
"pin_can_only_contain_numbers": "PIN-код может содержать только цифры.",
|
||||
"pin_must_be_a_four_digit_number": "PIN-код должен состоять из четырёх цифр.",
|
||||
"please_enter_a_file_extension": "Пожалуйста, введите расширение файла.",
|
||||
"please_enter_a_valid_url": "Пожалуйста, введите корректный URL (например, https://example.com)",
|
||||
"please_set_a_survey_trigger": "Пожалуйста, установите триггер опроса",
|
||||
"please_specify": "Пожалуйста, уточните",
|
||||
@@ -1520,7 +1520,6 @@
|
||||
"search_for_images": "Поиск изображений",
|
||||
"seconds_after_trigger_the_survey_will_be_closed_if_no_response": "секунд после запуска — опрос будет закрыт, если не будет ответа",
|
||||
"seconds_before_showing_the_survey": "секунд до показа опроса.",
|
||||
"select_field": "Выберите поле",
|
||||
"select_or_type_value": "Выберите или введите значение",
|
||||
"select_ordering": "Выберите порядок",
|
||||
"select_saved_action": "Выберите сохранённое действие",
|
||||
@@ -1568,6 +1567,8 @@
|
||||
"the_survey_will_be_shown_once_even_if_person_doesnt_respond": "Показать один раз, даже если не будет ответа.",
|
||||
"then": "Затем",
|
||||
"this_action_will_remove_all_the_translations_from_this_survey": "Это действие удалит все переводы из этого опроса.",
|
||||
"this_extension_is_already_added": "Это расширение уже добавлено.",
|
||||
"this_file_type_is_not_supported": "Этот тип файла не поддерживается.",
|
||||
"three_points": "3 балла",
|
||||
"times": "раз",
|
||||
"to_keep_the_placement_over_all_surveys_consistent_you_can": "Чтобы сохранить единое расположение во всех опросах, вы можете",
|
||||
@@ -1588,42 +1589,6 @@
|
||||
"upper_label": "Верхняя метка",
|
||||
"url_filters": "Фильтры URL",
|
||||
"url_not_supported": "URL не поддерживается",
|
||||
"validation": {
|
||||
"characters": "Символы",
|
||||
"contains": "Содержит",
|
||||
"does_not_contain": "Не содержит",
|
||||
"email": "Корректный email",
|
||||
"file_extension_is": "Расширение файла —",
|
||||
"file_extension_is_not": "Расширение файла не является",
|
||||
"is": "Является",
|
||||
"is_between": "Находится между",
|
||||
"is_earlier_than": "Ранее чем",
|
||||
"is_greater_than": "Больше чем",
|
||||
"is_later_than": "Позже чем",
|
||||
"is_less_than": "Меньше чем",
|
||||
"is_not": "Не является",
|
||||
"is_not_between": "Не находится между",
|
||||
"kb": "КБ",
|
||||
"max_length": "Не более",
|
||||
"max_selections": "Не более",
|
||||
"max_value": "Не более",
|
||||
"mb": "МБ",
|
||||
"min_length": "Не менее",
|
||||
"min_selections": "Не менее",
|
||||
"min_value": "Не менее",
|
||||
"minimum_options_ranked": "Минимальное количество ранжированных вариантов",
|
||||
"minimum_rows_answered": "Минимальное количество заполненных строк",
|
||||
"options_selected": "Выбранные опции",
|
||||
"pattern": "Соответствует шаблону regex",
|
||||
"phone": "Корректный телефон",
|
||||
"rank_all_options": "Ранжируйте все опции",
|
||||
"select_file_extensions": "Выберите расширения файлов...",
|
||||
"url": "Корректный URL"
|
||||
},
|
||||
"validation_logic_and": "Все условия выполняются",
|
||||
"validation_logic_or": "выполняется хотя бы одно условие",
|
||||
"validation_rules": "Правила валидации",
|
||||
"validation_rules_description": "Принимать только ответы, соответствующие следующим критериям",
|
||||
"variable_is_used_in_logic_of_question_please_remove_it_from_logic_first": "{variable} используется в логике вопроса {questionIndex}. Пожалуйста, сначала удалите его из логики.",
|
||||
"variable_is_used_in_quota_please_remove_it_from_quota_first": "Переменная «{variableName}» используется в квоте «{quotaName}»",
|
||||
"variable_name_is_already_taken_please_choose_another": "Это имя переменной уже занято, выберите другое.",
|
||||
@@ -1681,7 +1646,6 @@
|
||||
"error_downloading_responses": "Произошла ошибка при загрузке ответов",
|
||||
"first_name": "Имя",
|
||||
"how_to_identify_users": "Как идентифицировать пользователей",
|
||||
"ip_address": "IP-адрес",
|
||||
"last_name": "Фамилия",
|
||||
"not_completed": "Не завершено ⏳",
|
||||
"os": "ОС",
|
||||
@@ -1726,22 +1690,6 @@
|
||||
"url_encryption_description": "Отключайте только если нужно задать собственный одноразовый ID.",
|
||||
"url_encryption_label": "Шифрование URL для одноразового ID"
|
||||
},
|
||||
"custom_html": {
|
||||
"add_mode_description": "Скрипты опроса будут выполняться дополнительно к скриптам на уровне рабочего пространства.",
|
||||
"add_to_workspace": "Добавить к скриптам рабочего пространства",
|
||||
"description": "Добавьте трекинговые скрипты и пиксели в этот опрос",
|
||||
"nav_title": "Пользовательский HTML",
|
||||
"no_workspace_scripts": "Скрипты на уровне рабочего пространства не настроены. Вы можете добавить их в настройках рабочего пространства → Общие.",
|
||||
"placeholder": "<!-- Вставьте сюда ваши трекинговые скрипты -->\n<script>\n // Google Tag Manager, Analytics и др.\n</script>",
|
||||
"replace_mode_description": "Будут выполняться только скрипты опроса. Скрипты рабочего пространства будут проигнорированы. Оставьте пустым, чтобы не загружать скрипты.",
|
||||
"replace_workspace": "Заменить скрипты рабочего пространства",
|
||||
"saved_successfully": "Пользовательские скрипты успешно сохранены",
|
||||
"script_mode": "Режим скриптов",
|
||||
"security_warning": "Скрипты выполняются с полным доступом к браузеру. Добавляйте только скрипты из доверенных источников.",
|
||||
"survey_scripts_description": "Добавьте пользовательский HTML для внедрения в <head> этой страницы опроса.",
|
||||
"survey_scripts_label": "Скрипты, специфичные для опроса",
|
||||
"workspace_scripts_label": "Скрипты рабочего пространства (унаследованные)"
|
||||
},
|
||||
"dynamic_popup": {
|
||||
"alert_button": "Редактировать опрос",
|
||||
"alert_description": "Этот опрос сейчас настроен как опрос по ссылке, что не поддерживает динамические pop-up окна. Вы можете изменить это на вкладке настроек редактора опроса.",
|
||||
@@ -1981,13 +1929,6 @@
|
||||
},
|
||||
"general": {
|
||||
"cannot_delete_only_workspace": "Это ваш единственный рабочий проект, его нельзя удалить. Сначала создайте новый проект.",
|
||||
"custom_scripts": "Пользовательские скрипты",
|
||||
"custom_scripts_card_description": "Добавьте трекинговые скрипты и пиксели ко всем опросам по ссылке в этом рабочем пространстве.",
|
||||
"custom_scripts_description": "Скрипты будут внедряться в <head> всех страниц опросов по ссылке.",
|
||||
"custom_scripts_label": "HTML-скрипты",
|
||||
"custom_scripts_placeholder": "<!-- Вставьте сюда ваши трекинговые скрипты -->\n<script>\n // Google Tag Manager, Analytics и др.\n</script>",
|
||||
"custom_scripts_updated_successfully": "Пользовательские скрипты успешно обновлены",
|
||||
"custom_scripts_warning": "Скрипты выполняются с полным доступом к браузеру. Добавляйте только скрипты из доверенных источников.",
|
||||
"delete_workspace": "Удалить рабочий проект",
|
||||
"delete_workspace_confirmation": "Вы уверены, что хотите удалить {projectName}? Это действие необратимо.",
|
||||
"delete_workspace_name_includes_surveys_responses_people_and_more": "Удалить {projectName} вместе со всеми опросами, ответами, пользователями, действиями и атрибутами.",
|
||||
|
||||
+16
-75
@@ -197,7 +197,6 @@
|
||||
"docs": "Dokumentation",
|
||||
"documentation": "Dokumentation",
|
||||
"domain": "Domän",
|
||||
"done": "Klar",
|
||||
"download": "Ladda ner",
|
||||
"draft": "Utkast",
|
||||
"duplicate": "Duplicera",
|
||||
@@ -239,6 +238,7 @@
|
||||
"imprint": "Impressum",
|
||||
"in_progress": "Pågående",
|
||||
"inactive_surveys": "Inaktiva enkäter",
|
||||
"input_type": "Inmatningstyp",
|
||||
"integration": "integration",
|
||||
"integrations": "Integrationer",
|
||||
"invalid_date": "Ogiltigt datum",
|
||||
@@ -262,11 +262,13 @@
|
||||
"look_and_feel": "Utseende",
|
||||
"manage": "Hantera",
|
||||
"marketing": "Marknadsföring",
|
||||
"maximum": "Maximum",
|
||||
"member": "Medlem",
|
||||
"members": "Medlemmar",
|
||||
"members_and_teams": "Medlemmar och team",
|
||||
"membership_not_found": "Medlemskap hittades inte",
|
||||
"metadata": "Metadata",
|
||||
"minimum": "Minimum",
|
||||
"mobile_overlay_app_works_best_on_desktop": "Formbricks fungerar bäst på en större skärm. Byt till en annan enhet för att hantera eller bygga enkäter.",
|
||||
"mobile_overlay_surveys_look_good": "Oroa dig inte – dina enkäter ser bra ut på alla enheter och skärmstorlekar!",
|
||||
"mobile_overlay_title": "Hoppsan, liten skärm upptäckt!",
|
||||
@@ -319,7 +321,7 @@
|
||||
"placeholder": "Platshållare",
|
||||
"please_select_at_least_one_survey": "Vänligen välj minst en enkät",
|
||||
"please_select_at_least_one_trigger": "Vänligen välj minst en utlösare",
|
||||
"please_upgrade_your_plan": "Vänligen uppgradera din plan",
|
||||
"please_upgrade_your_plan": "Vänligen uppgradera din plan.",
|
||||
"preview": "Förhandsgranska",
|
||||
"preview_survey": "Förhandsgranska enkät",
|
||||
"privacy": "Integritetspolicy",
|
||||
@@ -781,26 +783,20 @@
|
||||
"add_webhook": "Lägg till webhook",
|
||||
"add_webhook_description": "Skicka enkätsvardata till en anpassad endpoint",
|
||||
"all_current_and_new_surveys": "Alla nuvarande och nya enkäter",
|
||||
"copy_secret_now": "Kopiera din signeringsnyckel",
|
||||
"created_by_third_party": "Skapad av tredje part",
|
||||
"discord_webhook_not_supported": "Discord-webhooks stöds för närvarande inte.",
|
||||
"empty_webhook_message": "Dina webhooks visas här så snart du lägger till dem. ⏲️",
|
||||
"endpoint_pinged": "Ja! Vi kan nå webhooken!",
|
||||
"endpoint_pinged_error": "Kunde inte nå webhooken!",
|
||||
"learn_to_verify": "Lär dig hur du verifierar webhook-signaturer",
|
||||
"please_check_console": "Vänligen kontrollera konsolen för mer information",
|
||||
"please_enter_a_url": "Vänligen ange en URL",
|
||||
"response_created": "Svar skapat",
|
||||
"response_finished": "Svar slutfört",
|
||||
"response_updated": "Svar uppdaterat",
|
||||
"secret_copy_warning": "Förvara denna nyckel säkert. Du kan visa den igen i webhook-inställningarna.",
|
||||
"secret_description": "Använd denna nyckel för att verifiera webhook-förfrågningar. Se dokumentationen för signaturverifiering.",
|
||||
"signing_secret": "Signeringsnyckel",
|
||||
"source": "Källa",
|
||||
"test_endpoint": "Testa endpoint",
|
||||
"triggers": "Utlösare",
|
||||
"webhook_added_successfully": "Webhook tillagd",
|
||||
"webhook_created": "Webhook skapad",
|
||||
"webhook_delete_confirmation": "Är du säker på att du vill ta bort denna webhook? Detta kommer att stoppa alla ytterligare notifieringar.",
|
||||
"webhook_deleted_successfully": "Webhook borttagen",
|
||||
"webhook_name_placeholder": "Valfritt: Namnge din webhook för enkel identifiering",
|
||||
@@ -1163,6 +1159,7 @@
|
||||
"adjust_survey_closed_message_description": "Ändra meddelandet besökare ser när enkäten är stängd.",
|
||||
"adjust_the_theme_in_the": "Justera temat i",
|
||||
"all_other_answers_will_continue_to": "Alla andra svar fortsätter till",
|
||||
"allow_file_type": "Tillåt filtyp",
|
||||
"allow_multi_select": "Tillåt flerval",
|
||||
"allow_multiple_files": "Tillåt flera filer",
|
||||
"allow_users_to_select_more_than_one_image": "Tillåt användare att välja mer än en bild",
|
||||
@@ -1193,8 +1190,6 @@
|
||||
"cal_username": "Cal.com-användarnamn eller användarnamn/händelse",
|
||||
"calculate": "Beräkna",
|
||||
"capture_a_new_action_to_trigger_a_survey_on": "Fånga en ny åtgärd att utlösa en enkät på.",
|
||||
"capture_ip_address": "Registrera IP-adress",
|
||||
"capture_ip_address_description": "Spara respondentens IP-adress i svarsmetadatan för att upptäcka dubbletter och av säkerhetsskäl",
|
||||
"capture_new_action": "Fånga ny åtgärd",
|
||||
"card_arrangement_for_survey_type_derived": "Kortarrangemang för {surveyTypeDerived}-enkäter",
|
||||
"card_background_color": "Kortets bakgrundsfärg",
|
||||
@@ -1225,6 +1220,8 @@
|
||||
"change_the_question_color_of_the_survey": "Ändra enkätens frågefärg.",
|
||||
"changes_saved": "Ändringar sparade.",
|
||||
"changing_survey_type_will_remove_existing_distribution_channels": "Att ändra enkättypen påverkar hur den kan delas. Om respondenter redan har åtkomstlänkar för den nuvarande typen kan de förlora åtkomst efter bytet.",
|
||||
"character_limit_toggle_description": "Begränsa hur kort eller långt ett svar kan vara.",
|
||||
"character_limit_toggle_title": "Lägg till teckengränser",
|
||||
"checkbox_label": "Kryssruteetikett",
|
||||
"choose_the_actions_which_trigger_the_survey": "Välj de åtgärder som utlöser enkäten.",
|
||||
"choose_the_first_question_on_your_block": "Välj den första frågan i ditt block",
|
||||
@@ -1244,6 +1241,7 @@
|
||||
"contact_fields": "Kontaktfält",
|
||||
"contains": "Innehåller",
|
||||
"continue_to_settings": "Fortsätt till inställningar",
|
||||
"control_which_file_types_can_be_uploaded": "Kontrollera vilka filtyper som kan laddas upp.",
|
||||
"convert_to_multiple_choice": "Konvertera till flerval",
|
||||
"convert_to_single_choice": "Konvertera till enkelval",
|
||||
"country": "Land",
|
||||
@@ -1360,7 +1358,7 @@
|
||||
"hide_question_settings": "Dölj frågeinställningar",
|
||||
"hostname": "Värdnamn",
|
||||
"how_funky_do_you_want_your_cards_in_survey_type_derived_surveys": "Hur coola vill du att dina kort ska vara i {surveyTypeDerived}-enkäter",
|
||||
"if_you_need_more_please": "Om du behöver mer, vänligen",
|
||||
"if_you_need_more_please": "Om du behöver fler, vänligen",
|
||||
"if_you_really_want_that_answer_ask_until_you_get_it": "Fortsätt visa när villkoren är uppfyllda tills ett svar skickas in.",
|
||||
"ignore_global_waiting_time": "Ignorera väntetid",
|
||||
"ignore_global_waiting_time_description": "Denna enkät kan visas när dess villkor är uppfyllda, även om en annan enkät nyligen visats.",
|
||||
@@ -1397,8 +1395,9 @@
|
||||
"key": "Nyckel",
|
||||
"last_name": "Efternamn",
|
||||
"let_people_upload_up_to_25_files_at_the_same_time": "Låt personer ladda upp upp till 25 filer samtidigt.",
|
||||
"limit_the_maximum_file_size": "Begränsa den maximala filstorleken för uppladdningar.",
|
||||
"limit_upload_file_size_to": "Begränsa uppladdad filstorlek till",
|
||||
"limit_file_types": "Begränsa filtyper",
|
||||
"limit_the_maximum_file_size": "Begränsa maximal filstorlek",
|
||||
"limit_upload_file_size_to": "Begränsa uppladdningsfilstorlek till",
|
||||
"link_survey_description": "Dela en länk till en enkätsida eller bädda in den på en webbsida eller i e-post.",
|
||||
"load_segment": "Ladda segment",
|
||||
"logic_error_warning": "Ändring kommer att orsaka logikfel",
|
||||
@@ -1411,7 +1410,7 @@
|
||||
"matrix_all_fields": "Alla fält",
|
||||
"matrix_rows": "Rader",
|
||||
"max_file_size": "Max filstorlek",
|
||||
"max_file_size_limit_is": "Maximal filstorleksgräns är",
|
||||
"max_file_size_limit_is": "Maxgräns för filstorlek är",
|
||||
"move_question_to_block": "Flytta fråga till block",
|
||||
"multiply": "Multiplicera *",
|
||||
"needed_for_self_hosted_cal_com_instance": "Behövs för en självhostad Cal.com-instans",
|
||||
@@ -1443,6 +1442,7 @@
|
||||
"picture_idx": "Bild {idx}",
|
||||
"pin_can_only_contain_numbers": "PIN kan endast innehålla siffror.",
|
||||
"pin_must_be_a_four_digit_number": "PIN måste vara ett fyrsiffrigt nummer.",
|
||||
"please_enter_a_file_extension": "Vänligen ange en filändelse.",
|
||||
"please_enter_a_valid_url": "Vänligen ange en giltig URL (t.ex. https://example.com)",
|
||||
"please_set_a_survey_trigger": "Vänligen ställ in en enkätutlösare",
|
||||
"please_specify": "Vänligen specificera",
|
||||
@@ -1520,7 +1520,6 @@
|
||||
"search_for_images": "Sök efter bilder",
|
||||
"seconds_after_trigger_the_survey_will_be_closed_if_no_response": "sekunder efter utlösning stängs enkäten om inget svar",
|
||||
"seconds_before_showing_the_survey": "sekunder innan enkäten visas.",
|
||||
"select_field": "Välj fält",
|
||||
"select_or_type_value": "Välj eller skriv värde",
|
||||
"select_ordering": "Välj ordning",
|
||||
"select_saved_action": "Välj sparad åtgärd",
|
||||
@@ -1568,6 +1567,8 @@
|
||||
"the_survey_will_be_shown_once_even_if_person_doesnt_respond": "Visa en enda gång, även om de inte svarar.",
|
||||
"then": "Sedan",
|
||||
"this_action_will_remove_all_the_translations_from_this_survey": "Denna åtgärd kommer att ta bort alla översättningar från denna enkät.",
|
||||
"this_extension_is_already_added": "Denna filändelse är redan tillagd.",
|
||||
"this_file_type_is_not_supported": "Denna filtyp stöds inte.",
|
||||
"three_points": "3 poäng",
|
||||
"times": "gånger",
|
||||
"to_keep_the_placement_over_all_surveys_consistent_you_can": "För att hålla placeringen konsekvent över alla enkäter kan du",
|
||||
@@ -1588,42 +1589,6 @@
|
||||
"upper_label": "Övre etikett",
|
||||
"url_filters": "URL-filter",
|
||||
"url_not_supported": "URL stöds inte",
|
||||
"validation": {
|
||||
"characters": "Tecken",
|
||||
"contains": "Innehåller",
|
||||
"does_not_contain": "Innehåller inte",
|
||||
"email": "Är en giltig e-postadress",
|
||||
"file_extension_is": "Filändelsen är",
|
||||
"file_extension_is_not": "Filändelsen är inte",
|
||||
"is": "Är",
|
||||
"is_between": "Är mellan",
|
||||
"is_earlier_than": "Är tidigare än",
|
||||
"is_greater_than": "Är större än",
|
||||
"is_later_than": "Är senare än",
|
||||
"is_less_than": "Är mindre än",
|
||||
"is_not": "Är inte",
|
||||
"is_not_between": "Är inte mellan",
|
||||
"kb": "KB",
|
||||
"max_length": "Högst",
|
||||
"max_selections": "Högst",
|
||||
"max_value": "Högst",
|
||||
"mb": "MB",
|
||||
"min_length": "Minst",
|
||||
"min_selections": "Minst",
|
||||
"min_value": "Minst",
|
||||
"minimum_options_ranked": "Minsta antal rangordnade alternativ",
|
||||
"minimum_rows_answered": "Minsta antal besvarade rader",
|
||||
"options_selected": "Valda alternativ",
|
||||
"pattern": "Matchar regexmönster",
|
||||
"phone": "Är ett giltigt telefonnummer",
|
||||
"rank_all_options": "Rangordna alla alternativ",
|
||||
"select_file_extensions": "Välj filändelser...",
|
||||
"url": "Är en giltig URL"
|
||||
},
|
||||
"validation_logic_and": "Alla är sanna",
|
||||
"validation_logic_or": "någon är sann",
|
||||
"validation_rules": "Valideringsregler",
|
||||
"validation_rules_description": "Acceptera endast svar som uppfyller följande kriterier",
|
||||
"variable_is_used_in_logic_of_question_please_remove_it_from_logic_first": "{variable} används i logiken för fråga {questionIndex}. Vänligen ta bort den från logiken först.",
|
||||
"variable_is_used_in_quota_please_remove_it_from_quota_first": "Variabel \"{variableName}\" används i kvoten \"{quotaName}\"",
|
||||
"variable_name_is_already_taken_please_choose_another": "Variabelnamnet är redan taget, vänligen välj ett annat.",
|
||||
@@ -1681,7 +1646,6 @@
|
||||
"error_downloading_responses": "Ett fel uppstod vid nedladdning av svar",
|
||||
"first_name": "Förnamn",
|
||||
"how_to_identify_users": "Hur man identifierar användare",
|
||||
"ip_address": "IP-adress",
|
||||
"last_name": "Efternamn",
|
||||
"not_completed": "Inte slutförd ⏳",
|
||||
"os": "OS",
|
||||
@@ -1726,22 +1690,6 @@
|
||||
"url_encryption_description": "Inaktivera endast om du behöver ange ett anpassat engångs-ID.",
|
||||
"url_encryption_label": "URL-kryptering av engångs-ID"
|
||||
},
|
||||
"custom_html": {
|
||||
"add_mode_description": "Undersökningsskript kommer att köras utöver arbetsytans skript.",
|
||||
"add_to_workspace": "Lägg till i arbetsytans skript",
|
||||
"description": "Lägg till spårningsskript och pixlar i denna undersökning",
|
||||
"nav_title": "Anpassad HTML",
|
||||
"no_workspace_scripts": "Inga arbetsytans skript har konfigurerats. Du kan lägga till dem i Arbetsytans inställningar → Allmänt.",
|
||||
"placeholder": "<!-- Klistra in dina spårningsskript här -->\n<script>\n // Google Tag Manager, Analytics, etc.\n</script>",
|
||||
"replace_mode_description": "Endast undersökningsskript kommer att köras. Arbetsytans skript ignoreras. Lämna tomt för att inte ladda några skript.",
|
||||
"replace_workspace": "Ersätt arbetsytans skript",
|
||||
"saved_successfully": "Anpassade skript har sparats",
|
||||
"script_mode": "Skriptläge",
|
||||
"security_warning": "Skript körs med full åtkomst till webbläsaren. Lägg endast till skript från betrodda källor.",
|
||||
"survey_scripts_description": "Lägg till anpassad HTML för att injicera i <head> på denna undersökningssida.",
|
||||
"survey_scripts_label": "Undersökningsspecifika skript",
|
||||
"workspace_scripts_label": "Arbetsytans skript (ärvda)"
|
||||
},
|
||||
"dynamic_popup": {
|
||||
"alert_button": "Redigera enkät",
|
||||
"alert_description": "Denna enkät är för närvarande konfigurerad som en länkenkät, vilket inte stöder dynamiska popup-fönster. Du kan ändra detta i inställningsfliken i enkätredigeraren.",
|
||||
@@ -1981,13 +1929,6 @@
|
||||
},
|
||||
"general": {
|
||||
"cannot_delete_only_workspace": "Detta är din enda arbetsyta, den kan inte tas bort. Skapa först en ny arbetsyta.",
|
||||
"custom_scripts": "Anpassade skript",
|
||||
"custom_scripts_card_description": "Lägg till spårningsskript och pixlar i alla länkundersökningar i denna arbetsyta.",
|
||||
"custom_scripts_description": "Skript kommer att injiceras i <head> på alla länkundersökningssidor.",
|
||||
"custom_scripts_label": "HTML-skript",
|
||||
"custom_scripts_placeholder": "<!-- Klistra in dina spårningsskript här -->\n<script>\n // Google Tag Manager, Analytics, etc.\n</script>",
|
||||
"custom_scripts_updated_successfully": "Anpassade skript har uppdaterats",
|
||||
"custom_scripts_warning": "Skript körs med full åtkomst till webbläsaren. Lägg endast till skript från betrodda källor.",
|
||||
"delete_workspace": "Ta bort arbetsyta",
|
||||
"delete_workspace_confirmation": "Är du säker på att du vill ta bort {projectName}? Denna åtgärd kan inte ångras.",
|
||||
"delete_workspace_name_includes_surveys_responses_people_and_more": "Ta bort {projectName} inkl. alla enkäter, svar, personer, åtgärder och attribut.",
|
||||
|
||||
@@ -197,7 +197,6 @@
|
||||
"docs": "文档",
|
||||
"documentation": "文档",
|
||||
"domain": "域名",
|
||||
"done": "完成",
|
||||
"download": "下载",
|
||||
"draft": "草稿",
|
||||
"duplicate": "复制",
|
||||
@@ -239,6 +238,7 @@
|
||||
"imprint": "印记",
|
||||
"in_progress": "进行中",
|
||||
"inactive_surveys": "不 活跃 调查",
|
||||
"input_type": "输入类型",
|
||||
"integration": "集成",
|
||||
"integrations": "集成",
|
||||
"invalid_date": "无效 日期",
|
||||
@@ -262,11 +262,13 @@
|
||||
"look_and_feel": "外观 & 感觉",
|
||||
"manage": "管理",
|
||||
"marketing": "市场营销",
|
||||
"maximum": "最大值",
|
||||
"member": "成员",
|
||||
"members": "成员",
|
||||
"members_and_teams": "成员和团队",
|
||||
"membership_not_found": "未找到会员资格",
|
||||
"metadata": "元数据",
|
||||
"minimum": "最低",
|
||||
"mobile_overlay_app_works_best_on_desktop": "Formbricks 在 更大 的 屏幕 上 效果 最佳。 若 需要 管理 或 构建 调查, 请 切换 到 其他 设备。",
|
||||
"mobile_overlay_surveys_look_good": "别 担心 – 您 的 调查 在 每 一 种 设备 和 屏幕 尺寸 上 看起来 都 很 棒!",
|
||||
"mobile_overlay_title": "噢, 检测 到 小 屏幕!",
|
||||
@@ -319,7 +321,7 @@
|
||||
"placeholder": "占位符",
|
||||
"please_select_at_least_one_survey": "请选择至少 一个调查",
|
||||
"please_select_at_least_one_trigger": "请选择至少 一个触发条件",
|
||||
"please_upgrade_your_plan": "请升级您的计划",
|
||||
"please_upgrade_your_plan": "请 升级 您的 计划。",
|
||||
"preview": "预览",
|
||||
"preview_survey": "预览 Survey",
|
||||
"privacy": "隐私政策",
|
||||
@@ -781,26 +783,20 @@
|
||||
"add_webhook": "添加 Webhook",
|
||||
"add_webhook_description": "发送 调查 响应 数据 到 自定义 端点",
|
||||
"all_current_and_new_surveys": "所有 当前 和 新的 调查",
|
||||
"copy_secret_now": "复制您的签名密钥",
|
||||
"created_by_third_party": "由 第三方 创建",
|
||||
"discord_webhook_not_supported": "Discord webhooks 目前不 支持。",
|
||||
"empty_webhook_message": "您的 Webhooks 会在您 添加 后 出现在这里。 ⏲️",
|
||||
"endpoint_pinged": "太好了! 我们能 ping 该 webhook!",
|
||||
"endpoint_pinged_error": "无法 ping 该 webhook!",
|
||||
"learn_to_verify": "了解如何验证 webhook 签名",
|
||||
"please_check_console": "请查看控制台以获取更多详情",
|
||||
"please_enter_a_url": "请输入一个 URL",
|
||||
"response_created": "创建 响应",
|
||||
"response_finished": "响应 完成",
|
||||
"response_updated": "更新 响应",
|
||||
"secret_copy_warning": "请妥善保存此密钥。您可以在 Webhook 设置中再次查看。",
|
||||
"secret_description": "使用此密钥验证 Webhook 请求。有关签名验证,请参阅文档。",
|
||||
"signing_secret": "签名密钥",
|
||||
"source": "来源",
|
||||
"test_endpoint": "测试 端点",
|
||||
"triggers": "触发器",
|
||||
"webhook_added_successfully": "Webhook 添加成功",
|
||||
"webhook_created": "Webhook 已创建",
|
||||
"webhook_delete_confirmation": "您 确定 要 删除 此 Webhook 吗?这 将 停止 向 您 发送 更多 通知 。",
|
||||
"webhook_deleted_successfully": "Webhook 删除 成功",
|
||||
"webhook_name_placeholder": "可选 : 为 您的 Webhook 标注 标签 以 便于 识别",
|
||||
@@ -1163,6 +1159,7 @@
|
||||
"adjust_survey_closed_message_description": "更改 访客 看到 调查 关闭 时 的 消息。",
|
||||
"adjust_the_theme_in_the": "调整主题在",
|
||||
"all_other_answers_will_continue_to": "所有其他答案将继续",
|
||||
"allow_file_type": "允许 文件类型",
|
||||
"allow_multi_select": "允许 多选",
|
||||
"allow_multiple_files": "允许 多 个 文件",
|
||||
"allow_users_to_select_more_than_one_image": "允许 用户 选择 多于 一个 图片",
|
||||
@@ -1193,8 +1190,6 @@
|
||||
"cal_username": "Cal.com 用户名 或 用户名/事件",
|
||||
"calculate": "计算",
|
||||
"capture_a_new_action_to_trigger_a_survey_on": "捕获一个新动作以触发调查。",
|
||||
"capture_ip_address": "记录IP地址",
|
||||
"capture_ip_address_description": "将答题者的IP地址存储在响应元数据中,用于重复检测和安全目的",
|
||||
"capture_new_action": "捕获 新动作",
|
||||
"card_arrangement_for_survey_type_derived": "{surveyTypeDerived} 调查 的 卡片 布局",
|
||||
"card_background_color": "卡片 的 背景 颜色",
|
||||
@@ -1225,6 +1220,8 @@
|
||||
"change_the_question_color_of_the_survey": "更改调查的 问题颜色",
|
||||
"changes_saved": "更改 已 保存",
|
||||
"changing_survey_type_will_remove_existing_distribution_channels": "更改 调查 类型 会影 响 分享 方式 。 如果 受访者 已经 拥有 当前 类型 的 访问 链接 , 在 更改 之后 ,他们 可能 会 失去 访问 权限 。",
|
||||
"character_limit_toggle_description": "限制 答案的短或长程度。",
|
||||
"character_limit_toggle_title": "添加 字符限制",
|
||||
"checkbox_label": "复选框 标签",
|
||||
"choose_the_actions_which_trigger_the_survey": "选择 触发 调查 的 动作 。",
|
||||
"choose_the_first_question_on_your_block": "选择区块中的第一个问题",
|
||||
@@ -1244,6 +1241,7 @@
|
||||
"contact_fields": "联络字段",
|
||||
"contains": "包含",
|
||||
"continue_to_settings": "继续 到 设置",
|
||||
"control_which_file_types_can_be_uploaded": "控制 可以 上传的 文件 类型",
|
||||
"convert_to_multiple_choice": "转换为 多选",
|
||||
"convert_to_single_choice": "转换为 单选",
|
||||
"country": "国家",
|
||||
@@ -1360,7 +1358,7 @@
|
||||
"hide_question_settings": "隐藏问题设置",
|
||||
"hostname": "主 机 名",
|
||||
"how_funky_do_you_want_your_cards_in_survey_type_derived_surveys": "在 {surveyTypeDerived} 调查 中,您 想要 卡片 多么 有趣",
|
||||
"if_you_need_more_please": "如果您需要更多,请",
|
||||
"if_you_need_more_please": "如果你需要更多,请",
|
||||
"if_you_really_want_that_answer_ask_until_you_get_it": "每次触发时都会显示,直到提交回应为止。",
|
||||
"ignore_global_waiting_time": "忽略冷却期",
|
||||
"ignore_global_waiting_time_description": "只要满足条件,此调查即可显示,即使最近刚显示过其他调查。",
|
||||
@@ -1397,8 +1395,9 @@
|
||||
"key": "键",
|
||||
"last_name": "姓",
|
||||
"let_people_upload_up_to_25_files_at_the_same_time": "允许 人们 同时 上传 最多 25 个 文件",
|
||||
"limit_the_maximum_file_size": "限制上传文件的最大大小。",
|
||||
"limit_upload_file_size_to": "将上传文件大小限制为",
|
||||
"limit_file_types": "限制 文件 类型",
|
||||
"limit_the_maximum_file_size": "限制 最大 文件 大小",
|
||||
"limit_upload_file_size_to": "将 上传 文件 大小 限制 为",
|
||||
"link_survey_description": "分享 问卷 页面 链接 或 将其 嵌入 网页 或 电子邮件 中。",
|
||||
"load_segment": "载入 段落",
|
||||
"logic_error_warning": "更改 将 导致 逻辑 错误",
|
||||
@@ -1410,8 +1409,8 @@
|
||||
"manage_languages": "管理 语言",
|
||||
"matrix_all_fields": "所有字段",
|
||||
"matrix_rows": "行",
|
||||
"max_file_size": "最大文件大小",
|
||||
"max_file_size_limit_is": "最大文件大小限制为",
|
||||
"max_file_size": "最大 文件 大小",
|
||||
"max_file_size_limit_is": "最大 文件 大小 限制 是",
|
||||
"move_question_to_block": "将问题移动到区块",
|
||||
"multiply": "乘 *",
|
||||
"needed_for_self_hosted_cal_com_instance": "需要用于 自建 Cal.com 实例",
|
||||
@@ -1443,6 +1442,7 @@
|
||||
"picture_idx": "图片 {idx}",
|
||||
"pin_can_only_contain_numbers": "PIN 只能包含数字。",
|
||||
"pin_must_be_a_four_digit_number": "PIN 必须是 四 位数字。",
|
||||
"please_enter_a_file_extension": "请输入 文件 扩展名。",
|
||||
"please_enter_a_valid_url": "请输入有效的 URL(例如, https://example.com )",
|
||||
"please_set_a_survey_trigger": "请 设置 一个 调查 触发",
|
||||
"please_specify": "请 指定",
|
||||
@@ -1520,7 +1520,6 @@
|
||||
"search_for_images": "搜索 图片",
|
||||
"seconds_after_trigger_the_survey_will_be_closed_if_no_response": "触发后 如果 没有 应答 将 在 几秒 后 关闭 调查",
|
||||
"seconds_before_showing_the_survey": "显示问卷前 几秒",
|
||||
"select_field": "选择字段",
|
||||
"select_or_type_value": "选择 或 输入 值",
|
||||
"select_ordering": "选择排序",
|
||||
"select_saved_action": "选择 保存的 操作",
|
||||
@@ -1568,6 +1567,8 @@
|
||||
"the_survey_will_be_shown_once_even_if_person_doesnt_respond": "仅显示一次,即使他们未回应。",
|
||||
"then": "然后",
|
||||
"this_action_will_remove_all_the_translations_from_this_survey": "此操作将删除该调查中的所有翻译。",
|
||||
"this_extension_is_already_added": "此扩展已经添加。",
|
||||
"this_file_type_is_not_supported": "此 文件 类型 不 支持。",
|
||||
"three_points": "3 分",
|
||||
"times": "次数",
|
||||
"to_keep_the_placement_over_all_surveys_consistent_you_can": "为了 保持 所有 调查 的 放置 一致,您 可以",
|
||||
@@ -1588,42 +1589,6 @@
|
||||
"upper_label": "上限标签",
|
||||
"url_filters": "URL 过滤器",
|
||||
"url_not_supported": "URL 不支持",
|
||||
"validation": {
|
||||
"characters": "字符",
|
||||
"contains": "包含",
|
||||
"does_not_contain": "不包含",
|
||||
"email": "是有效的邮箱地址",
|
||||
"file_extension_is": "文件扩展名为",
|
||||
"file_extension_is_not": "文件扩展名不是",
|
||||
"is": "等于",
|
||||
"is_between": "介于",
|
||||
"is_earlier_than": "早于",
|
||||
"is_greater_than": "大于",
|
||||
"is_later_than": "晚于",
|
||||
"is_less_than": "小于",
|
||||
"is_not": "不等于",
|
||||
"is_not_between": "不介于",
|
||||
"kb": "KB",
|
||||
"max_length": "最多",
|
||||
"max_selections": "最多",
|
||||
"max_value": "最多",
|
||||
"mb": "MB",
|
||||
"min_length": "至少",
|
||||
"min_selections": "至少",
|
||||
"min_value": "至少",
|
||||
"minimum_options_ranked": "最少排序选项数",
|
||||
"minimum_rows_answered": "最少回答行数",
|
||||
"options_selected": "已选择的选项",
|
||||
"pattern": "匹配正则表达式模式",
|
||||
"phone": "是有效的手机号",
|
||||
"rank_all_options": "对所有选项进行排序",
|
||||
"select_file_extensions": "选择文件扩展名...",
|
||||
"url": "是有效的URL"
|
||||
},
|
||||
"validation_logic_and": "全部为真",
|
||||
"validation_logic_or": "任一为真",
|
||||
"validation_rules": "校验规则",
|
||||
"validation_rules_description": "仅接受符合以下条件的回复",
|
||||
"variable_is_used_in_logic_of_question_please_remove_it_from_logic_first": "\"{variable} 在 问题 {questionIndex} 的 逻辑 中 使用。请 先 从 逻辑 中 删除 它。\"",
|
||||
"variable_is_used_in_quota_please_remove_it_from_quota_first": "变量 \"{variableName}\" 正在 被 \"{quotaName}\" 配额 使用",
|
||||
"variable_name_is_already_taken_please_choose_another": "变量名已被占用,请选择其他。",
|
||||
@@ -1681,7 +1646,6 @@
|
||||
"error_downloading_responses": "下载答复时发生错误",
|
||||
"first_name": "名字",
|
||||
"how_to_identify_users": "如何 识别 用户",
|
||||
"ip_address": "IP地址",
|
||||
"last_name": "姓",
|
||||
"not_completed": "未完成 ⏳",
|
||||
"os": "操作系统",
|
||||
@@ -1726,22 +1690,6 @@
|
||||
"url_encryption_description": "仅在 需要 设置 自定义 单次使用 ID 时 才 禁用。",
|
||||
"url_encryption_label": "单次 使用 ID 的 URL 加密"
|
||||
},
|
||||
"custom_html": {
|
||||
"add_mode_description": "调查脚本将在工作区级脚本的基础上运行。",
|
||||
"add_to_workspace": "添加到工作区脚本",
|
||||
"description": "为此调查添加跟踪脚本和像素代码",
|
||||
"nav_title": "自定义 HTML",
|
||||
"no_workspace_scripts": "尚未配置工作区级脚本。你可以在工作区设置 → 常规中添加。",
|
||||
"placeholder": "<!-- 在此粘贴你的跟踪脚本 -->\n<script>\n // Google Tag Manager、Analytics 等\n</script>",
|
||||
"replace_mode_description": "仅运行调查脚本,工作区脚本将被忽略。保持为空则不加载任何脚本。",
|
||||
"replace_workspace": "替换工作区脚本",
|
||||
"saved_successfully": "自定义脚本保存成功",
|
||||
"script_mode": "脚本模式",
|
||||
"security_warning": "脚本将以完整浏览器权限执行。请仅添加来自可信来源的脚本。",
|
||||
"survey_scripts_description": "添加自定义 HTML 注入到此调查页面的<head>中。",
|
||||
"survey_scripts_label": "调查专用脚本",
|
||||
"workspace_scripts_label": "工作区脚本(继承)"
|
||||
},
|
||||
"dynamic_popup": {
|
||||
"alert_button": "编辑 survey",
|
||||
"alert_description": "此 问卷 当前 配置 为 链接 问卷, 不 支持 动态 弹出 窗。 您 可以 在 问卷 编辑器 的 设置 选项 中 进行 修改。",
|
||||
@@ -1981,13 +1929,6 @@
|
||||
},
|
||||
"general": {
|
||||
"cannot_delete_only_workspace": "这是您唯一的工作区,无法删除。请先创建一个新工作区。",
|
||||
"custom_scripts": "自定义脚本",
|
||||
"custom_scripts_card_description": "为此工作区内所有链接调查添加跟踪脚本和像素代码。",
|
||||
"custom_scripts_description": "脚本将被注入到所有链接调查页面的<head>中。",
|
||||
"custom_scripts_label": "HTML 脚本",
|
||||
"custom_scripts_placeholder": "<!-- 在此粘贴你的跟踪脚本 -->\n<script>\n // Google Tag Manager、Analytics 等\n</script>",
|
||||
"custom_scripts_updated_successfully": "自定义脚本更新成功",
|
||||
"custom_scripts_warning": "脚本将以完整浏览器权限执行。请仅添加来自可信来源的脚本。",
|
||||
"delete_workspace": "删除工作区",
|
||||
"delete_workspace_confirmation": "您确定要删除 {projectName} 吗?此操作无法撤销。",
|
||||
"delete_workspace_name_includes_surveys_responses_people_and_more": "删除 {projectName},包括所有调查、回应、人员、动作和属性。",
|
||||
|
||||
@@ -197,7 +197,6 @@
|
||||
"docs": "文件",
|
||||
"documentation": "文件",
|
||||
"domain": "網域",
|
||||
"done": "完成",
|
||||
"download": "下載",
|
||||
"draft": "草稿",
|
||||
"duplicate": "複製",
|
||||
@@ -239,6 +238,7 @@
|
||||
"imprint": "版本訊息",
|
||||
"in_progress": "進行中",
|
||||
"inactive_surveys": "停用中的問卷",
|
||||
"input_type": "輸入類型",
|
||||
"integration": "整合",
|
||||
"integrations": "整合",
|
||||
"invalid_date": "無效日期",
|
||||
@@ -262,11 +262,13 @@
|
||||
"look_and_feel": "外觀與風格",
|
||||
"manage": "管理",
|
||||
"marketing": "行銷",
|
||||
"maximum": "最大值",
|
||||
"member": "成員",
|
||||
"members": "成員",
|
||||
"members_and_teams": "成員與團隊",
|
||||
"membership_not_found": "找不到成員資格",
|
||||
"metadata": "元數據",
|
||||
"minimum": "最小值",
|
||||
"mobile_overlay_app_works_best_on_desktop": "Formbricks 適合在大螢幕上使用。若要管理或建立問卷,請切換到其他裝置。",
|
||||
"mobile_overlay_surveys_look_good": "別擔心 -你的 問卷 在每個 裝置 和 螢幕尺寸 上 都 很出色!",
|
||||
"mobile_overlay_title": "糟糕 ,偵測到小螢幕!",
|
||||
@@ -319,7 +321,7 @@
|
||||
"placeholder": "提示文字",
|
||||
"please_select_at_least_one_survey": "請選擇至少一個問卷",
|
||||
"please_select_at_least_one_trigger": "請選擇至少一個觸發器",
|
||||
"please_upgrade_your_plan": "請升級您的方案",
|
||||
"please_upgrade_your_plan": "請升級您的方案。",
|
||||
"preview": "預覽",
|
||||
"preview_survey": "預覽問卷",
|
||||
"privacy": "隱私權政策",
|
||||
@@ -781,26 +783,20 @@
|
||||
"add_webhook": "新增 Webhook",
|
||||
"add_webhook_description": "將問卷回應資料傳送至自訂端點",
|
||||
"all_current_and_new_surveys": "所有目前和新的問卷",
|
||||
"copy_secret_now": "複製您的簽章密鑰",
|
||||
"created_by_third_party": "由第三方建立",
|
||||
"discord_webhook_not_supported": "目前不支援 Discord webhooks。",
|
||||
"empty_webhook_message": "您的 Webhook 將在您新增後立即顯示在此處。⏲️",
|
||||
"endpoint_pinged": "耶!我們能夠 ping Webhook!",
|
||||
"endpoint_pinged_error": "無法 ping Webhook!",
|
||||
"learn_to_verify": "了解如何驗證 webhook 簽章",
|
||||
"please_check_console": "請檢查主控台以取得更多詳細資料",
|
||||
"please_enter_a_url": "請輸入網址",
|
||||
"response_created": "已建立回應",
|
||||
"response_finished": "已完成回應",
|
||||
"response_updated": "已更新回應",
|
||||
"secret_copy_warning": "請妥善保存此密鑰。您可以在 Webhook 設定中再次查看。",
|
||||
"secret_description": "使用此密鑰來驗證 Webhook 請求。請參閱文件以了解簽章驗證方式。",
|
||||
"signing_secret": "簽章密鑰",
|
||||
"source": "來源",
|
||||
"test_endpoint": "測試端點",
|
||||
"triggers": "觸發器",
|
||||
"webhook_added_successfully": "Webhook 已成功新增",
|
||||
"webhook_created": "Webhook 已建立",
|
||||
"webhook_delete_confirmation": "您確定要刪除此 Webhook 嗎?這將停止向您發送任何進一步的通知。",
|
||||
"webhook_deleted_successfully": "Webhook 已成功刪除",
|
||||
"webhook_name_placeholder": "選填:為您的 Webhook 加上標籤以便於識別",
|
||||
@@ -1163,6 +1159,7 @@
|
||||
"adjust_survey_closed_message_description": "變更訪客在問卷關閉時看到的訊息。",
|
||||
"adjust_the_theme_in_the": "在",
|
||||
"all_other_answers_will_continue_to": "所有其他答案將繼續",
|
||||
"allow_file_type": "允許檔案類型",
|
||||
"allow_multi_select": "允許多重選取",
|
||||
"allow_multiple_files": "允許上傳多個檔案",
|
||||
"allow_users_to_select_more_than_one_image": "允許使用者選取多張圖片",
|
||||
@@ -1193,8 +1190,6 @@
|
||||
"cal_username": "Cal.com 使用者名稱或使用者名稱/事件",
|
||||
"calculate": "計算",
|
||||
"capture_a_new_action_to_trigger_a_survey_on": "擷取新的操作以觸發問卷。",
|
||||
"capture_ip_address": "擷取 IP 位址",
|
||||
"capture_ip_address_description": "將受訪者的 IP 位址儲存在回應中繼資料中,以便進行重複檢測與安全性用途",
|
||||
"capture_new_action": "擷取新操作",
|
||||
"card_arrangement_for_survey_type_derived": "'{'surveyTypeDerived'}' 問卷的卡片排列",
|
||||
"card_background_color": "卡片背景顏色",
|
||||
@@ -1225,6 +1220,8 @@
|
||||
"change_the_question_color_of_the_survey": "變更問卷的問題顏色。",
|
||||
"changes_saved": "已儲存變更。",
|
||||
"changing_survey_type_will_remove_existing_distribution_channels": "更改問卷類型會影響其共享方式。如果受訪者已擁有當前類型的存取連結,則在切換後可能會失去存取權限。",
|
||||
"character_limit_toggle_description": "限制答案的長度或短度。",
|
||||
"character_limit_toggle_title": "新增字元限制",
|
||||
"checkbox_label": "核取方塊標籤",
|
||||
"choose_the_actions_which_trigger_the_survey": "選擇觸發問卷的操作。",
|
||||
"choose_the_first_question_on_your_block": "選擇此區塊的第一個問題",
|
||||
@@ -1244,6 +1241,7 @@
|
||||
"contact_fields": "聯絡人欄位",
|
||||
"contains": "包含",
|
||||
"continue_to_settings": "繼續設定",
|
||||
"control_which_file_types_can_be_uploaded": "控制可以上傳哪些檔案類型。",
|
||||
"convert_to_multiple_choice": "轉換為多選",
|
||||
"convert_to_single_choice": "轉換為單選",
|
||||
"country": "國家/地區",
|
||||
@@ -1397,8 +1395,9 @@
|
||||
"key": "金鑰",
|
||||
"last_name": "姓氏",
|
||||
"let_people_upload_up_to_25_files_at_the_same_time": "允許使用者同時上傳最多 25 個檔案。",
|
||||
"limit_the_maximum_file_size": "限制上傳檔案的最大大小。",
|
||||
"limit_upload_file_size_to": "將上傳檔案大小限制為",
|
||||
"limit_file_types": "限制檔案類型",
|
||||
"limit_the_maximum_file_size": "限制最大檔案大小",
|
||||
"limit_upload_file_size_to": "限制上傳檔案大小為",
|
||||
"link_survey_description": "分享問卷頁面的連結或將其嵌入網頁或電子郵件中。",
|
||||
"load_segment": "載入區隔",
|
||||
"logic_error_warning": "變更將導致邏輯錯誤",
|
||||
@@ -1443,6 +1442,7 @@
|
||||
"picture_idx": "圖片 '{'idx'}'",
|
||||
"pin_can_only_contain_numbers": "PIN 碼只能包含數字。",
|
||||
"pin_must_be_a_four_digit_number": "PIN 碼必須是四位數的數字。",
|
||||
"please_enter_a_file_extension": "請輸入檔案副檔名。",
|
||||
"please_enter_a_valid_url": "請輸入有效的 URL(例如:https://example.com)",
|
||||
"please_set_a_survey_trigger": "請設定問卷觸發器",
|
||||
"please_specify": "請指定",
|
||||
@@ -1520,7 +1520,6 @@
|
||||
"search_for_images": "搜尋圖片",
|
||||
"seconds_after_trigger_the_survey_will_be_closed_if_no_response": "如果沒有回應,則在觸發後幾秒關閉問卷",
|
||||
"seconds_before_showing_the_survey": "秒後顯示問卷。",
|
||||
"select_field": "選擇欄位",
|
||||
"select_or_type_value": "選取或輸入值",
|
||||
"select_ordering": "選取排序",
|
||||
"select_saved_action": "選取已儲存的操作",
|
||||
@@ -1568,6 +1567,8 @@
|
||||
"the_survey_will_be_shown_once_even_if_person_doesnt_respond": "僅顯示一次,即使他們未回應。",
|
||||
"then": "然後",
|
||||
"this_action_will_remove_all_the_translations_from_this_survey": "此操作將從此問卷中移除所有翻譯。",
|
||||
"this_extension_is_already_added": "已新增此擴充功能。",
|
||||
"this_file_type_is_not_supported": "不支援此檔案類型。",
|
||||
"three_points": "3 分",
|
||||
"times": "次",
|
||||
"to_keep_the_placement_over_all_surveys_consistent_you_can": "若要保持所有問卷的位置一致,您可以",
|
||||
@@ -1588,42 +1589,6 @@
|
||||
"upper_label": "上標籤",
|
||||
"url_filters": "網址篩選器",
|
||||
"url_not_supported": "不支援網址",
|
||||
"validation": {
|
||||
"characters": "字元",
|
||||
"contains": "包含",
|
||||
"does_not_contain": "不包含",
|
||||
"email": "是有效的電子郵件",
|
||||
"file_extension_is": "檔案副檔名為",
|
||||
"file_extension_is_not": "檔案副檔名不是",
|
||||
"is": "等於",
|
||||
"is_between": "介於",
|
||||
"is_earlier_than": "早於",
|
||||
"is_greater_than": "大於",
|
||||
"is_later_than": "晚於",
|
||||
"is_less_than": "小於",
|
||||
"is_not": "不等於",
|
||||
"is_not_between": "不介於",
|
||||
"kb": "KB",
|
||||
"max_length": "最多",
|
||||
"max_selections": "最多",
|
||||
"max_value": "最多",
|
||||
"mb": "MB",
|
||||
"min_length": "至少",
|
||||
"min_selections": "至少",
|
||||
"min_value": "至少",
|
||||
"minimum_options_ranked": "最少排序選項數",
|
||||
"minimum_rows_answered": "最少作答列數",
|
||||
"options_selected": "已選擇的選項",
|
||||
"pattern": "符合正則表達式樣式",
|
||||
"phone": "是有效的電話號碼",
|
||||
"rank_all_options": "請為所有選項排序",
|
||||
"select_file_extensions": "請選擇檔案副檔名...",
|
||||
"url": "是有效的 URL"
|
||||
},
|
||||
"validation_logic_and": "全部為真",
|
||||
"validation_logic_or": "任一為真",
|
||||
"validation_rules": "驗證規則",
|
||||
"validation_rules_description": "僅接受符合下列條件的回應",
|
||||
"variable_is_used_in_logic_of_question_please_remove_it_from_logic_first": "'{'variable'}' 用於問題 '{'questionIndex'}' 的邏輯中。請先從邏輯中移除。",
|
||||
"variable_is_used_in_quota_please_remove_it_from_quota_first": "變數 \"{variableName}\" 正被使用於 \"{quotaName}\" 配額中",
|
||||
"variable_name_is_already_taken_please_choose_another": "已使用此變數名稱,請選擇另一個名稱。",
|
||||
@@ -1681,7 +1646,6 @@
|
||||
"error_downloading_responses": "下載回應時發生錯誤",
|
||||
"first_name": "名字",
|
||||
"how_to_identify_users": "如何識別使用者",
|
||||
"ip_address": "IP 位址",
|
||||
"last_name": "姓氏",
|
||||
"not_completed": "未完成 ⏳",
|
||||
"os": "作業系統",
|
||||
@@ -1726,22 +1690,6 @@
|
||||
"url_encryption_description": "僅在需要設定自訂一次性 ID 時停用",
|
||||
"url_encryption_label": "單次使用 ID 的 URL 加密"
|
||||
},
|
||||
"custom_html": {
|
||||
"add_mode_description": "調查問卷腳本將會與工作區層級的腳本一同執行。",
|
||||
"add_to_workspace": "加入至工作區腳本",
|
||||
"description": "將追蹤腳本與像素碼加入此調查問卷",
|
||||
"nav_title": "自訂 HTML",
|
||||
"no_workspace_scripts": "尚未設定工作區層級腳本。您可以在「工作區設定」→「一般」中新增。",
|
||||
"placeholder": "<!-- 請在此貼上您的追蹤腳本 -->\n<script>\n // Google Tag Manager、Analytics 等\n</script>",
|
||||
"replace_mode_description": "僅執行調查問卷腳本,將忽略工作區腳本。若不需載入任何腳本,請保持空白。",
|
||||
"replace_workspace": "取代工作區腳本",
|
||||
"saved_successfully": "自訂腳本已成功儲存",
|
||||
"script_mode": "腳本模式",
|
||||
"security_warning": "腳本將以完整瀏覽器權限執行。請僅加入來自可信來源的腳本。",
|
||||
"survey_scripts_description": "新增自訂 HTML 以注入至此調查問卷頁面的 <head>。",
|
||||
"survey_scripts_label": "調查問卷專屬腳本",
|
||||
"workspace_scripts_label": "工作區腳本(繼承)"
|
||||
},
|
||||
"dynamic_popup": {
|
||||
"alert_button": "編輯 問卷",
|
||||
"alert_description": "此 問卷 目前 被 設定 為 連結 問卷,不 支援 動態 彈出窗口。您 可 在 問卷 編輯器 的 設定 標籤 中 進行 更改。",
|
||||
@@ -1981,13 +1929,6 @@
|
||||
},
|
||||
"general": {
|
||||
"cannot_delete_only_workspace": "這是您唯一的工作區,無法刪除。請先建立新的工作區。",
|
||||
"custom_scripts": "自訂腳本",
|
||||
"custom_scripts_card_description": "將追蹤腳本與像素碼加入此工作區內所有連結調查問卷。",
|
||||
"custom_scripts_description": "腳本將注入至所有連結調查問卷頁面的 <head>。",
|
||||
"custom_scripts_label": "HTML 腳本",
|
||||
"custom_scripts_placeholder": "<!-- 請在此貼上您的追蹤腳本 -->\n<script>\n // Google Tag Manager、Analytics 等\n</script>",
|
||||
"custom_scripts_updated_successfully": "自訂腳本已成功更新",
|
||||
"custom_scripts_warning": "腳本將以完整瀏覽器權限執行。請僅加入來自可信來源的腳本。",
|
||||
"delete_workspace": "刪除工作區",
|
||||
"delete_workspace_confirmation": "您確定要刪除 {projectName} 嗎?此操作無法復原。",
|
||||
"delete_workspace_name_includes_surveys_responses_people_and_more": "刪除 {projectName}(包含所有問卷、回應、人員、操作和屬性)。",
|
||||
|
||||
-5
@@ -123,11 +123,6 @@ export const SingleResponseCardMetadata = ({ response, locale }: SingleResponseC
|
||||
{t("environments.surveys.responses.country")}: {response.meta.country}
|
||||
</p>
|
||||
)}
|
||||
{response.meta.ipAddress && (
|
||||
<p className="truncate" title={`IP Address: ${response.meta.ipAddress}`}>
|
||||
{t("environments.surveys.responses.ip_address")}: {response.meta.ipAddress}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
) : null;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { ZodRawShape, z } from "zod";
|
||||
import { logger } from "@formbricks/logger";
|
||||
import { TAuthenticationApiKey } from "@formbricks/types/auth";
|
||||
import { TApiAuditLog } from "@/app/lib/api/with-api-logging";
|
||||
import { formatZodError, handleApiError } from "@/modules/api/v2/lib/utils";
|
||||
@@ -68,22 +67,7 @@ export const apiWrapper = async <S extends ExtendedSchemas>({
|
||||
let parsedInput: ParsedSchemas<S> = {} as ParsedSchemas<S>;
|
||||
|
||||
if (schemas?.body) {
|
||||
let bodyData;
|
||||
try {
|
||||
bodyData = await request.json();
|
||||
} catch (error) {
|
||||
logger.error({ error, url: request.url }, "Error parsing JSON input");
|
||||
return handleApiError(request, {
|
||||
type: "bad_request",
|
||||
details: [
|
||||
{
|
||||
field: "error",
|
||||
issue: "Malformed JSON input, please check your request body",
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
const bodyData = await request.json();
|
||||
const bodyResult = schemas.body.safeParse(bodyData);
|
||||
|
||||
if (!bodyResult.success) {
|
||||
|
||||
@@ -132,71 +132,6 @@ describe("apiWrapper", () => {
|
||||
expect(handler).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test("should handle malformed JSON input in request body", async () => {
|
||||
const request = new Request("http://localhost", {
|
||||
method: "POST",
|
||||
body: "{ invalid json }",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
});
|
||||
|
||||
vi.mocked(authenticateRequest).mockResolvedValue(ok(mockAuthentication));
|
||||
vi.mocked(handleApiError).mockResolvedValue(new Response("error", { status: 400 }));
|
||||
|
||||
const bodySchema = z.object({ key: z.string() });
|
||||
const handler = vi.fn();
|
||||
|
||||
const response = await apiWrapper({
|
||||
request,
|
||||
schemas: { body: bodySchema },
|
||||
rateLimit: false,
|
||||
handler,
|
||||
});
|
||||
|
||||
expect(response.status).toBe(400);
|
||||
expect(handler).not.toHaveBeenCalled();
|
||||
expect(handleApiError).toHaveBeenCalledWith(request, {
|
||||
type: "bad_request",
|
||||
details: [
|
||||
{
|
||||
field: "error",
|
||||
issue: "Malformed JSON input, please check your request body",
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
test("should handle empty body when body schema is provided", async () => {
|
||||
const request = new Request("http://localhost", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
});
|
||||
|
||||
vi.mocked(authenticateRequest).mockResolvedValue(ok(mockAuthentication));
|
||||
vi.mocked(handleApiError).mockResolvedValue(new Response("error", { status: 400 }));
|
||||
|
||||
const bodySchema = z.object({ key: z.string() });
|
||||
const handler = vi.fn();
|
||||
|
||||
const response = await apiWrapper({
|
||||
request,
|
||||
schemas: { body: bodySchema },
|
||||
rateLimit: false,
|
||||
handler,
|
||||
});
|
||||
|
||||
expect(response.status).toBe(400);
|
||||
expect(handler).not.toHaveBeenCalled();
|
||||
expect(handleApiError).toHaveBeenCalledWith(request, {
|
||||
type: "bad_request",
|
||||
details: [
|
||||
{
|
||||
field: "error",
|
||||
issue: "Malformed JSON input, please check your request body",
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
test("should parse query schema correctly", async () => {
|
||||
const request = new Request("http://localhost?key=value");
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ export const ZWebhookUpdateSchema = ZWebhook.omit({
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
environmentId: true,
|
||||
secret: true,
|
||||
}).openapi({
|
||||
ref: "webhookUpdate",
|
||||
description: "A webhook to update.",
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Prisma, Webhook } from "@prisma/client";
|
||||
import { prisma } from "@formbricks/database";
|
||||
import { Result, err, ok } from "@formbricks/types/error-handlers";
|
||||
import { generateWebhookSecret } from "@/lib/crypto";
|
||||
import { getWebhooksQuery } from "@/modules/api/v2/management/webhooks/lib/utils";
|
||||
import { TGetWebhooksFilter, TWebhookInput } from "@/modules/api/v2/management/webhooks/types/webhooks";
|
||||
import { ApiErrorResponseV2 } from "@/modules/api/v2/types/api-error";
|
||||
@@ -50,8 +49,6 @@ export const createWebhook = async (webhook: TWebhookInput): Promise<Result<Webh
|
||||
const { environmentId, name, url, source, triggers, surveyIds } = webhook;
|
||||
|
||||
try {
|
||||
const secret = generateWebhookSecret();
|
||||
|
||||
const prismaData: Prisma.WebhookCreateInput = {
|
||||
environment: {
|
||||
connect: {
|
||||
@@ -63,7 +60,6 @@ export const createWebhook = async (webhook: TWebhookInput): Promise<Result<Webh
|
||||
source,
|
||||
triggers,
|
||||
surveyIds,
|
||||
secret,
|
||||
};
|
||||
|
||||
const createdWebhook = await prisma.webhook.create({
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { debounce } from "lodash";
|
||||
import dynamic from "next/dynamic";
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { useEffect, useMemo, useRef, useState } from "react";
|
||||
import toast from "react-hot-toast";
|
||||
import { TContactAttributeKey } from "@formbricks/types/contact-attribute-key";
|
||||
import { TEnvironment } from "@formbricks/types/environment";
|
||||
@@ -48,40 +48,40 @@ export const ContactDataView = ({
|
||||
);
|
||||
}, [contactAttributeKeys]);
|
||||
|
||||
// Fetch contacts from offset 0 with current search value
|
||||
const fetchContactsFromStart = useCallback(async () => {
|
||||
setIsDataLoaded(false);
|
||||
try {
|
||||
setHasMore(true);
|
||||
const contactsResponse = await getContactsAction({
|
||||
environmentId: environment.id,
|
||||
offset: 0,
|
||||
searchValue,
|
||||
});
|
||||
if (contactsResponse?.data) {
|
||||
setContacts(contactsResponse.data);
|
||||
}
|
||||
if (contactsResponse?.data && contactsResponse.data.length < itemsPerPage) {
|
||||
setHasMore(false);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error fetching contacts:", error);
|
||||
toast.error("Error fetching contacts. Please try again.");
|
||||
} finally {
|
||||
setIsDataLoaded(true);
|
||||
}
|
||||
}, [environment.id, itemsPerPage, searchValue]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isFirstRender.current) {
|
||||
const debouncedFetchData = debounce(fetchContactsFromStart, 300);
|
||||
const fetchData = async () => {
|
||||
setIsDataLoaded(false);
|
||||
try {
|
||||
setHasMore(true);
|
||||
const getPersonActionData = await getContactsAction({
|
||||
environmentId: environment.id,
|
||||
offset: 0,
|
||||
searchValue,
|
||||
});
|
||||
const personData = getPersonActionData?.data;
|
||||
if (getPersonActionData?.data) {
|
||||
setContacts(getPersonActionData.data);
|
||||
}
|
||||
if (personData && personData.length < itemsPerPage) {
|
||||
setHasMore(false);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error fetching people data:", error);
|
||||
toast.error("Error fetching people data. Please try again.");
|
||||
} finally {
|
||||
setIsDataLoaded(true);
|
||||
}
|
||||
};
|
||||
|
||||
const debouncedFetchData = debounce(fetchData, 300);
|
||||
debouncedFetchData();
|
||||
|
||||
return () => {
|
||||
debouncedFetchData.cancel();
|
||||
};
|
||||
}
|
||||
}, [fetchContactsFromStart]);
|
||||
}, [environment.id, itemsPerPage, searchValue]);
|
||||
|
||||
useEffect(() => {
|
||||
if (isFirstRender.current) {
|
||||
@@ -147,7 +147,6 @@ export const ContactDataView = ({
|
||||
setSearchValue={setSearchValue}
|
||||
isReadOnly={isReadOnly}
|
||||
isQuotasAllowed={isQuotasAllowed}
|
||||
refreshContacts={fetchContactsFromStart}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -43,7 +43,6 @@ interface ContactsTableProps {
|
||||
setSearchValue: (value: string) => void;
|
||||
isReadOnly: boolean;
|
||||
isQuotasAllowed: boolean;
|
||||
refreshContacts: () => Promise<void>;
|
||||
}
|
||||
|
||||
export const ContactsTable = ({
|
||||
@@ -57,7 +56,6 @@ export const ContactsTable = ({
|
||||
setSearchValue,
|
||||
isReadOnly,
|
||||
isQuotasAllowed,
|
||||
refreshContacts,
|
||||
}: ContactsTableProps) => {
|
||||
const [columnVisibility, setColumnVisibility] = useState<VisibilityState>({});
|
||||
const [columnOrder, setColumnOrder] = useState<string[]>([]);
|
||||
@@ -237,7 +235,6 @@ export const ContactsTable = ({
|
||||
type="contact"
|
||||
deleteAction={deleteContact}
|
||||
isQuotasAllowed={isQuotasAllowed}
|
||||
onRefresh={refreshContacts}
|
||||
leftContent={
|
||||
<div className="w-64">
|
||||
<SearchBar
|
||||
|
||||
@@ -11,7 +11,6 @@ import {
|
||||
vi.mock("@/lib/env", () => ({
|
||||
env: {
|
||||
ENTERPRISE_LICENSE_KEY: "test-license-key",
|
||||
ENVIRONMENT: "production",
|
||||
VERCEL_URL: "some.vercel.url",
|
||||
FORMBRICKS_COM_URL: "https://app.formbricks.com",
|
||||
HTTPS_PROXY: undefined,
|
||||
@@ -691,61 +690,4 @@ describe("License Core Logic", () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Environment-based endpoint selection", () => {
|
||||
test("should use staging endpoint when ENVIRONMENT is staging", async () => {
|
||||
vi.resetModules();
|
||||
vi.doMock("@/lib/env", () => ({
|
||||
env: {
|
||||
ENTERPRISE_LICENSE_KEY: "test-license-key",
|
||||
ENVIRONMENT: "staging",
|
||||
HTTPS_PROXY: undefined,
|
||||
HTTP_PROXY: undefined,
|
||||
},
|
||||
}));
|
||||
|
||||
const fetch = (await import("node-fetch")).default as Mock;
|
||||
|
||||
// Mock cache.withCache to execute the function (simulating cache miss)
|
||||
mockCache.withCache.mockImplementation(async (fn) => await fn());
|
||||
|
||||
fetch.mockResolvedValueOnce({
|
||||
ok: true,
|
||||
json: async () => ({
|
||||
data: {
|
||||
status: "active",
|
||||
features: {
|
||||
isMultiOrgEnabled: true,
|
||||
projects: 5,
|
||||
twoFactorAuth: true,
|
||||
sso: true,
|
||||
whitelabel: true,
|
||||
removeBranding: true,
|
||||
contacts: true,
|
||||
ai: true,
|
||||
saml: true,
|
||||
spamProtection: true,
|
||||
auditLogs: true,
|
||||
multiLanguageSurveys: true,
|
||||
accessControl: true,
|
||||
quotas: true,
|
||||
},
|
||||
},
|
||||
}),
|
||||
} as any);
|
||||
|
||||
// Re-import the module to apply the new mock
|
||||
const { fetchLicense } = await import("./license");
|
||||
await fetchLicense();
|
||||
|
||||
// Verify the staging endpoint was called
|
||||
expect(fetch).toHaveBeenCalledWith(
|
||||
"https://staging.ee.formbricks.com/api/licenses/check",
|
||||
expect.objectContaining({
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -26,10 +26,7 @@ const CONFIG = {
|
||||
RETRY_DELAY_MS: 1000,
|
||||
},
|
||||
API: {
|
||||
ENDPOINT:
|
||||
env.ENVIRONMENT === "staging"
|
||||
? "https://staging.ee.formbricks.com/api/licenses/check"
|
||||
: "https://ee.formbricks.com/api/licenses/check",
|
||||
ENDPOINT: "https://ee.formbricks.com/api/licenses/check",
|
||||
TIMEOUT_MS: 5000,
|
||||
},
|
||||
} as const;
|
||||
|
||||
@@ -153,7 +153,6 @@ export const getEnvironmentWithRelations = reactCache(async (environmentId: stri
|
||||
darkOverlay: true,
|
||||
styling: true,
|
||||
logo: true,
|
||||
customHeadScripts: true,
|
||||
// All project environments
|
||||
environments: {
|
||||
select: {
|
||||
@@ -223,7 +222,6 @@ export const getEnvironmentWithRelations = reactCache(async (environmentId: stri
|
||||
darkOverlay: data.project.darkOverlay,
|
||||
styling: data.project.styling,
|
||||
logo: data.project.logo,
|
||||
customHeadScripts: data.project.customHeadScripts,
|
||||
environments: data.project.environments,
|
||||
},
|
||||
organization: {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
"use client";
|
||||
|
||||
import { PipelineTriggers, Webhook } from "@prisma/client";
|
||||
import { PipelineTriggers } from "@prisma/client";
|
||||
import clsx from "clsx";
|
||||
import { Webhook as WebhookIcon } from "lucide-react";
|
||||
import { Webhook } from "lucide-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { useForm } from "react-hook-form";
|
||||
@@ -12,7 +12,6 @@ import { TSurvey } from "@formbricks/types/surveys/types";
|
||||
import { getFormattedErrorMessage } from "@/lib/utils/helper";
|
||||
import { SurveyCheckboxGroup } from "@/modules/integrations/webhooks/components/survey-checkbox-group";
|
||||
import { TriggerCheckboxGroup } from "@/modules/integrations/webhooks/components/trigger-checkbox-group";
|
||||
import { WebhookCreatedModal } from "@/modules/integrations/webhooks/components/webhook-created-modal";
|
||||
import { isDiscordWebhook, validWebHookURL } from "@/modules/integrations/webhooks/lib/utils";
|
||||
import { Button } from "@/modules/ui/components/button";
|
||||
import {
|
||||
@@ -52,7 +51,6 @@ export const AddWebhookModal = ({ environmentId, surveys, open, setOpen }: AddWe
|
||||
const [selectedSurveys, setSelectedSurveys] = useState<string[]>([]);
|
||||
const [selectedAllSurveys, setSelectedAllSurveys] = useState(false);
|
||||
const [creatingWebhook, setCreatingWebhook] = useState(false);
|
||||
const [createdWebhook, setCreatedWebhook] = useState<Webhook | null>(null);
|
||||
|
||||
const handleTestEndpoint = async (sendSuccessToast: boolean) => {
|
||||
try {
|
||||
@@ -144,7 +142,7 @@ export const AddWebhookModal = ({ environmentId, surveys, open, setOpen }: AddWe
|
||||
});
|
||||
if (createWebhookActionResult?.data) {
|
||||
router.refresh();
|
||||
setCreatedWebhook(createWebhookActionResult.data);
|
||||
setOpenWithStates(false);
|
||||
toast.success(t("environments.integrations.webhooks.webhook_added_successfully"));
|
||||
} else {
|
||||
const errorMessage = getFormattedErrorMessage(createWebhookActionResult);
|
||||
@@ -158,27 +156,21 @@ export const AddWebhookModal = ({ environmentId, surveys, open, setOpen }: AddWe
|
||||
}
|
||||
};
|
||||
|
||||
const resetAndClose = () => {
|
||||
setOpen(false);
|
||||
const setOpenWithStates = (isOpen: boolean) => {
|
||||
setOpen(isOpen);
|
||||
reset();
|
||||
setTestEndpointInput("");
|
||||
setEndpointAccessible(undefined);
|
||||
setSelectedSurveys([]);
|
||||
setSelectedTriggers([]);
|
||||
setSelectedAllSurveys(false);
|
||||
setCreatedWebhook(null);
|
||||
};
|
||||
|
||||
// Show success dialog with secret after webhook creation
|
||||
if (createdWebhook) {
|
||||
return <WebhookCreatedModal open={open} webhook={createdWebhook} onClose={resetAndClose} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={resetAndClose}>
|
||||
<Dialog open={open} onOpenChange={setOpenWithStates}>
|
||||
<DialogContent>
|
||||
<DialogHeader>
|
||||
<WebhookIcon />
|
||||
<Webhook />
|
||||
<DialogTitle>{t("environments.integrations.webhooks.add_webhook")}</DialogTitle>
|
||||
<DialogDescription>
|
||||
{t("environments.integrations.webhooks.add_webhook_description")}
|
||||
@@ -257,7 +249,12 @@ export const AddWebhookModal = ({ environmentId, surveys, open, setOpen }: AddWe
|
||||
</DialogBody>
|
||||
|
||||
<DialogFooter>
|
||||
<Button type="button" variant="secondary" onClick={resetAndClose}>
|
||||
<Button
|
||||
type="button"
|
||||
variant="secondary"
|
||||
onClick={() => {
|
||||
setOpenWithStates(false);
|
||||
}}>
|
||||
{t("common.cancel")}
|
||||
</Button>
|
||||
<Button type="submit" loading={creatingWebhook}>
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { Webhook } from "@prisma/client";
|
||||
import { CheckIcon, CopyIcon, ExternalLinkIcon } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { useState } from "react";
|
||||
import toast from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Button } from "@/modules/ui/components/button";
|
||||
import {
|
||||
Dialog,
|
||||
DialogBody,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogFooter,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from "@/modules/ui/components/dialog";
|
||||
import { Input } from "@/modules/ui/components/input";
|
||||
import { Label } from "@/modules/ui/components/label";
|
||||
|
||||
interface WebhookCreatedModalProps {
|
||||
open: boolean;
|
||||
webhook: Webhook;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
export const WebhookCreatedModal = ({ open, webhook, onClose }: WebhookCreatedModalProps) => {
|
||||
const { t } = useTranslation();
|
||||
const [copied, setCopied] = useState(false);
|
||||
|
||||
const copyToClipboard = async (text: string) => {
|
||||
await navigator.clipboard.writeText(text);
|
||||
setCopied(true);
|
||||
toast.success(t("common.copied_to_clipboard"));
|
||||
setTimeout(() => setCopied(false), 2000);
|
||||
};
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={onClose}>
|
||||
<DialogContent>
|
||||
<DialogHeader>
|
||||
<CheckIcon className="h-6 w-6 text-green-500" />
|
||||
<DialogTitle>{t("environments.integrations.webhooks.webhook_created")}</DialogTitle>
|
||||
<DialogDescription>{t("environments.integrations.webhooks.copy_secret_now")}</DialogDescription>
|
||||
</DialogHeader>
|
||||
|
||||
<DialogBody className="space-y-4 pb-4">
|
||||
<div className="col-span-1">
|
||||
<Label>{t("environments.integrations.webhooks.signing_secret")}</Label>
|
||||
<div className="mt-1 flex">
|
||||
<Input type="text" readOnly value={webhook.secret ?? ""} className="font-mono text-sm" />
|
||||
<Button
|
||||
type="button"
|
||||
variant="secondary"
|
||||
className="ml-2 whitespace-nowrap"
|
||||
onClick={() => copyToClipboard(webhook.secret ?? "")}>
|
||||
{copied ? (
|
||||
<>
|
||||
<CheckIcon className="h-4 w-4" />
|
||||
{t("common.copied")}
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<CopyIcon className="h-4 w-4" />
|
||||
{t("common.copy")}
|
||||
</>
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
<p className="mt-2 text-xs text-slate-500">
|
||||
{t("environments.integrations.webhooks.secret_copy_warning")}
|
||||
</p>
|
||||
<Link
|
||||
href="https://formbricks.com/docs/xm-and-surveys/core-features/integrations/webhooks#webhook-security-with-standard-webhooks"
|
||||
target="_blank"
|
||||
className="mt-2 inline-flex items-center gap-1 text-xs text-slate-600 underline hover:text-slate-800">
|
||||
{t("environments.integrations.webhooks.learn_to_verify")}
|
||||
<ExternalLinkIcon className="h-3 w-3" />
|
||||
</Link>
|
||||
</div>
|
||||
</DialogBody>
|
||||
|
||||
<DialogFooter>
|
||||
<Button type="button" onClick={onClose}>
|
||||
{t("common.done")}
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
);
|
||||
};
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { PipelineTriggers, Webhook } from "@prisma/client";
|
||||
import clsx from "clsx";
|
||||
import { CheckIcon, CopyIcon, ExternalLinkIcon, EyeIcon, EyeOff, TrashIcon } from "lucide-react";
|
||||
import { TrashIcon } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
@@ -48,15 +48,6 @@ export const WebhookSettingsTab = ({ webhook, surveys, setOpen, isReadOnly }: We
|
||||
const [endpointAccessible, setEndpointAccessible] = useState<boolean>();
|
||||
const [hittingEndpoint, setHittingEndpoint] = useState<boolean>(false);
|
||||
const [selectedAllSurveys, setSelectedAllSurveys] = useState(webhook.surveyIds.length === 0);
|
||||
const [showSecret, setShowSecret] = useState(false);
|
||||
const [copied, setCopied] = useState(false);
|
||||
|
||||
const copyToClipboard = async (text: string) => {
|
||||
await navigator.clipboard.writeText(text);
|
||||
setCopied(true);
|
||||
toast.success(t("common.copied_to_clipboard"));
|
||||
setTimeout(() => setCopied(false), 2000);
|
||||
};
|
||||
|
||||
const handleTestEndpoint = async (sendSuccessToast: boolean) => {
|
||||
try {
|
||||
@@ -122,7 +113,6 @@ export const WebhookSettingsTab = ({ webhook, surveys, setOpen, isReadOnly }: We
|
||||
toast.error(t("common.please_select_at_least_one_survey"));
|
||||
return;
|
||||
}
|
||||
|
||||
const endpointHitSuccessfully = await handleTestEndpoint(false);
|
||||
if (!endpointHitSuccessfully) {
|
||||
return;
|
||||
@@ -206,60 +196,6 @@ export const WebhookSettingsTab = ({ webhook, surveys, setOpen, isReadOnly }: We
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{webhook.secret && (
|
||||
<div className="col-span-1">
|
||||
<Label htmlFor="secret">{t("environments.integrations.webhooks.signing_secret")}</Label>
|
||||
<div className="mt-1 flex">
|
||||
<div className="relative flex-1">
|
||||
<Input
|
||||
type={showSecret ? "text" : "password"}
|
||||
id="secret"
|
||||
readOnly
|
||||
value={webhook.secret}
|
||||
className="pr-10 font-mono text-sm"
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
className="absolute top-1/2 right-3 -translate-y-1/2 transform"
|
||||
onClick={() => setShowSecret(!showSecret)}>
|
||||
{showSecret ? (
|
||||
<EyeOff className="h-5 w-5 text-slate-400" />
|
||||
) : (
|
||||
<EyeIcon className="h-5 w-5 text-slate-400" />
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
<Button
|
||||
type="button"
|
||||
variant="secondary"
|
||||
className="ml-2 whitespace-nowrap"
|
||||
onClick={() => copyToClipboard(webhook.secret ?? "")}>
|
||||
{copied ? (
|
||||
<>
|
||||
<CheckIcon className="h-4 w-4" />
|
||||
{t("common.copied")}
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<CopyIcon className="h-4 w-4" />
|
||||
{t("common.copy")}
|
||||
</>
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
<p className="mt-1 text-xs text-slate-500">
|
||||
{t("environments.integrations.webhooks.secret_description")}
|
||||
</p>
|
||||
<Link
|
||||
href="https://formbricks.com/docs/xm-and-surveys/core-features/integrations/webhooks#webhook-security-with-standard-webhooks"
|
||||
target="_blank"
|
||||
className="mt-1 inline-flex items-center gap-1 text-xs text-slate-600 underline hover:text-slate-800">
|
||||
{t("environments.integrations.webhooks.learn_to_verify")}
|
||||
<ExternalLinkIcon className="h-3 w-3" />
|
||||
</Link>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div>
|
||||
<Label htmlFor="Triggers">{t("environments.integrations.webhooks.triggers")}</Label>
|
||||
<TriggerCheckboxGroup
|
||||
|
||||
@@ -35,7 +35,6 @@ export const WebhookTable = ({
|
||||
surveyIds: [],
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
secret: null,
|
||||
});
|
||||
|
||||
const handleOpenWebhookDetailModalClick = (e, webhook: Webhook) => {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Prisma, Webhook } from "@prisma/client";
|
||||
import { v7 as uuidv7 } from "uuid";
|
||||
import { prisma } from "@formbricks/database";
|
||||
import { PrismaErrorType } from "@formbricks/database/types/error";
|
||||
import { ZId } from "@formbricks/types/common";
|
||||
@@ -9,7 +8,6 @@ import {
|
||||
ResourceNotFoundError,
|
||||
UnknownError,
|
||||
} from "@formbricks/types/errors";
|
||||
import { generateStandardWebhookSignature, generateWebhookSecret } from "@/lib/crypto";
|
||||
import { validateInputs } from "@/lib/utils/validate";
|
||||
import { isDiscordWebhook } from "@/modules/integrations/webhooks/lib/utils";
|
||||
import { TWebhookInput } from "../types/webhooks";
|
||||
@@ -61,19 +59,15 @@ export const deleteWebhook = async (id: string): Promise<boolean> => {
|
||||
}
|
||||
};
|
||||
|
||||
export const createWebhook = async (environmentId: string, webhookInput: TWebhookInput): Promise<Webhook> => {
|
||||
export const createWebhook = async (environmentId: string, webhookInput: TWebhookInput): Promise<boolean> => {
|
||||
try {
|
||||
if (isDiscordWebhook(webhookInput.url)) {
|
||||
throw new UnknownError("Discord webhooks are currently not supported.");
|
||||
}
|
||||
|
||||
const secret = generateWebhookSecret();
|
||||
|
||||
const webhook = await prisma.webhook.create({
|
||||
await prisma.webhook.create({
|
||||
data: {
|
||||
...webhookInput,
|
||||
surveyIds: webhookInput.surveyIds || [],
|
||||
secret,
|
||||
environment: {
|
||||
connect: {
|
||||
id: environmentId,
|
||||
@@ -82,7 +76,7 @@ export const createWebhook = async (environmentId: string, webhookInput: TWebhoo
|
||||
},
|
||||
});
|
||||
|
||||
return webhook;
|
||||
return true;
|
||||
} catch (error) {
|
||||
if (error instanceof Prisma.PrismaClientKnownRequestError) {
|
||||
throw new DatabaseError(error.message);
|
||||
@@ -127,22 +121,13 @@ export const testEndpoint = async (url: string): Promise<boolean> => {
|
||||
throw new UnknownError("Discord webhooks are currently not supported.");
|
||||
}
|
||||
|
||||
const webhookMessageId = uuidv7();
|
||||
const webhookTimestamp = Math.floor(Date.now() / 1000);
|
||||
const body = JSON.stringify({ event: "testEndpoint" });
|
||||
|
||||
// Generate a temporary test secret and signature for consistency with actual webhooks
|
||||
const testSecret = generateWebhookSecret();
|
||||
const signature = generateStandardWebhookSignature(webhookMessageId, webhookTimestamp, body, testSecret);
|
||||
|
||||
const response = await fetch(url, {
|
||||
method: "POST",
|
||||
body,
|
||||
body: JSON.stringify({
|
||||
event: "testEndpoint",
|
||||
}),
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"webhook-id": webhookMessageId,
|
||||
"webhook-timestamp": webhookTimestamp.toString(),
|
||||
"webhook-signature": signature,
|
||||
},
|
||||
signal: controller.signal,
|
||||
});
|
||||
|
||||
@@ -1,124 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { AlertTriangleIcon } from "lucide-react";
|
||||
import { SubmitHandler, useForm } from "react-hook-form";
|
||||
import toast from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { z } from "zod";
|
||||
import { TProject } from "@formbricks/types/project";
|
||||
import { cn } from "@/lib/cn";
|
||||
import { getFormattedErrorMessage } from "@/lib/utils/helper";
|
||||
import { Alert, AlertDescription } from "@/modules/ui/components/alert";
|
||||
import { Button } from "@/modules/ui/components/button";
|
||||
import {
|
||||
FormControl,
|
||||
FormDescription,
|
||||
FormField,
|
||||
FormItem,
|
||||
FormLabel,
|
||||
FormProvider,
|
||||
} from "@/modules/ui/components/form";
|
||||
import { updateProjectAction } from "../../actions";
|
||||
|
||||
interface CustomScriptsFormProps {
|
||||
project: TProject;
|
||||
isReadOnly: boolean;
|
||||
}
|
||||
|
||||
const ZCustomScriptsInput = z.object({
|
||||
customHeadScripts: z.string().nullish(),
|
||||
});
|
||||
|
||||
type TCustomScriptsFormValues = z.infer<typeof ZCustomScriptsInput>;
|
||||
|
||||
export const CustomScriptsForm: React.FC<CustomScriptsFormProps> = ({ project, isReadOnly }) => {
|
||||
const { t } = useTranslation();
|
||||
const form = useForm<TCustomScriptsFormValues>({
|
||||
defaultValues: {
|
||||
customHeadScripts: project.customHeadScripts ?? "",
|
||||
},
|
||||
resolver: zodResolver(ZCustomScriptsInput),
|
||||
mode: "onChange",
|
||||
});
|
||||
|
||||
const { isDirty, isSubmitting } = form.formState;
|
||||
|
||||
const updateCustomScripts: SubmitHandler<TCustomScriptsFormValues> = async (data) => {
|
||||
try {
|
||||
const updatedProjectResponse = await updateProjectAction({
|
||||
projectId: project.id,
|
||||
data: {
|
||||
customHeadScripts: data.customHeadScripts || null,
|
||||
},
|
||||
});
|
||||
if (updatedProjectResponse?.data) {
|
||||
toast.success(t("environments.workspace.general.custom_scripts_updated_successfully"));
|
||||
form.reset({ customHeadScripts: updatedProjectResponse.data.customHeadScripts ?? "" });
|
||||
} else {
|
||||
const errorMessage = getFormattedErrorMessage(updatedProjectResponse);
|
||||
toast.error(errorMessage);
|
||||
}
|
||||
} catch {
|
||||
toast.error(t("common.something_went_wrong_please_try_again"));
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<FormProvider {...form}>
|
||||
<form className="flex w-full flex-col space-y-4" onSubmit={form.handleSubmit(updateCustomScripts)}>
|
||||
<Alert variant="warning" className="flex items-start gap-2">
|
||||
<AlertTriangleIcon className="mt-0.5 h-4 w-4 shrink-0" />
|
||||
<AlertDescription>{t("environments.workspace.general.custom_scripts_warning")}</AlertDescription>
|
||||
</Alert>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="customHeadScripts"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel htmlFor="customHeadScripts">
|
||||
{t("environments.workspace.general.custom_scripts_label")}
|
||||
</FormLabel>
|
||||
<FormDescription>
|
||||
{t("environments.workspace.general.custom_scripts_description")}
|
||||
</FormDescription>
|
||||
<FormControl>
|
||||
<textarea
|
||||
id="customHeadScripts"
|
||||
rows={8}
|
||||
placeholder={t("environments.workspace.general.custom_scripts_placeholder")}
|
||||
className={cn(
|
||||
"focus:border-brand-dark flex w-full rounded-md border border-slate-300 bg-transparent px-3 py-2 font-mono text-xs text-slate-800 placeholder:text-slate-400 focus:ring-2 focus:ring-slate-400 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",
|
||||
isReadOnly && "bg-slate-50"
|
||||
)}
|
||||
{...field}
|
||||
value={field.value ?? ""}
|
||||
disabled={isReadOnly}
|
||||
/>
|
||||
</FormControl>
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<Button
|
||||
type="submit"
|
||||
size="sm"
|
||||
className="w-fit"
|
||||
loading={isSubmitting}
|
||||
disabled={isSubmitting || !isDirty || isReadOnly}>
|
||||
{t("common.save")}
|
||||
</Button>
|
||||
</form>
|
||||
</FormProvider>
|
||||
{isReadOnly && (
|
||||
<Alert variant="warning" className="mt-4">
|
||||
<AlertDescription>
|
||||
{t("common.only_owners_managers_and_manage_access_members_can_perform_this_action")}
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -8,7 +8,6 @@ import { IdBadge } from "@/modules/ui/components/id-badge";
|
||||
import { PageContentWrapper } from "@/modules/ui/components/page-content-wrapper";
|
||||
import { PageHeader } from "@/modules/ui/components/page-header";
|
||||
import packageJson from "@/package.json";
|
||||
import { CustomScriptsForm } from "./components/custom-scripts-form";
|
||||
import { DeleteProject } from "./components/delete-project";
|
||||
import { EditProjectNameForm } from "./components/edit-project-name-form";
|
||||
import { EditWaitingTimeForm } from "./components/edit-waiting-time-form";
|
||||
@@ -40,13 +39,6 @@ export const GeneralSettingsPage = async (props: { params: Promise<{ environment
|
||||
description={t("environments.workspace.general.recontact_waiting_time_settings_description")}>
|
||||
<EditWaitingTimeForm project={project} isReadOnly={isReadOnly} />
|
||||
</SettingsCard>
|
||||
{!IS_FORMBRICKS_CLOUD && (
|
||||
<SettingsCard
|
||||
title={t("environments.workspace.general.custom_scripts")}
|
||||
description={t("environments.workspace.general.custom_scripts_card_description")}>
|
||||
<CustomScriptsForm project={project} isReadOnly={!isOwnerOrManager} />
|
||||
</SettingsCard>
|
||||
)}
|
||||
<SettingsCard
|
||||
title={t("environments.workspace.general.delete_workspace")}
|
||||
description={t("environments.workspace.general.delete_workspace_settings_description")}>
|
||||
|
||||
@@ -28,7 +28,6 @@ const selectProject = {
|
||||
environments: true,
|
||||
styling: true,
|
||||
logo: true,
|
||||
customHeadScripts: true,
|
||||
};
|
||||
|
||||
export const updateProject = async (
|
||||
|
||||
+1
-1
@@ -112,7 +112,7 @@ export const InviteMembers = ({ IS_SMTP_CONFIGURED, organizationId }: InviteMemb
|
||||
<div className="relative">
|
||||
<Input
|
||||
{...field}
|
||||
placeholder={t("common.full_name")}
|
||||
placeholder={`Full Name (optional)`}
|
||||
className="w-80"
|
||||
isInvalid={Boolean(error?.message)}
|
||||
/>
|
||||
|
||||
@@ -153,9 +153,9 @@ export const ElementFormInput = ({
|
||||
(currentElement &&
|
||||
(id.includes(".")
|
||||
? // Handle nested properties
|
||||
(currentElement[id.split(".")[0] as keyof TSurveyElement] as any)?.[id.split(".")[1]]
|
||||
(currentElement[id.split(".")[0] as keyof TSurveyElement] as any)?.[id.split(".")[1]]
|
||||
: // Original behavior
|
||||
(currentElement[id as keyof TSurveyElement] as TI18nString))) ||
|
||||
(currentElement[id as keyof TSurveyElement] as TI18nString))) ||
|
||||
createI18nString("", surveyLanguageCodes)
|
||||
);
|
||||
}, [
|
||||
@@ -391,7 +391,7 @@ export const ElementFormInput = ({
|
||||
return (
|
||||
<div className="w-full">
|
||||
{label && (
|
||||
<div className="mt-3 mb-2 flex items-center justify-between">
|
||||
<div className="mb-2 mt-3 flex items-center justify-between">
|
||||
<Label htmlFor={id}>{label}</Label>
|
||||
{id === "headline" && currentElement && updateElement && (
|
||||
<div className="flex items-center space-x-2">
|
||||
@@ -521,8 +521,23 @@ export const ElementFormInput = ({
|
||||
return (
|
||||
<div className="w-full">
|
||||
{label && (
|
||||
<div className="mt-3 mb-2 flex items-center justify-between">
|
||||
<div className="mb-2 mt-3 flex items-center justify-between">
|
||||
<Label htmlFor={id}>{label}</Label>
|
||||
{id === "headline" && currentElement && updateElement && (
|
||||
<div className="flex items-center space-x-2">
|
||||
<Label htmlFor="required-toggle" className="text-sm">
|
||||
{t("environments.surveys.edit.required")}
|
||||
</Label>
|
||||
<Switch
|
||||
id="required-toggle"
|
||||
checked={currentElement.required}
|
||||
disabled={getIsRequiredToggleDisabled()}
|
||||
onCheckedChange={(checked) => {
|
||||
updateElement(elementIdx, { required: checked });
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
<MultiLangWrapper
|
||||
@@ -568,9 +583,8 @@ export const ElementFormInput = ({
|
||||
<div className="h-10 w-full"></div>
|
||||
<div
|
||||
ref={highlightContainerRef}
|
||||
className={`no-scrollbar absolute top-0 z-0 mt-0.5 flex h-10 w-full overflow-scroll px-3 py-2 text-center text-sm whitespace-nowrap text-transparent ${
|
||||
localSurvey.languages?.length > 1 ? "pr-24" : ""
|
||||
}`}
|
||||
className={`no-scrollbar absolute top-0 z-0 mt-0.5 flex h-10 w-full overflow-scroll whitespace-nowrap px-3 py-2 text-center text-sm text-transparent ${localSurvey.languages?.length > 1 ? "pr-24" : ""
|
||||
}`}
|
||||
dir="auto"
|
||||
key={highlightedJSX.toString()}>
|
||||
{highlightedJSX}
|
||||
@@ -597,9 +611,8 @@ export const ElementFormInput = ({
|
||||
maxLength={maxLength}
|
||||
ref={inputRef}
|
||||
onBlur={onBlur}
|
||||
className={`absolute top-0 text-black caret-black ${
|
||||
localSurvey.languages?.length > 1 ? "pr-24" : ""
|
||||
} ${className}`}
|
||||
className={`absolute top-0 text-black caret-black ${localSurvey.languages?.length > 1 ? "pr-24" : ""
|
||||
} ${className}`}
|
||||
isInvalid={
|
||||
isInvalid &&
|
||||
text[usedLanguageCode]?.trim() === "" &&
|
||||
|
||||
@@ -4,12 +4,11 @@ import { useAutoAnimate } from "@formkit/auto-animate/react";
|
||||
import { PlusIcon } from "lucide-react";
|
||||
import { type JSX, useEffect } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { TSurveyAddressElement, TSurveyElementTypeEnum } from "@formbricks/types/surveys/elements";
|
||||
import { TSurveyAddressElement } from "@formbricks/types/surveys/elements";
|
||||
import { TSurvey } from "@formbricks/types/surveys/types";
|
||||
import { TUserLocale } from "@formbricks/types/user";
|
||||
import { createI18nString, extractLanguageCodes } from "@/lib/i18n/utils";
|
||||
import { ElementFormInput } from "@/modules/survey/components/element-form-input";
|
||||
import { ValidationRulesEditor } from "@/modules/survey/editor/components/validation-rules-editor";
|
||||
import { Button } from "@/modules/ui/components/button";
|
||||
import { ElementToggleTable } from "@/modules/ui/components/element-toggle-table";
|
||||
|
||||
@@ -160,16 +159,6 @@ export const AddressElementForm = ({
|
||||
isStorageConfigured={isStorageConfigured}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<ValidationRulesEditor
|
||||
elementType={TSurveyElementTypeEnum.Address}
|
||||
validation={element.validation}
|
||||
onUpdateValidation={(validation) => {
|
||||
updateElement(elementIdx, {
|
||||
validation,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</form>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -4,12 +4,11 @@ import { useAutoAnimate } from "@formkit/auto-animate/react";
|
||||
import { PlusIcon } from "lucide-react";
|
||||
import { type JSX, useEffect } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { TSurveyContactInfoElement, TSurveyElementTypeEnum } from "@formbricks/types/surveys/elements";
|
||||
import { TSurveyContactInfoElement } from "@formbricks/types/surveys/elements";
|
||||
import { TSurvey } from "@formbricks/types/surveys/types";
|
||||
import { TUserLocale } from "@formbricks/types/user";
|
||||
import { createI18nString, extractLanguageCodes } from "@/lib/i18n/utils";
|
||||
import { ElementFormInput } from "@/modules/survey/components/element-form-input";
|
||||
import { ValidationRulesEditor } from "@/modules/survey/editor/components/validation-rules-editor";
|
||||
import { Button } from "@/modules/ui/components/button";
|
||||
import { ElementToggleTable } from "@/modules/ui/components/element-toggle-table";
|
||||
|
||||
@@ -157,16 +156,6 @@ export const ContactInfoElementForm = ({
|
||||
isStorageConfigured={isStorageConfigured}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<ValidationRulesEditor
|
||||
elementType={TSurveyElementTypeEnum.ContactInfo}
|
||||
validation={element.validation}
|
||||
onUpdateValidation={(validation) => {
|
||||
updateElement(elementIdx, {
|
||||
validation,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</form>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -111,7 +111,7 @@ export const CTAElementForm = ({
|
||||
description={t("environments.surveys.edit.button_external_description")}
|
||||
childBorder
|
||||
customContainerClass="p-0 mt-4">
|
||||
<div className="flex flex-1 flex-col gap-2 px-4 pt-1 pb-4">
|
||||
<div className="flex flex-1 flex-col gap-2 px-4 pb-4 pt-1">
|
||||
<ElementFormInput
|
||||
id="ctaButtonLabel"
|
||||
value={element.ctaButtonLabel}
|
||||
@@ -133,7 +133,6 @@ export const CTAElementForm = ({
|
||||
<Input
|
||||
id="buttonUrl"
|
||||
name="buttonUrl"
|
||||
className="mt-1 bg-white"
|
||||
value={element.buttonUrl}
|
||||
placeholder="https://website.com"
|
||||
onChange={(e) => updateElement(elementIdx, { buttonUrl: e.target.value })}
|
||||
|
||||
@@ -4,12 +4,11 @@ import { useAutoAnimate } from "@formkit/auto-animate/react";
|
||||
import { PlusIcon } from "lucide-react";
|
||||
import { type JSX } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { TSurveyDateElement, TSurveyElementTypeEnum } from "@formbricks/types/surveys/elements";
|
||||
import { TSurveyDateElement } from "@formbricks/types/surveys/elements";
|
||||
import { TSurvey } from "@formbricks/types/surveys/types";
|
||||
import { TUserLocale } from "@formbricks/types/user";
|
||||
import { createI18nString, extractLanguageCodes } from "@/lib/i18n/utils";
|
||||
import { ElementFormInput } from "@/modules/survey/components/element-form-input";
|
||||
import { ValidationRulesEditor } from "@/modules/survey/editor/components/validation-rules-editor";
|
||||
import { Button } from "@/modules/ui/components/button";
|
||||
import { Label } from "@/modules/ui/components/label";
|
||||
import { OptionsSwitch } from "@/modules/ui/components/options-switch";
|
||||
@@ -127,16 +126,6 @@ export const DateElementForm = ({
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ValidationRulesEditor
|
||||
elementType={TSurveyElementTypeEnum.Date}
|
||||
validation={element.validation}
|
||||
onUpdateValidation={(validation) => {
|
||||
updateElement(elementIdx, {
|
||||
validation,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</form>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -112,7 +112,6 @@ export const EditorCardMenu = ({
|
||||
choices: card.choices,
|
||||
type,
|
||||
logic: undefined,
|
||||
validation: undefined,
|
||||
});
|
||||
|
||||
return;
|
||||
@@ -129,7 +128,6 @@ export const EditorCardMenu = ({
|
||||
buttonLabel,
|
||||
backButtonLabel,
|
||||
logic: undefined,
|
||||
validation: undefined,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
|
||||
import { useAutoAnimate } from "@formkit/auto-animate/react";
|
||||
import { Project } from "@prisma/client";
|
||||
import { PlusIcon } from "lucide-react";
|
||||
import { PlusIcon, XCircleIcon } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { type JSX, useMemo, useState } from "react";
|
||||
import { toast } from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { TSurveyElementTypeEnum, TSurveyFileUploadElement } from "@formbricks/types/surveys/elements";
|
||||
import { TAllowedFileExtension, ZAllowedFileExtension } from "@formbricks/types/storage";
|
||||
import { TSurveyFileUploadElement } from "@formbricks/types/surveys/elements";
|
||||
import { TSurvey } from "@formbricks/types/surveys/types";
|
||||
import { TUserLocale } from "@formbricks/types/user";
|
||||
import { createI18nString, extractLanguageCodes } from "@/lib/i18n/utils";
|
||||
import { ElementFormInput } from "@/modules/survey/components/element-form-input";
|
||||
import { ValidationRulesEditor } from "@/modules/survey/editor/components/validation-rules-editor";
|
||||
import { AdvancedOptionToggle } from "@/modules/ui/components/advanced-option-toggle";
|
||||
import { Button } from "@/modules/ui/components/button";
|
||||
import { Input } from "@/modules/ui/components/input";
|
||||
@@ -47,8 +47,9 @@ export const FileUploadElementForm = ({
|
||||
isStorageConfigured = true,
|
||||
isExternalUrlsAllowed,
|
||||
}: FileUploadFormProps): JSX.Element => {
|
||||
const [extension, setExtension] = useState("");
|
||||
const { t } = useTranslation();
|
||||
const [isMaxSizeError, setIsMaxSizeError] = useState(false);
|
||||
const [isMaxSizeError, setMaxSizeError] = useState(false);
|
||||
const {
|
||||
billingInfo,
|
||||
error: billingInfoError,
|
||||
@@ -56,6 +57,62 @@ export const FileUploadElementForm = ({
|
||||
} = useGetBillingInfo(project?.organizationId ?? "");
|
||||
const surveyLanguageCodes = extractLanguageCodes(localSurvey.languages);
|
||||
|
||||
const handleInputChange = (event) => {
|
||||
setExtension(event.target.value);
|
||||
};
|
||||
|
||||
const addExtension = (event) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
let rawExtension = extension.trim();
|
||||
|
||||
// Remove the dot at the start if it exists
|
||||
if (rawExtension.startsWith(".")) {
|
||||
rawExtension = rawExtension.substring(1);
|
||||
}
|
||||
|
||||
if (!rawExtension) {
|
||||
toast.error(t("environments.surveys.edit.please_enter_a_file_extension"));
|
||||
return;
|
||||
}
|
||||
|
||||
// Convert to lowercase before validation and adding
|
||||
const modifiedExtension = rawExtension.toLowerCase() as TAllowedFileExtension;
|
||||
|
||||
const parsedExtensionResult = ZAllowedFileExtension.safeParse(modifiedExtension);
|
||||
|
||||
if (!parsedExtensionResult.success) {
|
||||
// This error should now be less likely unless the extension itself is invalid (e.g., "exe")
|
||||
toast.error(t("environments.surveys.edit.this_file_type_is_not_supported"));
|
||||
return;
|
||||
}
|
||||
|
||||
const currentExtensions = element.allowedFileExtensions || [];
|
||||
|
||||
// Check if the lowercase extension already exists
|
||||
if (!currentExtensions.includes(modifiedExtension)) {
|
||||
updateElement(elementIdx, {
|
||||
allowedFileExtensions: [...currentExtensions, modifiedExtension],
|
||||
});
|
||||
setExtension(""); // Clear the input field
|
||||
} else {
|
||||
toast.error(t("environments.surveys.edit.this_extension_is_already_added"));
|
||||
}
|
||||
};
|
||||
|
||||
const removeExtension = (event, index: number) => {
|
||||
event.preventDefault();
|
||||
if (element.allowedFileExtensions) {
|
||||
const updatedExtensions = [...(element.allowedFileExtensions || [])];
|
||||
updatedExtensions.splice(index, 1);
|
||||
// Ensure array is set to undefined if empty, matching toggle behavior
|
||||
updateElement(elementIdx, {
|
||||
allowedFileExtensions: updatedExtensions.length > 0 ? updatedExtensions : undefined,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const maxSizeInMBLimit = useMemo(() => {
|
||||
if (billingInfoError || billingInfoLoading || !billingInfo) {
|
||||
return 10;
|
||||
@@ -159,20 +216,20 @@ export const FileUploadElementForm = ({
|
||||
id="fileSizeLimit"
|
||||
value={element.maxSizeInMB}
|
||||
onChange={(e) => {
|
||||
const parsedValue = Number.parseInt(e.target.value, 10);
|
||||
const parsedValue = parseInt(e.target.value, 10);
|
||||
|
||||
if (isFormbricksCloud && parsedValue > maxSizeInMBLimit) {
|
||||
toast.error(
|
||||
`${t("environments.surveys.edit.max_file_size_limit_is")} ${maxSizeInMBLimit} MB`
|
||||
);
|
||||
setIsMaxSizeError(true);
|
||||
setMaxSizeError(true);
|
||||
updateElement(elementIdx, { maxSizeInMB: maxSizeInMBLimit });
|
||||
return;
|
||||
}
|
||||
|
||||
updateElement(elementIdx, { maxSizeInMB: Number.parseInt(e.target.value, 10) });
|
||||
updateElement(elementIdx, { maxSizeInMB: parseInt(e.target.value, 10) });
|
||||
}}
|
||||
className="mr-2 ml-2 inline w-20 bg-white text-center text-sm"
|
||||
className="ml-2 mr-2 inline w-20 bg-white text-center text-sm"
|
||||
/>
|
||||
MB
|
||||
</p>
|
||||
@@ -190,18 +247,49 @@ export const FileUploadElementForm = ({
|
||||
)}
|
||||
</label>
|
||||
</AdvancedOptionToggle>
|
||||
</div>
|
||||
|
||||
<ValidationRulesEditor
|
||||
elementType={TSurveyElementTypeEnum.FileUpload}
|
||||
validation={element.validation}
|
||||
onUpdateValidation={(validation) => {
|
||||
updateElement(elementIdx, {
|
||||
validation,
|
||||
});
|
||||
}}
|
||||
element={element}
|
||||
/>
|
||||
<AdvancedOptionToggle
|
||||
isChecked={!!element.allowedFileExtensions}
|
||||
onToggle={(checked) =>
|
||||
updateElement(elementIdx, { allowedFileExtensions: checked ? [] : undefined })
|
||||
}
|
||||
htmlId="limitFileType"
|
||||
title={t("environments.surveys.edit.limit_file_types")}
|
||||
description={t("environments.surveys.edit.control_which_file_types_can_be_uploaded")}
|
||||
childBorder
|
||||
customContainerClass="p-0">
|
||||
<div className="p-4">
|
||||
<div className="flex flex-row flex-wrap gap-2">
|
||||
{element.allowedFileExtensions?.map((item, index) => (
|
||||
<div
|
||||
key={item}
|
||||
className="mb-2 flex h-8 items-center space-x-2 rounded-full bg-slate-200 px-2">
|
||||
<p className="text-sm text-slate-800">{item}</p>
|
||||
<Button
|
||||
className="inline-flex px-0"
|
||||
variant="ghost"
|
||||
onClick={(e) => removeExtension(e, index)}>
|
||||
<XCircleIcon className="h-4 w-4" />
|
||||
</Button>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<div className="flex items-center">
|
||||
<Input
|
||||
autoFocus
|
||||
className="mr-2 w-20 rounded-md bg-white placeholder:text-sm"
|
||||
placeholder=".pdf"
|
||||
value={extension}
|
||||
onChange={handleInputChange}
|
||||
type="text"
|
||||
/>
|
||||
<Button size="sm" variant="secondary" onClick={(e) => addExtension(e)}>
|
||||
{t("environments.surveys.edit.allow_file_type")}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</AdvancedOptionToggle>
|
||||
</div>
|
||||
</form>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -9,13 +9,12 @@ import { type JSX, useCallback } from "react";
|
||||
import toast from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { TI18nString } from "@formbricks/types/i18n";
|
||||
import { TSurveyElementTypeEnum, TSurveyMatrixElement } from "@formbricks/types/surveys/elements";
|
||||
import { TSurveyMatrixElement } from "@formbricks/types/surveys/elements";
|
||||
import { TSurvey } from "@formbricks/types/surveys/types";
|
||||
import { TUserLocale } from "@formbricks/types/user";
|
||||
import { createI18nString, extractLanguageCodes } from "@/lib/i18n/utils";
|
||||
import { ElementFormInput } from "@/modules/survey/components/element-form-input";
|
||||
import { MatrixSortableItem } from "@/modules/survey/editor/components/matrix-sortable-item";
|
||||
import { ValidationRulesEditor } from "@/modules/survey/editor/components/validation-rules-editor";
|
||||
import { findOptionUsedInLogic } from "@/modules/survey/editor/lib/utils";
|
||||
import { Button } from "@/modules/ui/components/button";
|
||||
import { Label } from "@/modules/ui/components/label";
|
||||
@@ -348,19 +347,6 @@ export const MatrixElementForm = ({
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{!element.required && (
|
||||
<ValidationRulesEditor
|
||||
elementType={TSurveyElementTypeEnum.Matrix}
|
||||
validation={element.validation}
|
||||
onUpdateValidation={(validation) => {
|
||||
updateElement(elementIdx, {
|
||||
validation,
|
||||
});
|
||||
}}
|
||||
element={element}
|
||||
/>
|
||||
)}
|
||||
</form>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -11,6 +11,7 @@ import { useTranslation } from "react-i18next";
|
||||
import { getLanguageLabel } from "@formbricks/i18n-utils/src/utils";
|
||||
import { TI18nString } from "@formbricks/types/i18n";
|
||||
import { TSurveyElementTypeEnum, TSurveyMultipleChoiceElement } from "@formbricks/types/surveys/elements";
|
||||
import { TValidationRule } from "@formbricks/types/surveys/validation-rules";
|
||||
import { TShuffleOption, TSurvey } from "@formbricks/types/surveys/types";
|
||||
import { TUserLocale } from "@formbricks/types/user";
|
||||
import { createI18nString, extractLanguageCodes } from "@/lib/i18n/utils";
|
||||
@@ -400,16 +401,16 @@ export const MultipleChoiceElementForm = ({
|
||||
locale={locale}
|
||||
/>
|
||||
|
||||
{/* Validation Rules Editor - only for MultipleChoiceMulti */}
|
||||
{element.type === TSurveyElementTypeEnum.MultipleChoiceMulti && (
|
||||
<ValidationRulesEditor
|
||||
elementType={TSurveyElementTypeEnum.MultipleChoiceMulti}
|
||||
validation={element.validation}
|
||||
onUpdateValidation={(validation) => {
|
||||
validationRules={element.validationRules ?? []}
|
||||
onUpdateRules={(rules: TValidationRule[]) => {
|
||||
updateElement(elementIdx, {
|
||||
validation,
|
||||
validationRules: rules,
|
||||
});
|
||||
}}
|
||||
element={element}
|
||||
/>
|
||||
)}
|
||||
</form>
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
"use client";
|
||||
|
||||
import { useAutoAnimate } from "@formkit/auto-animate/react";
|
||||
import { PlusIcon } from "lucide-react";
|
||||
import { JSX } from "react";
|
||||
import { HashIcon, LinkIcon, MailIcon, MessageSquareTextIcon, PhoneIcon, PlusIcon } from "lucide-react";
|
||||
import { JSX, useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import {
|
||||
TSurveyElementTypeEnum,
|
||||
TSurveyOpenTextElement,
|
||||
TSurveyOpenTextElementInputType,
|
||||
} from "@formbricks/types/surveys/elements";
|
||||
import { TValidationRule } from "@formbricks/types/surveys/validation-rules";
|
||||
import { TSurvey } from "@formbricks/types/surveys/types";
|
||||
import { TUserLocale } from "@formbricks/types/user";
|
||||
import { createI18nString, extractLanguageCodes } from "@/lib/i18n/utils";
|
||||
@@ -16,6 +17,9 @@ import { ElementFormInput } from "@/modules/survey/components/element-form-input
|
||||
import { ValidationRulesEditor } from "@/modules/survey/editor/components/validation-rules-editor";
|
||||
import { AdvancedOptionToggle } from "@/modules/ui/components/advanced-option-toggle";
|
||||
import { Button } from "@/modules/ui/components/button";
|
||||
import { Input } from "@/modules/ui/components/input";
|
||||
import { Label } from "@/modules/ui/components/label";
|
||||
import { OptionsSwitch } from "@/modules/ui/components/options-switch";
|
||||
|
||||
interface OpenElementFormProps {
|
||||
localSurvey: TSurvey;
|
||||
@@ -44,10 +48,43 @@ export const OpenElementForm = ({
|
||||
isExternalUrlsAllowed,
|
||||
}: OpenElementFormProps): JSX.Element => {
|
||||
const { t } = useTranslation();
|
||||
const elementTypes = [
|
||||
{ value: "text", label: t("common.text"), icon: <MessageSquareTextIcon className="h-4 w-4" /> },
|
||||
{ value: "email", label: t("common.email"), icon: <MailIcon className="h-4 w-4" /> },
|
||||
{ value: "url", label: t("common.url"), icon: <LinkIcon className="h-4 w-4" /> },
|
||||
{ value: "number", label: t("common.number"), icon: <HashIcon className="h-4 w-4" /> },
|
||||
{ value: "phone", label: t("common.phone"), icon: <PhoneIcon className="h-4 w-4" /> },
|
||||
];
|
||||
const defaultPlaceholder = getPlaceholderByInputType(element.inputType ?? "text");
|
||||
const surveyLanguageCodes = extractLanguageCodes(localSurvey.languages ?? []);
|
||||
|
||||
const [showCharLimits, setShowCharLimits] = useState(element.inputType === "text");
|
||||
|
||||
const handleInputChange = (inputType: TSurveyOpenTextElementInputType) => {
|
||||
const updatedAttributes = {
|
||||
inputType: inputType,
|
||||
placeholder: createI18nString(getPlaceholderByInputType(inputType), surveyLanguageCodes),
|
||||
longAnswer: inputType === "text" ? element.longAnswer : false,
|
||||
charLimit: {
|
||||
min: undefined,
|
||||
max: undefined,
|
||||
},
|
||||
};
|
||||
setIsCharLimitEnabled(false);
|
||||
setShowCharLimits(inputType === "text");
|
||||
updateElement(elementIdx, updatedAttributes);
|
||||
};
|
||||
|
||||
const [parent] = useAutoAnimate();
|
||||
const [isCharLimitEnabled, setIsCharLimitEnabled] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (element?.charLimit?.min !== undefined || element?.charLimit?.max !== undefined) {
|
||||
setIsCharLimitEnabled(true);
|
||||
} else {
|
||||
setIsCharLimitEnabled(false);
|
||||
}
|
||||
}, [element?.charLimit?.max, element?.charLimit?.min]);
|
||||
|
||||
return (
|
||||
<form>
|
||||
@@ -125,7 +162,80 @@ export const OpenElementForm = ({
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Add a dropdown to select the element type */}
|
||||
<div className="mt-3">
|
||||
<Label htmlFor="elementType">{t("common.input_type")}</Label>
|
||||
<div className="mt-2 flex items-center">
|
||||
<OptionsSwitch
|
||||
options={elementTypes}
|
||||
currentOption={element.inputType}
|
||||
handleOptionChange={handleInputChange} // Use the merged function
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="mt-6 space-y-6">
|
||||
{showCharLimits && (
|
||||
<AdvancedOptionToggle
|
||||
isChecked={isCharLimitEnabled}
|
||||
onToggle={(checked: boolean) => {
|
||||
setIsCharLimitEnabled(checked);
|
||||
updateElement(elementIdx, {
|
||||
charLimit: {
|
||||
enabled: checked,
|
||||
min: undefined,
|
||||
max: undefined,
|
||||
},
|
||||
});
|
||||
}}
|
||||
htmlId={`charLimit-${element.id}`}
|
||||
description={t("environments.surveys.edit.character_limit_toggle_description")}
|
||||
childBorder
|
||||
title={t("environments.surveys.edit.character_limit_toggle_title")}
|
||||
customContainerClass="p-0">
|
||||
<div className="flex gap-4 p-4">
|
||||
<div className="flex items-center gap-2">
|
||||
<Label htmlFor="minLength">{t("common.minimum")}</Label>
|
||||
<Input
|
||||
id="minLength"
|
||||
name="minLength"
|
||||
type="number"
|
||||
min={0}
|
||||
value={element?.charLimit?.min || ""}
|
||||
aria-label={t("common.minimum")}
|
||||
className="bg-white"
|
||||
onChange={(e) =>
|
||||
updateElement(elementIdx, {
|
||||
charLimit: {
|
||||
...element?.charLimit,
|
||||
min: e.target.value ? parseInt(e.target.value) : undefined,
|
||||
},
|
||||
})
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Label htmlFor="maxLength">{t("common.maximum")}</Label>
|
||||
<Input
|
||||
id="maxLength"
|
||||
name="maxLength"
|
||||
type="number"
|
||||
min={0}
|
||||
aria-label={t("common.maximum")}
|
||||
value={element?.charLimit?.max || ""}
|
||||
className="bg-white"
|
||||
onChange={(e) =>
|
||||
updateElement(elementIdx, {
|
||||
charLimit: {
|
||||
...element?.charLimit,
|
||||
max: e.target.value ? parseInt(e.target.value) : undefined,
|
||||
},
|
||||
})
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</AdvancedOptionToggle>
|
||||
)}
|
||||
<div className="mt-4">
|
||||
<AdvancedOptionToggle
|
||||
isChecked={element.longAnswer !== false}
|
||||
@@ -142,23 +252,13 @@ export const OpenElementForm = ({
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Validation Rules Editor */}
|
||||
<ValidationRulesEditor
|
||||
elementType={TSurveyElementTypeEnum.OpenText}
|
||||
validation={element.validation}
|
||||
onUpdateValidation={(validation) => {
|
||||
validationRules={element.validationRules ?? []}
|
||||
onUpdateRules={(rules: TValidationRule[]) => {
|
||||
updateElement(elementIdx, {
|
||||
validation,
|
||||
});
|
||||
}}
|
||||
inputType={element.inputType ?? "text"}
|
||||
onUpdateInputType={(newInputType) => {
|
||||
updateElement(elementIdx, {
|
||||
inputType: newInputType,
|
||||
// Update placeholder if not already set
|
||||
placeholder:
|
||||
element.placeholder ||
|
||||
createI18nString(getPlaceholderByInputType(newInputType), surveyLanguageCodes),
|
||||
longAnswer: newInputType === "text",
|
||||
validationRules: rules,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -8,13 +8,12 @@ import { PlusIcon } from "lucide-react";
|
||||
import { type JSX, useEffect, useRef, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { TI18nString } from "@formbricks/types/i18n";
|
||||
import { TSurveyElementTypeEnum, TSurveyRankingElement } from "@formbricks/types/surveys/elements";
|
||||
import { TSurveyRankingElement } from "@formbricks/types/surveys/elements";
|
||||
import { TSurvey } from "@formbricks/types/surveys/types";
|
||||
import { TUserLocale } from "@formbricks/types/user";
|
||||
import { createI18nString, extractLanguageCodes } from "@/lib/i18n/utils";
|
||||
import { ElementFormInput } from "@/modules/survey/components/element-form-input";
|
||||
import { ElementOptionChoice } from "@/modules/survey/editor/components/element-option-choice";
|
||||
import { ValidationRulesEditor } from "@/modules/survey/editor/components/validation-rules-editor";
|
||||
import { Button } from "@/modules/ui/components/button";
|
||||
import { Label } from "@/modules/ui/components/label";
|
||||
import { ShuffleOptionSelect } from "@/modules/ui/components/shuffle-option-select";
|
||||
@@ -247,17 +246,6 @@ export const RankingElementForm = ({
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ValidationRulesEditor
|
||||
elementType={TSurveyElementTypeEnum.Ranking}
|
||||
validation={element.validation}
|
||||
onUpdateValidation={(validation) => {
|
||||
updateElement(elementIdx, {
|
||||
validation,
|
||||
});
|
||||
}}
|
||||
element={element}
|
||||
/>
|
||||
</form>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -33,10 +33,9 @@ export const ResponseOptionsCard = ({
|
||||
const [surveyClosedMessageToggle, setSurveyClosedMessageToggle] = useState(false);
|
||||
const [verifyEmailToggle, setVerifyEmailToggle] = useState(localSurvey.isVerifyEmailEnabled);
|
||||
const [recaptchaToggle, setRecaptchaToggle] = useState(localSurvey.recaptcha?.enabled ?? false);
|
||||
const [singleResponsePerEmailToggle, setSingleResponsePerEmailToggle] = useState(
|
||||
const [isSingleResponsePerEmailEnabledToggle, setIsSingleResponsePerEmailToggle] = useState(
|
||||
localSurvey.isSingleResponsePerEmailEnabled
|
||||
);
|
||||
const [captureIpToggle, setCaptureIpToggle] = useState(localSurvey.isCaptureIpEnabled);
|
||||
|
||||
const [surveyClosedMessage, setSurveyClosedMessage] = useState({
|
||||
heading: t("environments.surveys.edit.survey_completed_heading"),
|
||||
@@ -91,7 +90,7 @@ export const ResponseOptionsCard = ({
|
||||
};
|
||||
|
||||
const handleSingleResponsePerEmailToggle = () => {
|
||||
setSingleResponsePerEmailToggle(!singleResponsePerEmailToggle);
|
||||
setIsSingleResponsePerEmailToggle(!isSingleResponsePerEmailEnabledToggle);
|
||||
setLocalSurvey({
|
||||
...localSurvey,
|
||||
isSingleResponsePerEmailEnabled: !localSurvey.isSingleResponsePerEmailEnabled,
|
||||
@@ -118,11 +117,6 @@ export const ResponseOptionsCard = ({
|
||||
setLocalSurvey({ ...localSurvey, isBackButtonHidden: !localSurvey.isBackButtonHidden });
|
||||
};
|
||||
|
||||
const handleCaptureIpToggle = () => {
|
||||
setCaptureIpToggle(!captureIpToggle);
|
||||
setLocalSurvey({ ...localSurvey, isCaptureIpEnabled: !localSurvey.isCaptureIpEnabled });
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (!!localSurvey.surveyClosedMessage) {
|
||||
setSurveyClosedMessage({
|
||||
@@ -205,7 +199,7 @@ export const ResponseOptionsCard = ({
|
||||
)}>
|
||||
<Collapsible.CollapsibleTrigger asChild className="h-full w-full cursor-pointer">
|
||||
<div className="inline-flex px-4 py-4">
|
||||
<div className="flex items-center pr-5 pl-2">
|
||||
<div className="flex items-center pl-2 pr-5">
|
||||
<CheckIcon
|
||||
strokeWidth={3}
|
||||
className="h-7 w-7 rounded-full border border-green-300 bg-green-100 p-1.5 text-green-600"
|
||||
@@ -243,7 +237,7 @@ export const ResponseOptionsCard = ({
|
||||
value={localSurvey.autoComplete?.toString()}
|
||||
onChange={handleInputResponse}
|
||||
onBlur={handleInputResponseBlur}
|
||||
className="mr-2 ml-2 inline w-20 bg-white text-center text-sm"
|
||||
className="ml-2 mr-2 inline w-20 bg-white text-center text-sm"
|
||||
/>
|
||||
{t("environments.surveys.edit.completed_responses")}
|
||||
</p>
|
||||
@@ -310,7 +304,7 @@ export const ResponseOptionsCard = ({
|
||||
<Input
|
||||
autoFocus
|
||||
id="heading"
|
||||
className="mt-2 mb-4 bg-white"
|
||||
className="mb-4 mt-2 bg-white"
|
||||
name="heading"
|
||||
defaultValue={surveyClosedMessage.heading}
|
||||
onChange={(e) => handleClosedSurveyMessageChange({ heading: e.target.value })}
|
||||
@@ -339,7 +333,7 @@ export const ResponseOptionsCard = ({
|
||||
<div className="m-1">
|
||||
<AdvancedOptionToggle
|
||||
htmlId="preventDoubleSubmission"
|
||||
isChecked={singleResponsePerEmailToggle}
|
||||
isChecked={isSingleResponsePerEmailEnabledToggle}
|
||||
onToggle={handleSingleResponsePerEmailToggle}
|
||||
title={t("environments.surveys.edit.prevent_double_submission")}
|
||||
description={t("environments.surveys.edit.prevent_double_submission_description")}
|
||||
@@ -386,13 +380,6 @@ export const ResponseOptionsCard = ({
|
||||
title={t("environments.surveys.edit.hide_back_button")}
|
||||
description={t("environments.surveys.edit.hide_back_button_description")}
|
||||
/>
|
||||
<AdvancedOptionToggle
|
||||
htmlId="captureIp"
|
||||
isChecked={captureIpToggle}
|
||||
onToggle={handleCaptureIpToggle}
|
||||
title={t("environments.surveys.edit.capture_ip_address")}
|
||||
description={t("environments.surveys.edit.capture_ip_address_description")}
|
||||
/>
|
||||
</div>
|
||||
</Collapsible.CollapsibleContent>
|
||||
</Collapsible.Root>
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { TValidationLogic } from "@formbricks/types/surveys/elements";
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "@/modules/ui/components/select";
|
||||
|
||||
interface ValidationLogicSelectorProps {
|
||||
value: TValidationLogic;
|
||||
onChange: (value: TValidationLogic) => void;
|
||||
}
|
||||
|
||||
export const ValidationLogicSelector = ({ value, onChange }: ValidationLogicSelectorProps) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<div className="flex w-full items-center gap-2">
|
||||
<Select value={value} onValueChange={(val) => onChange(val as TValidationLogic)}>
|
||||
<SelectTrigger className="h-8 w-fit bg-white">
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="and">{t("environments.surveys.edit.validation_logic_and")}</SelectItem>
|
||||
<SelectItem value="or">{t("environments.surveys.edit.validation_logic_or")}</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -1,42 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { TAddressField, TContactInfoField } from "@formbricks/types/surveys/validation-rules";
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "@/modules/ui/components/select";
|
||||
|
||||
interface ValidationRuleFieldSelectorProps {
|
||||
value: TAddressField | TContactInfoField | undefined;
|
||||
onChange: (value: TAddressField | TContactInfoField | undefined) => void;
|
||||
fieldOptions: { value: TAddressField | TContactInfoField; label: string }[];
|
||||
}
|
||||
|
||||
export const ValidationRuleFieldSelector = ({
|
||||
value,
|
||||
onChange,
|
||||
fieldOptions,
|
||||
}: ValidationRuleFieldSelectorProps) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<Select
|
||||
value={value ?? ""}
|
||||
onValueChange={(val) => onChange(val ? (val as TAddressField | TContactInfoField) : undefined)}>
|
||||
<SelectTrigger className="h-9 min-w-[140px] bg-white">
|
||||
<SelectValue placeholder={t("environments.surveys.edit.select_field")} />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{fieldOptions.map((field) => (
|
||||
<SelectItem key={field.value} value={field.value}>
|
||||
{field.label}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
);
|
||||
};
|
||||
@@ -1,45 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { TSurveyOpenTextElementInputType } from "@formbricks/types/surveys/elements";
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "@/modules/ui/components/select";
|
||||
import { cn } from "@/modules/ui/lib/utils";
|
||||
|
||||
interface ValidationRuleInputTypeSelectorProps {
|
||||
value: TSurveyOpenTextElementInputType;
|
||||
onChange?: (value: TSurveyOpenTextElementInputType) => void;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export const ValidationRuleInputTypeSelector = ({
|
||||
value,
|
||||
onChange,
|
||||
disabled = false,
|
||||
}: ValidationRuleInputTypeSelectorProps) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<Select
|
||||
value={value}
|
||||
onValueChange={onChange ? (val) => onChange(val as TSurveyOpenTextElementInputType) : undefined}
|
||||
disabled={disabled}>
|
||||
<SelectTrigger
|
||||
className={cn("h-9 min-w-[120px]", disabled ? "cursor-not-allowed bg-slate-100" : "bg-white")}>
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="text">{t("common.text")}</SelectItem>
|
||||
<SelectItem value="email">{t("common.email")}</SelectItem>
|
||||
<SelectItem value="url">{t("common.url")}</SelectItem>
|
||||
<SelectItem value="phone">{t("common.phone")}</SelectItem>
|
||||
<SelectItem value="number">{t("common.number")}</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
);
|
||||
};
|
||||
@@ -1,168 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { PlusIcon, TrashIcon } from "lucide-react";
|
||||
import { TAllowedFileExtension } from "@formbricks/types/storage";
|
||||
import {
|
||||
TSurveyElement,
|
||||
TSurveyElementTypeEnum,
|
||||
TSurveyOpenTextElementInputType,
|
||||
} from "@formbricks/types/surveys/elements";
|
||||
import {
|
||||
TAddressField,
|
||||
TContactInfoField,
|
||||
TValidationRule,
|
||||
TValidationRuleType,
|
||||
} from "@formbricks/types/surveys/validation-rules";
|
||||
import { Button } from "@/modules/ui/components/button";
|
||||
import { RULE_TYPE_CONFIG } from "../lib/validation-rules-config";
|
||||
import { getAvailableRuleTypes, getRuleValue } from "../lib/validation-rules-utils";
|
||||
import { ValidationRuleFieldSelector } from "./validation-rule-field-selector";
|
||||
import { ValidationRuleInputTypeSelector } from "./validation-rule-input-type-selector";
|
||||
import { ValidationRuleTypeSelector } from "./validation-rule-type-selector";
|
||||
import { ValidationRuleUnitSelector } from "./validation-rule-unit-selector";
|
||||
import { ValidationRuleValueInput } from "./validation-rule-value-input";
|
||||
|
||||
interface ValidationRuleRowProps {
|
||||
rule: TValidationRule;
|
||||
index: number;
|
||||
elementType: TSurveyElementTypeEnum;
|
||||
element?: TSurveyElement;
|
||||
inputType?: TSurveyOpenTextElementInputType;
|
||||
onInputTypeChange?: (inputType: TSurveyOpenTextElementInputType) => void;
|
||||
fieldOptions: { value: TAddressField | TContactInfoField; label: string }[];
|
||||
needsFieldSelector: boolean;
|
||||
validationRules: TValidationRule[];
|
||||
ruleLabels: Record<string, string>;
|
||||
onFieldChange: (ruleId: string, field: TAddressField | TContactInfoField | undefined) => void;
|
||||
onRuleTypeChange: (ruleId: string, newType: TValidationRuleType) => void;
|
||||
onRuleValueChange: (ruleId: string, value: string) => void;
|
||||
onFileExtensionChange: (ruleId: string, extensions: TAllowedFileExtension[]) => void;
|
||||
onDelete: (ruleId: string) => void;
|
||||
onAdd: (insertAfterIndex: number) => void;
|
||||
canAddMore: boolean;
|
||||
}
|
||||
|
||||
export const ValidationRuleRow = ({
|
||||
rule,
|
||||
index,
|
||||
elementType,
|
||||
element,
|
||||
inputType,
|
||||
onInputTypeChange,
|
||||
fieldOptions,
|
||||
needsFieldSelector,
|
||||
validationRules,
|
||||
ruleLabels,
|
||||
onFieldChange,
|
||||
onRuleTypeChange,
|
||||
onRuleValueChange,
|
||||
onFileExtensionChange,
|
||||
onDelete,
|
||||
onAdd,
|
||||
canAddMore,
|
||||
}: ValidationRuleRowProps) => {
|
||||
const ruleType = rule.type;
|
||||
const config = RULE_TYPE_CONFIG[ruleType];
|
||||
const currentValue = getRuleValue(rule);
|
||||
|
||||
// Get available types for this rule (current type + unused types, no duplicates)
|
||||
// For address/contact info, filter by selected field
|
||||
const ruleField = rule.field;
|
||||
const otherAvailableTypes = getAvailableRuleTypes(
|
||||
elementType,
|
||||
validationRules.filter((r) => r.id !== rule.id),
|
||||
elementType === TSurveyElementTypeEnum.OpenText ? inputType : undefined,
|
||||
ruleField
|
||||
).filter((t) => t !== ruleType);
|
||||
const availableTypesForSelect = [ruleType, ...otherAvailableTypes];
|
||||
|
||||
// Check if this is OpenText and first rule - show input type selector
|
||||
const isOpenText = elementType === TSurveyElementTypeEnum.OpenText;
|
||||
const isFirstRule = index === 0;
|
||||
const showInputTypeSelector = isOpenText && isFirstRule;
|
||||
|
||||
const handleFileExtensionChange = (extensions: TAllowedFileExtension[]) => {
|
||||
onFileExtensionChange(rule.id, extensions);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="flex w-full items-center gap-2">
|
||||
{/* Field Selector (for Address and Contact Info elements) */}
|
||||
{needsFieldSelector && (
|
||||
<ValidationRuleFieldSelector
|
||||
value={rule.field}
|
||||
onChange={(value) => onFieldChange(rule.id, value)}
|
||||
fieldOptions={fieldOptions}
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Input Type Selector (only for OpenText, first rule) */}
|
||||
{showInputTypeSelector && inputType !== undefined && onInputTypeChange && (
|
||||
<ValidationRuleInputTypeSelector value={inputType} onChange={onInputTypeChange} />
|
||||
)}
|
||||
|
||||
{/* Input Type Display (disabled, for subsequent rules) */}
|
||||
{isOpenText && !isFirstRule && inputType !== undefined && (
|
||||
<ValidationRuleInputTypeSelector value={inputType} disabled />
|
||||
)}
|
||||
|
||||
{/* Rule Type Selector */}
|
||||
<ValidationRuleTypeSelector
|
||||
value={ruleType}
|
||||
onChange={(value) => onRuleTypeChange(rule.id, value)}
|
||||
availableTypes={availableTypesForSelect}
|
||||
ruleLabels={ruleLabels}
|
||||
needsValue={config.needsValue}
|
||||
/>
|
||||
|
||||
{/* Value Input (if needed) */}
|
||||
{config.needsValue && (
|
||||
<div className="flex w-full items-center gap-2">
|
||||
<ValidationRuleValueInput
|
||||
rule={rule}
|
||||
ruleType={ruleType}
|
||||
config={config}
|
||||
currentValue={currentValue}
|
||||
onChange={(value) => onRuleValueChange(rule.id, value)}
|
||||
onFileExtensionChange={handleFileExtensionChange}
|
||||
element={element}
|
||||
/>
|
||||
|
||||
{/* Unit selector (if applicable) */}
|
||||
{config.unitOptions && config.unitOptions.length > 0 && (
|
||||
<ValidationRuleUnitSelector
|
||||
value={config.unitOptions[0].value}
|
||||
unitOptions={config.unitOptions}
|
||||
ruleLabels={ruleLabels}
|
||||
disabled={config.unitOptions.length === 1}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Delete button */}
|
||||
<Button
|
||||
variant="outline"
|
||||
size="icon"
|
||||
type="button"
|
||||
onClick={() => onDelete(rule.id)}
|
||||
className="shrink-0 bg-white"
|
||||
aria-label="Delete validation rule">
|
||||
<TrashIcon className="h-4 w-4" />
|
||||
</Button>
|
||||
|
||||
{/* Add button */}
|
||||
{canAddMore && (
|
||||
<Button
|
||||
variant="outline"
|
||||
size="icon"
|
||||
type="button"
|
||||
onClick={() => onAdd(index)}
|
||||
className="shrink-0 bg-white"
|
||||
aria-label="Add validation rule">
|
||||
<PlusIcon className="h-4 w-4" />
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -1,44 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { capitalize } from "lodash";
|
||||
import { TValidationRuleType } from "@formbricks/types/surveys/validation-rules";
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "@/modules/ui/components/select";
|
||||
import { cn } from "@/modules/ui/lib/utils";
|
||||
import { RULE_TYPE_CONFIG } from "../lib/validation-rules-config";
|
||||
|
||||
interface ValidationRuleTypeSelectorProps {
|
||||
value: TValidationRuleType;
|
||||
onChange: (value: TValidationRuleType) => void;
|
||||
availableTypes: TValidationRuleType[];
|
||||
ruleLabels: Record<string, string>;
|
||||
needsValue: boolean;
|
||||
}
|
||||
|
||||
export const ValidationRuleTypeSelector = ({
|
||||
value,
|
||||
onChange,
|
||||
availableTypes,
|
||||
ruleLabels,
|
||||
needsValue,
|
||||
}: ValidationRuleTypeSelectorProps) => {
|
||||
return (
|
||||
<Select value={value} onValueChange={(val) => onChange(val as TValidationRuleType)}>
|
||||
<SelectTrigger className={cn("bg-white", needsValue ? "min-w-[200px]" : "flex-1")}>
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{availableTypes.map((type) => (
|
||||
<SelectItem key={type} value={type}>
|
||||
{capitalize(ruleLabels[RULE_TYPE_CONFIG[type].labelKey])}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
);
|
||||
};
|
||||
@@ -1,44 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "@/modules/ui/components/select";
|
||||
import { cn } from "@/modules/ui/lib/utils";
|
||||
|
||||
interface UnitOption {
|
||||
value: string;
|
||||
labelKey: string;
|
||||
}
|
||||
|
||||
interface ValidationRuleUnitSelectorProps {
|
||||
value: string;
|
||||
unitOptions: UnitOption[];
|
||||
ruleLabels: Record<string, string>;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export const ValidationRuleUnitSelector = ({
|
||||
value,
|
||||
unitOptions,
|
||||
ruleLabels,
|
||||
disabled = false,
|
||||
}: ValidationRuleUnitSelectorProps) => {
|
||||
return (
|
||||
<Select value={value} onValueChange={() => {}} disabled={disabled || unitOptions.length === 1}>
|
||||
<SelectTrigger className={cn("h-9 min-w-[180px] flex-1 bg-white", disabled && "cursor-not-allowed")}>
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{unitOptions.map((unit) => (
|
||||
<SelectItem key={unit.value} value={unit.value} className="truncate">
|
||||
{ruleLabels[unit.labelKey]}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
);
|
||||
};
|
||||
@@ -1,137 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { ALLOWED_FILE_EXTENSIONS, TAllowedFileExtension } from "@formbricks/types/storage";
|
||||
import { TSurveyElement } from "@formbricks/types/surveys/elements";
|
||||
import { TValidationRule, TValidationRuleType } from "@formbricks/types/surveys/validation-rules";
|
||||
import { Input } from "@/modules/ui/components/input";
|
||||
import { MultiSelect } from "@/modules/ui/components/multi-select";
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "@/modules/ui/components/select";
|
||||
import { RULE_TYPE_CONFIG } from "../lib/validation-rules-config";
|
||||
|
||||
interface ValidationRuleValueInputProps {
|
||||
rule: TValidationRule;
|
||||
ruleType: TValidationRuleType;
|
||||
config: (typeof RULE_TYPE_CONFIG)[TValidationRuleType];
|
||||
currentValue: number | string | undefined;
|
||||
onChange: (value: string) => void;
|
||||
onFileExtensionChange: (extensions: TAllowedFileExtension[]) => void;
|
||||
element?: TSurveyElement;
|
||||
}
|
||||
|
||||
export const ValidationRuleValueInput = ({
|
||||
rule,
|
||||
ruleType,
|
||||
config,
|
||||
currentValue,
|
||||
onChange,
|
||||
onFileExtensionChange,
|
||||
element,
|
||||
}: ValidationRuleValueInputProps) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
// Determine HTML input type for value inputs
|
||||
let htmlInputType: "number" | "date" | "text" = "text";
|
||||
if (config.valueType === "number") {
|
||||
htmlInputType = "number";
|
||||
} else if (
|
||||
ruleType.startsWith("is") &&
|
||||
(ruleType.includes("Later") || ruleType.includes("Earlier") || ruleType.includes("On"))
|
||||
) {
|
||||
htmlInputType = "date";
|
||||
}
|
||||
|
||||
// Special handling for date range inputs
|
||||
if (ruleType === "isBetween" || ruleType === "isNotBetween") {
|
||||
return (
|
||||
<div className="flex w-full items-center gap-2">
|
||||
<Input
|
||||
type="date"
|
||||
value={(currentValue as string)?.split(",")?.[0] ?? ""}
|
||||
onChange={(e) => {
|
||||
const currentEndDate = (currentValue as string)?.split(",")?.[1] ?? "";
|
||||
onChange(`${e.target.value},${currentEndDate}`);
|
||||
}}
|
||||
placeholder="Start date"
|
||||
className="h-9 flex-1 bg-white"
|
||||
/>
|
||||
<span className="text-sm text-slate-500">and</span>
|
||||
<Input
|
||||
type="date"
|
||||
value={(currentValue as string)?.split(",")?.[1] ?? ""}
|
||||
onChange={(e) => {
|
||||
const currentStartDate = (currentValue as string)?.split(",")?.[0] ?? "";
|
||||
onChange(`${currentStartDate},${e.target.value}`);
|
||||
}}
|
||||
placeholder="End date"
|
||||
className="h-9 flex-1 bg-white"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// Option selector for single select validation rules
|
||||
if (config.valueType === "option") {
|
||||
const optionValue = typeof currentValue === "string" ? currentValue : "";
|
||||
return (
|
||||
<Select value={optionValue} onValueChange={onChange}>
|
||||
<SelectTrigger className="h-9 min-w-[200px] bg-white">
|
||||
<SelectValue placeholder="Select option" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{element &&
|
||||
"choices" in element &&
|
||||
element.choices
|
||||
.filter((choice) => choice.id !== "other" && choice.id !== "none" && "label" in choice)
|
||||
.map((choice) => {
|
||||
const choiceLabel =
|
||||
"label" in choice
|
||||
? choice.label.default || Object.values(choice.label)[0] || choice.id
|
||||
: choice.id;
|
||||
return (
|
||||
<SelectItem key={choice.id} value={choice.id}>
|
||||
{choiceLabel}
|
||||
</SelectItem>
|
||||
);
|
||||
})}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
);
|
||||
}
|
||||
|
||||
// File extension MultiSelect
|
||||
if (ruleType === "fileExtensionIs" || ruleType === "fileExtensionIsNot") {
|
||||
const extensionOptions = ALLOWED_FILE_EXTENSIONS.map((ext) => ({
|
||||
value: ext,
|
||||
label: `.${ext}`,
|
||||
}));
|
||||
const selectedExtensions = (rule.params as { extensions: string[] })?.extensions || [];
|
||||
return (
|
||||
<MultiSelect
|
||||
options={extensionOptions}
|
||||
value={selectedExtensions as TAllowedFileExtension[]}
|
||||
onChange={onFileExtensionChange}
|
||||
placeholder={t("environments.surveys.edit.validation.select_file_extensions")}
|
||||
disabled={false}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
// Default text/number input
|
||||
return (
|
||||
<Input
|
||||
type={htmlInputType}
|
||||
value={currentValue ?? ""}
|
||||
onChange={(e) => onChange(e.target.value)}
|
||||
placeholder={config.valuePlaceholder}
|
||||
className="h-9 min-w-[80px] bg-white"
|
||||
min={config.valueType === "number" ? 0 : ""}
|
||||
/>
|
||||
);
|
||||
};
|
||||
@@ -1,351 +1,341 @@
|
||||
"use client";
|
||||
|
||||
import { createId } from "@paralleldrive/cuid2";
|
||||
import { PlusIcon, TrashIcon } from "lucide-react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { v7 as uuidv7 } from "uuid";
|
||||
import { TAllowedFileExtension } from "@formbricks/types/storage";
|
||||
import { TSurveyElementTypeEnum } from "@formbricks/types/surveys/elements";
|
||||
import {
|
||||
TSurveyElement,
|
||||
TSurveyElementTypeEnum,
|
||||
TSurveyOpenTextElementInputType,
|
||||
TValidationLogic,
|
||||
} from "@formbricks/types/surveys/elements";
|
||||
import {
|
||||
TAddressField,
|
||||
TContactInfoField,
|
||||
TValidationRule,
|
||||
TValidationRuleType,
|
||||
APPLICABLE_RULES,
|
||||
TValidationRule,
|
||||
TValidationRuleType,
|
||||
} from "@formbricks/types/surveys/validation-rules";
|
||||
import { AdvancedOptionToggle } from "@/modules/ui/components/advanced-option-toggle";
|
||||
import { RULE_TYPE_CONFIG } from "../lib/validation-rules-config";
|
||||
import { Button } from "@/modules/ui/components/button";
|
||||
import { Input } from "@/modules/ui/components/input";
|
||||
import {
|
||||
getAddressFields,
|
||||
getContactInfoFields,
|
||||
getDefaultRuleValue,
|
||||
getRuleLabels,
|
||||
parseRuleValue,
|
||||
} from "../lib/validation-rules-helpers";
|
||||
import { RULES_BY_INPUT_TYPE, createRuleParams, getAvailableRuleTypes } from "../lib/validation-rules-utils";
|
||||
import { ValidationLogicSelector } from "./validation-logic-selector";
|
||||
import { ValidationRuleRow } from "./validation-rule-row";
|
||||
|
||||
type TValidationField = TAddressField | TContactInfoField | undefined;
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "@/modules/ui/components/select";
|
||||
|
||||
interface ValidationRulesEditorProps {
|
||||
elementType: TSurveyElementTypeEnum;
|
||||
validation?: { rules: TValidationRule[]; logic?: TValidationLogic };
|
||||
onUpdateValidation: (validation: { rules: TValidationRule[]; logic: TValidationLogic }) => void;
|
||||
element?: TSurveyElement;
|
||||
// For OpenText: input type and callback to update it
|
||||
inputType?: TSurveyOpenTextElementInputType;
|
||||
onUpdateInputType?: (inputType: TSurveyOpenTextElementInputType) => void;
|
||||
elementType: TSurveyElementTypeEnum;
|
||||
validationRules: TValidationRule[];
|
||||
onUpdateRules: (rules: TValidationRule[]) => void;
|
||||
}
|
||||
|
||||
// Rule type definitions with labels and whether they need a value input
|
||||
const RULE_TYPE_CONFIG: Record<
|
||||
TValidationRuleType,
|
||||
{
|
||||
label: string;
|
||||
needsValue: boolean;
|
||||
valueType?: "number" | "text";
|
||||
valuePlaceholder?: string;
|
||||
unitOptions?: { value: string; label: string }[];
|
||||
}
|
||||
> = {
|
||||
required: {
|
||||
label: "Is not empty",
|
||||
needsValue: false,
|
||||
},
|
||||
minLength: {
|
||||
label: "Is longer than",
|
||||
needsValue: true,
|
||||
valueType: "number",
|
||||
valuePlaceholder: "100",
|
||||
unitOptions: [
|
||||
{ value: "characters", label: "characters" },
|
||||
],
|
||||
},
|
||||
maxLength: {
|
||||
label: "Is shorter than",
|
||||
needsValue: true,
|
||||
valueType: "number",
|
||||
valuePlaceholder: "500",
|
||||
unitOptions: [
|
||||
{ value: "characters", label: "characters" },
|
||||
],
|
||||
},
|
||||
pattern: {
|
||||
label: "Matches pattern",
|
||||
needsValue: true,
|
||||
valueType: "text",
|
||||
valuePlaceholder: "^[A-Z].*",
|
||||
},
|
||||
email: {
|
||||
label: "Is valid email",
|
||||
needsValue: false,
|
||||
},
|
||||
url: {
|
||||
label: "Is valid URL",
|
||||
needsValue: false,
|
||||
},
|
||||
phone: {
|
||||
label: "Is valid phone",
|
||||
needsValue: false,
|
||||
},
|
||||
minValue: {
|
||||
label: "Is greater than",
|
||||
needsValue: true,
|
||||
valueType: "number",
|
||||
valuePlaceholder: "0",
|
||||
},
|
||||
maxValue: {
|
||||
label: "Is less than",
|
||||
needsValue: true,
|
||||
valueType: "number",
|
||||
valuePlaceholder: "100",
|
||||
},
|
||||
minSelections: {
|
||||
label: "At least",
|
||||
needsValue: true,
|
||||
valueType: "number",
|
||||
valuePlaceholder: "1",
|
||||
unitOptions: [{ value: "options", label: "options selected" }],
|
||||
},
|
||||
maxSelections: {
|
||||
label: "At most",
|
||||
needsValue: true,
|
||||
valueType: "number",
|
||||
valuePlaceholder: "3",
|
||||
unitOptions: [{ value: "options", label: "options selected" }],
|
||||
},
|
||||
};
|
||||
|
||||
// Get available rule types for an element type
|
||||
const getAvailableRuleTypes = (
|
||||
elementType: TSurveyElementTypeEnum,
|
||||
existingRules: TValidationRule[]
|
||||
): TValidationRuleType[] => {
|
||||
const elementTypeKey = elementType.toString();
|
||||
const applicable = APPLICABLE_RULES[elementTypeKey] ?? [];
|
||||
|
||||
// Filter out rules that are already added (for non-repeatable rules)
|
||||
const existingTypes = new Set(existingRules.map((r) => r.params.type));
|
||||
|
||||
return applicable.filter((ruleType) => {
|
||||
// Allow only one of each rule type
|
||||
return !existingTypes.has(ruleType);
|
||||
});
|
||||
};
|
||||
|
||||
// Get the value from rule params based on rule type
|
||||
const getRuleValue = (rule: TValidationRule): number | string | undefined => {
|
||||
const params = rule.params as Record<string, unknown>;
|
||||
if ("min" in params) return params.min as number;
|
||||
if ("max" in params) return params.max as number;
|
||||
if ("pattern" in params) return params.pattern as string;
|
||||
return undefined;
|
||||
};
|
||||
|
||||
// Create params object from rule type and value
|
||||
const createRuleParams = (
|
||||
ruleType: TValidationRuleType,
|
||||
value?: number | string
|
||||
): TValidationRule["params"] => {
|
||||
switch (ruleType) {
|
||||
case "required":
|
||||
return { type: "required" };
|
||||
case "minLength":
|
||||
return { type: "minLength", min: Number(value) || 0 };
|
||||
case "maxLength":
|
||||
return { type: "maxLength", max: Number(value) || 100 };
|
||||
case "pattern":
|
||||
return { type: "pattern", pattern: String(value) || "" };
|
||||
case "email":
|
||||
return { type: "email" };
|
||||
case "url":
|
||||
return { type: "url" };
|
||||
case "phone":
|
||||
return { type: "phone" };
|
||||
case "minValue":
|
||||
return { type: "minValue", min: Number(value) || 0 };
|
||||
case "maxValue":
|
||||
return { type: "maxValue", max: Number(value) || 100 };
|
||||
case "minSelections":
|
||||
return { type: "minSelections", min: Number(value) || 1 };
|
||||
case "maxSelections":
|
||||
return { type: "maxSelections", max: Number(value) || 3 };
|
||||
default:
|
||||
return { type: "required" };
|
||||
}
|
||||
};
|
||||
|
||||
export const ValidationRulesEditor = ({
|
||||
elementType,
|
||||
validation,
|
||||
onUpdateValidation,
|
||||
element,
|
||||
inputType,
|
||||
onUpdateInputType,
|
||||
}: ValidationRulesEditorProps) => {
|
||||
const validationRules = validation?.rules ?? [];
|
||||
const validationLogic = validation?.logic ?? "and";
|
||||
const { t } = useTranslation();
|
||||
|
||||
// Field options for address and contact info elements
|
||||
const isAddress = elementType === TSurveyElementTypeEnum.Address;
|
||||
const isContactInfo = elementType === TSurveyElementTypeEnum.ContactInfo;
|
||||
const needsFieldSelector = isAddress || isContactInfo;
|
||||
|
||||
let fieldOptions: { value: TAddressField | TContactInfoField; label: string }[] = [];
|
||||
if (isAddress) {
|
||||
fieldOptions = getAddressFields(t);
|
||||
} else if (isContactInfo) {
|
||||
fieldOptions = getContactInfoFields(t);
|
||||
}
|
||||
|
||||
const ruleLabels = getRuleLabels(t);
|
||||
|
||||
const isEnabled = validationRules.length > 0;
|
||||
|
||||
// For matrix elements, only show validation rules when element is not required
|
||||
const shouldShowValidationRules =
|
||||
elementType !== TSurveyElementTypeEnum.Matrix || (element && !element.required);
|
||||
|
||||
const handleEnable = () => {
|
||||
// For address/contact info, get rules for first field
|
||||
const defaultField = needsFieldSelector && fieldOptions.length > 0 ? fieldOptions[0].value : undefined;
|
||||
const availableRules = getAvailableRuleTypes(
|
||||
elementType,
|
||||
[],
|
||||
elementType === TSurveyElementTypeEnum.OpenText ? inputType : undefined,
|
||||
defaultField
|
||||
);
|
||||
if (availableRules.length > 0) {
|
||||
const defaultRuleType = availableRules[0];
|
||||
const config = RULE_TYPE_CONFIG[defaultRuleType];
|
||||
const defaultValue = getDefaultRuleValue(config, element);
|
||||
const newRule: TValidationRule = {
|
||||
id: uuidv7(),
|
||||
type: defaultRuleType,
|
||||
params: createRuleParams(defaultRuleType, defaultValue),
|
||||
// For address/contact info, set field to first available field if not set
|
||||
field: needsFieldSelector && fieldOptions.length > 0 ? fieldOptions[0].value : undefined,
|
||||
} as TValidationRule;
|
||||
onUpdateValidation({ rules: [newRule], logic: validationLogic });
|
||||
}
|
||||
};
|
||||
|
||||
const handleDisable = () => {
|
||||
onUpdateValidation({ rules: [], logic: validationLogic });
|
||||
};
|
||||
|
||||
const handleAddRule = (insertAfterIndex: number) => {
|
||||
// For address/contact info, get rules for the field of the rule we're inserting after (or first field)
|
||||
const insertAfterRule = validationRules[insertAfterIndex];
|
||||
let fieldForNewRule: TValidationField;
|
||||
if (insertAfterRule?.field) {
|
||||
fieldForNewRule = insertAfterRule.field;
|
||||
} else if (needsFieldSelector && fieldOptions.length > 0) {
|
||||
fieldForNewRule = fieldOptions[0].value;
|
||||
}
|
||||
|
||||
const availableRules = getAvailableRuleTypes(
|
||||
elementType,
|
||||
validationRules,
|
||||
elementType === TSurveyElementTypeEnum.OpenText ? inputType : undefined,
|
||||
fieldForNewRule
|
||||
);
|
||||
if (availableRules.length === 0) return;
|
||||
|
||||
const newRuleType = availableRules[0];
|
||||
const config = RULE_TYPE_CONFIG[newRuleType];
|
||||
const defaultValue = getDefaultRuleValue(config, element);
|
||||
|
||||
let defaultField: TValidationField;
|
||||
if (needsFieldSelector && fieldOptions.length > 0) {
|
||||
defaultField = fieldOptions[0].value;
|
||||
}
|
||||
|
||||
const newRule: TValidationRule = {
|
||||
id: uuidv7(),
|
||||
type: newRuleType,
|
||||
params: createRuleParams(newRuleType, defaultValue),
|
||||
field: defaultField,
|
||||
} as TValidationRule;
|
||||
const newRules = [...validationRules];
|
||||
newRules.splice(insertAfterIndex + 1, 0, newRule);
|
||||
onUpdateValidation({ rules: newRules, logic: validationLogic });
|
||||
};
|
||||
|
||||
const handleDeleteRule = (ruleId: string) => {
|
||||
const updated = validationRules.filter((r) => r.id !== ruleId);
|
||||
onUpdateValidation({ rules: updated, logic: validationLogic });
|
||||
};
|
||||
|
||||
const handleRuleTypeChange = (ruleId: string, newType: TValidationRuleType) => {
|
||||
const ruleToUpdate = validationRules.find((r) => r.id === ruleId);
|
||||
if (!ruleToUpdate) return;
|
||||
|
||||
// For address/contact info, verify the new rule type is valid for the selected field
|
||||
if (needsFieldSelector && ruleToUpdate.field) {
|
||||
const availableRulesForField = getAvailableRuleTypes(
|
||||
elementType,
|
||||
validationRules.filter((r) => r.id !== ruleId),
|
||||
undefined,
|
||||
ruleToUpdate.field
|
||||
);
|
||||
|
||||
// If the new rule type is not available for this field, don't change it
|
||||
if (!availableRulesForField.includes(newType)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const updated = validationRules.map((rule) => {
|
||||
if (rule.id !== ruleId) return rule;
|
||||
return {
|
||||
...rule,
|
||||
type: newType,
|
||||
params: createRuleParams(newType),
|
||||
} as TValidationRule;
|
||||
});
|
||||
onUpdateValidation({ rules: updated, logic: validationLogic });
|
||||
};
|
||||
|
||||
const handleFieldChange = (ruleId: string, field: TValidationField) => {
|
||||
const ruleToUpdate = validationRules.find((r) => r.id === ruleId);
|
||||
if (!ruleToUpdate) return;
|
||||
|
||||
// If changing field, check if current rule type is still valid for the new field
|
||||
// If not, change to first available rule type for that field
|
||||
let updatedRule = { ...ruleToUpdate, field } as TValidationRule;
|
||||
|
||||
if (field) {
|
||||
const availableRulesForField = getAvailableRuleTypes(
|
||||
elementType,
|
||||
validationRules.filter((r) => r.id !== ruleId),
|
||||
undefined,
|
||||
field
|
||||
);
|
||||
|
||||
// If current rule type is not available for the new field, change it
|
||||
if (!availableRulesForField.includes(ruleToUpdate.type) && availableRulesForField.length > 0) {
|
||||
updatedRule = {
|
||||
...updatedRule,
|
||||
type: availableRulesForField[0],
|
||||
params: createRuleParams(availableRulesForField[0]),
|
||||
} as TValidationRule;
|
||||
}
|
||||
}
|
||||
|
||||
const updated = validationRules.map((rule) => {
|
||||
if (rule.id !== ruleId) return rule;
|
||||
return updatedRule;
|
||||
});
|
||||
onUpdateValidation({ rules: updated, logic: validationLogic });
|
||||
};
|
||||
|
||||
const handleRuleValueChange = (ruleId: string, value: string) => {
|
||||
const updated = validationRules.map((rule) => {
|
||||
if (rule.id !== ruleId) return rule;
|
||||
const ruleType = rule.type;
|
||||
const config = RULE_TYPE_CONFIG[ruleType];
|
||||
const parsedValue = parseRuleValue(ruleType, value, config);
|
||||
|
||||
return {
|
||||
...rule,
|
||||
params: createRuleParams(ruleType, parsedValue),
|
||||
} as TValidationRule;
|
||||
});
|
||||
onUpdateValidation({ rules: updated, logic: validationLogic });
|
||||
};
|
||||
|
||||
const handleFileExtensionChange = (ruleId: string, extensions: TAllowedFileExtension[]) => {
|
||||
const updated = validationRules.map((r) => {
|
||||
if (r.id !== ruleId) return r;
|
||||
return {
|
||||
...r,
|
||||
params: {
|
||||
extensions,
|
||||
},
|
||||
} as TValidationRule;
|
||||
});
|
||||
onUpdateValidation({ rules: updated, logic: validationLogic });
|
||||
};
|
||||
|
||||
// Handle input type change for OpenText
|
||||
const handleInputTypeChange = (newInputType: TSurveyOpenTextElementInputType) => {
|
||||
if (!onUpdateInputType) return;
|
||||
|
||||
// Update element input type
|
||||
onUpdateInputType(newInputType);
|
||||
|
||||
// Filter out incompatible rules based on new input type
|
||||
// Also remove redundant "email"/"url"/"phone" rules when inputType matches
|
||||
const compatibleRules = RULES_BY_INPUT_TYPE[newInputType] ?? [];
|
||||
const filteredRules = validationRules.filter((rule) => {
|
||||
// Remove rules that aren't compatible with the new input type
|
||||
if (!compatibleRules.includes(rule.type)) {
|
||||
return false;
|
||||
}
|
||||
// Remove redundant validation rules when inputType matches
|
||||
if (newInputType === "email" && rule.type === "email") {
|
||||
return false;
|
||||
}
|
||||
if (newInputType === "url" && rule.type === "url") {
|
||||
return false;
|
||||
}
|
||||
if (newInputType === "phone" && rule.type === "phone") {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
// If no compatible rules remain, add a default rule
|
||||
if (filteredRules.length === 0 && compatibleRules.length > 0) {
|
||||
const defaultRuleType = compatibleRules[0];
|
||||
const config = RULE_TYPE_CONFIG[defaultRuleType];
|
||||
let defaultValue: number | string | undefined = undefined;
|
||||
if (config.needsValue && config.valueType === "number") {
|
||||
defaultValue = 0;
|
||||
} else if (config.needsValue && config.valueType === "text") {
|
||||
defaultValue = "";
|
||||
}
|
||||
const defaultRule: TValidationRule = {
|
||||
id: uuidv7(),
|
||||
type: defaultRuleType,
|
||||
params: createRuleParams(defaultRuleType, defaultValue),
|
||||
} as TValidationRule;
|
||||
onUpdateValidation({ rules: [defaultRule], logic: validationLogic });
|
||||
} else if (filteredRules.length !== validationRules.length) {
|
||||
onUpdateValidation({ rules: filteredRules, logic: validationLogic });
|
||||
}
|
||||
};
|
||||
|
||||
// For address/contact info, use first field if no rules exist, or use the field from last rule
|
||||
let defaultField: TValidationField;
|
||||
if (needsFieldSelector && validationRules.length > 0) {
|
||||
defaultField = validationRules.at(-1)?.field;
|
||||
} else if (needsFieldSelector && fieldOptions.length > 0) {
|
||||
defaultField = fieldOptions[0].value;
|
||||
} else {
|
||||
defaultField = undefined;
|
||||
}
|
||||
|
||||
const availableRulesForAdd = getAvailableRuleTypes(
|
||||
elementType,
|
||||
validationRules,
|
||||
elementType === TSurveyElementTypeEnum.OpenText ? inputType : undefined,
|
||||
defaultField
|
||||
);
|
||||
const canAddMore = availableRulesForAdd.length > 0;
|
||||
onUpdateRules,
|
||||
}: ValidationRulesEditorProps) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
// Don't show validation rules for required matrix elements
|
||||
if (!shouldShowValidationRules) {
|
||||
return null;
|
||||
}
|
||||
const isEnabled = validationRules.length > 0;
|
||||
|
||||
return (
|
||||
<AdvancedOptionToggle
|
||||
isChecked={isEnabled}
|
||||
onToggle={(checked) => (checked ? handleEnable() : handleDisable())}
|
||||
htmlId="validation-rules-toggle"
|
||||
title={t("environments.surveys.edit.validation_rules")}
|
||||
description={t("environments.surveys.edit.validation_rules_description")}
|
||||
customContainerClass="p-0 mt-4"
|
||||
childrenContainerClass="flex-col p-3 gap-2">
|
||||
{/* Validation Logic Selector - only show when there are 2+ rules */}
|
||||
{validationRules.length >= 2 && (
|
||||
<ValidationLogicSelector
|
||||
value={validationLogic}
|
||||
onChange={(value) => onUpdateValidation({ rules: validationRules, logic: value })}
|
||||
/>
|
||||
)}
|
||||
<div className="flex w-full flex-col gap-2">
|
||||
{validationRules.map((rule, index) => (
|
||||
<ValidationRuleRow
|
||||
key={rule.id}
|
||||
rule={rule}
|
||||
index={index}
|
||||
elementType={elementType}
|
||||
element={element}
|
||||
inputType={inputType}
|
||||
onInputTypeChange={handleInputTypeChange}
|
||||
fieldOptions={fieldOptions}
|
||||
needsFieldSelector={needsFieldSelector}
|
||||
validationRules={validationRules}
|
||||
ruleLabels={ruleLabels}
|
||||
onFieldChange={handleFieldChange}
|
||||
onRuleTypeChange={handleRuleTypeChange}
|
||||
onRuleValueChange={handleRuleValueChange}
|
||||
onFileExtensionChange={handleFileExtensionChange}
|
||||
onDelete={handleDeleteRule}
|
||||
onAdd={handleAddRule}
|
||||
canAddMore={canAddMore}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</AdvancedOptionToggle>
|
||||
);
|
||||
const handleEnable = () => {
|
||||
const availableRules = getAvailableRuleTypes(elementType, []);
|
||||
if (availableRules.length > 0) {
|
||||
const defaultRuleType = availableRules[0];
|
||||
const newRule: TValidationRule = {
|
||||
id: createId(),
|
||||
params: createRuleParams(defaultRuleType),
|
||||
enabled: true,
|
||||
};
|
||||
onUpdateRules([newRule]);
|
||||
}
|
||||
};
|
||||
|
||||
const handleDisable = () => {
|
||||
onUpdateRules([]);
|
||||
};
|
||||
|
||||
const handleToggle = (checked: boolean) => {
|
||||
if (checked) {
|
||||
handleEnable();
|
||||
} else {
|
||||
handleDisable();
|
||||
}
|
||||
};
|
||||
|
||||
const handleAddRule = () => {
|
||||
const availableRules = getAvailableRuleTypes(elementType, validationRules);
|
||||
if (availableRules.length === 0) return;
|
||||
|
||||
const newRuleType = availableRules[0];
|
||||
const newRule: TValidationRule = {
|
||||
id: createId(),
|
||||
params: createRuleParams(newRuleType),
|
||||
enabled: true,
|
||||
};
|
||||
onUpdateRules([...validationRules, newRule]);
|
||||
};
|
||||
|
||||
const handleDeleteRule = (ruleId: string) => {
|
||||
const updated = validationRules.filter((r) => r.id !== ruleId);
|
||||
onUpdateRules(updated);
|
||||
};
|
||||
|
||||
const handleRuleTypeChange = (ruleId: string, newType: TValidationRuleType) => {
|
||||
const updated = validationRules.map((rule) => {
|
||||
if (rule.id !== ruleId) return rule;
|
||||
return {
|
||||
...rule,
|
||||
params: createRuleParams(newType),
|
||||
};
|
||||
});
|
||||
onUpdateRules(updated);
|
||||
};
|
||||
|
||||
const handleRuleValueChange = (ruleId: string, value: string) => {
|
||||
const updated = validationRules.map((rule) => {
|
||||
if (rule.id !== ruleId) return rule;
|
||||
const ruleType = rule.params.type;
|
||||
const config = RULE_TYPE_CONFIG[ruleType];
|
||||
const parsedValue = config.valueType === "number" ? Number(value) || 0 : value;
|
||||
return {
|
||||
...rule,
|
||||
params: createRuleParams(ruleType, parsedValue),
|
||||
};
|
||||
});
|
||||
onUpdateRules(updated);
|
||||
};
|
||||
|
||||
const availableRulesForAdd = getAvailableRuleTypes(elementType, validationRules);
|
||||
const canAddMore = availableRulesForAdd.length > 0;
|
||||
|
||||
return (
|
||||
<AdvancedOptionToggle
|
||||
isChecked={isEnabled}
|
||||
onToggle={handleToggle}
|
||||
htmlId="validation-rules-toggle"
|
||||
title={t("environments.surveys.edit.validation_rules")}
|
||||
description={t("environments.surveys.edit.validation_rules_description")}
|
||||
customContainerClass="p-0 mt-4"
|
||||
childrenContainerClass="flex-col p-3 gap-2">
|
||||
{validationRules.map((rule, index) => {
|
||||
const ruleType = rule.params.type;
|
||||
const config = RULE_TYPE_CONFIG[ruleType];
|
||||
const currentValue = getRuleValue(rule);
|
||||
|
||||
// Get available types for this rule (current type + unused types, no duplicates)
|
||||
const otherAvailableTypes = getAvailableRuleTypes(
|
||||
elementType,
|
||||
validationRules.filter((r) => r.id !== rule.id)
|
||||
).filter((t) => t !== ruleType);
|
||||
const availableTypesForSelect = [ruleType, ...otherAvailableTypes];
|
||||
|
||||
return (
|
||||
<div key={rule.id} className="flex w-full items-center gap-2">
|
||||
{/* Rule Type Selector */}
|
||||
<Select value={ruleType} onValueChange={(value) => handleRuleTypeChange(rule.id, value as TValidationRuleType)}>
|
||||
<SelectTrigger className={config.needsValue ? "w-[160px]" : "flex-1"}>
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{availableTypesForSelect.map((type) => (
|
||||
<SelectItem key={type} value={type}>
|
||||
{RULE_TYPE_CONFIG[type].label}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
|
||||
{/* Value Input (if needed) */}
|
||||
{config.needsValue && (
|
||||
<>
|
||||
<Input
|
||||
type={config.valueType === "number" ? "number" : "text"}
|
||||
value={currentValue ?? ""}
|
||||
onChange={(e) => handleRuleValueChange(rule.id, e.target.value)}
|
||||
placeholder={config.valuePlaceholder}
|
||||
className="w-[80px] bg-white"
|
||||
min={config.valueType === "number" ? 0 : undefined}
|
||||
/>
|
||||
|
||||
{/* Unit selector (if applicable) */}
|
||||
{config.unitOptions && config.unitOptions.length > 0 && (
|
||||
<Select value={config.unitOptions[0].value} disabled>
|
||||
<SelectTrigger className="flex-1">
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{config.unitOptions.map((unit) => (
|
||||
<SelectItem key={unit.value} value={unit.value}>
|
||||
{unit.label}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
{/* Delete button */}
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="icon"
|
||||
type="button"
|
||||
onClick={() => handleDeleteRule(rule.id)}
|
||||
className="shrink-0">
|
||||
<TrashIcon className="h-4 w-4" />
|
||||
</Button>
|
||||
|
||||
{/* Add button (only on last row and if can add more) */}
|
||||
{index === validationRules.length - 1 && canAddMore && (
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="icon"
|
||||
type="button"
|
||||
onClick={handleAddRule}
|
||||
className="shrink-0">
|
||||
<PlusIcon className="h-4 w-4" />
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</AdvancedOptionToggle>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -271,7 +271,6 @@ export const updateSurvey = async (updatedSurvey: TSurvey): Promise<TSurvey> =>
|
||||
...prismaSurvey, // Properties from prismaSurvey
|
||||
displayPercentage: Number(prismaSurvey.displayPercentage) || null,
|
||||
segment: surveySegment,
|
||||
customHeadScriptsMode: prismaSurvey.customHeadScriptsMode,
|
||||
};
|
||||
|
||||
return modifiedSurvey;
|
||||
|
||||
@@ -1,176 +0,0 @@
|
||||
import { describe, expect, test } from "vitest";
|
||||
import { TValidationRuleType } from "@formbricks/types/surveys/validation-rules";
|
||||
import { RULE_TYPE_CONFIG } from "./validation-rules-config";
|
||||
|
||||
describe("RULE_TYPE_CONFIG", () => {
|
||||
test("should have config for all validation rule types", () => {
|
||||
const allRuleTypes: TValidationRuleType[] = [
|
||||
"minLength",
|
||||
"maxLength",
|
||||
"pattern",
|
||||
"email",
|
||||
"url",
|
||||
"phone",
|
||||
"minValue",
|
||||
"maxValue",
|
||||
"minSelections",
|
||||
"maxSelections",
|
||||
];
|
||||
|
||||
allRuleTypes.forEach((ruleType) => {
|
||||
expect(RULE_TYPE_CONFIG[ruleType]).toBeDefined();
|
||||
expect(RULE_TYPE_CONFIG[ruleType].labelKey).toBeDefined();
|
||||
expect(typeof RULE_TYPE_CONFIG[ruleType].labelKey).toBe("string");
|
||||
expect(typeof RULE_TYPE_CONFIG[ruleType].needsValue).toBe("boolean");
|
||||
});
|
||||
});
|
||||
|
||||
describe("minLength rule", () => {
|
||||
test("should have correct config", () => {
|
||||
const config = RULE_TYPE_CONFIG.minLength;
|
||||
expect(config.labelKey).toBe("min_length");
|
||||
expect(config.needsValue).toBe(true);
|
||||
expect(config.valueType).toBe("number");
|
||||
expect(config.valuePlaceholder).toBe("100");
|
||||
expect(config.unitOptions).toEqual([{ value: "characters", labelKey: "characters" }]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("maxLength rule", () => {
|
||||
test("should have correct config", () => {
|
||||
const config = RULE_TYPE_CONFIG.maxLength;
|
||||
expect(config.labelKey).toBe("max_length");
|
||||
expect(config.needsValue).toBe(true);
|
||||
expect(config.valueType).toBe("number");
|
||||
expect(config.valuePlaceholder).toBe("500");
|
||||
expect(config.unitOptions).toEqual([{ value: "characters", labelKey: "characters" }]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("pattern rule", () => {
|
||||
test("should have correct config", () => {
|
||||
const config = RULE_TYPE_CONFIG.pattern;
|
||||
expect(config.labelKey).toBe("pattern");
|
||||
expect(config.needsValue).toBe(true);
|
||||
expect(config.valueType).toBe("text");
|
||||
expect(config.valuePlaceholder).toBe("^[A-Z].*");
|
||||
expect(config.unitOptions).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe("email rule", () => {
|
||||
test("should have correct config", () => {
|
||||
const config = RULE_TYPE_CONFIG.email;
|
||||
expect(config.labelKey).toBe("email");
|
||||
expect(config.needsValue).toBe(false);
|
||||
expect(config.valueType).toBeUndefined();
|
||||
expect(config.valuePlaceholder).toBeUndefined();
|
||||
expect(config.unitOptions).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe("url rule", () => {
|
||||
test("should have correct config", () => {
|
||||
const config = RULE_TYPE_CONFIG.url;
|
||||
expect(config.labelKey).toBe("url");
|
||||
expect(config.needsValue).toBe(false);
|
||||
expect(config.valueType).toBeUndefined();
|
||||
expect(config.valuePlaceholder).toBeUndefined();
|
||||
expect(config.unitOptions).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe("phone rule", () => {
|
||||
test("should have correct config", () => {
|
||||
const config = RULE_TYPE_CONFIG.phone;
|
||||
expect(config.labelKey).toBe("phone");
|
||||
expect(config.needsValue).toBe(false);
|
||||
expect(config.valueType).toBeUndefined();
|
||||
expect(config.valuePlaceholder).toBeUndefined();
|
||||
expect(config.unitOptions).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe("minValue rule", () => {
|
||||
test("should have correct config", () => {
|
||||
const config = RULE_TYPE_CONFIG.minValue;
|
||||
expect(config.labelKey).toBe("min_value");
|
||||
expect(config.needsValue).toBe(true);
|
||||
expect(config.valueType).toBe("number");
|
||||
expect(config.valuePlaceholder).toBe("0");
|
||||
expect(config.unitOptions).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe("maxValue rule", () => {
|
||||
test("should have correct config", () => {
|
||||
const config = RULE_TYPE_CONFIG.maxValue;
|
||||
expect(config.labelKey).toBe("max_value");
|
||||
expect(config.needsValue).toBe(true);
|
||||
expect(config.valueType).toBe("number");
|
||||
expect(config.valuePlaceholder).toBe("100");
|
||||
expect(config.unitOptions).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe("minSelections rule", () => {
|
||||
test("should have correct config", () => {
|
||||
const config = RULE_TYPE_CONFIG.minSelections;
|
||||
expect(config.labelKey).toBe("min_selections");
|
||||
expect(config.needsValue).toBe(true);
|
||||
expect(config.valueType).toBe("number");
|
||||
expect(config.valuePlaceholder).toBe("1");
|
||||
expect(config.unitOptions).toEqual([{ value: "options", labelKey: "options_selected" }]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("maxSelections rule", () => {
|
||||
test("should have correct config", () => {
|
||||
const config = RULE_TYPE_CONFIG.maxSelections;
|
||||
expect(config.labelKey).toBe("max_selections");
|
||||
expect(config.needsValue).toBe(true);
|
||||
expect(config.valueType).toBe("number");
|
||||
expect(config.valuePlaceholder).toBe("3");
|
||||
expect(config.unitOptions).toEqual([{ value: "options", labelKey: "options_selected" }]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("valueType validation", () => {
|
||||
test("should have valueType 'number' for numeric rules", () => {
|
||||
expect(RULE_TYPE_CONFIG.minLength.valueType).toBe("number");
|
||||
expect(RULE_TYPE_CONFIG.maxLength.valueType).toBe("number");
|
||||
expect(RULE_TYPE_CONFIG.minValue.valueType).toBe("number");
|
||||
expect(RULE_TYPE_CONFIG.maxValue.valueType).toBe("number");
|
||||
expect(RULE_TYPE_CONFIG.minSelections.valueType).toBe("number");
|
||||
expect(RULE_TYPE_CONFIG.maxSelections.valueType).toBe("number");
|
||||
});
|
||||
|
||||
test("should have valueType 'text' for text rules", () => {
|
||||
expect(RULE_TYPE_CONFIG.pattern.valueType).toBe("text");
|
||||
});
|
||||
|
||||
test("should not have valueType for rules that don't need values", () => {
|
||||
expect(RULE_TYPE_CONFIG.email.valueType).toBeUndefined();
|
||||
expect(RULE_TYPE_CONFIG.url.valueType).toBeUndefined();
|
||||
expect(RULE_TYPE_CONFIG.phone.valueType).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe("unitOptions validation", () => {
|
||||
test("should have unitOptions for length and selection rules", () => {
|
||||
expect(RULE_TYPE_CONFIG.minLength.unitOptions).toBeDefined();
|
||||
expect(RULE_TYPE_CONFIG.maxLength.unitOptions).toBeDefined();
|
||||
expect(RULE_TYPE_CONFIG.minSelections.unitOptions).toBeDefined();
|
||||
expect(RULE_TYPE_CONFIG.maxSelections.unitOptions).toBeDefined();
|
||||
});
|
||||
|
||||
test("should not have unitOptions for other rules", () => {
|
||||
expect(RULE_TYPE_CONFIG.pattern.unitOptions).toBeUndefined();
|
||||
expect(RULE_TYPE_CONFIG.email.unitOptions).toBeUndefined();
|
||||
expect(RULE_TYPE_CONFIG.url.unitOptions).toBeUndefined();
|
||||
expect(RULE_TYPE_CONFIG.phone.unitOptions).toBeUndefined();
|
||||
expect(RULE_TYPE_CONFIG.minValue.unitOptions).toBeUndefined();
|
||||
expect(RULE_TYPE_CONFIG.maxValue.unitOptions).toBeUndefined();
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,160 +0,0 @@
|
||||
import { TValidationRuleType } from "@formbricks/types/surveys/validation-rules";
|
||||
|
||||
// Rule type definitions with i18n keys
|
||||
export const RULE_TYPE_CONFIG: Record<
|
||||
TValidationRuleType,
|
||||
{
|
||||
labelKey: string;
|
||||
needsValue: boolean;
|
||||
valueType?: "number" | "text" | "option" | "ranking";
|
||||
valuePlaceholder?: string;
|
||||
unitOptions?: { value: string; labelKey: string }[];
|
||||
}
|
||||
> = {
|
||||
minLength: {
|
||||
labelKey: "min_length",
|
||||
needsValue: true,
|
||||
valueType: "number",
|
||||
valuePlaceholder: "100",
|
||||
unitOptions: [{ value: "characters", labelKey: "characters" }],
|
||||
},
|
||||
maxLength: {
|
||||
labelKey: "max_length",
|
||||
needsValue: true,
|
||||
valueType: "number",
|
||||
valuePlaceholder: "500",
|
||||
unitOptions: [{ value: "characters", labelKey: "characters" }],
|
||||
},
|
||||
pattern: {
|
||||
labelKey: "pattern",
|
||||
needsValue: true,
|
||||
valueType: "text",
|
||||
valuePlaceholder: "^[A-Z].*",
|
||||
},
|
||||
email: {
|
||||
labelKey: "email",
|
||||
needsValue: false,
|
||||
},
|
||||
url: {
|
||||
labelKey: "url",
|
||||
needsValue: false,
|
||||
},
|
||||
phone: {
|
||||
labelKey: "phone",
|
||||
needsValue: false,
|
||||
},
|
||||
minValue: {
|
||||
labelKey: "min_value",
|
||||
needsValue: true,
|
||||
valueType: "number",
|
||||
valuePlaceholder: "0",
|
||||
},
|
||||
maxValue: {
|
||||
labelKey: "max_value",
|
||||
needsValue: true,
|
||||
valueType: "number",
|
||||
valuePlaceholder: "100",
|
||||
},
|
||||
minSelections: {
|
||||
labelKey: "min_selections",
|
||||
needsValue: true,
|
||||
valueType: "number",
|
||||
valuePlaceholder: "1",
|
||||
unitOptions: [{ value: "options", labelKey: "options_selected" }],
|
||||
},
|
||||
maxSelections: {
|
||||
labelKey: "max_selections",
|
||||
needsValue: true,
|
||||
valueType: "number",
|
||||
valuePlaceholder: "3",
|
||||
unitOptions: [{ value: "options", labelKey: "options_selected" }],
|
||||
},
|
||||
equals: {
|
||||
labelKey: "is",
|
||||
needsValue: true,
|
||||
valueType: "text",
|
||||
valuePlaceholder: "Value",
|
||||
},
|
||||
doesNotEqual: {
|
||||
labelKey: "is_not",
|
||||
needsValue: true,
|
||||
valueType: "text",
|
||||
valuePlaceholder: "Value",
|
||||
},
|
||||
contains: {
|
||||
labelKey: "contains",
|
||||
needsValue: true,
|
||||
valueType: "text",
|
||||
valuePlaceholder: "Text",
|
||||
},
|
||||
doesNotContain: {
|
||||
labelKey: "does_not_contain",
|
||||
needsValue: true,
|
||||
valueType: "text",
|
||||
valuePlaceholder: "Text",
|
||||
},
|
||||
isGreaterThan: {
|
||||
labelKey: "is_greater_than",
|
||||
needsValue: true,
|
||||
valueType: "number",
|
||||
valuePlaceholder: "0",
|
||||
},
|
||||
isLessThan: {
|
||||
labelKey: "is_less_than",
|
||||
needsValue: true,
|
||||
valueType: "number",
|
||||
valuePlaceholder: "100",
|
||||
},
|
||||
isLaterThan: {
|
||||
labelKey: "is_later_than",
|
||||
needsValue: true,
|
||||
valueType: "text",
|
||||
valuePlaceholder: "YYYY-MM-DD",
|
||||
},
|
||||
isEarlierThan: {
|
||||
labelKey: "is_earlier_than",
|
||||
needsValue: true,
|
||||
valueType: "text",
|
||||
valuePlaceholder: "YYYY-MM-DD",
|
||||
},
|
||||
isBetween: {
|
||||
labelKey: "is_between",
|
||||
needsValue: true,
|
||||
valueType: "text",
|
||||
valuePlaceholder: "YYYY-MM-DD,YYYY-MM-DD",
|
||||
},
|
||||
isNotBetween: {
|
||||
labelKey: "is_not_between",
|
||||
needsValue: true,
|
||||
valueType: "text",
|
||||
valuePlaceholder: "YYYY-MM-DD,YYYY-MM-DD",
|
||||
},
|
||||
minRanked: {
|
||||
labelKey: "minimum_options_ranked",
|
||||
needsValue: true,
|
||||
valueType: "number",
|
||||
valuePlaceholder: "1",
|
||||
},
|
||||
rankAll: {
|
||||
labelKey: "rank_all_options",
|
||||
needsValue: false,
|
||||
},
|
||||
minRowsAnswered: {
|
||||
labelKey: "minimum_rows_answered",
|
||||
needsValue: true,
|
||||
valueType: "number",
|
||||
valuePlaceholder: "1",
|
||||
},
|
||||
fileExtensionIs: {
|
||||
labelKey: "file_extension_is",
|
||||
needsValue: true,
|
||||
valueType: "text",
|
||||
valuePlaceholder: "Select extensions...",
|
||||
},
|
||||
fileExtensionIsNot: {
|
||||
labelKey: "file_extension_is_not",
|
||||
needsValue: true,
|
||||
valueType: "text",
|
||||
valuePlaceholder: "Select extensions...",
|
||||
},
|
||||
};
|
||||
@@ -1,237 +0,0 @@
|
||||
import { describe, expect, test } from "vitest";
|
||||
import { TSurveyElementTypeEnum } from "@formbricks/types/surveys/elements";
|
||||
import type {
|
||||
TSurveyElement,
|
||||
TSurveyMultipleChoiceElement,
|
||||
TSurveyRankingElement,
|
||||
} from "@formbricks/types/surveys/elements";
|
||||
import { RULE_TYPE_CONFIG } from "./validation-rules-config";
|
||||
import {
|
||||
getAddressFields,
|
||||
getContactInfoFields,
|
||||
getDefaultRuleValue,
|
||||
getRuleLabels,
|
||||
normalizeFileExtension,
|
||||
parseRuleValue,
|
||||
} from "./validation-rules-helpers";
|
||||
|
||||
// Mock translation function
|
||||
const mockT = (key: string): string => key;
|
||||
|
||||
describe("getAddressFields", () => {
|
||||
test("should return all address fields with correct labels", () => {
|
||||
const fields = getAddressFields(mockT);
|
||||
expect(fields).toHaveLength(6);
|
||||
expect(fields.map((f) => f.value)).toEqual([
|
||||
"addressLine1",
|
||||
"addressLine2",
|
||||
"city",
|
||||
"state",
|
||||
"zip",
|
||||
"country",
|
||||
]);
|
||||
expect(fields[0].label).toBe("environments.surveys.edit.address_line_1");
|
||||
});
|
||||
});
|
||||
|
||||
describe("getContactInfoFields", () => {
|
||||
test("should return all contact info fields with correct labels", () => {
|
||||
const fields = getContactInfoFields(mockT);
|
||||
expect(fields).toHaveLength(5);
|
||||
expect(fields.map((f) => f.value)).toEqual(["firstName", "lastName", "email", "phone", "company"]);
|
||||
expect(fields[0].label).toBe("environments.surveys.edit.first_name");
|
||||
});
|
||||
});
|
||||
|
||||
describe("getRuleLabels", () => {
|
||||
test("should return all rule labels", () => {
|
||||
const labels = getRuleLabels(mockT);
|
||||
expect(labels).toHaveProperty("min_length");
|
||||
expect(labels).toHaveProperty("max_length");
|
||||
expect(labels).toHaveProperty("pattern");
|
||||
expect(labels).toHaveProperty("email");
|
||||
expect(labels).toHaveProperty("url");
|
||||
expect(labels).toHaveProperty("phone");
|
||||
expect(labels).toHaveProperty("min_value");
|
||||
expect(labels).toHaveProperty("max_value");
|
||||
expect(labels).toHaveProperty("min_selections");
|
||||
expect(labels).toHaveProperty("max_selections");
|
||||
expect(labels).toHaveProperty("characters");
|
||||
expect(labels).toHaveProperty("options_selected");
|
||||
expect(labels).toHaveProperty("is");
|
||||
expect(labels).toHaveProperty("is_not");
|
||||
expect(labels).toHaveProperty("contains");
|
||||
expect(labels).toHaveProperty("does_not_contain");
|
||||
expect(labels).toHaveProperty("is_greater_than");
|
||||
expect(labels).toHaveProperty("is_less_than");
|
||||
expect(labels).toHaveProperty("is_later_than");
|
||||
expect(labels).toHaveProperty("is_earlier_than");
|
||||
expect(labels).toHaveProperty("is_between");
|
||||
expect(labels).toHaveProperty("is_not_between");
|
||||
expect(labels).toHaveProperty("minimum_options_ranked");
|
||||
expect(labels).toHaveProperty("rank_all_options");
|
||||
expect(labels).toHaveProperty("minimum_rows_answered");
|
||||
expect(labels).toHaveProperty("file_extension_is");
|
||||
expect(labels).toHaveProperty("file_extension_is_not");
|
||||
expect(labels).toHaveProperty("kb");
|
||||
expect(labels).toHaveProperty("mb");
|
||||
});
|
||||
|
||||
test("should return correct translation keys", () => {
|
||||
const labels = getRuleLabels(mockT);
|
||||
expect(labels.min_length).toBe("environments.surveys.edit.validation.min_length");
|
||||
expect(labels.email).toBe("environments.surveys.edit.validation.email");
|
||||
expect(labels.rank_all_options).toBe("environments.surveys.edit.validation.rank_all_options");
|
||||
});
|
||||
});
|
||||
|
||||
describe("getDefaultRuleValue", () => {
|
||||
test("should return undefined when config does not need value", () => {
|
||||
const config = RULE_TYPE_CONFIG.email;
|
||||
const value = getDefaultRuleValue(config);
|
||||
expect(value).toBeUndefined();
|
||||
});
|
||||
|
||||
test("should return empty string for text value type", () => {
|
||||
const config = RULE_TYPE_CONFIG.pattern;
|
||||
const value = getDefaultRuleValue(config);
|
||||
expect(value).toBe("");
|
||||
});
|
||||
|
||||
test("should return empty string for equals rule (has valueType: text, not option)", () => {
|
||||
const element: TSurveyElement = {
|
||||
id: "multi1",
|
||||
type: TSurveyElementTypeEnum.MultipleChoiceSingle,
|
||||
choices: [
|
||||
{ id: "opt1", label: { default: "Option 1" } },
|
||||
{ id: "opt2", label: { default: "Option 2" } },
|
||||
{ id: "other", label: { default: "Other" } },
|
||||
],
|
||||
} as TSurveyMultipleChoiceElement;
|
||||
|
||||
const config = RULE_TYPE_CONFIG.equals;
|
||||
const value = getDefaultRuleValue(config, element);
|
||||
// equals has valueType: "text", not "option", so it returns "" (empty string for text type)
|
||||
expect(value).toBe("");
|
||||
});
|
||||
|
||||
test("should return empty string when config valueType is text (not option)", () => {
|
||||
const element: TSurveyElement = {
|
||||
id: "multi1",
|
||||
type: TSurveyElementTypeEnum.MultipleChoiceSingle,
|
||||
choices: [
|
||||
{ id: "other", label: { default: "Other" } },
|
||||
{ id: "none", label: { default: "None" } },
|
||||
{ id: "opt1", label: { default: "Option 1" } },
|
||||
],
|
||||
} as TSurveyMultipleChoiceElement;
|
||||
|
||||
const config = RULE_TYPE_CONFIG.equals;
|
||||
const value = getDefaultRuleValue(config, element);
|
||||
// equals has valueType: "text", so it returns "" regardless of element choices
|
||||
expect(value).toBe("");
|
||||
});
|
||||
|
||||
test("should return empty string when no valid choices found for option value type", () => {
|
||||
const element: TSurveyElement = {
|
||||
id: "multi1",
|
||||
type: TSurveyElementTypeEnum.MultipleChoiceSingle,
|
||||
choices: [
|
||||
{ id: "other", label: { default: "Other" } },
|
||||
{ id: "none", label: { default: "None" } },
|
||||
],
|
||||
} as TSurveyMultipleChoiceElement;
|
||||
|
||||
const config = RULE_TYPE_CONFIG.equals;
|
||||
const value = getDefaultRuleValue(config, element);
|
||||
expect(value).toBe("");
|
||||
});
|
||||
|
||||
test("should return empty string for option value type when element is not provided", () => {
|
||||
const config = RULE_TYPE_CONFIG.equals;
|
||||
const value = getDefaultRuleValue(config);
|
||||
expect(value).toBe("");
|
||||
});
|
||||
|
||||
test("should return undefined for number value type (minRanked uses number, not ranking)", () => {
|
||||
const element: TSurveyElement = {
|
||||
id: "rank1",
|
||||
type: TSurveyElementTypeEnum.Ranking,
|
||||
choices: [
|
||||
{ id: "opt1", label: { default: "Option 1" } },
|
||||
{ id: "opt2", label: { default: "Option 2" } },
|
||||
],
|
||||
} as TSurveyRankingElement;
|
||||
|
||||
const config = RULE_TYPE_CONFIG.minRanked;
|
||||
const value = getDefaultRuleValue(config, element);
|
||||
// minRanked has valueType: "number", not "ranking", so it returns undefined
|
||||
expect(value).toBeUndefined();
|
||||
});
|
||||
|
||||
test("should return undefined for number value type when element is not provided", () => {
|
||||
const config = RULE_TYPE_CONFIG.minRanked;
|
||||
const value = getDefaultRuleValue(config);
|
||||
expect(value).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe("normalizeFileExtension", () => {
|
||||
test("should add dot prefix when missing", () => {
|
||||
expect(normalizeFileExtension("pdf")).toBe(".pdf");
|
||||
expect(normalizeFileExtension("jpg")).toBe(".jpg");
|
||||
});
|
||||
|
||||
test("should not add dot prefix when already present", () => {
|
||||
expect(normalizeFileExtension(".pdf")).toBe(".pdf");
|
||||
expect(normalizeFileExtension(".jpg")).toBe(".jpg");
|
||||
});
|
||||
|
||||
test("should handle empty string", () => {
|
||||
expect(normalizeFileExtension("")).toBe(".");
|
||||
});
|
||||
});
|
||||
|
||||
describe("parseRuleValue", () => {
|
||||
test("should normalize file extension for fileExtensionIs", () => {
|
||||
const config = RULE_TYPE_CONFIG.fileExtensionIs;
|
||||
const value = parseRuleValue("fileExtensionIs", "pdf", config);
|
||||
expect(value).toBe(".pdf");
|
||||
});
|
||||
|
||||
test("should normalize file extension for fileExtensionIsNot", () => {
|
||||
const config = RULE_TYPE_CONFIG.fileExtensionIsNot;
|
||||
const value = parseRuleValue("fileExtensionIsNot", "jpg", config);
|
||||
expect(value).toBe(".jpg");
|
||||
});
|
||||
|
||||
test("should not add dot if already present for file extension", () => {
|
||||
const config = RULE_TYPE_CONFIG.fileExtensionIs;
|
||||
const value = parseRuleValue("fileExtensionIs", ".pdf", config);
|
||||
expect(value).toBe(".pdf");
|
||||
});
|
||||
|
||||
test("should parse number for number value type", () => {
|
||||
const config = RULE_TYPE_CONFIG.minLength;
|
||||
const value = parseRuleValue("minLength", "10", config);
|
||||
expect(value).toBe(10);
|
||||
});
|
||||
|
||||
test("should return 0 for invalid number string", () => {
|
||||
const config = RULE_TYPE_CONFIG.minLength;
|
||||
const value = parseRuleValue("minLength", "invalid", config);
|
||||
expect(value).toBe(0);
|
||||
});
|
||||
|
||||
test("should return string as-is for text value type", () => {
|
||||
const config = RULE_TYPE_CONFIG.pattern;
|
||||
const value = parseRuleValue("pattern", "test-pattern", config);
|
||||
expect(value).toBe("test-pattern");
|
||||
});
|
||||
|
||||
test("should return string as-is for equals rule", () => {
|
||||
const config = RULE_TYPE_CONFIG.equals;
|
||||
const value = parseRuleValue("equals", "test-value", config);
|
||||
expect(value).toBe("test-value");
|
||||
});
|
||||
});
|
||||
@@ -1,116 +0,0 @@
|
||||
import { TSurveyElement } from "@formbricks/types/surveys/elements";
|
||||
import {
|
||||
TAddressField,
|
||||
TContactInfoField,
|
||||
TValidationRuleType,
|
||||
} from "@formbricks/types/surveys/validation-rules";
|
||||
import { RULE_TYPE_CONFIG } from "./validation-rules-config";
|
||||
|
||||
// Field options for address elements
|
||||
export const getAddressFields = (t: (key: string) => string): { value: TAddressField; label: string }[] => [
|
||||
{ value: "addressLine1", label: t("environments.surveys.edit.address_line_1") },
|
||||
{ value: "addressLine2", label: t("environments.surveys.edit.address_line_2") },
|
||||
{ value: "city", label: t("environments.surveys.edit.city") },
|
||||
{ value: "state", label: t("environments.surveys.edit.state") },
|
||||
{ value: "zip", label: t("environments.surveys.edit.zip") },
|
||||
{ value: "country", label: t("environments.surveys.edit.country") },
|
||||
];
|
||||
|
||||
// Field options for contact info elements
|
||||
export const getContactInfoFields = (
|
||||
t: (key: string) => string
|
||||
): { value: TContactInfoField; label: string }[] => [
|
||||
{ value: "firstName", label: t("environments.surveys.edit.first_name") },
|
||||
{ value: "lastName", label: t("environments.surveys.edit.last_name") },
|
||||
{ value: "email", label: t("common.email") },
|
||||
{ value: "phone", label: t("common.phone") },
|
||||
{ value: "company", label: t("environments.surveys.edit.company") },
|
||||
];
|
||||
|
||||
// Rule labels mapping
|
||||
export const getRuleLabels = (t: (key: string) => string): Record<string, string> => ({
|
||||
min_length: t("environments.surveys.edit.validation.min_length"),
|
||||
max_length: t("environments.surveys.edit.validation.max_length"),
|
||||
pattern: t("environments.surveys.edit.validation.pattern"),
|
||||
email: t("environments.surveys.edit.validation.email"),
|
||||
url: t("environments.surveys.edit.validation.url"),
|
||||
phone: t("environments.surveys.edit.validation.phone"),
|
||||
min_value: t("environments.surveys.edit.validation.min_value"),
|
||||
max_value: t("environments.surveys.edit.validation.max_value"),
|
||||
min_selections: t("environments.surveys.edit.validation.min_selections"),
|
||||
max_selections: t("environments.surveys.edit.validation.max_selections"),
|
||||
characters: t("environments.surveys.edit.validation.characters"),
|
||||
options_selected: t("environments.surveys.edit.validation.options_selected"),
|
||||
is: t("environments.surveys.edit.validation.is"),
|
||||
is_not: t("environments.surveys.edit.validation.is_not"),
|
||||
contains: t("environments.surveys.edit.validation.contains"),
|
||||
does_not_contain: t("environments.surveys.edit.validation.does_not_contain"),
|
||||
is_greater_than: t("environments.surveys.edit.validation.is_greater_than"),
|
||||
is_less_than: t("environments.surveys.edit.validation.is_less_than"),
|
||||
is_later_than: t("environments.surveys.edit.validation.is_later_than"),
|
||||
is_earlier_than: t("environments.surveys.edit.validation.is_earlier_than"),
|
||||
is_between: t("environments.surveys.edit.validation.is_between"),
|
||||
is_not_between: t("environments.surveys.edit.validation.is_not_between"),
|
||||
minimum_options_ranked: t("environments.surveys.edit.validation.minimum_options_ranked"),
|
||||
rank_all_options: t("environments.surveys.edit.validation.rank_all_options"),
|
||||
minimum_rows_answered: t("environments.surveys.edit.validation.minimum_rows_answered"),
|
||||
file_extension_is: t("environments.surveys.edit.validation.file_extension_is"),
|
||||
file_extension_is_not: t("environments.surveys.edit.validation.file_extension_is_not"),
|
||||
kb: t("environments.surveys.edit.validation.kb"),
|
||||
mb: t("environments.surveys.edit.validation.mb"),
|
||||
});
|
||||
|
||||
// Helper function to get default value for a validation rule based on its config and element
|
||||
export const getDefaultRuleValue = (
|
||||
config: (typeof RULE_TYPE_CONFIG)[TValidationRuleType],
|
||||
element?: TSurveyElement
|
||||
): number | string | undefined => {
|
||||
if (!config.needsValue) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (config.valueType === "text") {
|
||||
return "";
|
||||
}
|
||||
|
||||
if (config.valueType === "option") {
|
||||
if (element && "choices" in element) {
|
||||
const firstChoice = element.choices.find((c) => c.id !== "other" && c.id !== "none");
|
||||
return firstChoice?.id ?? "";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
if (config.valueType === "ranking") {
|
||||
if (element && "choices" in element) {
|
||||
const firstChoice = element.choices.find((c) => c.id !== "other" && c.id !== "none");
|
||||
return firstChoice ? `${firstChoice.id},1` : ",1";
|
||||
}
|
||||
return ",1";
|
||||
}
|
||||
|
||||
return undefined;
|
||||
};
|
||||
|
||||
// Helper function to normalize file extension format
|
||||
export const normalizeFileExtension = (value: string): string => {
|
||||
return value.startsWith(".") ? value : `.${value}`;
|
||||
};
|
||||
|
||||
// Helper function to parse and validate rule value based on rule type
|
||||
export const parseRuleValue = (
|
||||
ruleType: TValidationRuleType,
|
||||
value: string,
|
||||
config: (typeof RULE_TYPE_CONFIG)[TValidationRuleType]
|
||||
): string | number => {
|
||||
// Handle file extension formatting: auto-add dot if missing
|
||||
if (ruleType === "fileExtensionIs" || ruleType === "fileExtensionIsNot") {
|
||||
return normalizeFileExtension(value);
|
||||
}
|
||||
|
||||
if (config.valueType === "number") {
|
||||
return Number(value) || 0;
|
||||
}
|
||||
|
||||
return value;
|
||||
};
|
||||
@@ -1,477 +0,0 @@
|
||||
import { describe, expect, test } from "vitest";
|
||||
import { TSurveyElementTypeEnum } from "@formbricks/types/surveys/elements";
|
||||
import { TValidationRule } from "@formbricks/types/surveys/validation-rules";
|
||||
import { createRuleParams, getAvailableRuleTypes, getRuleValue } from "./validation-rules-utils";
|
||||
|
||||
describe("getAvailableRuleTypes", () => {
|
||||
test("should return text rules for openText element with text inputType when no rules exist", () => {
|
||||
const elementType = TSurveyElementTypeEnum.OpenText;
|
||||
const existingRules: TValidationRule[] = [];
|
||||
|
||||
const available = getAvailableRuleTypes(elementType, existingRules, "text");
|
||||
|
||||
expect(available).toContain("minLength");
|
||||
expect(available).toContain("maxLength");
|
||||
expect(available).toContain("pattern");
|
||||
expect(available).not.toContain("email"); // Excluded - redundant
|
||||
expect(available).not.toContain("url"); // Excluded - redundant
|
||||
expect(available).not.toContain("phone"); // Excluded - redundant
|
||||
expect(available).not.toContain("minValue"); // Only for number inputType
|
||||
});
|
||||
|
||||
test("should return text rules for openText element with email inputType", () => {
|
||||
const elementType = TSurveyElementTypeEnum.OpenText;
|
||||
const existingRules: TValidationRule[] = [];
|
||||
|
||||
const available = getAvailableRuleTypes(elementType, existingRules, "email");
|
||||
|
||||
expect(available).toContain("minLength");
|
||||
expect(available).toContain("maxLength");
|
||||
expect(available).not.toContain("email"); // Excluded - redundant when inputType=email
|
||||
expect(available).not.toContain("minValue"); // Only for number inputType
|
||||
});
|
||||
|
||||
test("should return numeric rules for openText element with number inputType", () => {
|
||||
const elementType = TSurveyElementTypeEnum.OpenText;
|
||||
const existingRules: TValidationRule[] = [];
|
||||
|
||||
const available = getAvailableRuleTypes(elementType, existingRules, "number");
|
||||
|
||||
expect(available).toContain("minValue");
|
||||
expect(available).toContain("maxValue");
|
||||
expect(available).not.toContain("isGreaterThan"); // Removed - redundant with minValue
|
||||
expect(available).not.toContain("isLessThan"); // Removed - redundant with maxValue
|
||||
expect(available).not.toContain("minLength"); // Only for text inputType
|
||||
expect(available).not.toContain("email"); // Excluded
|
||||
});
|
||||
|
||||
test("should filter out already added rules", () => {
|
||||
const elementType = TSurveyElementTypeEnum.OpenText;
|
||||
const existingRules: TValidationRule[] = [
|
||||
{
|
||||
id: "rule2",
|
||||
type: "minLength",
|
||||
params: { min: 10 },
|
||||
},
|
||||
];
|
||||
|
||||
const available = getAvailableRuleTypes(elementType, existingRules, "text");
|
||||
|
||||
expect(available).not.toContain("minLength");
|
||||
expect(available).toContain("maxLength");
|
||||
expect(available).toContain("pattern");
|
||||
});
|
||||
|
||||
test("should return empty array for multipleChoiceSingle element (no validation rules)", () => {
|
||||
const elementType = TSurveyElementTypeEnum.MultipleChoiceSingle;
|
||||
const existingRules: TValidationRule[] = [];
|
||||
|
||||
const available = getAvailableRuleTypes(elementType, existingRules);
|
||||
|
||||
expect(available).toEqual([]);
|
||||
});
|
||||
|
||||
test("should return minSelections, maxSelections for multipleChoiceMulti element", () => {
|
||||
const elementType = TSurveyElementTypeEnum.MultipleChoiceMulti;
|
||||
const existingRules: TValidationRule[] = [];
|
||||
|
||||
const available = getAvailableRuleTypes(elementType, existingRules);
|
||||
|
||||
expect(available).toContain("minSelections");
|
||||
expect(available).toContain("maxSelections");
|
||||
expect(available.length).toBe(2);
|
||||
});
|
||||
|
||||
test("should return empty array for rating element (no validation rules)", () => {
|
||||
const elementType = TSurveyElementTypeEnum.Rating;
|
||||
const existingRules: TValidationRule[] = [];
|
||||
|
||||
const available = getAvailableRuleTypes(elementType, existingRules);
|
||||
|
||||
expect(available).toEqual([]);
|
||||
});
|
||||
|
||||
test("should return empty array for nps element (no validation rules)", () => {
|
||||
const elementType = TSurveyElementTypeEnum.NPS;
|
||||
const existingRules: TValidationRule[] = [];
|
||||
|
||||
const available = getAvailableRuleTypes(elementType, existingRules);
|
||||
|
||||
expect(available).toEqual([]);
|
||||
});
|
||||
|
||||
test("should return date validation rules for date element", () => {
|
||||
const elementType = TSurveyElementTypeEnum.Date;
|
||||
const existingRules: TValidationRule[] = [];
|
||||
|
||||
const available = getAvailableRuleTypes(elementType, existingRules);
|
||||
|
||||
expect(available).toContain("isLaterThan");
|
||||
expect(available).toContain("isEarlierThan");
|
||||
expect(available).toContain("isBetween");
|
||||
expect(available).toContain("isNotBetween");
|
||||
});
|
||||
|
||||
test("should return empty array for consent element (no validation rules)", () => {
|
||||
const elementType = TSurveyElementTypeEnum.Consent;
|
||||
const existingRules: TValidationRule[] = [];
|
||||
|
||||
const available = getAvailableRuleTypes(elementType, existingRules);
|
||||
|
||||
expect(available).toEqual([]);
|
||||
});
|
||||
|
||||
test("should return matrix validation rules for matrix element", () => {
|
||||
const elementType = TSurveyElementTypeEnum.Matrix;
|
||||
const existingRules: TValidationRule[] = [];
|
||||
|
||||
const available = getAvailableRuleTypes(elementType, existingRules);
|
||||
|
||||
expect(available).toContain("minRowsAnswered");
|
||||
expect(available.length).toBe(1);
|
||||
});
|
||||
|
||||
test("should return ranking validation rules for ranking element", () => {
|
||||
const elementType = TSurveyElementTypeEnum.Ranking;
|
||||
const existingRules: TValidationRule[] = [];
|
||||
|
||||
const available = getAvailableRuleTypes(elementType, existingRules);
|
||||
|
||||
expect(available).toContain("minRanked");
|
||||
expect(available).toContain("rankAll");
|
||||
expect(available.length).toBe(2);
|
||||
});
|
||||
|
||||
test("should return file validation rules for fileUpload element", () => {
|
||||
const elementType = TSurveyElementTypeEnum.FileUpload;
|
||||
const existingRules: TValidationRule[] = [];
|
||||
|
||||
const available = getAvailableRuleTypes(elementType, existingRules);
|
||||
|
||||
expect(available).toContain("fileExtensionIs");
|
||||
expect(available).toContain("fileExtensionIsNot");
|
||||
});
|
||||
|
||||
test("should return empty array for pictureSelection element (no validation rules)", () => {
|
||||
const elementType = TSurveyElementTypeEnum.PictureSelection;
|
||||
const existingRules: TValidationRule[] = [];
|
||||
|
||||
const available = getAvailableRuleTypes(elementType, existingRules);
|
||||
|
||||
expect(available).toEqual([]);
|
||||
});
|
||||
|
||||
test("should return empty array for address element (no validation rules)", () => {
|
||||
const elementType = TSurveyElementTypeEnum.Address;
|
||||
const existingRules: TValidationRule[] = [];
|
||||
|
||||
const available = getAvailableRuleTypes(elementType, existingRules);
|
||||
|
||||
expect(available).toEqual([]);
|
||||
});
|
||||
|
||||
test("should return empty array for contactInfo element (no validation rules)", () => {
|
||||
const elementType = TSurveyElementTypeEnum.ContactInfo;
|
||||
const existingRules: TValidationRule[] = [];
|
||||
|
||||
const available = getAvailableRuleTypes(elementType, existingRules);
|
||||
|
||||
expect(available).toEqual([]);
|
||||
});
|
||||
|
||||
test("should return empty array for cal element (no validation rules)", () => {
|
||||
const elementType = TSurveyElementTypeEnum.Cal;
|
||||
const existingRules: TValidationRule[] = [];
|
||||
|
||||
const available = getAvailableRuleTypes(elementType, existingRules);
|
||||
|
||||
expect(available).toEqual([]);
|
||||
});
|
||||
|
||||
test("should return empty array for cta element", () => {
|
||||
const elementType = TSurveyElementTypeEnum.CTA;
|
||||
const existingRules: TValidationRule[] = [];
|
||||
|
||||
const available = getAvailableRuleTypes(elementType, existingRules);
|
||||
|
||||
expect(available).toEqual([]);
|
||||
});
|
||||
|
||||
test("should handle unknown element type gracefully", () => {
|
||||
const elementType = "unknown" as TSurveyElementTypeEnum;
|
||||
const existingRules: TValidationRule[] = [];
|
||||
|
||||
const available = getAvailableRuleTypes(elementType, existingRules);
|
||||
|
||||
expect(available).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("getRuleValue", () => {
|
||||
test("should return min value for minLength rule", () => {
|
||||
const rule: TValidationRule = {
|
||||
id: "rule1",
|
||||
type: "minLength",
|
||||
params: { min: 10 },
|
||||
};
|
||||
|
||||
expect(getRuleValue(rule)).toBe(10);
|
||||
});
|
||||
|
||||
test("should return max value for maxLength rule", () => {
|
||||
const rule: TValidationRule = {
|
||||
id: "rule2",
|
||||
type: "maxLength",
|
||||
params: { max: 100 },
|
||||
};
|
||||
|
||||
expect(getRuleValue(rule)).toBe(100);
|
||||
});
|
||||
|
||||
test("should return pattern string for pattern rule", () => {
|
||||
const rule: TValidationRule = {
|
||||
id: "rule3",
|
||||
type: "pattern",
|
||||
params: { pattern: "^[A-Z].*" },
|
||||
};
|
||||
|
||||
expect(getRuleValue(rule)).toBe("^[A-Z].*");
|
||||
});
|
||||
|
||||
test("should return pattern string with flags for pattern rule", () => {
|
||||
const rule: TValidationRule = {
|
||||
id: "rule3",
|
||||
type: "pattern",
|
||||
params: { pattern: "^[A-Z].*", flags: "i" },
|
||||
};
|
||||
|
||||
expect(getRuleValue(rule)).toBe("^[A-Z].*");
|
||||
});
|
||||
|
||||
test("should return min value for minValue rule", () => {
|
||||
const rule: TValidationRule = {
|
||||
id: "rule4",
|
||||
type: "minValue",
|
||||
params: { min: 5 },
|
||||
};
|
||||
|
||||
expect(getRuleValue(rule)).toBe(5);
|
||||
});
|
||||
|
||||
test("should return max value for maxValue rule", () => {
|
||||
const rule: TValidationRule = {
|
||||
id: "rule5",
|
||||
type: "maxValue",
|
||||
params: { max: 50 },
|
||||
};
|
||||
|
||||
expect(getRuleValue(rule)).toBe(50);
|
||||
});
|
||||
|
||||
test("should return min value for minSelections rule", () => {
|
||||
const rule: TValidationRule = {
|
||||
id: "rule6",
|
||||
type: "minSelections",
|
||||
params: { min: 2 },
|
||||
};
|
||||
|
||||
expect(getRuleValue(rule)).toBe(2);
|
||||
});
|
||||
|
||||
test("should return max value for maxSelections rule", () => {
|
||||
const rule: TValidationRule = {
|
||||
id: "rule7",
|
||||
type: "maxSelections",
|
||||
params: { max: 5 },
|
||||
};
|
||||
|
||||
expect(getRuleValue(rule)).toBe(5);
|
||||
});
|
||||
|
||||
test("should return undefined for email rule", () => {
|
||||
const rule: TValidationRule = {
|
||||
id: "rule9",
|
||||
type: "email",
|
||||
params: {},
|
||||
};
|
||||
|
||||
expect(getRuleValue(rule)).toBeUndefined();
|
||||
});
|
||||
|
||||
test("should return undefined for url rule", () => {
|
||||
const rule: TValidationRule = {
|
||||
id: "rule10",
|
||||
type: "url",
|
||||
params: {},
|
||||
};
|
||||
|
||||
expect(getRuleValue(rule)).toBeUndefined();
|
||||
});
|
||||
|
||||
test("should return undefined for phone rule", () => {
|
||||
const rule: TValidationRule = {
|
||||
id: "rule11",
|
||||
type: "phone",
|
||||
params: {},
|
||||
};
|
||||
|
||||
expect(getRuleValue(rule)).toBeUndefined();
|
||||
});
|
||||
|
||||
test("should return empty string for pattern rule with empty pattern", () => {
|
||||
const rule: TValidationRule = {
|
||||
id: "rule12",
|
||||
type: "pattern",
|
||||
params: { pattern: "" },
|
||||
};
|
||||
|
||||
expect(getRuleValue(rule)).toBe("");
|
||||
});
|
||||
});
|
||||
|
||||
describe("createRuleParams", () => {
|
||||
test("should create params for minLength rule with value", () => {
|
||||
const params = createRuleParams("minLength", 10);
|
||||
expect(params).toEqual({ min: 10 });
|
||||
});
|
||||
|
||||
test("should create params for minLength rule without value (defaults to 0)", () => {
|
||||
const params = createRuleParams("minLength");
|
||||
expect(params).toEqual({ min: 0 });
|
||||
});
|
||||
|
||||
test("should create params for maxLength rule with value", () => {
|
||||
const params = createRuleParams("maxLength", 100);
|
||||
expect(params).toEqual({ max: 100 });
|
||||
});
|
||||
|
||||
test("should create params for maxLength rule without value (defaults to 100)", () => {
|
||||
const params = createRuleParams("maxLength");
|
||||
expect(params).toEqual({ max: 100 });
|
||||
});
|
||||
|
||||
test("should create params for pattern rule with string value", () => {
|
||||
const params = createRuleParams("pattern", "^[A-Z].*");
|
||||
expect(params).toEqual({ pattern: "^[A-Z].*" });
|
||||
});
|
||||
|
||||
test("should create params for pattern rule without value (defaults to empty string)", () => {
|
||||
const params = createRuleParams("pattern");
|
||||
expect(params).toEqual({ pattern: "" });
|
||||
});
|
||||
|
||||
test("should create empty params for email rule", () => {
|
||||
const params = createRuleParams("email");
|
||||
expect(params).toEqual({});
|
||||
});
|
||||
|
||||
test("should create empty params for url rule", () => {
|
||||
const params = createRuleParams("url");
|
||||
expect(params).toEqual({});
|
||||
});
|
||||
|
||||
test("should create empty params for phone rule", () => {
|
||||
const params = createRuleParams("phone");
|
||||
expect(params).toEqual({});
|
||||
});
|
||||
|
||||
test("should create params for minValue rule with value", () => {
|
||||
const params = createRuleParams("minValue", 5);
|
||||
expect(params).toEqual({ min: 5 });
|
||||
});
|
||||
|
||||
test("should create params for minValue rule without value (defaults to 0)", () => {
|
||||
const params = createRuleParams("minValue");
|
||||
expect(params).toEqual({ min: 0 });
|
||||
});
|
||||
|
||||
test("should create params for maxValue rule with value", () => {
|
||||
const params = createRuleParams("maxValue", 50);
|
||||
expect(params).toEqual({ max: 50 });
|
||||
});
|
||||
|
||||
test("should create params for maxValue rule without value (defaults to 100)", () => {
|
||||
const params = createRuleParams("maxValue");
|
||||
expect(params).toEqual({ max: 100 });
|
||||
});
|
||||
|
||||
test("should create params for minSelections rule with value", () => {
|
||||
const params = createRuleParams("minSelections", 2);
|
||||
expect(params).toEqual({ min: 2 });
|
||||
});
|
||||
|
||||
test("should create params for minSelections rule without value (defaults to 1)", () => {
|
||||
const params = createRuleParams("minSelections");
|
||||
expect(params).toEqual({ min: 1 });
|
||||
});
|
||||
|
||||
test("should create params for maxSelections rule with value", () => {
|
||||
const params = createRuleParams("maxSelections", 5);
|
||||
expect(params).toEqual({ max: 5 });
|
||||
});
|
||||
|
||||
test("should create params for maxSelections rule without value (defaults to 3)", () => {
|
||||
const params = createRuleParams("maxSelections");
|
||||
expect(params).toEqual({ max: 3 });
|
||||
});
|
||||
|
||||
test("should convert string number to number for minLength", () => {
|
||||
const params = createRuleParams("minLength", "10");
|
||||
expect(params).toEqual({ min: 10 });
|
||||
});
|
||||
|
||||
test("should convert string number to number for maxLength", () => {
|
||||
const params = createRuleParams("maxLength", "100");
|
||||
expect(params).toEqual({ max: 100 });
|
||||
});
|
||||
|
||||
test("should convert string number to number for minValue", () => {
|
||||
const params = createRuleParams("minValue", "5");
|
||||
expect(params).toEqual({ min: 5 });
|
||||
});
|
||||
|
||||
test("should convert string number to number for maxValue", () => {
|
||||
const params = createRuleParams("maxValue", "50");
|
||||
expect(params).toEqual({ max: 50 });
|
||||
});
|
||||
|
||||
test("should convert string number to number for minSelections", () => {
|
||||
const params = createRuleParams("minSelections", "2");
|
||||
expect(params).toEqual({ min: 2 });
|
||||
});
|
||||
|
||||
test("should convert string number to number for maxSelections", () => {
|
||||
const params = createRuleParams("maxSelections", "5");
|
||||
expect(params).toEqual({ max: 5 });
|
||||
});
|
||||
|
||||
test("should handle invalid string number (defaults to 0 for minLength)", () => {
|
||||
const params = createRuleParams("minLength", "invalid");
|
||||
expect(params).toEqual({ min: 0 });
|
||||
});
|
||||
|
||||
test("should handle invalid string number (defaults to 100 for maxLength)", () => {
|
||||
const params = createRuleParams("maxLength", "invalid");
|
||||
expect(params).toEqual({ max: 100 });
|
||||
});
|
||||
|
||||
test("should handle invalid string number (defaults to 0 for minValue)", () => {
|
||||
const params = createRuleParams("minValue", "invalid");
|
||||
expect(params).toEqual({ min: 0 });
|
||||
});
|
||||
|
||||
test("should handle invalid string number (defaults to 100 for maxValue)", () => {
|
||||
const params = createRuleParams("maxValue", "invalid");
|
||||
expect(params).toEqual({ max: 100 });
|
||||
});
|
||||
|
||||
test("should handle invalid string number (defaults to 1 for minSelections)", () => {
|
||||
const params = createRuleParams("minSelections", "invalid");
|
||||
expect(params).toEqual({ min: 1 });
|
||||
});
|
||||
|
||||
test("should handle invalid string number (defaults to 3 for maxSelections)", () => {
|
||||
const params = createRuleParams("maxSelections", "invalid");
|
||||
expect(params).toEqual({ max: 3 });
|
||||
});
|
||||
});
|
||||
@@ -1,276 +0,0 @@
|
||||
import { TSurveyElementTypeEnum, TSurveyOpenTextElementInputType } from "@formbricks/types/surveys/elements";
|
||||
import {
|
||||
APPLICABLE_RULES,
|
||||
TAddressField,
|
||||
TContactInfoField,
|
||||
TValidationRule,
|
||||
TValidationRuleType,
|
||||
} from "@formbricks/types/surveys/validation-rules";
|
||||
|
||||
const stringRules: TValidationRuleType[] = [
|
||||
"minLength",
|
||||
"maxLength",
|
||||
"pattern",
|
||||
"equals",
|
||||
"doesNotEqual",
|
||||
"contains",
|
||||
"doesNotContain",
|
||||
];
|
||||
|
||||
// Rules applicable per field for Address elements
|
||||
// General text fields don't support format-specific validators (email, url, phone)
|
||||
export const RULES_BY_ADDRESS_FIELD: Record<TAddressField, TValidationRuleType[]> = {
|
||||
addressLine1: stringRules,
|
||||
addressLine2: stringRules,
|
||||
city: stringRules,
|
||||
state: stringRules,
|
||||
zip: stringRules,
|
||||
country: stringRules,
|
||||
};
|
||||
|
||||
// Rules applicable per field for Contact Info elements
|
||||
// Note: "email" and "phone" validation are automatically enforced for their respective fields
|
||||
// and should not appear as selectable options in the UI
|
||||
export const RULES_BY_CONTACT_INFO_FIELD: Record<TContactInfoField, TValidationRuleType[]> = {
|
||||
firstName: stringRules,
|
||||
lastName: stringRules,
|
||||
email: stringRules,
|
||||
phone: ["equals", "doesNotEqual", "contains", "doesNotContain"],
|
||||
company: stringRules,
|
||||
};
|
||||
|
||||
// Rules applicable per input type for OpenText
|
||||
export const RULES_BY_INPUT_TYPE: Record<TSurveyOpenTextElementInputType, TValidationRuleType[]> = {
|
||||
text: [
|
||||
"minLength",
|
||||
"maxLength",
|
||||
"pattern",
|
||||
// "email", "url", "phone" excluded - redundant for text inputType
|
||||
"equals",
|
||||
"doesNotEqual",
|
||||
"contains",
|
||||
"doesNotContain",
|
||||
],
|
||||
email: [
|
||||
"minLength",
|
||||
"maxLength",
|
||||
"pattern",
|
||||
// "email" rule excluded - redundant when inputType=email (HTML5 already validates)
|
||||
"equals",
|
||||
"doesNotEqual",
|
||||
"contains",
|
||||
"doesNotContain",
|
||||
],
|
||||
url: [
|
||||
"minLength",
|
||||
"maxLength",
|
||||
"pattern",
|
||||
// "url" rule excluded - redundant when inputType=url (HTML5 already validates)
|
||||
"equals",
|
||||
"doesNotEqual",
|
||||
"contains",
|
||||
"doesNotContain",
|
||||
],
|
||||
phone: [
|
||||
"minLength",
|
||||
"maxLength",
|
||||
"pattern",
|
||||
// "phone" rule excluded - redundant when inputType=phone (HTML5 already validates)
|
||||
"equals",
|
||||
"doesNotEqual",
|
||||
"contains",
|
||||
"doesNotContain",
|
||||
],
|
||||
number: ["minValue", "maxValue", "equals", "doesNotEqual"],
|
||||
};
|
||||
|
||||
/**
|
||||
* Get available rule types for an element type, excluding already added rules
|
||||
* For OpenText elements, filters rules based on inputType
|
||||
* For Address/ContactInfo elements, filters rules based on field
|
||||
*/
|
||||
export const getAvailableRuleTypes = (
|
||||
elementType: TSurveyElementTypeEnum,
|
||||
existingRules: TValidationRule[],
|
||||
inputType?: TSurveyOpenTextElementInputType,
|
||||
field?: TAddressField | TContactInfoField
|
||||
): TValidationRuleType[] => {
|
||||
const elementTypeKey = elementType.toString();
|
||||
|
||||
// For OpenText, use input-type-based filtering
|
||||
if (elementType === TSurveyElementTypeEnum.OpenText && inputType) {
|
||||
const applicable = RULES_BY_INPUT_TYPE[inputType] ?? [];
|
||||
const existingTypes = new Set(existingRules.map((r) => r.type));
|
||||
return applicable.filter((ruleType) => !existingTypes.has(ruleType));
|
||||
}
|
||||
|
||||
// For Address elements, use field-based filtering
|
||||
if (elementType === TSurveyElementTypeEnum.Address) {
|
||||
if (!field) {
|
||||
// Address elements require a field to be specified for validation rules
|
||||
return [];
|
||||
}
|
||||
const applicable = RULES_BY_ADDRESS_FIELD[field as TAddressField] ?? [];
|
||||
const existingTypes = new Set(existingRules.map((r) => r.type));
|
||||
return applicable.filter((ruleType) => !existingTypes.has(ruleType));
|
||||
}
|
||||
|
||||
// For Contact Info elements, use field-based filtering
|
||||
if (elementType === TSurveyElementTypeEnum.ContactInfo) {
|
||||
if (!field) {
|
||||
// Contact Info elements require a field to be specified for validation rules
|
||||
return [];
|
||||
}
|
||||
const applicable = RULES_BY_CONTACT_INFO_FIELD[field as TContactInfoField] ?? [];
|
||||
const existingTypes = new Set(existingRules.map((r) => r.type));
|
||||
return applicable.filter((ruleType) => !existingTypes.has(ruleType));
|
||||
}
|
||||
|
||||
// For other element types, use standard filtering
|
||||
const applicable = APPLICABLE_RULES[elementTypeKey] ?? [];
|
||||
const existingTypes = new Set(existingRules.map((r) => r.type));
|
||||
|
||||
return applicable.filter((ruleType) => {
|
||||
// Allow only one of each rule type
|
||||
return !existingTypes.has(ruleType);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the value from rule params based on rule type
|
||||
*/
|
||||
export const getRuleValue = (rule: TValidationRule): number | string | undefined => {
|
||||
const params = rule.params;
|
||||
if ("min" in params) return params.min;
|
||||
if ("max" in params) return params.max;
|
||||
if ("pattern" in params) {
|
||||
const pattern = params.pattern;
|
||||
return pattern ?? "";
|
||||
}
|
||||
if ("value" in params) {
|
||||
return params.value;
|
||||
}
|
||||
if ("date" in params) {
|
||||
return params.date;
|
||||
}
|
||||
if ("startDate" in params && "endDate" in params) {
|
||||
return `${params.startDate},${params.endDate}`;
|
||||
}
|
||||
if ("extensions" in params) {
|
||||
// For file extension rules, return extensions array as comma-separated string for display
|
||||
const extensions = params.extensions;
|
||||
return extensions.length > 0 ? extensions.join(", ") : "";
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* Helper functions to create params for different rule types
|
||||
*/
|
||||
const createStringValueParams = (value?: number | string) => ({
|
||||
value: value === undefined || value === null ? "" : String(value),
|
||||
});
|
||||
|
||||
const createMinParams = (value?: number | string, defaultValue = 0) => ({
|
||||
min: Number(value) || defaultValue,
|
||||
});
|
||||
|
||||
const createMaxParams = (value?: number | string, defaultValue = 100) => ({
|
||||
max: Number(value) || defaultValue,
|
||||
});
|
||||
|
||||
const createDateParams = (value?: number | string) => ({
|
||||
date: value === undefined || value === null ? "" : String(value),
|
||||
});
|
||||
|
||||
const createDateRangeParams = (value?: number | string) => {
|
||||
if (typeof value === "string" && value.includes(",")) {
|
||||
const [startDate, endDate] = value.split(",");
|
||||
return {
|
||||
startDate: startDate?.trim() || "",
|
||||
endDate: endDate?.trim() || "",
|
||||
};
|
||||
}
|
||||
return { startDate: "", endDate: "" };
|
||||
};
|
||||
|
||||
const createFileExtensionParams = (value?: number | string) => {
|
||||
if (Array.isArray(value)) {
|
||||
return { extensions: value };
|
||||
}
|
||||
if (typeof value === "string" && value.includes(",")) {
|
||||
return { extensions: value.split(",").map((ext) => ext.trim()) };
|
||||
}
|
||||
const extensionValue = value === undefined || value === null ? "" : String(value);
|
||||
return { extensions: extensionValue ? [extensionValue] : [] };
|
||||
};
|
||||
|
||||
/**
|
||||
* Create params object from rule type and value (without type field)
|
||||
*/
|
||||
export const createRuleParams = (
|
||||
ruleType: TValidationRuleType,
|
||||
value?: number | string
|
||||
): TValidationRule["params"] => {
|
||||
// Rules that return empty params
|
||||
if (ruleType === "email" || ruleType === "url" || ruleType === "phone" || ruleType === "rankAll") {
|
||||
return {};
|
||||
}
|
||||
|
||||
// Rules that use string value params
|
||||
if (
|
||||
ruleType === "equals" ||
|
||||
ruleType === "doesNotEqual" ||
|
||||
ruleType === "contains" ||
|
||||
ruleType === "doesNotContain"
|
||||
) {
|
||||
return createStringValueParams(value);
|
||||
}
|
||||
|
||||
// Rules that use min params
|
||||
if (
|
||||
ruleType === "minLength" ||
|
||||
ruleType === "minValue" ||
|
||||
ruleType === "isGreaterThan" ||
|
||||
ruleType === "minSelections" ||
|
||||
ruleType === "minRanked" ||
|
||||
ruleType === "minRowsAnswered"
|
||||
) {
|
||||
const defaultValue =
|
||||
ruleType === "minSelections" || ruleType === "minRanked" || ruleType === "minRowsAnswered" ? 1 : 0;
|
||||
return createMinParams(value, defaultValue);
|
||||
}
|
||||
|
||||
// Rules that use max params
|
||||
if (
|
||||
ruleType === "maxLength" ||
|
||||
ruleType === "maxValue" ||
|
||||
ruleType === "isLessThan" ||
|
||||
ruleType === "maxSelections"
|
||||
) {
|
||||
const defaultValue = ruleType === "maxSelections" ? 3 : 100;
|
||||
return createMaxParams(value, defaultValue);
|
||||
}
|
||||
|
||||
// Rules that use date params
|
||||
if (ruleType === "isLaterThan" || ruleType === "isEarlierThan") {
|
||||
return createDateParams(value);
|
||||
}
|
||||
|
||||
// Rules that use date range params
|
||||
if (ruleType === "isBetween" || ruleType === "isNotBetween") {
|
||||
return createDateRangeParams(value);
|
||||
}
|
||||
|
||||
// Rules that use file extension params
|
||||
if (ruleType === "fileExtensionIs" || ruleType === "fileExtensionIsNot") {
|
||||
return createFileExtensionParams(value);
|
||||
}
|
||||
|
||||
// Pattern rule
|
||||
if (ruleType === "pattern") {
|
||||
return { pattern: value === undefined || value === null ? "" : String(value) };
|
||||
}
|
||||
|
||||
return {};
|
||||
};
|
||||
@@ -168,6 +168,7 @@ export const getElementTypes = (t: TFunction): TElement[] => [
|
||||
icon: MousePointerClickIcon,
|
||||
preset: {
|
||||
headline: createI18nString("", []),
|
||||
subheader: createI18nString("", []),
|
||||
ctaButtonLabel: createI18nString(t("templates.book_interview"), []),
|
||||
buttonUrl: "",
|
||||
buttonExternal: true,
|
||||
@@ -181,6 +182,7 @@ export const getElementTypes = (t: TFunction): TElement[] => [
|
||||
icon: CheckIcon,
|
||||
preset: {
|
||||
headline: createI18nString("", []),
|
||||
subheader: createI18nString("", []),
|
||||
label: createI18nString("", []),
|
||||
},
|
||||
},
|
||||
|
||||
@@ -29,7 +29,6 @@ export const selectSurvey = {
|
||||
autoComplete: true,
|
||||
isVerifyEmailEnabled: true,
|
||||
isSingleResponsePerEmailEnabled: true,
|
||||
isCaptureIpEnabled: true,
|
||||
redirectUrl: true,
|
||||
projectOverwrites: true,
|
||||
styling: true,
|
||||
@@ -41,8 +40,6 @@ export const selectSurvey = {
|
||||
isBackButtonHidden: true,
|
||||
metadata: true,
|
||||
slug: true,
|
||||
customHeadScripts: true,
|
||||
customHeadScriptsMode: true,
|
||||
languages: {
|
||||
select: {
|
||||
default: true,
|
||||
|
||||
@@ -20,7 +20,6 @@ export const transformPrismaSurvey = <T extends TSurvey | TJsEnvironmentStateSur
|
||||
...surveyPrisma,
|
||||
displayPercentage: Number(surveyPrisma.displayPercentage) || null,
|
||||
segment,
|
||||
customHeadScriptsMode: surveyPrisma.customHeadScriptsMode,
|
||||
} as T;
|
||||
|
||||
return transformedSurvey;
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useRef } from "react";
|
||||
import { TSurvey } from "@formbricks/types/surveys/types";
|
||||
|
||||
interface CustomScriptsInjectorProps {
|
||||
projectScripts?: string | null;
|
||||
surveyScripts?: string | null;
|
||||
scriptsMode?: TSurvey["customHeadScriptsMode"];
|
||||
}
|
||||
|
||||
/**
|
||||
* Injects custom HTML scripts into the document head for link surveys.
|
||||
* Supports merging project and survey scripts or replacing project scripts with survey scripts.
|
||||
*
|
||||
* @param projectScripts - Scripts configured at the workspace/project level
|
||||
* @param surveyScripts - Scripts configured at the survey level
|
||||
* @param scriptsMode - "add" merges both, "replace" uses only survey scripts
|
||||
*/
|
||||
export const CustomScriptsInjector = ({
|
||||
projectScripts,
|
||||
surveyScripts,
|
||||
scriptsMode,
|
||||
}: CustomScriptsInjectorProps) => {
|
||||
const injectedRef = useRef(false);
|
||||
|
||||
useEffect(() => {
|
||||
// Prevent double injection in React strict mode
|
||||
if (injectedRef.current) return;
|
||||
|
||||
// Determine which scripts to inject based on mode
|
||||
let scriptsToInject: string;
|
||||
|
||||
if (scriptsMode === "replace" && surveyScripts) {
|
||||
// Replace mode: only use survey scripts
|
||||
scriptsToInject = surveyScripts;
|
||||
} else {
|
||||
// Add mode (default): merge project and survey scripts
|
||||
scriptsToInject = [projectScripts, surveyScripts].filter(Boolean).join("\n");
|
||||
}
|
||||
|
||||
if (!scriptsToInject.trim()) return;
|
||||
|
||||
try {
|
||||
// Create a temporary container to parse the HTML
|
||||
const container = document.createElement("div");
|
||||
container.innerHTML = scriptsToInject;
|
||||
|
||||
// Process and inject script elements
|
||||
const scripts = container.querySelectorAll("script");
|
||||
scripts.forEach((script) => {
|
||||
const newScript = document.createElement("script");
|
||||
|
||||
// Copy all attributes (src, async, defer, type, etc.)
|
||||
Array.from(script.attributes).forEach((attr) => {
|
||||
newScript.setAttribute(attr.name, attr.value);
|
||||
});
|
||||
|
||||
// Copy inline script content
|
||||
if (script.textContent) {
|
||||
newScript.textContent = script.textContent;
|
||||
}
|
||||
|
||||
document.head.appendChild(newScript);
|
||||
});
|
||||
|
||||
// Process and inject non-script elements (noscript, meta, link, style, etc.)
|
||||
const nonScripts = container.querySelectorAll(":not(script)");
|
||||
nonScripts.forEach((el) => {
|
||||
const clonedEl = el.cloneNode(true) as Element;
|
||||
document.head.appendChild(clonedEl);
|
||||
});
|
||||
|
||||
injectedRef.current = true;
|
||||
} catch (error) {
|
||||
// Log error but don't break the survey - self-hosted admins can check console
|
||||
console.warn("[Formbricks] Error injecting custom scripts:", error);
|
||||
}
|
||||
}, [projectScripts, surveyScripts, scriptsMode]);
|
||||
|
||||
return null;
|
||||
};
|
||||
@@ -13,7 +13,7 @@ import { OTPInput } from "@/modules/ui/components/otp-input";
|
||||
|
||||
interface PinScreenProps {
|
||||
surveyId: string;
|
||||
project: Pick<Project, "styling" | "logo" | "linkSurveyBranding" | "customHeadScripts">;
|
||||
project: Pick<Project, "styling" | "logo" | "linkSurveyBranding">;
|
||||
singleUseId?: string;
|
||||
singleUseResponse?: Pick<Response, "id" | "finished">;
|
||||
publicDomain: string;
|
||||
|
||||
@@ -7,14 +7,13 @@ import { TProjectStyling } from "@formbricks/types/project";
|
||||
import { TResponseData } from "@formbricks/types/responses";
|
||||
import { TSurvey, TSurveyStyling } from "@formbricks/types/surveys/types";
|
||||
import { getElementsFromBlocks } from "@/modules/survey/lib/client-utils";
|
||||
import { CustomScriptsInjector } from "@/modules/survey/link/components/custom-scripts-injector";
|
||||
import { LinkSurveyWrapper } from "@/modules/survey/link/components/link-survey-wrapper";
|
||||
import { getPrefillValue } from "@/modules/survey/link/lib/prefill";
|
||||
import { SurveyInline } from "@/modules/ui/components/survey";
|
||||
|
||||
interface SurveyClientWrapperProps {
|
||||
survey: TSurvey;
|
||||
project: Pick<Project, "styling" | "logo" | "linkSurveyBranding" | "customHeadScripts">;
|
||||
project: Pick<Project, "styling" | "logo" | "linkSurveyBranding">;
|
||||
styling: TProjectStyling | TSurveyStyling;
|
||||
publicDomain: string;
|
||||
responseCount?: number;
|
||||
@@ -118,62 +117,52 @@ export const SurveyClientWrapper = ({
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* Inject custom scripts for tracking/analytics (self-hosted only) */}
|
||||
{!IS_FORMBRICKS_CLOUD && !isPreview && (
|
||||
<CustomScriptsInjector
|
||||
projectScripts={project.customHeadScripts}
|
||||
surveyScripts={survey.customHeadScripts}
|
||||
scriptsMode={survey.customHeadScriptsMode}
|
||||
/>
|
||||
)}
|
||||
<LinkSurveyWrapper
|
||||
project={project}
|
||||
surveyId={survey.id}
|
||||
isWelcomeCardEnabled={survey.welcomeCard.enabled}
|
||||
isPreview={isPreview}
|
||||
surveyType={survey.type}
|
||||
determineStyling={() => styling}
|
||||
handleResetSurvey={handleResetSurvey}
|
||||
isEmbed={isEmbed}
|
||||
publicDomain={publicDomain}
|
||||
IS_FORMBRICKS_CLOUD={IS_FORMBRICKS_CLOUD}
|
||||
IMPRINT_URL={IMPRINT_URL}
|
||||
PRIVACY_URL={PRIVACY_URL}
|
||||
isBrandingEnabled={project.linkSurveyBranding}>
|
||||
<SurveyInline
|
||||
appUrl={publicDomain}
|
||||
environmentId={survey.environmentId}
|
||||
isPreviewMode={isPreview}
|
||||
survey={survey}
|
||||
styling={styling}
|
||||
languageCode={languageCode}
|
||||
isBrandingEnabled={project.linkSurveyBranding}
|
||||
shouldResetQuestionId={false}
|
||||
autoFocus={autoFocus}
|
||||
prefillResponseData={prefillValue}
|
||||
skipPrefilled={skipPrefilled}
|
||||
responseCount={responseCount}
|
||||
getSetBlockId={(f: (value: string) => void) => {
|
||||
setBlockId = f;
|
||||
}}
|
||||
getSetResponseData={(f: (value: TResponseData) => void) => {
|
||||
setResponseData = f;
|
||||
}}
|
||||
startAtQuestionId={startAt && isStartAtValid ? startAt : undefined}
|
||||
fullSizeCards={isEmbed}
|
||||
hiddenFieldsRecord={{
|
||||
...hiddenFieldsRecord,
|
||||
...getVerifiedEmail,
|
||||
}}
|
||||
singleUseId={singleUseId}
|
||||
singleUseResponseId={singleUseResponseId}
|
||||
getSetIsResponseSendingFinished={(_f: (value: boolean) => void) => {}}
|
||||
contactId={contactId}
|
||||
recaptchaSiteKey={recaptchaSiteKey}
|
||||
isSpamProtectionEnabled={isSpamProtectionEnabled}
|
||||
/>
|
||||
</LinkSurveyWrapper>
|
||||
</>
|
||||
<LinkSurveyWrapper
|
||||
project={project}
|
||||
surveyId={survey.id}
|
||||
isWelcomeCardEnabled={survey.welcomeCard.enabled}
|
||||
isPreview={isPreview}
|
||||
surveyType={survey.type}
|
||||
determineStyling={() => styling}
|
||||
handleResetSurvey={handleResetSurvey}
|
||||
isEmbed={isEmbed}
|
||||
publicDomain={publicDomain}
|
||||
IS_FORMBRICKS_CLOUD={IS_FORMBRICKS_CLOUD}
|
||||
IMPRINT_URL={IMPRINT_URL}
|
||||
PRIVACY_URL={PRIVACY_URL}
|
||||
isBrandingEnabled={project.linkSurveyBranding}>
|
||||
<SurveyInline
|
||||
appUrl={publicDomain}
|
||||
environmentId={survey.environmentId}
|
||||
isPreviewMode={isPreview}
|
||||
survey={survey}
|
||||
styling={styling}
|
||||
languageCode={languageCode}
|
||||
isBrandingEnabled={project.linkSurveyBranding}
|
||||
shouldResetQuestionId={false}
|
||||
autoFocus={autoFocus}
|
||||
prefillResponseData={prefillValue}
|
||||
skipPrefilled={skipPrefilled}
|
||||
responseCount={responseCount}
|
||||
getSetBlockId={(f: (value: string) => void) => {
|
||||
setBlockId = f;
|
||||
}}
|
||||
getSetResponseData={(f: (value: TResponseData) => void) => {
|
||||
setResponseData = f;
|
||||
}}
|
||||
startAtQuestionId={startAt && isStartAtValid ? startAt : undefined}
|
||||
fullSizeCards={isEmbed}
|
||||
hiddenFieldsRecord={{
|
||||
...hiddenFieldsRecord,
|
||||
...getVerifiedEmail,
|
||||
}}
|
||||
singleUseId={singleUseId}
|
||||
singleUseResponseId={singleUseResponseId}
|
||||
getSetIsResponseSendingFinished={(_f: (value: boolean) => void) => {}}
|
||||
contactId={contactId}
|
||||
recaptchaSiteKey={recaptchaSiteKey}
|
||||
isSpamProtectionEnabled={isSpamProtectionEnabled}
|
||||
/>
|
||||
</LinkSurveyWrapper>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -48,7 +48,6 @@ export const getSurveyWithMetadata = reactCache(async (surveyId: string) => {
|
||||
redirectUrl: true,
|
||||
pin: true,
|
||||
isBackButtonHidden: true,
|
||||
isCaptureIpEnabled: true,
|
||||
|
||||
// Single use configuration
|
||||
singleUse: true,
|
||||
@@ -61,10 +60,6 @@ export const getSurveyWithMetadata = reactCache(async (surveyId: string) => {
|
||||
recaptcha: true,
|
||||
metadata: true,
|
||||
|
||||
// Custom scripts (self-hosted only)
|
||||
customHeadScripts: true,
|
||||
customHeadScriptsMode: true,
|
||||
|
||||
// Related data
|
||||
languages: {
|
||||
select: {
|
||||
|
||||
@@ -85,7 +85,6 @@ describe("getEnvironmentContextForLinkSurvey", () => {
|
||||
styling: true,
|
||||
logo: true,
|
||||
linkSurveyBranding: true,
|
||||
customHeadScripts: true,
|
||||
organizationId: true,
|
||||
organization: {
|
||||
select: {
|
||||
|
||||
@@ -16,10 +16,7 @@ import { validateInputs } from "@/lib/utils/validate";
|
||||
* deduplication within the same render cycle.
|
||||
*/
|
||||
|
||||
type TProjectForLinkSurvey = Pick<
|
||||
Project,
|
||||
"id" | "name" | "styling" | "logo" | "linkSurveyBranding" | "customHeadScripts"
|
||||
>;
|
||||
type TProjectForLinkSurvey = Pick<Project, "id" | "name" | "styling" | "logo" | "linkSurveyBranding">;
|
||||
|
||||
export interface TEnvironmentContextForLinkSurvey {
|
||||
project: TProjectForLinkSurvey;
|
||||
@@ -64,7 +61,6 @@ export const getEnvironmentContextForLinkSurvey = reactCache(
|
||||
styling: true,
|
||||
logo: true,
|
||||
linkSurveyBranding: true,
|
||||
customHeadScripts: true,
|
||||
organizationId: true,
|
||||
organization: {
|
||||
select: {
|
||||
@@ -95,7 +91,6 @@ export const getEnvironmentContextForLinkSurvey = reactCache(
|
||||
styling: environment.project.styling,
|
||||
logo: environment.project.logo,
|
||||
linkSurveyBranding: environment.project.linkSurveyBranding,
|
||||
customHeadScripts: environment.project.customHeadScripts,
|
||||
},
|
||||
organizationId: environment.project.organizationId,
|
||||
organizationBilling: environment.project.organization.billing,
|
||||
|
||||
@@ -61,7 +61,6 @@ describe("getProjectByEnvironmentId", () => {
|
||||
},
|
||||
},
|
||||
select: {
|
||||
customHeadScripts: true,
|
||||
linkSurveyBranding: true,
|
||||
logo: true,
|
||||
styling: true,
|
||||
|
||||
@@ -10,10 +10,7 @@ import { validateInputs } from "@/lib/utils/validate";
|
||||
export const getProjectByEnvironmentId = reactCache(
|
||||
async (
|
||||
environmentId: string
|
||||
): Promise<Pick<
|
||||
Project,
|
||||
"styling" | "logo" | "linkSurveyBranding" | "name" | "customHeadScripts"
|
||||
> | null> => {
|
||||
): Promise<Pick<Project, "styling" | "logo" | "linkSurveyBranding" | "name"> | null> => {
|
||||
validateInputs([environmentId, ZId]);
|
||||
|
||||
let projectPrisma;
|
||||
@@ -32,7 +29,6 @@ export const getProjectByEnvironmentId = reactCache(
|
||||
logo: true,
|
||||
linkSurveyBranding: true,
|
||||
name: true,
|
||||
customHeadScripts: true,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -43,5 +43,4 @@ export const getMinimalSurvey = (t: TFunction): TSurvey => ({
|
||||
isBackButtonHidden: false,
|
||||
metadata: {},
|
||||
slug: null,
|
||||
isCaptureIpEnabled: false,
|
||||
});
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import { Table } from "@tanstack/react-table";
|
||||
import { MoveVerticalIcon, RefreshCcwIcon, SettingsIcon } from "lucide-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import toast from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { cn } from "@/lib/cn";
|
||||
@@ -19,7 +20,6 @@ interface DataTableToolbarProps<T> {
|
||||
downloadRowsAction?: (rowIds: string[], format: string) => Promise<void>;
|
||||
isQuotasAllowed: boolean;
|
||||
leftContent?: React.ReactNode;
|
||||
onRefresh?: () => Promise<void>;
|
||||
}
|
||||
|
||||
export const DataTableToolbar = <T,>({
|
||||
@@ -33,9 +33,9 @@ export const DataTableToolbar = <T,>({
|
||||
downloadRowsAction,
|
||||
isQuotasAllowed,
|
||||
leftContent,
|
||||
onRefresh,
|
||||
}: DataTableToolbarProps<T>) => {
|
||||
const { t } = useTranslation();
|
||||
const router = useRouter();
|
||||
|
||||
return (
|
||||
<div className="sticky top-0 z-30 flex w-full items-center justify-between bg-slate-50 py-2">
|
||||
@@ -52,13 +52,13 @@ export const DataTableToolbar = <T,>({
|
||||
<div>{leftContent}</div>
|
||||
)}
|
||||
<div className="flex space-x-2">
|
||||
{type === "contact" && onRefresh ? (
|
||||
{type === "contact" ? (
|
||||
<TooltipRenderer
|
||||
tooltipContent={t("environments.contacts.contacts_table_refresh")}
|
||||
shouldRender={true}>
|
||||
<button
|
||||
onClick={async () => {
|
||||
await onRefresh();
|
||||
router.refresh();
|
||||
toast.success(t("environments.contacts.contacts_table_refresh_success"));
|
||||
}}
|
||||
className="cursor-pointer rounded-md border bg-white hover:border-slate-400">
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
import { Command as CommandPrimitive } from "cmdk";
|
||||
import { X } from "lucide-react";
|
||||
import * as React from "react";
|
||||
import { createPortal } from "react-dom";
|
||||
import { Command, CommandGroup, CommandItem, CommandList } from "@/modules/ui/components/command";
|
||||
import { Badge } from "@/modules/ui/components/multi-select/badge";
|
||||
|
||||
@@ -36,62 +35,25 @@ export function MultiSelect<T extends string, K extends TOption<T>["value"][]>(
|
||||
|
||||
const [open, setOpen] = React.useState(false);
|
||||
const [inputValue, setInputValue] = React.useState("");
|
||||
const [position, setPosition] = React.useState<{ top: number; left: number; width: number } | null>(null);
|
||||
const containerRef = React.useRef<HTMLDivElement>(null);
|
||||
|
||||
// Track if changes are user-initiated (not from value prop)
|
||||
const isUserInitiatedRef = React.useRef(false);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (value) {
|
||||
const newSelected = value
|
||||
.map((val) => options.find((o) => o.value === val))
|
||||
.filter((o): o is TOption<T> => !!o);
|
||||
// Only update if different (avoid unnecessary updates)
|
||||
const currentValues = selected.map((s) => s.value);
|
||||
const newValues = newSelected.map((s) => s.value);
|
||||
if (
|
||||
currentValues.length !== newValues.length ||
|
||||
currentValues.some((val, idx) => val !== newValues[idx])
|
||||
) {
|
||||
isUserInitiatedRef.current = false; // Mark as prop-initiated
|
||||
setSelected(newSelected);
|
||||
}
|
||||
setSelected(
|
||||
value.map((val) => options.find((o) => o.value === val)).filter((o): o is TOption<T> => !!o)
|
||||
);
|
||||
}
|
||||
}, [value, options]);
|
||||
|
||||
// Sync user-initiated selected changes to parent via onChange (deferred to avoid render issues)
|
||||
const prevSelectedRef = React.useRef(selected);
|
||||
React.useEffect(() => {
|
||||
// Only call onChange if change was user-initiated and selected actually changed
|
||||
if (isUserInitiatedRef.current && prevSelectedRef.current !== selected) {
|
||||
const selectedValues = selected.map((s) => s.value) as K;
|
||||
const prevValues = prevSelectedRef.current.map((s) => s.value) as K;
|
||||
// Check if values actually changed
|
||||
if (
|
||||
selectedValues.length !== prevValues.length ||
|
||||
selectedValues.some((val, idx) => val !== prevValues[idx])
|
||||
) {
|
||||
// Use queueMicrotask to defer the onChange call after render
|
||||
queueMicrotask(() => {
|
||||
onChange?.(selectedValues);
|
||||
});
|
||||
}
|
||||
prevSelectedRef.current = selected;
|
||||
isUserInitiatedRef.current = false; // Reset flag
|
||||
} else if (!isUserInitiatedRef.current) {
|
||||
// Update ref even if not user-initiated to track state
|
||||
prevSelectedRef.current = selected;
|
||||
}
|
||||
}, [selected, onChange]);
|
||||
|
||||
const handleUnselect = React.useCallback(
|
||||
(option: TOption<T>) => {
|
||||
if (disabled) return;
|
||||
isUserInitiatedRef.current = true; // Mark as user-initiated
|
||||
setSelected((prev) => prev.filter((s) => s.value !== option.value));
|
||||
setSelected((prev) => {
|
||||
const newSelected = prev.filter((s) => s.value !== option.value);
|
||||
onChange?.(newSelected.map((s) => s.value) as K);
|
||||
return newSelected;
|
||||
});
|
||||
},
|
||||
[disabled]
|
||||
[onChange, disabled]
|
||||
);
|
||||
|
||||
const handleKeyDown = React.useCallback(
|
||||
@@ -100,10 +62,10 @@ export function MultiSelect<T extends string, K extends TOption<T>["value"][]>(
|
||||
if (!input || disabled) return;
|
||||
|
||||
if ((e.key === "Delete" || e.key === "Backspace") && input.value === "") {
|
||||
isUserInitiatedRef.current = true; // Mark as user-initiated
|
||||
setSelected((prev) => {
|
||||
const newSelected = [...prev];
|
||||
newSelected.pop();
|
||||
onChange?.(newSelected.map((s) => s.value) as K);
|
||||
return newSelected;
|
||||
});
|
||||
}
|
||||
@@ -124,26 +86,11 @@ export function MultiSelect<T extends string, K extends TOption<T>["value"][]>(
|
||||
});
|
||||
}, [options, selected, inputValue]);
|
||||
|
||||
// Calculate position for dropdown when opening
|
||||
React.useEffect(() => {
|
||||
if (open && containerRef.current) {
|
||||
const rect = containerRef.current.getBoundingClientRect();
|
||||
setPosition({
|
||||
top: rect.bottom + window.scrollY + 6,
|
||||
left: rect.left + window.scrollX,
|
||||
width: rect.width,
|
||||
});
|
||||
} else {
|
||||
setPosition(null);
|
||||
}
|
||||
}, [open]);
|
||||
|
||||
return (
|
||||
<Command
|
||||
onKeyDown={handleKeyDown}
|
||||
className={`relative overflow-visible bg-white ${disabled ? "cursor-not-allowed opacity-50" : ""}`}>
|
||||
className={`overflow-visible bg-white ${disabled ? "cursor-not-allowed opacity-50" : ""}`}>
|
||||
<div
|
||||
ref={containerRef}
|
||||
className={`border-input ring-offset-background group rounded-md border px-3 py-2 text-sm focus-within:ring-2 focus-within:ring-offset-2 ${
|
||||
disabled ? "pointer-events-none" : "focus-within:ring-ring"
|
||||
}`}>
|
||||
@@ -179,45 +126,34 @@ export function MultiSelect<T extends string, K extends TOption<T>["value"][]>(
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
{open &&
|
||||
selectableOptions.length > 0 &&
|
||||
!disabled &&
|
||||
position &&
|
||||
globalThis.window !== undefined &&
|
||||
createPortal(
|
||||
<div
|
||||
className="fixed z-[100]"
|
||||
style={{
|
||||
top: `${position.top}px`,
|
||||
left: `${position.left}px`,
|
||||
width: `${position.width}px`,
|
||||
}}>
|
||||
<CommandList className="border-0">
|
||||
<div className="text-popover-foreground animate-in max-h-32 w-full overflow-auto rounded-md border border-slate-300 bg-white shadow-md outline-none">
|
||||
<CommandGroup className="h-full overflow-auto">
|
||||
{selectableOptions.map((option) => (
|
||||
<CommandItem
|
||||
key={option.value}
|
||||
onMouseDown={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}}
|
||||
onSelect={() => {
|
||||
if (disabled) return;
|
||||
isUserInitiatedRef.current = true; // Mark as user-initiated
|
||||
setSelected((prev) => [...prev, option]);
|
||||
setInputValue("");
|
||||
}}
|
||||
className="cursor-pointer">
|
||||
{option.label}
|
||||
</CommandItem>
|
||||
))}
|
||||
</CommandGroup>
|
||||
</div>
|
||||
</CommandList>
|
||||
</div>,
|
||||
document.body
|
||||
)}
|
||||
{open && selectableOptions.length > 0 && !disabled && (
|
||||
<div className="relative mt-2">
|
||||
<CommandList className="border-0">
|
||||
<div className="text-popover-foreground animate-in absolute top-0 z-10 max-h-32 w-full overflow-auto rounded-md bg-white shadow-md outline-none">
|
||||
<CommandGroup className="h-full overflow-auto">
|
||||
{selectableOptions.map((option) => (
|
||||
<CommandItem
|
||||
key={option.value}
|
||||
onMouseDown={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}}
|
||||
onSelect={() => {
|
||||
if (disabled) return;
|
||||
const newSelected = [...selected, option];
|
||||
setSelected(newSelected);
|
||||
onChange?.(newSelected.map((o) => o.value) as K);
|
||||
setInputValue("");
|
||||
}}
|
||||
className="cursor-pointer">
|
||||
{option.label}
|
||||
</CommandItem>
|
||||
))}
|
||||
</CommandGroup>
|
||||
</div>
|
||||
</CommandList>
|
||||
</div>
|
||||
)}
|
||||
</Command>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,17 +2,12 @@ import { useEffect, useState } from "react";
|
||||
import { TOrganizationBilling } from "@formbricks/types/organizations";
|
||||
import { getOrganizationBillingInfoAction } from "./actions";
|
||||
|
||||
export const useGetBillingInfo = (organizationId: string | undefined) => {
|
||||
export const useGetBillingInfo = (organizationId: string) => {
|
||||
const [billingInfo, setBillingInfo] = useState<TOrganizationBilling>();
|
||||
const [isLoading, setIsLoading] = useState<boolean>(false);
|
||||
const [error, setError] = useState<string>("");
|
||||
|
||||
useEffect(() => {
|
||||
// Skip fetching if organizationId is not provided
|
||||
if (!organizationId) {
|
||||
return;
|
||||
}
|
||||
|
||||
const getBillingInfo = async () => {
|
||||
try {
|
||||
setIsLoading(true);
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
"generate-api-specs": "./scripts/openapi/generate.sh",
|
||||
"merge-client-endpoints": "tsx ./scripts/openapi/merge-client-endpoints.ts",
|
||||
"generate-and-merge-api-specs": "pnpm run generate-api-specs && pnpm run merge-client-endpoints",
|
||||
"i18n:generate": "npx lingo.dev@latest run && npx lingo.dev@latest lockfile --force"
|
||||
"i18n:generate": "npx lingo.dev@latest i18n"
|
||||
},
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "3.879.0",
|
||||
|
||||
+1
-2
@@ -101,8 +101,7 @@
|
||||
"xm-and-surveys/surveys/link-surveys/start-at-question",
|
||||
"xm-and-surveys/surveys/link-surveys/verify-email-before-survey",
|
||||
"xm-and-surveys/surveys/link-surveys/market-research-panel",
|
||||
"xm-and-surveys/surveys/link-surveys/pin-protected-surveys",
|
||||
"xm-and-surveys/surveys/link-surveys/custom-head-scripts"
|
||||
"xm-and-surveys/surveys/link-surveys/pin-protected-surveys"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 68 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user