Compare commits

...

5 Commits

19 changed files with 45 additions and 5 deletions

View File

@@ -180,6 +180,8 @@ checksums:
common/download: 56b7d0834952b39ee394b44bd8179178
common/draft: e8a92958ad300aacfe46c2bf6644927e
common/duplicate: 27756566785c2b8463e21582c4bb619b
common/duplicate_copy: 68d2201918610ca87c2914b61dc8010f
common/duplicate_copy_number: 083cfffd294672043dcbcc4c3dfeac6a
common/e_commerce: b9584e7d0449a6d1b0c182d7ff14061e
common/edit: eee7f39ff90b18852afc1671f21fbaa9
common/email: e7f34943a0c2fb849db1839ff6ef5cb5

View File

@@ -207,6 +207,8 @@
"download": "Herunterladen",
"draft": "Entwurf",
"duplicate": "Duplikat",
"duplicate_copy": "(Kopie)",
"duplicate_copy_number": "(Kopie {copyNumber})",
"e_commerce": "E-Commerce",
"edit": "Bearbeiten",
"email": "E-Mail",

View File

@@ -207,6 +207,8 @@
"download": "Download",
"draft": "Draft",
"duplicate": "Duplicate",
"duplicate_copy": "(copy)",
"duplicate_copy_number": "(copy {copyNumber})",
"e_commerce": "E-Commerce",
"edit": "Edit",
"email": "Email",

View File

@@ -207,6 +207,8 @@
"download": "Descargar",
"draft": "Borrador",
"duplicate": "Duplicar",
"duplicate_copy": "(copia)",
"duplicate_copy_number": "(copia {copyNumber})",
"e_commerce": "Comercio electrónico",
"edit": "Editar",
"email": "Email",

View File

@@ -207,6 +207,8 @@
"download": "Télécharger",
"draft": "Brouillon",
"duplicate": "Dupliquer",
"duplicate_copy": "(copie)",
"duplicate_copy_number": "(copie {copyNumber})",
"e_commerce": "E-commerce",
"edit": "Modifier",
"email": "Email",

View File

@@ -207,6 +207,8 @@
"download": "Letöltés",
"draft": "Piszkozat",
"duplicate": "Kettőzés",
"duplicate_copy": "(másolat)",
"duplicate_copy_number": "({copyNumber}. másolat)",
"e_commerce": "E-kereskedelem",
"edit": "Szerkesztés",
"email": "E-mail",

View File

@@ -207,6 +207,8 @@
"download": "ダウンロード",
"draft": "下書き",
"duplicate": "複製",
"duplicate_copy": "(コピー)",
"duplicate_copy_number": "(コピー {copyNumber})",
"e_commerce": "Eコマース",
"edit": "編集",
"email": "メールアドレス",

View File

@@ -207,6 +207,8 @@
"download": "Downloaden",
"draft": "Voorlopige versie",
"duplicate": "Duplicaat",
"duplicate_copy": "(kopie)",
"duplicate_copy_number": "(kopie {copyNumber})",
"e_commerce": "E-commerce",
"edit": "Bewerking",
"email": "E-mail",

View File

@@ -207,6 +207,8 @@
"download": "baixar",
"draft": "Rascunho",
"duplicate": "Duplicar",
"duplicate_copy": "(cópia)",
"duplicate_copy_number": "(cópia {copyNumber})",
"e_commerce": "comércio eletrônico",
"edit": "Editar",
"email": "Email",

View File

@@ -207,6 +207,8 @@
"download": "Transferir",
"draft": "Rascunho",
"duplicate": "Duplicar",
"duplicate_copy": "(cópia)",
"duplicate_copy_number": "(cópia {copyNumber})",
"e_commerce": "Comércio Eletrónico",
"edit": "Editar",
"email": "Email",

View File

@@ -207,6 +207,8 @@
"download": "Descărcare",
"draft": "Schiță",
"duplicate": "Duplicități",
"duplicate_copy": "(copie)",
"duplicate_copy_number": "(copie {copyNumber})",
"e_commerce": "Comerț electronic",
"edit": "Editare",
"email": "Email",

View File

