Bugzilla – Attachment 143955 Details for
Bug 31891
Regression: show "MARC staging results" with clear link to manage staged batch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31891: (bug 27421 follow-up) Remove one additional click
Bug-31891-bug-27421-follow-up-Remove-one-additiona.patch (text/plain), 4.86 KB, created by
Katrin Fischer
on 2022-11-16 13:54:50 UTC
(
hide
)
Description:
Bug 31891: (bug 27421 follow-up) Remove one additional click
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2022-11-16 13:54:50 UTC
Size:
4.86 KB
patch
obsolete
>From f3ff39a0a0b7b705603dac6e1f2b64c61330628c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 16 Nov 2022 07:40:59 +0100 >Subject: [PATCH] Bug 31891: (bug 27421 follow-up) Remove one additional click > >From comment 0 >""" >Moving marc batch import actions to background jobs has introduced some confusing >clicks to the process. Before this change, after staging a batch one was taken >to a "MARC staging results" page with details of how the staging went and, most >importantly, a link straight to the batch you'd just staged >(at manage-marc-import.pl?import_batch_id). > >Now, however, one must click the status bar to get to details of the job >and then click "View batch" from there. Not only is that an extra click >and page load, but neither of those links are particularly large or >obvious. >""" > >Test plan: >- Stage a record for import, notice that the "View batch" link appears >when the job is finished >- Add order to basket from a new file, select a file and import >Notice that the "Add staged files to basket" link is displayed when the >job is finished > >Note for QA: We should have a js_callback in the background_job include >file instead. > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > .../prog/en/modules/tools/stage-marc-import.tt | 16 +++++++++++++--- > koha-tmpl/intranet-tmpl/prog/js/job_progess.js | 5 +++-- > 2 files changed, 16 insertions(+), 5 deletions(-) > >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 6c6be6c43f..dfb1d05fe7 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 >@@ -79,6 +79,7 @@ > <p>The job has been enqueued! It will be processed as soon as possible.</p> > [% INCLUDE "job_progress.inc" job_id=job_id %] > <p><a class="job_details" href="/cgi-bin/koha/admin/background_jobs.pl?op=view&id=[% job_id | uri %]" title="View detail of the enqueued job">View detail of the enqueued job</a> >+ <div id="job_callback"></div> > </div> > [% ELSE %] > <h1>Stage MARC records for import</h1> >@@ -105,8 +106,7 @@ > > <div id="fileuploadpanel"> > <div id="fileuploadstatus" class="progress_panel">Upload progress: >- <progress id="fileuploadprogress" max="100" value="0"> >- </progress> >+ <progress id="fileuploadprogress" max="100" value="0"></progress> > <span class="fileuploadpercent">0</span>% > </div> > <div id="fileuploadfailed"></div> >@@ -428,7 +428,17 @@ > }) > }); > [% IF job_enqueued %] >- updateProgress([% job_id | html %]); >+ updateProgress([% job_id | html %], function(){ >+ $.getJSON('/api/v1/jobs/[% job_id | html %]', function(job){ >+ let import_batch_id = job.data.report.import_batch_id; >+ $('<p><a href="/cgi-bin/koha/tools/manage-marc-import.pl?import_batch_id=%s">%s</a></p>'.format(import_batch_id, _("View batch"))).appendTo("#job_callback"); >+ let basket_id = job.data.report.basket_id; >+ let vendor_id = job.data.report.vendor_id; >+ if ( basket_id && vendor_id ) { >+ $('<p><a id="addtobasket" class="btn btn-default" href="/cgi-bin/koha/acqui/addorderiso2709.pl?import_batch_id=%s&basketno=%s&booksellerid=%s">%s</a></p>'.format(import_batch_id, basket_id, vendor_id, _("Add staged files to basket"))).appendTo("#job_callback"); >+ } >+ }); >+ }); > [% END %] > }); > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/job_progess.js b/koha-tmpl/intranet-tmpl/prog/js/job_progess.js >index 5b91507596..8da44420a1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/job_progess.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/job_progess.js >@@ -1,4 +1,4 @@ >-function updateProgress(job_id) { >+function updateProgress(job_id, callback) { > $.getJSON('/api/v1/jobs/' + job_id, function(job){ > let recheck = true; > >@@ -19,6 +19,7 @@ function updateProgress(job_id) { > $('#progress-bar-' + job_id).addClass("progress-bar-success"); > $('#progress-bar-' + job_id).attr('aria-valuenow', 100).css("width", "100%"); > recheck = false; >+ callback(); > } else if ( job.status == "failed" ) { > $('#job-percent-' + job_id).text(0); > $('#job-status-' + job_id).text(JOB_PROGRESS_FAILED); >@@ -28,7 +29,7 @@ function updateProgress(job_id) { > } > > if ( recheck ) { >- setTimeout(function(){updateProgress(job_id)}, 1 * 1000); >+ setTimeout(function(){updateProgress(job_id, callback)}, 1 * 1000); > } > }); > } >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 31891
:
143933
|
143935
|
143955
|
144056