[Bug 40141] New: Add "Run" and "Test" buttons to data provider toolbar
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 Bug ID: 40141 Summary: Add "Run" and "Test" buttons to data provider toolbar Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: ERM Assignee: jonathan.druart@gmail.com Reporter: katrin.fischer@bsz-bw.de QA Contact: testopia@bugs.koha-community.org CC: jonathan.druart@gmail.com, jonathan.field@openfifth.co.uk, martin.renvoize@openfifth.co.uk, matt.blenkinsop@openfifth.co.uk, pedro.amorim@openfifth.co.uk At the moment you can only "Test" and "Run" SUSHI connections and downloads from the data provider results list. It would be nice if these options would also be available directly from the detail view to save some clicks. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |clemens.tubach@kit.edu, | |michaela.sieber@kit.edu -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 --- Comment #1 from Jan Kissig <bibliothek@th-wildau.de> --- Created attachment 187813 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187813&action=edit Bug 40141 This patch adds the SUSHI test and run options to the toolbar of the data providers detail page. If a provider is not active the buttons are disabled. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bibliothek@th-wildau.de --- Comment #2 from Jan Kissig <bibliothek@th-wildau.de> --- missed the testplan: - go to /cgi-bin/koha/erm/eusage/usage_data_providers - add a dummy provider - notice the toolbar on the data provider detail page: Only Edit and Delete are available - apply the patch - run 'yarn js:build' - I needed to call 'restart_all' - refresh the providers detail page and notice the two new buttons: Test and run now - click on 'test' and wait for the result - click on 'Run now' and enter some appropriate dates. - Click 'yes run' to see the jobs queued - (Please do not dismiss the 'run now' dialog by clicking outside, as this triggers bug 41001) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 Clemens Tubach <clemens.tubach@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 --- Comment #3 from Clemens Tubach <clemens.tubach@kit.edu> --- Created attachment 187854 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187854&action=edit Bug 40141 This patch adds the SUSHI test and run options to the toolbar of the data providers detail page. If a provider is not active the buttons are disabled. Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 Michaela Sieber <michaela.sieber@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|jonathan.druart@gmail.com |jan.kissig@th-wildau.de --- Comment #4 from Michaela Sieber <michaela.sieber@kit.edu> --- Thanks Jan! I have changed the Assignee from Jonathan to Jan. Tested and signed off :-) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 Clemens Tubach <clemens.tubach@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187813|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187854|0 |1 is obsolete| | --- Comment #5 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 187885 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187885&action=edit Bug 40141 This patch adds the SUSHI test and run options to the toolbar of the data providers detail page. If a provider is not active the buttons are disabled. Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paul.derscheid@lmscloud.de --- Comment #6 from Paul Derscheid <paul.derscheid@lmscloud.de> --- I have some things to note: 1. Maybe camel casing the functions would be more in line with the rest of the module. 2. I personally don't love the code duplication here but could maybe be consolidated in a follow up.
From a functionality standpoint this looks fine.
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 Michaela Sieber <michaela.sieber@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |paul.derscheid@lmscloud.de |y.org | CC| |mathsabypro@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 --- Comment #7 from Pedro Amorim <pedro.amorim@openfifth.co.uk> --- (In reply to Paul Derscheid from comment #6)
I have some things to note: 1. Maybe camel casing the functions would be more in line with the rest of the module. 2. I personally don't love the code duplication here but could maybe be consolidated in a follow up.
From a functionality standpoint this looks fine.
I agree, but the eUsage part of ERM still needs to be moved into the bug 38201 framework. Until then I think these types of patches are to be expected. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 --- Comment #8 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Thanks for the additional context, Pedro! Was hoping one of you would take a peek :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 --- Comment #9 from Jan Kissig <bibliothek@th-wildau.de> --- (In reply to Paul Derscheid from comment #6)
I have some things to note: 1. Maybe camel casing the functions would be more in line with the rest of the module. 2. I personally don't love the code duplication here but could maybe be consolidated in a follow up.
From a functionality standpoint this looks fine.
Thanks Paul, yeah I agree about that. I followed the kebab-case as the other functions were already kebab-case in UsageStatisticsDataProvidersShow.vue -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Status|Passed QA |Failed QA --- Comment #10 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Can this patch include a description of what it does? "Bug 40141" isn't very descriptive. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 --- Comment #11 from Jan Kissig <bibliothek@th-wildau.de> --- Comment on attachment 187813 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187813 Bug 40141
From c913963f4876dc89a77e064776f8464a86892295 Mon Sep 17 00:00:00 2001 From: Jan Kissig <bibliothek@th-wildau.de> Date: Mon, 13 Oct 2025 08:31:58 +0000 Subject: [PATCH] Bug 40141:
This patch adds the SUSHI test and run options to the toolbar of the data providers detail page. If a provider is not active the buttons are disabled. --- .../ERM/UsageStatisticsDataProvidersShow.vue | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+)
diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersShow.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersShow.vue index f640f3ea659..95f3935f63e 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersShow.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersShow.vue @@ -23,6 +23,29 @@ class="btn btn-default" ><font-awesome-icon icon="trash" /> {{ $__("Delete") }}</a > + <button + @click=" + test_usage_data_provider( + usage_data_provider.erm_usage_data_provider_id, + usage_data_provider.name + ) + " + class="btn btn-default" + :disabled="!usage_data_provider.active" + > + <i class="fa fa-check"></i> {{ $__("Test") }} + </button> + <button + @click=" + run_harvester( + usage_data_provider.erm_usage_data_provider_id + ) + " + class="btn btn-default" + :disabled="!usage_data_provider.active" + > + <i class="fa fa-play"></i> {{ $__("Run now") }} + </button> </Toolbar>
<h2> @@ -220,6 +243,103 @@ export default { } ); }; + + const test_usage_data_provider = ( + usage_data_provider_id, + usage_data_provider_name + ) => { + const client = APIClient.erm; + client.usage_data_providers.test(usage_data_provider_id).then( + success => { + if (success) { + setMessage( + $__( + "Harvester connection was successful for usage data provider %s" + ).format(usage_data_provider_name), + true + ); + } else { + setMessage( + $__( + "No connection for usage data provider %s, please check your credentials and try again." + ).format(usage_data_provider_name), + true + ); + } + }, + error => {} + ); + }; + + const run_harvester = usage_data_provider_id => { + let date = new Date(); + setConfirmationDialog( + { + title: $__( + "Are you sure you want to run the harvester for this data provider?" + ), + message: name, + accept_label: $__("Yes, run"), + cancel_label: $__("No, do not run"), + inputs: [ + { + name: "begin_date", + type: "date", + value: null, + label: $__("Begin date"), + required: true, + componentProps: { + required: { + type: "boolean", + value: true, + }, + }, + }, + { + name: "end_date", + type: "date", + value: $date_to_rfc3339($date(date.toString())), + label: $__("End date"), + required: true, + componentProps: { + required: { + type: "boolean", + value: true, + }, + }, + }, + ], + }, + (callback_result, inputFields) => { + const client = APIClient.erm; + client.usage_data_providers + .process_SUSHI_response( + usage_data_provider_id, + inputFields + ) + .then( + success => { + let message = ""; + success.jobs.forEach((job, i) => { + message += + "<li>" + + $__( + "Job for report type <strong>%s</strong> has been queued" + ).format(job.report_type) + + '. <a href="/cgi-bin/koha/admin/background_jobs.pl?op=view&id=' + + job.job_id + + '" target="_blank">' + + $__("Check job progress") + + ".</a></li>"; + }); + setMessage(message, true); + }, + error => {} + ); + } + ); + }; + const change_tab_content = e => { tab_content.value = e.target.getAttribute("data-content"); }; @@ -235,6 +355,8 @@ export default { tab_content, available_data_types, delete_usage_data_provider, + test_usage_data_provider, + run_harvester, change_tab_content, }; }, -- 2.39.5
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 --- Comment #12 from Jan Kissig <bibliothek@th-wildau.de> --- please ignore last comment :/ -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187885|Bug 40141 |Bug 40141: This patch adds description| |the SUSHI test and run | |options to the toolbar of | |the data providers detail | |page. | |If a provider is not active | |the buttons are disabled. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 --- Comment #13 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- You just need to fix the subject line, I can help with that a little later. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 --- Comment #14 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Just a side note, interestingly our QA script is fine with just: But <number> Maybe it should not be :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187885|0 |1 is obsolete| | --- Comment #15 from Jan Kissig <bibliothek@th-wildau.de> --- Created attachment 187901 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187901&action=edit Bug 40141: Add "Run" and "Test" buttons to data provider toolbar This patch adds the SUSHI test and run options to the toolbar of the data providers detail page. If a provider is not active the buttons are disabled. Testplan: - go to /cgi-bin/koha/erm/eusage/usage_data_providers - add a dummy provider - notice the toolbar on the data provider detail page: Only Edit and Delete are available - apply the patch - run 'yarn js:build' - I needed to call 'restart_all' - refresh the providers detail page and notice the two new buttons: Test and run now - click on 'test' and wait for the result - click on 'Run now' and enter some appropriate dates. - Click 'yes run' to see the jobs queued - (Please do not dismiss the 'run now' dialog by clicking outside, as this triggers bug 41001) Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> If a provider is not active the buttons are disabled. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA --- Comment #16 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- With this applied DataProviders_spec.ts is failing: Data providers action buttons 1) Should queue a harvest background job ✓ Should test a provider's SUSHI connection (2191ms) 12 passing (58s) 1 failing 1) Data providers action buttons Should queue a harvest background job: AssertionError: Timed out retrying after 10000ms: Expected to find element: `main div[class='alert alert-info']`, but never found it. at Context.eval (webpack://koha/./t/cypress/integration/ERM/DataProviders_spec.ts:752:53) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA --- Comment #17 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- (In reply to Lucas Gass (lukeg) from comment #16)
With this applied DataProviders_spec.ts is failing:
Data providers action buttons 1) Should queue a harvest background job ✓ Should test a provider's SUSHI connection (2191ms)
12 passing (58s) 1 failing
1) Data providers action buttons Should queue a harvest background job: AssertionError: Timed out retrying after 10000ms: Expected to find element: `main div[class='alert alert-info']`, but never found it. at Context.eval (webpack://koha/./t/cypress/integration/ERM/DataProviders_spec.ts:752:53)
Wait a minute, false alarm. For me that test is failing with or without this patch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |25.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 --- Comment #18 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 25.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Needs documenting CC| |Laura.escamilla@bywatersolu | |tions.com --- Comment #19 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- This is an enhancement and will not be backported to the 25.05.x branch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40141 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This enhances the ERM data release notes| |provider details page for | |direct testing and | |harvesting SUSHI data via | |toolbar. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org