diff --git a/client/components/FacultyMonitoringView/FacultyTrackingView/QuestionPicker.js b/client/components/FacultyMonitoringView/FacultyTrackingView/QuestionPicker.js index 9d48cf7a..d238d51b 100644 --- a/client/components/FacultyMonitoringView/FacultyTrackingView/QuestionPicker.js +++ b/client/components/FacultyMonitoringView/FacultyTrackingView/QuestionPicker.js @@ -28,6 +28,13 @@ const QuestionPicker = ({ index, label, questionsList, form }) => { } const handleSelectionChange = (_, { value: newQuestion }) => { + const deselectedQuestions = sectionQuestions.filter(id => !newQuestion.includes(id)) + if (deselectedQuestions.length > 0) { + const confirmDeselect = window.confirm(t('common:confirmDeselect')) + if (!confirmDeselect) { + return + } + } setSectionQuestions(newQuestion) updateAllSelectedQuestions(newQuestion) } diff --git a/client/util/locales/en.js b/client/util/locales/en.js index 6165829b..3e4bc135 100644 --- a/client/util/locales/en.js +++ b/client/util/locales/en.js @@ -59,6 +59,7 @@ export default { edit: 'Edit', delete: 'Delete', filled: 'filled', + confirmDeselect: 'Are you sure you want to deselect the question?', yearlyAssessment: 'Annual follow-up', evaluation: 'Review', diff --git a/client/util/locales/fi.js b/client/util/locales/fi.js index 64e0b1d3..08a33db1 100644 --- a/client/util/locales/fi.js +++ b/client/util/locales/fi.js @@ -66,6 +66,7 @@ export default { edit: 'Muokkaa', delete: 'Poista', filled: 'täytetty', + confirmDeselect: 'Haluatko varmasti poistaa valinnan?', modifyLights: 'Muokkaa valoja', diff --git a/client/util/locales/se.js b/client/util/locales/se.js index 2b0722a7..fda0ece1 100644 --- a/client/util/locales/se.js +++ b/client/util/locales/se.js @@ -63,6 +63,7 @@ export default { edit: 'Redigera', delete: 'Ta bort', filled: 'ifylld', + confirmDeselect: 'Vill du ta bort svaret?', yearlyAssessment: 'Årlig uppföljning', evaluation: 'Översynen',