Remove 'client_not_signed' layout from questionnaire logic
Some checks failed
PHPUnit / test (push) Has been cancelled
Some checks failed
PHPUnit / test (push) Has been cancelled
This commit is contained in:
@ -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 = {}) {
|
||||
</div>
|
||||
</div>`;
|
||||
break;
|
||||
case 'client_not_signed':
|
||||
html = `
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label>Text key 1</label>
|
||||
<input type="text" id="${prefix}_textKey1" value="${esc(config.textKey1 || '')}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Text key 2</label>
|
||||
<input type="text" id="${prefix}_textKey2" value="${esc(config.textKey2 || '')}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label>Hint key</label>
|
||||
<input type="text" id="${prefix}_hint" value="${esc(config.hint || '')}">
|
||||
</div>
|
||||
</div>`;
|
||||
break;
|
||||
case 'last_page':
|
||||
html = `
|
||||
<div class="form-group">
|
||||
@ -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;
|
||||
|
||||
@ -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';
|
||||
|
||||
Reference in New Issue
Block a user