From 76e9f4de4d0bb21737a65675beeb352f37f18398 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 | 7 ++++ .../en/modules/tools/stage-marc-import.tt | 9 ++--- .../intranet-tmpl/prog/js/job_progess.js | 34 +++++++++++++++++++ 4 files changed, 51 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..8741bab4d0 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/job_progress.inc @@ -0,0 +1,5 @@ +
+
+ 0% +
+
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..9e85c25810 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/str/job_progess.inc @@ -0,0 +1,7 @@ + + 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..c790fd0f1e 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' job_id=job_id %] + [% Asset.js("js/job_progess.js") | $raw %]