Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
"❗️ migrations":
- packages/database/migration/**/migration.sql
- changed-files:
- any-glob-to-any-file: packages/database/migration/**/migration.sql

"❗️ .env changes":
- .env.example
- .env.docker
- changed-files:
- any-glob-to-any-file:
- .env.example
- .env.docker
29 changes: 29 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Pull Request Labeler

on:
pull_request_target:
types: [opened, reopened, synchronize]

permissions:
contents: read
pull-requests: write

concurrency:
group: pr-path-labeler-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
labeler:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Harden the runner
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit

- name: Label pull request from changed paths
uses: actions/labeler@bf12e9b00b37c5c0ca2b87b79b2daf7891dbda13 # v7.0.0
with:
configuration-path: .github/labeler.yml
repo-token: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import { resolveStorageUrlsInObject, validateClientFileUploads } from "@/modules
import { updateResponseWithQuotaEvaluation } from "./lib/response";

type TUncheckedResponseUpdate = Record<string, unknown> & {
data: TResponseData;
// Both optional: the body is unchecked here, and ZResponseUpdateInput allows partial updates.
data?: TResponseData;
language?: string;
};

Expand Down
4 changes: 3 additions & 1 deletion apps/web/i18n.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2984,6 +2984,9 @@ checksums:
workspace/surveys/edit/back_button_label: 504551d78645d968fcee95e3dfa5586f
workspace/surveys/edit/background_styling: eb4a06cf54a7271b493fab625d930570
workspace/surveys/edit/block_duplicated: dc9e9fab2b1cd91f6c265324b34c6376
workspace/surveys/edit/block_n: 7bfcbe9919e7826127f93a005c5852a6
workspace/surveys/edit/block_name: df519e7fa53c3c20e2f25da6cc00244d
workspace/surveys/edit/block_name_required_for: 066ef44bb57f625a0b4975f613e6a1ee
workspace/surveys/edit/bold: 4d7306bc355ed2befd6a9237c5452ee6
workspace/surveys/edit/brand_color: 84ddb5736deb9f5c081ffe4962a6c63e
workspace/surveys/edit/brand_color_description: 1cd10092621d375a37e297cc6353bce7
Expand Down Expand Up @@ -3413,7 +3416,6 @@ checksums:
workspace/surveys/edit/unlock_targeting_title: 6098caf969cac64cd54e217471ae42d4
workspace/surveys/edit/unsaved_changes_warning: a164f276c9f7344022aa4640b32abcf9
workspace/surveys/edit/until_they_submit_a_response: 2a0fd5dcc6cc40a72ed9b974f22eaf68
workspace/surveys/edit/untitled_block: fdaa045139deff5cc65fa027df0cc22e
workspace/surveys/edit/update_options: 3499161b010acdefba2d878daa5fb6fa
workspace/surveys/edit/upload: 4a6c84aa16db0f4e5697f49b45257bc7
workspace/surveys/edit/upload_at_least_2_images: b627440b77068eff412bd28e5ff459a7
Expand Down
26 changes: 26 additions & 0 deletions apps/web/lib/response/service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,32 @@ describe("updateResponse", () => {
})
);
});

test("preserves stored data and language when the input omits them", async () => {
// The management API accepts partial bodies (e.g. `{ "finished": true }`), so `data` and
// `language` can both be absent. Absent must mean "leave the stored column alone" — never
// overwrite it with an empty value (ENG-2425).
const currentResponse = createMockCurrentResponse({
data: { question1: "answer1" },
language: "de-DE",
}) as unknown as NonNullable<Awaited<ReturnType<typeof prisma.response.findUnique>>>;

vi.mocked(prisma.response.findUnique).mockResolvedValue(currentResponse);
vi.mocked(prisma.response.update).mockResolvedValue(currentResponse);

await updateResponse(mockResponseId, { finished: true });

expect(prisma.response.update).toHaveBeenCalledWith(
expect.objectContaining({
data: expect.objectContaining({
finished: true,
data: { question1: "answer1" },
// undefined is a Prisma no-op; null or "" would wipe the stored language
language: undefined,
}),
})
);
});
});

