diff --git a/src/admin/components/edition/importer-edition-form.vue b/src/admin/components/edition/importer-edition-form.vue index 370880b80..84f32d905 100644 --- a/src/admin/components/edition/importer-edition-form.vue +++ b/src/admin/components/edition/importer-edition-form.vue @@ -127,6 +127,7 @@ (importer.accepts.file && importer.accepts.url && !importerFile && !url)" id="button-submit-collection-creation" @click.prevent="onFinishImporter()" + :class="{'is-loading': isLoadingRun }" class="button is-success">{{ $i18n.get('run') }}
@@ -162,6 +163,7 @@ export default { importerId: Number, importer: null, isLoading: false, + isLoadingRun: false, isFetchingCollections: false, form: { @@ -310,19 +312,23 @@ export default { }); }, onFinishImporter() { - + this.isLoadingRun = true; this.onUpdateOptions().then(() => { this.uploadSource() .then(() => { - if (this.importer.manual_mapping) + if (this.importer.manual_mapping) { this.goToMappingPage(); - else + this.isLoadingRun = false; + } else { this.onRunImporter(); + } }).catch((errors) => { + this.isLoadingRun = false; this.$console.log(errors); }); }) .catch((errors) => { + this.isLoadingRun = false; this.$console.log(errors); }); @@ -331,9 +337,11 @@ export default { this.runImporter(this.sessionId) .then(backgroundProcess => { this.backgroundProcess = backgroundProcess; - this.$router.push(this.$routerHelper.getProcessesPage()); + this.isLoadingRun = false; + this.$router.push(this.$routerHelper.getProcessesPage(backgroundProcess.bg_process_id)); }) .catch((errors) => { + this.isLoadingRun = false; this.$console.log(errors); }); }, diff --git a/src/admin/components/edition/importer-mapping-form.vue b/src/admin/components/edition/importer-mapping-form.vue index 548f47ddc..5051fc415 100644 --- a/src/admin/components/edition/importer-mapping-form.vue +++ b/src/admin/components/edition/importer-mapping-form.vue @@ -152,6 +152,7 @@ :disabled="sessionId == undefined || importer == undefined" id="button-submit-collection-creation" @click.prevent="onRunImporter" + :class="{'is-loading': isLoadingRun }" class="button is-success">{{ $i18n.get('run') }} @@ -174,6 +175,7 @@ export default { importerId: Number, importer: null, isLoading: false, + isLoadingRun: false, mappedCollection: { 'id': Number, 'mapping': {}, @@ -284,12 +286,14 @@ export default { return undefined; }, onRunImporter() { + this.isLoadingRun = true; this.updateImporterCollection({ sessionId: this.sessionId, collection: this.mappedCollection }) .then(updatedImporter => { this.importer = updatedImporter; this.finishRunImporter(); }) .catch((errors) => { + this.isLoadingRun = false; this.$console.log(errors); }); @@ -298,27 +302,27 @@ export default { this.runImporter(this.sessionId) .then(backgroundProcess => { this.backgroundProcess = backgroundProcess; + this.isLoadingRun = false; this.$router.push(this.$routerHelper.getProcessesPage()); }) .catch((errors) => { + this.isLoadingRun = false; this.$console.log(errors); }); }, onSelectCollectionMetadata(selectedMetadatum, sourceMetadatum) { - - if (selectedMetadatum) - this.mappedCollection['mapping'][selectedMetadatum] = sourceMetadatum; - else { - let removedKey = ''; - for (let key in this.mappedCollection['mapping']) { - if(this.mappedCollection['mapping'][key] == sourceMetadatum) - removedKey = key; - } - - if (removedKey != '') - delete this.mappedCollection['mapping'][removedKey]; + + let removedKey = ''; + for (let key in this.mappedCollection['mapping']) { + if(this.mappedCollection['mapping'][key] == sourceMetadatum) + removedKey = key; } - + + if (removedKey != '') + delete this.mappedCollection['mapping'][removedKey]; + + this.mappedCollection['mapping'][selectedMetadatum] = sourceMetadatum; + // Necessary for causing reactivity to re-check if metadata remains available this.collectionMetadata.push(""); this.collectionMetadata.pop(); diff --git a/src/admin/components/lists/collections-list.vue b/src/admin/components/lists/collections-list.vue index 1575ad21d..6ffc83bee 100644 --- a/src/admin/components/lists/collections-list.vue +++ b/src/admin/components/lists/collections-list.vue @@ -396,10 +396,6 @@ export default { } } - img.table-thumb { - border-radius: 50px !important; - } - .total-items-header { text-align: right; } diff --git a/src/admin/components/lists/processes-list.vue b/src/admin/components/lists/processes-list.vue index a1c42a7d3..15fd0af6e 100644 --- a/src/admin/components/lists/processes-list.vue +++ b/src/admin/components/lists/processes-list.vue @@ -67,7 +67,7 @@