Skip to content
Snippets Groups Projects

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

Merged REDMINE_ISSUE-18666 | Les formulaires de listes à choix multiples ne se rafraichissent pas
Merged Timothee P requested to merge redmine-issues/18666 into develop
2 files
+ 18
15
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -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() {
Loading