diff --git a/src/admin/components/lists/processes-list.vue b/src/admin/components/lists/processes-list.vue index cfa85197b..d5c6d327b 100644 --- a/src/admin/components/lists/processes-list.vue +++ b/src/admin/components/lists/processes-list.vue @@ -159,6 +159,7 @@ class="actions-cell column-small-width" :label="$i18n.get('label_status')">
+ {{ getStatusLabel(bgProcess.status) }} @@ -341,6 +342,31 @@ }, pauseProcess(index) { this.updateProcess({ id: this.processes[index].ID, status: 'closed' }); + }, + getStatusLabel(status) { + + switch(status) { + case 'finished': + return this.$i18n.get('info_process_status_finished'); + + case 'finished-errors': + return this.$i18n.get('info_process_status_finished_errors'); + + case 'errored': + return this.$i18n.get('info_process_status_errored'); + + case 'cancelled': + return this.$i18n.get('info_process_status_cancelled'); + + case 'paused': + return this.$i18n.get('info_process_status_paused'); + + case 'running': + return this.$i18n.get('info_process_status_running'); + + default: + return this.$i18n.get('info_process_status_finished'); + } } }, mounted() { @@ -377,6 +403,11 @@ } } + .label-status { + font-size: 9pt; + margin-right: 3px; + } + .loading-icon .control.is-loading::after { position: relative !important; right: 0; diff --git a/src/admin/tainacan-admin-i18n.php b/src/admin/tainacan-admin-i18n.php index 08a738976..4605e45fa 100644 --- a/src/admin/tainacan-admin-i18n.php +++ b/src/admin/tainacan-admin-i18n.php @@ -499,6 +499,12 @@ return apply_filters( 'tainacan-admin-i18n', [ 'info_current_view_mode_metadata_not_allowed' => __( 'Current view mode does not allow displayed metadata selection.', 'tainacan' ), 'info_cant_select_metadata_without_items' => __( 'Can not select displayed metadata without items on list.', 'tainacan' ), 'info_available_exporters_helper' => __( '?', 'tainacan' ), + 'info_process_status_finished' => __('Finished', 'tainacan'), + 'info_process_status_finished_errors' => __('Finished with errors', 'tainacan'), + 'info_process_status_errored' => __('Error', 'tainacan'), + 'info_process_status_cancelled' => __('Cancelled', 'tainacan'), + 'info_process_status_paused' => __('Paused', 'tainacan'), + 'info_process_status_running' => __('Running', 'tainacan'), // Tainacan Metadatum Types 'tainacan-text' => __( 'Text', 'tainacan' ), diff --git a/src/api/endpoints/class-tainacan-rest-background-processes-controller.php b/src/api/endpoints/class-tainacan-rest-background-processes-controller.php index 731dbc201..881b67747 100644 --- a/src/api/endpoints/class-tainacan-rest-background-processes-controller.php +++ b/src/api/endpoints/class-tainacan-rest-background-processes-controller.php @@ -222,7 +222,7 @@ class REST_Background_Processes_Controller extends REST_Controller { $status_q = "done = 0"; } if ( $body['status'] == 'closed' ) { - $status_q = "done = 1, status = 'cancelled'"; + $status_q = "done = 1, status = 'paused'"; } $id_q = $wpdb->prepare("AND ID = %d", $id); diff --git a/src/migrations.php b/src/migrations.php index a85070ce4..5940aedfd 100644 --- a/src/migrations.php +++ b/src/migrations.php @@ -71,6 +71,10 @@ class Migrations { ADD name text NOT NULL "); } + } + + static function create_importer_status_column(){ + global $wpdb; $column_exists = $wpdb->get_results( "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = '{$wpdb->prefix}tnc_bg_process' AND column_name = 'status'" ); @@ -80,8 +84,8 @@ class Migrations { ADD status ENUM('waiting','running','paused','cancelled','errored','finished','finished-errors') "); } - - } + + } static function init_capabilites() { $Tainacan_Capabilities = \Tainacan\Capabilities::get_instance();