add a validation to avoid block selected values (#223)

This commit is contained in:
Eduardo Humberto 2019-04-01 20:15:03 -03:00
parent f5e985f30c
commit 589c522214
1 changed files with 12 additions and 1 deletions

View File

@ -296,7 +296,18 @@ export default {
this.$router.go(-2);
},
checkIfMetadatumIsAvailable(metadatumId) {
return this.mappedCollection['mapping'][metadatumId] != undefined;
if ( this.mappedCollection['mapping'][metadatumId] != undefined &&
this.importerSourceInfo != undefined &&
this.importerSourceInfo != null){
let val = this.mappedCollection['mapping'][metadatumId];
const { source_metadata } = this.importerSourceInfo;
if(source_metadata && source_metadata.indexOf(val) >= 0) {
return true;
}
}
return false;
},
checkCurrentSelectedCollectionMetadatum(sourceMetadatum) {
for (let key in this.mappedCollection['mapping']) {