From 23ba70cd3d35b996469b278310dce0365e7bc199 Mon Sep 17 00:00:00 2001 From: Kyle Hall Date: Fri, 30 Sep 2022 12:35:00 -0400 Subject: [PATCH] Bug 31666: Add job progress bar to stage-marc-import.pl It would be nice if we had progress bars to indicate the progress of background jobs for scripts that utilize them. This patch implements a reusable bootstrap based progess bar. Test Plan: 1) Apply this patch 2) Stage a marc batch ( preferrably a large one to show the progress updating ) 3) Note the new progess bar, verify it functions correctly. --- .../prog/en/includes/job_progress.inc | 5 ++++ .../prog/en/includes/str/job_progess.inc | 6 ++++ .../en/modules/tools/stage-marc-import.tt | 9 +++--- .../intranet-tmpl/prog/js/job_progess.js | 28 +++++++++++++++++++ 4 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/job_progress.inc create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/str/job_progess.inc create mode 100644 koha-tmpl/intranet-tmpl/prog/js/job_progess.js diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/job_progress.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/job_progress.inc new file mode 100644 index 0000000000..2dc931e338 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/job_progress.inc @@ -0,0 +1,5 @@ +
+
+ 0% Complete +
+
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/str/job_progess.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/str/job_progess.inc new file mode 100644 index 0000000000..a8f4b1c5db --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/str/job_progess.inc @@ -0,0 +1,6 @@ + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt index 8a23682952..94754a9069 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt @@ -74,6 +74,7 @@

MARC staging

The job has been enqueued! It will be processed as soon as possible.

+ [% INCLUDE "job_progress.inc" job_id=job_id %]

View detail of the enqueued job

[% ELSE %] @@ -258,6 +259,9 @@ [% Asset.js("js/tools-menu.js") | $raw %] [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %] [% Asset.js("js/file-upload.js") | $raw %] + + [% INCLUDE 'str/job_progess.inc' %] + [% Asset.js("js/job_progess.js") | $raw %]