Bug 34468 - Add a progress callback to job_progress.js
Summary: Add a progress callback to job_progress.js
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Pedro Amorim
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on: 31666
Blocks: 34587 34788
  Show dependency treegraph
 
Reported: 2023-08-03 10:10 UTC by Pedro Amorim
Modified: 2023-10-26 08:31 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00


Attachments
Bug 34468: Add progress callback to job_progress.js (2.07 KB, patch)
2023-08-03 10:12 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 34468: Update how we call updateProgress in stage-marc-import.tt (2.79 KB, patch)
2023-08-03 10:12 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 34468: Add progress callback to job_progress.js (2.72 KB, patch)
2023-08-24 14:48 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34468: Update how we call updateProgress in stage-marc-import.tt (2.84 KB, patch)
2023-08-24 14:48 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34468: Add progress callback to job_progress.js (2.79 KB, patch)
2023-10-20 13:53 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 34468: Update how we call updateProgress in stage-marc-import.tt (2.91 KB, patch)
2023-10-20 13:53 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro Amorim 2023-08-03 10:10:52 UTC

    
Comment 1 Pedro Amorim 2023-08-03 10:12:34 UTC
Created attachment 154216 [details] [review]
Bug 34468: Add progress callback to job_progress.js
Comment 2 Pedro Amorim 2023-08-03 10:12:37 UTC
Created attachment 154217 [details] [review]
Bug 34468: Update how we call updateProgress in stage-marc-import.tt
Comment 3 Pedro Amorim 2023-08-03 10:14:12 UTC
Calling anyone who can SO/QA this by testing the stage marc import tool and progress bar.
Comment 4 Pedro Amorim 2023-08-03 10:14:29 UTC
This is something we're using/need for ERM Usage Statistics.
Comment 5 David Nind 2023-08-08 19:13:01 UTC
If you could add a test plan, I'll happily have a go at testing.

For example, what it does, and what to expect before and after the patches are applied.
Comment 6 Pedro Amorim 2023-08-09 08:24:16 UTC
(In reply to David Nind from comment #5)
> If you could add a test plan, I'll happily have a go at testing.
> 
> For example, what it does, and what to expect before and after the patches
> are applied.

Hi David, thank you!

These patches change the current updateProgress function to accept a progress callback (a function that is called every time the bar progresses) in addition to the already existing callback that is called when the progress bar finishes.

It's not expected to change any current behavior in master because updateProgress is only used once in the stage marc import tool using the already existing callback, and these patches aim to keep that.

I think the most appropriate test plan here is to make sure it doesn't break existing functionality, by using the test plan in bug 31666 : 

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.
Comment 7 Owen Leonard 2023-08-24 13:37:35 UTC
Does this patch affect the progress bar when uploading the MARC file or the progress bar shown when staging the file for import?
Comment 8 Pedro Amorim 2023-08-24 13:59:28 UTC
(In reply to Owen Leonard from comment #7)
> Does this patch affect the progress bar when uploading the MARC file or the
> progress bar shown when staging the file for import?

It should not change any current behavior, no. This is only a preparation bug for bug 34587 that changes updateProgress to accept an array of callbacks, instead of just a callback.
Comment 9 Owen Leonard 2023-08-24 14:48:10 UTC
Created attachment 154739 [details] [review]
Bug 34468: Add progress callback to job_progress.js

These patches change the current updateProgress function to accept a
progress callback (a function that is called every time the bar
progresses) in addition to the already existing callback that is called
when the progress bar finishes.

It's not expected to change any current behavior in master because
updateProgress is only used once in the stage marc import tool using
the already existing callback, and these patches aim to keep that.

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.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 10 Owen Leonard 2023-08-24 14:48:12 UTC
Created attachment 154740 [details] [review]
Bug 34468: Update how we call updateProgress in stage-marc-import.tt

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 11 Martin Renvoize 2023-10-20 13:53:50 UTC
Created attachment 157517 [details] [review]
Bug 34468: Add progress callback to job_progress.js

These patches change the current updateProgress function to accept a
progress callback (a function that is called every time the bar
progresses) in addition to the already existing callback that is called
when the progress bar finishes.

It's not expected to change any current behavior in master because
updateProgress is only used once in the stage marc import tool using
the already existing callback, and these patches aim to keep that.

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.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 12 Martin Renvoize 2023-10-20 13:53:52 UTC
Created attachment 157518 [details] [review]
Bug 34468: Update how we call updateProgress in stage-marc-import.tt

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 13 Martin Renvoize 2023-10-20 13:54:53 UTC
All working as described and a positive change.

No regressions found, QA scripts happy.

Passing QA
Comment 14 Tomás Cohen Arazi 2023-10-25 14:49:10 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 15 Fridolin Somers 2023-10-26 08:31:31 UTC
Enhancement not pushed to 23.05.x