Fixes event and error handling of geocoordinate metadata.

This commit is contained in:
mateuswetah 2024-04-09 10:56:23 -03:00
parent 459cc1baff
commit 79e216c3bf
2 changed files with 7 additions and 7 deletions

View File

@ -213,8 +213,8 @@
this.$emitter.off('itemEditionFormResize', () => this.handleWindowResize(mapComponentRef));
},
methods: {
onUpdateFromLatitudeInput: _.debounce( function($event) {
let newLatitude = $event.target.value;
onUpdateFromLatitudeInput: _.debounce( function(value) {
let newLatitude = value;
if ( !isNaN(newLatitude) ) {
this.latitude = newLatitude;
this.onUpdateFromLatitudeAndLongitude();
@ -232,8 +232,8 @@
}
}
}, 250),
onUpdateFromLongitudeInput: _.debounce( function($event) {
let newLongitude = $event.target.value;
onUpdateFromLongitudeInput: _.debounce( function(value) {
let newLongitude = value;
if ( !isNaN(newLongitude) ) {
this.longitude = newLongitude;

View File

@ -22,7 +22,7 @@ export const itemMetadataMixin = {
if (this.errors.length > 0 && this.errors[0].errors && this.errors[0].errors.length) {
for (let error of this.errors)
this.$emitter.on('updateErrorMessageOf#' + (error.metadatum_id + (error.parent_meta_id ? '-' + error.parent_meta_id : '')), error);
this.$emitter.emit('updateErrorMessageOf#' + (error.metadatum_id + (error.parent_meta_id ? '-' + error.parent_meta_id : '')), error);
}
},
deep: true
@ -61,7 +61,7 @@ export const itemMetadataMixin = {
this.$emitter.emit('updateErrorMessageOf#' + (parentMetaId ? metadatumId + '-' + parentMetaId : metadatumId), this.errors[index]);
})
.catch(({ error_message, error, item_metadata }) => {
this.isUpdatingValues = false;;
this.isUpdatingValues = false;
let index = this.errors.findIndex( errorItem => errorItem.metadatum_id == metadatumId && (parentMetaId ? errorItem.parent_meta_id == parentMetaId : true ));
let messages = [];