Skip to content

Commit

Permalink
added confirmation if user wants to deselect the chose action
Browse files Browse the repository at this point in the history
  • Loading branch information
tfhuhtal committed Nov 12, 2024
1 parent 85bd191 commit c7c580b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
1 change: 1 addition & 0 deletions client/util/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions client/util/locales/fi.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export default {
edit: 'Muokkaa',
delete: 'Poista',
filled: 'täytetty',
confirmDeselect: 'Haluatko varmasti poistaa valinnan?',

modifyLights: 'Muokkaa valoja',

Expand Down
1 change: 1 addition & 0 deletions client/util/locales/se.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit c7c580b

Please sign in to comment.