Bind value on Collection Metadatum select at Importer Page.

This commit is contained in:
mateuswetah 2018-06-22 16:03:37 -03:00
parent 96d0058469
commit 72fba0ea5b
3 changed files with 7670 additions and 2538 deletions

10196
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -13,6 +13,7 @@
"html-to-json": "^0.6.0", "html-to-json": "^0.6.0",
"mdi": "^2.2.43", "mdi": "^2.2.43",
"moment": "^2.22.1", "moment": "^2.22.1",
"npm": "^6.1.0",
"qs": "^6.5.2", "qs": "^6.5.2",
"v-mask": "^1.3.2", "v-mask": "^1.3.2",
"v-tooltip": "^2.0.0-rc.32", "v-tooltip": "^2.0.0-rc.32",

View File

@ -107,6 +107,7 @@
v-if="collectionMetadata != undefined && v-if="collectionMetadata != undefined &&
collectionMetadata.length > 0 && collectionMetadata.length > 0 &&
!isFetchingCollectionMetadata" !isFetchingCollectionMetadata"
:value="checkCurrentSelectedCollectionMetadatum(source_metadatum)"
@input="onSelectCollectionMetadata($event, source_metadatum)" @input="onSelectCollectionMetadata($event, source_metadatum)"
:placeholder="$i18n.get('label_select_metadatum')"> :placeholder="$i18n.get('label_select_metadatum')">
<option :value="undefined"> <option :value="undefined">
@ -340,6 +341,13 @@ export default {
checkIfMetadatumIsAvailable(metadatumId) { checkIfMetadatumIsAvailable(metadatumId) {
return this.mappedCollection['mapping'][metadatumId] != undefined; return this.mappedCollection['mapping'][metadatumId] != undefined;
}, },
checkCurrentSelectedCollectionMetadatum(sourceMetadatum) {
for (let key in this.mappedCollection['mapping']) {
if(this.mappedCollection['mapping'][key] == sourceMetadatum)
return key;
}
return undefined;
},
onInputURL(event) { onInputURL(event) {
this.url = event; this.url = event;
@ -433,9 +441,8 @@ export default {
if (removedKey != '') if (removedKey != '')
delete this.mappedCollection['mapping'][removedKey]; delete this.mappedCollection['mapping'][removedKey];
} }
// Necessary for causing reactivity to re-check if metadata remains available // Necessary for causing reactivity to re-check if metadata remains available
this.collectionMetadata.push(""); this.collectionMetadata.push("");
this.collectionMetadata.pop(); this.collectionMetadata.pop();