From 8fdaefe10b7cc0cbdb944fc479a520794f82d706 Mon Sep 17 00:00:00 2001 From: Tom Hempel Date: Sat, 6 Jun 2026 16:35:57 +0200 Subject: [PATCH] Remove 'client_not_signed' layout from questionnaire logic --- data/app_ui_strings.json | 4 +-- lib/dev_fixture.php | 1 - website/js/pages/editor.js | 26 ------------------- website/js/questionnaire-preview.js | 13 +--------- .../temp-assets/questionnaire_0_readme.json | 11 ++++---- 5 files changed, 8 insertions(+), 47 deletions(-) diff --git a/data/app_ui_strings.json b/data/app_ui_strings.json index 243d7df..5b28968 100644 --- a/data/app_ui_strings.json +++ b/data/app_ui_strings.json @@ -1,6 +1,6 @@ { "version": 2, - "description": "Coach-visible app UI strings only (excludes dev settings \/ database tools).", + "description": "Coach-visible app UI strings only (excludes dev settings / database tools).", "keys": [ "all_clients", "answer", @@ -134,7 +134,7 @@ "extreme_glass": "Extrem", "february": "Februar", "fill_all_fields": "Bitte alle Felder ausfüllen!", - "fill_both_fields": "Bitte beide Felder ausfüllen!", + "fill_both_fields": "Bitte Klienten-Code und Coach-Code prüfen.", "hours_short": "h", "january": "Januar", "july": "Juli", diff --git a/lib/dev_fixture.php b/lib/dev_fixture.php index 0bd56a3..0385b68 100644 --- a/lib/dev_fixture.php +++ b/lib/dev_fixture.php @@ -418,7 +418,6 @@ function qdb_dev_build_answers_for_questionnaire(PDO $pdo, string $qnID, int $va break; case 'radio_question': - case 'client_not_signed': $opts = $optionsByQuestion[$q['questionID']] ?? []; if ($opts) { $pick = $opts[$v % count($opts)]; diff --git a/website/js/pages/editor.js b/website/js/pages/editor.js index 62594d1..038a116 100644 --- a/website/js/pages/editor.js +++ b/website/js/pages/editor.js @@ -28,7 +28,6 @@ const LAYOUT_TYPES = [ { value: 'string_spinner', label: 'String Spinner' }, { value: 'free_text', label: 'Free Text' }, { value: 'client_coach_code_question', label: 'Client / Coach Code' }, - { value: 'client_not_signed', label: 'Client Not Signed' }, { value: 'last_page', label: 'Last Page' }, ]; @@ -342,7 +341,6 @@ const QUESTION_LEVEL_NEXT_LAYOUTS = new Set([ 'multi_check_box_question', 'glass_scale_question', 'client_coach_code_question', - 'client_not_signed', 'last_page', ]); @@ -566,25 +564,6 @@ function configFormHTML(layout, config, prefix, opts = {}) { `; break; - case 'client_not_signed': - html = ` -
-
- - -
-
- - -
-
-
-
- - -
-
`; - break; case 'last_page': html = `
@@ -672,11 +651,6 @@ function readConfigFromForm(layout, prefix) { if (val('hint1')) config.hint1 = val('hint1'); if (val('hint2')) config.hint2 = val('hint2'); break; - case 'client_not_signed': - if (val('textKey1')) config.textKey1 = val('textKey1'); - if (val('textKey2')) config.textKey2 = val('textKey2'); - if (val('hint')) config.hint = val('hint'); - break; case 'last_page': if (val('textKey')) config.textKey = val('textKey'); break; diff --git a/website/js/questionnaire-preview.js b/website/js/questionnaire-preview.js index 3ac5af4..45dd807 100644 --- a/website/js/questionnaire-preview.js +++ b/website/js/questionnaire-preview.js @@ -83,7 +83,7 @@ function hasBranchingOptions(q) { } const withQuestionNext = new Set([ 'free_text', 'date_spinner', 'slider_question', 'glass_scale_question', - 'client_coach_code_question', 'client_not_signed', + 'client_coach_code_question', ]); return withQuestionNext.has(layout) && Boolean(config.nextQuestionId?.trim()); } @@ -176,10 +176,6 @@ function readAnswerFromBody(body, q) { if (!client && !coach) return null; return { client_code: client || '', coach_code: coach || '' }; } - case 'client_not_signed': { - const coach = body.querySelector('[data-field=coach]')?.value?.trim(); - return coach || null; - } case 'last_page': return true; default: @@ -225,8 +221,6 @@ function hasAnswerInUi(q, sectionEl) { } case 'client_coach_code_question': return Boolean(answer?.client_code && answer?.coach_code); - case 'client_not_signed': - return Boolean(answer) || !q.isRequired; case 'last_page': return true; default: @@ -407,10 +401,6 @@ function renderQuestionBody(q, sectionIdx) {
`; break; - case 'client_not_signed': - inner += ``; - break; - case 'last_page': inner += `

${esc(config.textKey || 'End of questionnaire.')}

`; break; @@ -434,7 +424,6 @@ function layoutLabel(type) { string_spinner: 'String spinner', free_text: 'Free text', client_coach_code_question: 'Client / coach code', - client_not_signed: 'Client not signed', last_page: 'Last page', }; return labels[type] || type || 'Unknown'; diff --git a/website/temp-assets/questionnaire_0_readme.json b/website/temp-assets/questionnaire_0_readme.json index efbb9ca..228c980 100644 --- a/website/temp-assets/questionnaire_0_readme.json +++ b/website/temp-assets/questionnaire_0_readme.json @@ -25,12 +25,11 @@ { "id": "q2", - "_comment": "Frage nach dem Code des Coaches.", - "layout": "client_not_signed", - "textKey1": "no_consent_entered", - "textKey2": "no_consent_note", - "question": "coach_code_request", - "hint": "coach_code" + "_comment": "Client- und Coach-Code (z. B. wenn Einwilligung nicht unterschrieben).", + "layout": "client_coach_code_question", + "question": "no_consent_entered", + "hint1": "client_code", + "hint2": "coach_code" },