Improvements on Background Processes list and Importers Page. Ref .20.

This commit is contained in:
Mateus Machado Luna 2018-08-07 11:23:18 -03:00
parent c925750a0d
commit ccac64abde
3 changed files with 42 additions and 15 deletions

View File

@ -143,6 +143,7 @@
(importer.accepts.file && importer.accepts.url && !importerFile && !url)"
id="button-submit-collection-creation"
@click.prevent="onFinishImporter()"
:class="{'is-loading': isLoadingUpload }"
class="button is-success">{{ $i18n.get('next') }}</button>
</div>
</div>
@ -164,6 +165,7 @@ export default {
importer: null,
isLoading: false,
isLoadingRun: false,
isLoadingUpload: false,
isFetchingCollections: false,
form: {
@ -295,20 +297,33 @@ export default {
});
},
uploadSource() {
this.isLoadingUpload = true;
return new Promise((resolve, reject) => {
if (this.importer.accepts.file && !this.importer.accepts.url)
this.onUploadFile().then(() => { resolve() }).catch((errors) => this.$console.log(errors));
else if (!this.importer.accepts.file && this.importer.accepts.url)
this.onInputURL().then(() => { resolve() }).catch((errors) => this.$console.log(errors));
else if (this.importer.accepts.file && this.importer.accepts.url) {
if (this.importerFile)
this.onUploadFile().then(() => { resolve() }).catch((errors) => this.$console.log(errors));
else if (this.url)
this.onInputURL().then(() => { resolve() }).catch((errors) => this.$console.log(errors));
else
if (this.importer.accepts.file && !this.importer.accepts.url) {
this.onUploadFile()
.then(() => { this.isLoadingUpload = false; resolve(); })
.catch((errors) => { this.isLoadingUpload = false; this.$console.log(errors) });
} else if (!this.importer.accepts.file && this.importer.accepts.url) {
this.onInputURL()
.then(() => { this.isLoadingUpload = false; resolve() })
.catch((errors) => { this.isLoadingUpload = false; this.$console.log(errors); });
} else if (this.importer.accepts.file && this.importer.accepts.url) {
if (this.importerFile) {
this.onUploadFile()
.then(() => { this.isLoadingUpload = false; resolve(); })
.catch((errors) => { this.isLoadingUpload = false; this.$console.log(errors) });
} else if (this.url) {
this.onInputURL()
.then(() => { this.isLoadingUpload = false; resolve() })
.catch((errors) => { this.isLoadingUpload = false; this.$console.log(errors); });
} else {
this.isLoadingUpload = false;
reject('No source file given');
} else
}
} else {
this.isLoadingUpload = false;
resolve();
}
});
},
onFinishImporter() {

View File

@ -106,7 +106,9 @@
autoHide: false,
placement: 'auto-start'
}">
{{ bgProcess.progress_label ? bgProcess.progress_label + (bgProcess.progress_value ? ' (' + bgProcess.progress_value + '%)' : '') : $i18n.get('label_no_details_of_process') }}</p>
<span class="occluding-content">{{ bgProcess.progress_label ? bgProcess.progress_label : $i18n.get('label_no_details_of_process') }}</span>
<span>{{ bgProcess.progress_value ? ' (' + bgProcess.progress_value + '%)' : '' }}</span>
</p>
</td>
<!-- Queued on -->
<td
@ -136,7 +138,7 @@
</td>
<!-- Logs -->
<td
class="column-small-width"
class="column-needed-width"
:label="$i18n.get('label_log_file')"
:aria-label="$i18n.get('label_log_gile')">
<p>
@ -386,6 +388,15 @@
}
}
.occluding-content {
width: calc(100% - 40px);
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
top: 4px;
position: relative;
}
</style>

View File

@ -6,8 +6,9 @@
class="metadatum">
<b-checkbox
v-model="selected"
:native-value="option.value"
>{{ option.label }}</b-checkbox>
:native-value="option.value">
{{ option.label }}
</b-checkbox>
<div
class="view-all-button-container"
v-if="option.seeMoreLink"