Skip to content
Snippets Groups Projects
Commit 4e304876 authored by Timothee P's avatar Timothee P :sunflower:
Browse files

Merge branch 'develop' into redmine-issues/18348

parents 65f87f05 550b893e
No related branches found
No related tags found
1 merge request!669REDMINE_ISSUE-18348 | import geojson avec champ pre_recorded_list
......@@ -375,9 +375,15 @@ export default {
},
watch: {
'field.value': function(newValue) {
'field.value': function(newValue, oldValue) {
if (newValue) {
this.error = null;
// 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' &&
newValue.label && newValue.label === oldValue.label) {
this.initPrerecordedCustomField();
}
}
},
......@@ -399,23 +405,9 @@ export default {
created() {
if (this.field) {
const { field_type, options, value } = this.field;
const { field_type, value } = this.field;
if (field_type === 'pre_recorded_list') {
this.loadingPrerecordedListValues = true;
this.GET_SELECTED_PRERECORDED_LIST_VALUES({
name: options[0],
pattern: '',
limit: 10,
})
.then(() => {
this.loadingPrerecordedListValues = false;
})
.catch(() => {
this.loadingPrerecordedListValues = false;
});
if (value) {
this.selectedPrerecordedValue = { label: value.label ? value.label : value };
}
this.initPrerecordedCustomField();
} else if (field_type === 'multi_choices_list' && value) {
this.selectedMultipleCheckbox = value;
}
......@@ -438,6 +430,25 @@ export default {
'SET_EXTRA_FORMS',
]),
initPrerecordedCustomField() {
const { options, value } = this.field;
this.loadingPrerecordedListValues = true;
this.GET_SELECTED_PRERECORDED_LIST_VALUES({
name: options[0],
pattern: '',
limit: 10,
})
.then(() => {
this.loadingPrerecordedListValues = false;
})
.catch(() => {
this.loadingPrerecordedListValues = false;
});
if (value) {
this.selectedPrerecordedValue = { label: value.label ? value.label : value };
}
},
updateStore_extra_form(evt) {
if (this.field) {
let newValue;
......
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