@@ -207,6 +207,8 @@
"download": "Скачать",
"draft": "Черновик",
"duplicate": "Дублировать",
"duplicate_copy": "(копия)",
"duplicate_copy_number": "(копия {copyNumber})",
"e_commerce": "E-Commerce",
"edit": "Редактировать",
"email": "Email",

View File

@@ -207,6 +207,8 @@
"download": "Ladda ner",
"draft": "Utkast",
"duplicate": "Duplicera",
"duplicate_copy": "(kopia)",
"duplicate_copy_number": "(kopia {copyNumber})",
"e_commerce": "E-handel",
"edit": "Redigera",
"email": "E-post",

View File

@@ -207,6 +207,8 @@
"download": "下载",
"draft": "草稿",
"duplicate": "复制",
"duplicate_copy": "(副本)",
"duplicate_copy_number": "(副本 {copyNumber}",
"e_commerce": "电子商务",
"edit": "编辑",
"email": "邮箱",

View File

@@ -207,6 +207,8 @@
"download": "下載",
"draft": "草稿",
"duplicate": "複製",
"duplicate_copy": "(複製)",
"duplicate_copy_number": "(複製 {copyNumber}",
"e_commerce": "電子商務",
"edit": "編輯",
"email": "電子郵件",

View File

@@ -81,7 +81,7 @@ export const ActionActivityTab = ({
if (copyName && actionClassNames.includes(copyName)) {
while (actionClassNames.includes(copyName)) {
copyName += " (copy)";
copyName += ` ${t("common.duplicate_copy")}`;
}
}

View File

@@ -110,7 +110,7 @@ export const FollowUpItem = ({
const newFollowUp = {
...followUp,
id: createId(),
name: `${followUp.name} (copy)`,
name: `${followUp.name} ${t("common.duplicate_copy")}`,
};
setLocalSurvey((prev) => ({

View File

@@ -61,6 +61,14 @@ vi.mock("@/modules/ee/license-check/lib/utils", () => ({
getIsQuotasEnabled: vi.fn(),
}));
vi.mock("@/lingodotdev/server", () => ({
getTranslate: async () => (key: string, params?: Record<string, unknown>) => {
if (key === "common.duplicate_copy") return "(copy)";
if (key === "common.duplicate_copy_number") return `(copy ${params?.copyNumber})`;
return key;
},
}));
vi.mock("@formbricks/database", () => ({
prisma: {
survey: {

View File

@@ -10,6 +10,7 @@ import { TSurveyFilterCriteria } from "@formbricks/types/surveys/types";
import { getOrganizationByEnvironmentId } from "@/lib/organization/service";
import { checkForInvalidMediaInBlocks } from "@/lib/survey/utils";
import { validateInputs } from "@/lib/utils/validate";
import { getTranslate } from "@/lingodotdev/server";
import { getIsQuotasEnabled } from "@/modules/ee/license-check/lib/utils";
import { getQuotas } from "@/modules/ee/quotas/lib/quotas";
import { buildOrderByClause, buildWhereClause } from "@/modules/survey/lib/utils";
@@ -332,12 +333,13 @@ export const copySurveyToOtherEnvironment = async (
const { ...restExistingSurvey } = existingSurvey;
const hasLanguages = existingSurvey.languages && existingSurvey.languages.length > 0;
const t = await getTranslate();
// Prepare survey data
const surveyData: Prisma.SurveyCreateInput = {
...restExistingSurvey,
id: createId(),
name: `${existingSurvey.name} (copy)`,
name: `${existingSurvey.name} ${t("common.duplicate_copy")}`,
type: existingSurvey.type,
status: "draft",
welcomeCard: structuredClone(existingSurvey.welcomeCard),
@@ -400,11 +402,11 @@ export const copySurveyToOtherEnvironment = async (
if (hasNameConflict) {
// Find a unique name by appending (copy), (copy 2), (copy 3), etc.
let copyNumber = 1;
let candidateName = `${trigger.actionClass.name} (copy)`;
let candidateName = `${trigger.actionClass.name} ${t("common.duplicate_copy")}`;
while (existingActionClassNames.has(candidateName)) {
copyNumber++;
candidateName = `${trigger.actionClass.name} (copy ${copyNumber})`;
candidateName = `${trigger.actionClass.name} ${t("common.duplicate_copy_number", { copyNumber })}`;
}
modifiedName = candidateName;