Skip to content
Snippets Groups Projects
Commit f5b582c1 authored by Camille Blanchon's avatar Camille Blanchon
Browse files

Merge branch 'redmine-issues/18666' into 'develop'

REDMINE_ISSUE-18666 | Les formulaires de listes à choix multiples ne se rafraichissent pas

See merge request !690
parents 2e8b6137 bdb5e805
No related branches found
No related tags found
1 merge request!690REDMINE_ISSUE-18666 | Les formulaires de listes à choix multiples ne se rafraichissent pas
......@@ -379,22 +379,24 @@ export default {
'field.value': function(newValue, oldValue) {
// In fast edition, prerecordedlist is not updated, thus the value stay the same
// in this case we renitialize the field. This doesn't impact usual behavior if user reselect the same option
if (this.field.field_type === 'pre_recorded_list') {
// if both values are defined but their values changed, value in form should be updated
if (newValue && oldValue && newValue.label !== oldValue.label
// if any of them is undefined, the form value should be updated, because in this case the value changed
// otherwise (if they are both undefined) the watcher would not called, thus we don't need to prevent this case
|| !newValue || !oldValue)
{
this.initPrerecordedXform();
}
} else if (this.field.field_type === 'multi_choices_list') {
// if array values changed, value in form should be updated, otherwise at edition in fast browsing mode, it would overide current value with previous value loaded at component creation
if (isEqual(newValue, oldValue)){
this.initMultipleCheckboxXform();
if (this.field) {
if (this.field.field_type === 'pre_recorded_list') {
// if both values are defined but their values changed, value in form should be updated
if (newValue && oldValue && newValue.label !== oldValue.label
// if any of them is undefined, the form value should be updated, because in this case the value changed
// otherwise (if they are both undefined) the watcher would not called, thus we don't need to prevent this case
|| !newValue || !oldValue)
{
this.initPrerecordedXform();
}
} else if (this.field.field_type === 'multi_choices_list') {
// if array values changed, value in form should be updated, otherwise at edition in fast browsing mode, it would overide current value with previous value loaded at component creation
if (isEqual(newValue, oldValue)){
this.initMultipleCheckboxXform();
}
}
this.error = null;
}
this.error = null;
},
prerecordedListSearchQuery(newValue) {
......@@ -439,7 +441,7 @@ export default {
]),
initMultipleCheckboxXform() {
this.selectedMultipleCheckbox = this.field.value;
this.selectedMultipleCheckbox = this.field.value || [];
},
initPrerecordedXform() {
......
......@@ -543,6 +543,7 @@ export default {
},
created() {
this.$store.commit('feature/CLEAR_EXTRA_FORM');
this.$store.commit(
'feature-type/SET_CURRENT_FEATURE_TYPE_SLUG',
this.$route.params.slug_type_signal
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment