From d5b1f7b194e59cc321d433115e04876db9d948a2 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 24 Aug 2021 13:50:17 +0200 Subject: [PATCH] Warning message when changing question type --- www/form/inner.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/www/form/inner.js b/www/form/inner.js index 6ac16626f..1a776facc 100644 --- a/www/form/inner.js +++ b/www/form/inner.js @@ -2765,6 +2765,7 @@ define([ //Messages.form_changeType = "Change type"; // XXX Messages.form_changeTypeConfirm = "Select the new type of this question and click OK."; // XXX + Messages.form_breakAnswers = "Changing the type may corrupt existing answers"; if (Array.isArray(model.compatible)) { changeType = h('div.cp-form-block-type.editable', [ model.icon.cloneNode(), @@ -2783,6 +2784,9 @@ define([ }); var tag = h('div.radio-group', els); var changeTypeContent = [ + APP.answers && Object.keys(APP.answers).length ? + h('div.alert.alert-warning', Messages.form_breakAnswers) : + undefined, h('p', Messages.form_changeTypeConfirm), tag ];