diff --git a/boranga/frontend/boranga/src/components/internal/occurrence/bulk_import_schema.vue b/boranga/frontend/boranga/src/components/internal/occurrence/bulk_import_schema.vue index 2734e755..4cb1e333 100644 --- a/boranga/frontend/boranga/src/components/internal/occurrence/bulk_import_schema.vue +++ b/boranga/frontend/boranga/src/components/internal/occurrence/bulk_import_schema.vue @@ -39,9 +39,12 @@ class="bi bi-copy me-2"> Copy - Validate + Validatinge Preview @@ -450,7 +453,7 @@ Save Column Loading... Cancel Adding Column Delete Column @@ -497,12 +500,12 @@ Save + class="btn btn-primary me-2 float-end" @click.prevent="save()" :disabled="saving">Save and Continue Loading...Save and Exit + class="btn btn-primary me-2 float-end" @click.prevent="saveAndExit()" :disabled="saving">Save and Exit Loading... @@ -536,7 +539,7 @@ choice[1] }} {{ choice[0] - }} + }} @@ -580,6 +583,7 @@ export default { showDjangoImportFieldSelect: false, newColumn: null, saving: false, + validatingSchema: false, errors: null } }, @@ -804,7 +808,7 @@ export default { // Remove columns that are already in the schema newColumns = newColumns.filter(newColumn => !this.schema.columns.some(column => column.django_import_field_name == newColumn.django_import_field_name)) - if(newColumns.length == 0) { + if (newColumns.length == 0) { swal.fire({ title: 'No New Columns Added', text: 'All fields from the selected model are already in the schema', @@ -821,7 +825,7 @@ export default { newColumns = newColumns.filter(column => !column.xlsx_data_validation_allow_blank) } - if(newColumns.length == 0) { + if (newColumns.length == 0) { swal.fire({ title: 'No New Columns Added', text: 'There are no mandatory fields from the selected model that are not already in the schema', @@ -841,7 +845,7 @@ export default { this.addEditMode = false let lastColumnIndex = this.schema.columns.length; - if(this.schema.columns.filter(column => column.django_import_content_type == selectedContentType).length > 0) { + if (this.schema.columns.filter(column => column.django_import_content_type == selectedContentType).length > 0) { let lastColumn = this.schema.columns.findLast(column => column.django_import_content_type == selectedContentType) lastColumnIndex = this.schema.columns.indexOf(lastColumn) + 1 } @@ -947,6 +951,7 @@ export default { this.save(); }, validate() { + this.validatingSchema = true; this.$http.get(`${api_endpoints.occurrence_report_bulk_import_schemas}${this.schema.id}/validate/`) .then(response => { swal.fire({ @@ -983,6 +988,9 @@ export default { } }) }) + .finally(() => { + this.validatingSchema = false; + }) }, save() { // If there is a column with no django_import_content_type or django_import_field_name, remove it diff --git a/boranga/settings.py b/boranga/settings.py index 47cd87c2..1b722baf 100755 --- a/boranga/settings.py +++ b/boranga/settings.py @@ -235,6 +235,8 @@ def show_toolbar(request): CRON_CLASSES = [ "appmonitor_client.cron.CronJobAppMonitorClient", "boranga.cron.CronJobFetchNomosTaxonDataDaily", + "boranga.cron.CronJobOCRPreProcessBulkImportTasks", + "boranga.cron.CronJobOCRProcessBulkImportQueue", ]