Remove 'client_not_signed' layout from questionnaire logic
Some checks failed
PHPUnit / test (push) Has been cancelled

This commit is contained in:
2026-06-06 16:35:57 +02:00
parent e5ae48c02e
commit 8fdaefe10b
5 changed files with 8 additions and 47 deletions

View File

@ -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) {
</div>`;
break;
case 'client_not_signed':
inner += `<label>Coach code<input type="text" data-field="coach"></label>`;
break;
case 'last_page':
inner += `<p class="qp-hint">${esc(config.textKey || 'End of questionnaire.')}</p>`;
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';