From dad9430b7b062d25aec0cdeb86dd412133621d5f Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 22 Mar 2023 19:54:48 +0000 Subject: [PATCH] Bug 33316: Improve display of ES indexer jobs We don't do a lot of processing to the data, but we can still make the display a bit nicer, to show how many records were done, and show the record ids. To test: 1 - Do some batch modifications on a system running ES 2 - Check background jobs to see ES jobs 3 - Note display 4 - Apply patch 5 - Confirm display is improved Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- .../background_jobs/update_elastic_index.inc | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs/update_elastic_index.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs/update_elastic_index.inc index d6f24e89a9..d50f7651c8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs/update_elastic_index.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs/update_elastic_index.inc @@ -1,18 +1,19 @@ [% USE Koha %] +[% SET report = job.decoded_data %] [% BLOCK report %] - [% SET report = job.report %] - [% IF report %] - [% IF report.total_records == 1 %] - [% IF report.total_success == 1 %] -
The records have successfully been reindexed!
- [% END %] + [% IF job.status == 'finished' %] + [% IF report %] +
+ [% report.record_ids.size | html %] records have successfully been reindexed. +
[% ELSE %]
- [% report.total_success | html %] / [% report.total_records | html %] records have successfully been reindexed. Some errors occurred. - [% IF job.status == 'cancelled' %]The job has been cancelled before it finished.[% END %] + Job data could not be read, see the logs for details
[% END %] + [% ELSIF job.status == 'cancelled' %] + The job has been cancelled before it finished. [% END %] [% END %] @@ -32,7 +33,16 @@ [% END %] [% END %] + [% IF report %] +

Record ids:

+
    + [% FOREACH record_id IN report.record_ids %] +
  • [% record_id | html %]
  • + [% END %] +
+ [% END %] [% END %] + [% BLOCK js %] [% END %] -- 2.39.5