describe("variables merging behavior", () => {
Expand Down
4 changes: 3 additions & 1 deletion apps/web/locales/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -3101,6 +3101,9 @@
"back_button_label": "Beschriftung für „Zurück“-Button",
"background_styling": "Hintergrund-Gestaltung",
"block_duplicated": "Block dupliziert.",
"block_n": "Block {blockNumber}",
"block_name": "Blockname",
"block_name_required_for": "Blockname ist erforderlich für Block {blockNumber}",
"bold": "Fett",
"brand_color": "Markenfarbe",
"brand_color_description": "Wird auf Buttons, Links und Hervorhebungen angewendet.",
Expand Down Expand Up @@ -3532,7 +3535,6 @@
"unlock_targeting_title": "Schalte Targeting mit einem höheren Plan frei",
"unsaved_changes_warning": "Du hast ungespeicherte Änderungen in deiner Umfrage. Möchtest du sie speichern, bevor du die Seite verlässt?",
"until_they_submit_a_response": "Fragen, bis sie eine Antwort absenden",
"untitled_block": "Unbenannter Block",
"update_options": "Optionen aktualisieren",
"upload": "Hochladen",
"upload_at_least_2_images": "Lade mindestens 2 Bilder hoch",
Expand Down
4 changes: 3 additions & 1 deletion apps/web/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -3101,6 +3101,9 @@
"back_button_label": "“Back” Button Label",
"background_styling": "Background styling",
"block_duplicated": "Block duplicated.",
"block_n": "Block {blockNumber}",
"block_name": "Block name",
"block_name_required_for": "Block name is required for Block {blockNumber}",
"bold": "Bold",
"brand_color": "Brand color",
"brand_color_description": "Applied to buttons, links and highlights.",
Expand Down Expand Up @@ -3532,7 +3535,6 @@
"unlock_targeting_title": "Unlock targeting with a higher plan",
"unsaved_changes_warning": "You have unsaved changes in your survey. Would you like to save them before leaving?",
"until_they_submit_a_response": "Ask until they submit a response",
"untitled_block": "Untitled Block",
"update_options": "Update options",
"upload": "Upload",
"upload_at_least_2_images": "Upload at least 2 images",
Expand Down
4 changes: 3 additions & 1 deletion apps/web/locales/es-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -3101,6 +3101,9 @@
"back_button_label": "Etiqueta del botón \"Atrás\"",
"background_styling": "Estilo del fondo",
"block_duplicated": "Bloque duplicado.",
"block_n": "Bloque {blockNumber}",
"block_name": "Nombre del bloque",
"block_name_required_for": "El nombre del bloque es obligatorio para el Bloque {blockNumber}",
"bold": "Negrita",
"brand_color": "Color de marca",
"brand_color_description": "Se aplica a botones, enlaces y resaltados.",
Expand Down Expand Up @@ -3532,7 +3535,6 @@
"unlock_targeting_title": "Desbloquea la segmentación con un plan superior",
"unsaved_changes_warning": "Tienes cambios sin guardar en tu encuesta. ¿Quieres guardarlos antes de salir?",
"until_they_submit_a_response": "Preguntar hasta que envíen una respuesta",
"untitled_block": "Bloque sin título",
"update_options": "Actualizar opciones",
"upload": "Subir",
"upload_at_least_2_images": "Sube al menos 2 imágenes",
Expand Down
4 changes: 3 additions & 1 deletion apps/web/locales/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -3101,6 +3101,9 @@
"back_button_label": "Label du bouton \"Retour''",
"background_styling": "Style d'arrière-plan",
"block_duplicated": "Bloc dupliqué.",
"block_n": "Bloc {blockNumber}",
"block_name": "Nom du bloc",
"block_name_required_for": "Le nom du bloc est requis pour le bloc {blockNumber}",
"bold": "Gras",
"brand_color": "Couleur de marque",
"brand_color_description": "Appliqué aux boutons, liens et éléments mis en évidence.",
Expand Down Expand Up @@ -3532,7 +3535,6 @@
"unlock_targeting_title": "Débloquez le ciblage avec un plan supérieur.",
"unsaved_changes_warning": "Vous avez des modifications non enregistrées dans votre enquête. Souhaitez-vous les enregistrer avant de partir ?",
"until_they_submit_a_response": "Demander jusqu'à ce qu'ils soumettent une réponse",
"untitled_block": "Bloc sans titre",
"update_options": "Mettre à jour les options",
"upload": "Télécharger",
"upload_at_least_2_images": "Téléchargez au moins 2 images",
Expand Down
4 changes: 3 additions & 1 deletion apps/web/locales/hu-HU.json
Original file line number Diff line number Diff line change
Expand Up @@ -3101,6 +3101,9 @@
"back_button_label": "A „Vissza” gomb címkéje",
"background_styling": "Háttér stílusának beállítása",
"block_duplicated": "A blokk kettőzve.",
"block_n": "Blokk {blockNumber}",
"block_name": "Blokk neve",
"block_name_required_for": "A blokk neve kötelező a(z) {blockNumber}. blokkhoz",
"bold": "Félkövér",
"brand_color": "Márkajel színe",
"brand_color_description": "Gombokra, hivatkozásokra és kiemelésekre alkalmazva.",
Expand Down Expand Up @@ -3532,7 +3535,6 @@
"unlock_targeting_title": "Célzás feloldása egy magasabb csomaggal",
"unsaved_changes_warning": "Elmentetlen változtatások vannak a kérdőívében. Szeretné elmenteni azokat a kilépés előtt?",
"until_they_submit_a_response": "Kérdezzen, amíg nem küldenek választ",
"untitled_block": "Névtelen blokk",
"update_options": "Lehetőségek frissítése",
"upload": "Feltöltés",
"upload_at_least_2_images": "Töltsön fel legalább 2 képet",
Expand Down
4 changes: 3 additions & 1 deletion apps/web/locales/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -3101,6 +3101,9 @@
"back_button_label": "「戻る」ボタンのラベル",
"background_styling": "背景のスタイル設定",
"block_duplicated": "ブロックが複製されました。",
"block_n": "ブロック {blockNumber}",
"block_name": "ブロック名",
"block_name_required_for": "ブロック{blockNumber}にはブロック名が必要です",
"bold": "太字",
"brand_color": "ブランドカラー",
"brand_color_description": "ボタン、リンク、ハイライトに適用されます。",
Expand Down Expand Up @@ -3532,7 +3535,6 @@
"unlock_targeting_title": "上位プランでターゲティングをアンロック",
"unsaved_changes_warning": "フォームに未保存の変更があります。離れる前に保存しますか?",
"until_they_submit_a_response": "回答が提出されるまで質問する",
"untitled_block": "無題のブロック",
"update_options": "オプションを更新",
"upload": "アップロード",
"upload_at_least_2_images": "少なくとも2枚の画像をアップロードしてください",
Expand Down
4 changes: 3 additions & 1 deletion apps/web/locales/nl-NL.json
Original file line number Diff line number Diff line change
Expand Up @@ -3101,6 +3101,9 @@
"back_button_label": "Knoplabel 'Terug'",
"background_styling": "Achtergrondstijl",
"block_duplicated": "Blok gedupliceerd.",
"block_n": "Blok {blockNumber}",
"block_name": "Bloknaam",
"block_name_required_for": "Bloknaam is vereist voor blok {blockNumber}",
"bold": "Vetgedrukt",
"brand_color": "Merk kleur",
"brand_color_description": "Toegepast op knoppen, links en highlights.",
Expand Down Expand Up @@ -3532,7 +3535,6 @@
"unlock_targeting_title": "Ontgrendel targeting met een hoger plan",
"unsaved_changes_warning": "Er zijn niet-opgeslagen wijzigingen in uw enquête. Wilt u ze bewaren voordat u vertrekt?",
"until_they_submit_a_response": "Vraag totdat ze een reactie indienen",
"untitled_block": "Naamloos blok",
"update_options": "Opties bijwerken",
"upload": "Uploaden",
"upload_at_least_2_images": "Upload minimaal 2 afbeeldingen",
Expand Down
4 changes: 3 additions & 1 deletion apps/web/locales/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -3101,6 +3101,9 @@
"back_button_label": "Voltar",
"background_styling": "Estilo do plano de fundo",
"block_duplicated": "Bloco duplicado.",
"block_n": "Bloco {blockNumber}",
"block_name": "Nome do bloco",
"block_name_required_for": "O nome do bloco é obrigatório para o Bloco {blockNumber}",
"bold": "Negrito",
"brand_color": "Cor da marca",
"brand_color_description": "Aplicado a botões, links e destaques.",
Expand Down Expand Up @@ -3532,7 +3535,6 @@
"unlock_targeting_title": "Desbloqueie o direcionamento com um plano superior",
"unsaved_changes_warning": "Você tem alterações não salvas na sua pesquisa. Quer salvar antes de sair?",
"until_they_submit_a_response": "Perguntar até que enviem uma resposta",
"untitled_block": "Bloco sem título",
"update_options": "Atualizar opções",
"upload": "Enviar",
"upload_at_least_2_images": "Faz o upload de pelo menos 2 imagens",
Expand Down
4 changes: 3 additions & 1 deletion apps/web/locales/pt-PT.json
Original file line number Diff line number Diff line change
Expand Up @@ -3101,6 +3101,9 @@
"back_button_label": "Rótulo do botão \"Voltar\"",
"background_styling": "Estilo de fundo",
"block_duplicated": "Bloco duplicado.",
"block_n": "Bloco {blockNumber}",
"block_name": "Nome do bloco",
"block_name_required_for": "O nome do bloco é obrigatório para o Bloco {blockNumber}",
"bold": "Negrito",
"brand_color": "Cor da marca",
"brand_color_description": "Aplicado a botões, links e destaques.",
Expand Down Expand Up @@ -3532,7 +3535,6 @@
"unlock_targeting_title": "Desbloqueie a segmentação com um plano superior",
"unsaved_changes_warning": "Tem alterações não guardadas no seu inquérito. Gostaria de as guardar antes de sair?",
"until_they_submit_a_response": "Perguntar até que submetam uma resposta",
"untitled_block": "Bloco sem título",
"update_options": "Atualizar opções",
"upload": "Carregar",
"upload_at_least_2_images": "Carregue pelo menos 2 imagens",
Expand Down
4 changes: 3 additions & 1 deletion apps/web/locales/ro-RO.json
Original file line number Diff line number Diff line change
Expand Up @@ -3101,6 +3101,9 @@
"back_button_label": "Etichetă buton \"Înapoi\"",
"background_styling": "Stilizare fundal",
"block_duplicated": "Bloc duplicat.",
"block_n": "Blocul {blockNumber}",
"block_name": "Nume bloc",
"block_name_required_for": "Numele blocului este obligatoriu pentru Blocul {blockNumber}",
"bold": "Îngroșat",
"brand_color": "Culoarea brandului",
"brand_color_description": "Se aplică pe butoane, linkuri și evidențieri.",
Expand Down Expand Up @@ -3532,7 +3535,6 @@
"unlock_targeting_title": "Deblocați țintirea cu un plan superior",
"unsaved_changes_warning": "Aveți modificări nesalvate în sondajul dumneavoastră. Doriți să le salvați înainte de a pleca?",
"until_they_submit_a_response": "Întreabă până când trimit un răspuns",
"untitled_block": "Bloc fără titlu",
"update_options": "Actualizați opțiunile",
"upload": "Încărcați",
"upload_at_least_2_images": "Încărcați cel puțin 2 imagini",
Expand Down
4 changes: 3 additions & 1 deletion apps/web/locales/ru-RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -3101,6 +3101,9 @@
"back_button_label": "Метка кнопки «Назад»",
"background_styling": "Оформление фона",
"block_duplicated": "Блокировать дубликаты.",
"block_n": "Блок {blockNumber}",
"block_name": "Название блока",
"block_name_required_for": "Название блока обязательно для блока {blockNumber}",
"bold": "Жирный",
"brand_color": "Фирменный цвет",
"brand_color_description": "Применяется к кнопкам, ссылкам и выделениям.",
Expand Down Expand Up @@ -3532,7 +3535,6 @@
"unlock_targeting_title": "Откройте таргетинг на более высоком тарифе",
"unsaved_changes_warning": "У вас есть несохранённые изменения в опросе. Сохранить их перед выходом?",
"until_they_submit_a_response": "Спрашивать, пока не будет получен ответ",
"untitled_block": "Безымянный блок",
"update_options": "Обновить параметры",
"upload": "Загрузить",
"upload_at_least_2_images": "Загрузите как минимум 2 изображения",
Expand Down
4 changes: 3 additions & 1 deletion apps/web/locales/sv-SE.json
Original file line number Diff line number Diff line change
Expand Up @@ -3101,6 +3101,9 @@
"back_button_label": "\"Tillbaka\"-knappens etikett",
"background_styling": "Bakgrundsstil",
"block_duplicated": "Block duplicerat.",
"block_n": "Block {blockNumber}",
"block_name": "Blocknamn",
"block_name_required_for": "Blocknamn krävs för Block {blockNumber}",
"bold": "Fet",
"brand_color": "Varumärkesfärg",
"brand_color_description": "Används för knappar, länkar och markeringar.",
Expand Down Expand Up @@ -3532,7 +3535,6 @@
"unlock_targeting_title": "Lås upp målgruppsinriktning med en högre plan",
"unsaved_changes_warning": "Du har osparade ändringar i din enkät. Vill du spara dem innan du lämnar?",
"until_they_submit_a_response": "Fråga tills de skickar in ett svar",
"untitled_block": "Namnlöst block",
"update_options": "Uppdatera alternativ",
"upload": "Ladda upp",
"upload_at_least_2_images": "Ladda upp minst 2 bilder",
Expand Down
4 changes: 3 additions & 1 deletion apps/web/locales/tr-TR.json
Original file line number Diff line number Diff line change
Expand Up @@ -3101,6 +3101,9 @@
"back_button_label": "\"Geri\" Düğme Etiketi",
"background_styling": "Arka plan stili",
"block_duplicated": "Blok çoğaltıldı.",
"block_n": "Blok {blockNumber}",
"block_name": "Blok adı",
"block_name_required_for": "Blok {blockNumber} için blok adı gerekli",
"bold": "Kalın",
"brand_color": "Marka rengi",
"brand_color_description": "Düğmelere, bağlantılara ve vurgulara uygulanır.",
Expand Down Expand Up @@ -3532,7 +3535,6 @@
"unlock_targeting_title": "Daha yüksek bir planla hedeflemeyi aç",
"unsaved_changes_warning": "Anketinde kaydedilmemiş değişiklikler var. Ayrılmadan önce kaydetmek ister misin?",
"until_they_submit_a_response": "Yanıt gönderene kadar sor",
"untitled_block": "Başlıksız Blok",
"update_options": "Seçenekleri güncelle",
"upload": "Yükle",
"upload_at_least_2_images": "En az 2 görsel yükle",
Expand Down
4 changes: 3 additions & 1 deletion apps/web/locales/zh-Hans-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -3101,6 +3101,9 @@
"back_button_label": "\"返回\" 按钮标签",
"background_styling": "背景样式",
"block_duplicated": "区块已复制。",
"block_n": "区块 {blockNumber}",
"block_name": "区块名称",
"block_name_required_for": "区块 {blockNumber} 需要填写区块名称",
"bold": "粗体",
"brand_color": "品牌 颜色",
"brand_color_description": "应用于按钮、链接和高亮部分。",
Expand Down Expand Up @@ -3532,7 +3535,6 @@
"unlock_targeting_title": "通过 更 高级 划解锁 定位",
"unsaved_changes_warning": "您在调查中有未保存的更改。离开前是否要保存?",
"until_they_submit_a_response": "持续显示直到提交回应",
"untitled_block": "未命名区块",
"update_options": "更新选项",
"upload": "上传",
"upload_at_least_2_images": "至少 上传 2 张 图片",
Expand Down
4 changes: 3 additions & 1 deletion apps/web/locales/zh-Hant-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -3101,6 +3101,9 @@
"back_button_label": "「返回」按鈕標籤",
"background_styling": "背景樣式",
"block_duplicated": "區塊已複製。",
"block_n": "區塊 {blockNumber}",
"block_name": "區塊名稱",
"block_name_required_for": "區塊 {blockNumber} 需要區塊名稱",
"bold": "粗體",
"brand_color": "品牌顏色",
"brand_color_description": "應用於按鈕、連結和重點標示。",
Expand Down Expand Up @@ -3532,7 +3535,6 @@
"unlock_targeting_title": "使用更高等級的方案解鎖目標設定",
"unsaved_changes_warning": "您的問卷中有未儲存的變更。您要先儲存它們再離開嗎?",
"until_they_submit_a_response": "持續詢問直到提交回應",
"untitled_block": "未命名區塊",
"update_options": "更新選項",
"upload": "上傳",
"upload_at_least_2_images": "上傳至少 2 張圖片",
Expand Down
Loading
Loading