Commit Graph

59037 Commits

Author SHA1 Message Date
Matt Blenkinsop 2dfa887f24
Bug 38201: Add a ResourceFormAdd component
Dries out adding and editing resources

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:34 -06:00
Matt Blenkinsop e7a53871f5
Bug 38201: Make a ResourceShow component
This patch dries out the Show components by adding a singular component that handles resource rendering - ResourceWrapper. It handles what to display based on the route and shows the relevant abstracted component for that resource

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:34 -06:00
Matt Blenkinsop e83f68941d
Bug 38201: Rebase for additional fields
This patch enables the abstraction to consider additional fields

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:33 -06:00
Matt Blenkinsop 17e279d511
Bug 38201: Add a BaseElement
This patch adds a BaseElement component to handle logic shared between FormElement and ShowElement

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:33 -06:00
Matt Blenkinsop 8b9f7263f0
Bug 38201: Remove old code
This patch removes code that previously was commented out

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:32 -06:00
Matt Blenkinsop b6a8126bf2
Bug 38201: Add components for displaying non-standard data
This patch adds components to display data that does not conform easily to the structures in ShowElement

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:32 -06:00
Matt Blenkinsop 8eee66f7a5
Bug 38201: Add a link wrapper
This patch adds a wrapper to handle elements that need to be a link

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:31 -06:00
Matt Blenkinsop 1b84fe77c3
Bug 38201: Add tables to ShowElement
This patch adds the ability to display element fields in a table in the show component

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:31 -06:00
Matt Blenkinsop b9d90163ac
Bug 38201: DRY form components
This patch continues the work to DRY form components

It creates reusable components for PatronSearch and Documents as well as moving logic into the FormElement and BaseResource components

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:30 -06:00
Pedro Amorim f86f0041cb
Bug 38201: VueJS rework WIP
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:30 -06:00
Pedro Amorim eec04d890c
Bug 38201: (QA follow-up): Fix Dialog_spec.ts
Run the test spec before and after applying the patch:
cypress run --spec t/cypress/integration/ERM/Dialog_spec.ts

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:29 -06:00
Pedro Amorim 46bccdc142
Bug 38201: Update cypress
Local packages were named 'package' on the delete confirmation dialog, but 'local package' on the deleted confirmation message.
Both these places now use the same i18n.display_name from the respective Resource component so these label tests need to be updated.
Same for local titles.

Test plan:
cypress run --spec t/cypress/integration/ERM/DataProviders_spec.ts
cypress run --spec t/cypress/integration/ERM/Agreements_spec.ts
cypress run --spec t/cypress/integration/ERM/Licenses_spec.ts
cypress run --spec t/cypress/integration/ERM/Titles_spec.ts
cypress run --spec t/cypress/integration/ERM/Packages_spec.ts

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:29 -06:00
Pedro Amorim e4fc404429
Bug 38201: Apply changes to preservation trains
Also update edit route from TrainsFormEdit to TrainsFormAddEdit for consistency

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:28 -06:00
Pedro Amorim d2e60cd9d6
Bug 38201: Apply changes to usage statistics data providers
This is also removing UsageStatissticsDataProvidersToolbar as that is
not required, and updating the UsageStatisticsDataProvidersSummary
button to a ToolbarButton instead of a router-link

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:28 -06:00
Pedro Amorim 8a2db5068c
Bug 38201: Add required faicon for fontawesome compnent
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:27 -06:00
Pedro Amorim bdf83ae5e1
Bug 38201: Fix: URL param needs to match attr_id
url param needs to match attr_id
usage statistics is non-standard when compared to agreements+licenses etc.
using usage_data_provider_id but resource id field is erm_usage_data_provider_id.
This patch is fixing that.

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:27 -06:00
Pedro Amorim 99926859d2
Bug 38201: Move setWarning to BaseResource
UsageStatisticsDataProvidersList needs it, and others in the future will as well

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:26 -06:00
Pedro Amorim 7b78126adf
Bug 38201: Apply changes to eholdings titles
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:26 -06:00
Pedro Amorim 9ad59433d1
Bug 38201: Restore possibility of a custom toolbar button
EHoldingsLocalTitles needs this for 'Import from list' and 'Import from KBART file'

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:25 -06:00
Pedro Amorim b45c655735
Bug 38201: Apply changes to eHoldings local packages
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:25 -06:00
Pedro Amorim d989ce4946
Bug 38201: Apply changes to licenses
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:24 -06:00
Pedro Amorim 4c1a430298
Bug 38201: Move table_url declaration to resource class
This is relevant because doResourceDelete expected table_url to be implemented, but LicensesList does not implement it for example.
We now have a getResourceTableUrl implemented by all resources

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:24 -06:00
Pedro Amorim db9c0be914
Bug 38201: DRY delete
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:23 -06:00
Pedro Amorim b95a975d5a
Bug 38201: Get rid of e.preventDefault
Feels wrong to have datatable+event related args in BaseResource, remove that.
The only reason we needed preventDefault was because 'show' action was a
link with an href, but we dont even need that, and add 'role="button"'
for cursor:pointer mouseover interaction.

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:23 -06:00
Jonathan Druart 5e82ac70f1
Bug 38201: Add goToResourceShow to BaseResource
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:22 -06:00
Jonathan Druart 6b78eae56a
Bug 38201: Remove toToResource* methods to BaseResource
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:22 -06:00
Jonathan Druart fcf42cbdc4
Bug 38201: (follow-up) PoC (Continuation): Add BaseResource and AgreementResource
To squash with previous patch

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:21 -06:00
Pedro Amorim b12034d644
Bug 38201: PoC (Continuation): Add BaseResource and AgreementResource
This is the building blocks for a much consistent approach, for example:
AgreementsShow -> delete_agreement && AgreementsList -> doDelete should be DRY into AgreementResource
Any WET code currently in setup for list+show of a resource can (and should) be moved into <resourceName>Resource
Any WET code currently in setup for all 'resources' can (and should) be moved into BaseResource

and others

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:21 -06:00
Jonathan Druart e78f243f81
Bug 38201: Rename 'type' with 'action'
'type' is too generic.
Also move to else-if and add a else block to ease debugging in case an
unsupported action is passed

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:20 -06:00
Jonathan Druart 8c4868fb1b
Bug 38201: Remove methods
We do not need the methods, we can emit from the template.
Also rename the events to the wording more consistent with what we have.

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:20 -06:00
Pedro Amorim 013a588f71
Bug 38201: [PoC] DRY ToolbarButton
This is only a PoC applied to Agreements for discussion.
This is a continuation of bug 37274.
Bug 37274 applied the ToolbarButton to missing components but it was mostly replacing WET for WET.

This is DRYer:
- All mark-up related to toolbar buttons is now written once (css class, icons, elements)
- All labels are now written once (except 'Add' for translatability)

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:19 -06:00
Matt Blenkinsop a3299492f9
Bug 40512: (follow-up) Fix api.t
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:19 -06:00
Matt Blenkinsop f79ef1794e
Bug 40512: Add unit test
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:18 -06:00
Matt Blenkinsop 1d32470f16
Bug 40512: Add maxLength to erm agreements
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:18 -06:00
Matt Blenkinsop aca7a6234d
Bug 40511: Add unit test
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:17 -06:00
Matt Blenkinsop cff32a2e02
Bug 40511: Add maxLength to eholdings titles
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:09 -06:00
Lucas Gass b7cb04b925
Revert "Bug 40286: Make C4::Auth::checkpw_internal use Koha::Patrons->find_by_identifier"
This reverts commit 4d748a390c.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 06:02:02 -06:00
Lucas Gass 99283025fc
Bug 38330: (follow-up) Add an entry for new column
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-01 09:19:21 -06:00
Lucas Gass 2fb76a3a5e
Bug 38936: Use https in license
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-01 08:32:49 -06:00
Tomás Cohen Arazi cfc2cd7f7f
Bug 38330: (follow-up) Quote tagfield value to force VARCHAR comparisson
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-01 08:32:48 -06:00
Lucas Gass ab0fc75c9e
Bug 38330: Commit changes for dbic --force
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-01 08:32:41 -06:00
Lucas Gass c144c733cd
Bug 38330: (RM follow-up) Add missing comma
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-30 06:17:26 -06:00
Lucas Gass 904dc92a62
Bug 39145: Use empty string for system preference value
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-29 18:50:13 -06:00
Tomas Cohen Arazi 4d748a390c
Bug 40286: Make C4::Auth::checkpw_internal use Koha::Patrons->find_by_identifier
This patch does what the title says. The code change is clear to
understand.

The check for userid vs. cardnumber is done in the `find_by_identifier`
method so no need to do it here.

Note: When `find_by_identifier` was written, I picked some other place's
logic (API password validation) so `userid` is used first for finding
the patron. Because of this, tests in t/db_dependent/Auth.t need to be
adjusted. I believe this is not an issue, as those tests should be
removed once we move forward with bug 33905, entirely.

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Auth.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-29 14:02:30 -06:00
Pedro Amorim 46ffd07b85
Bug 40171: Add tests
prove t/db_dependent/Koha/ILL/Requests.t

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-29 14:02:30 -06:00
Jonathan Druart be0dd91c41
Bug 40320: Use insertSamplePatron
On
  commit 959b7e8f05
  Bug 40345: Add insertSamplePatron

We remove the ability to insert a patron using insertObject, we need to
use insertSamplePatron instead.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-29 14:02:29 -06:00
Jonathan Druart 67e04b039a
Bug 40320: (bug 40319 follow-up) Add Cypress tests
Test plan:
Make sure the display of city, state and zipcode is the same as before
the patch
Confirm that the new Cypress tests pass

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Amended-by: Jonathan Druart
Added $raw filter to [% ", " %]

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-29 14:02:29 -06:00
Rachel A-M 15c51ce4b2
Bug 36518: Add IDs to sections (fieldsets) on the item search form
This patch adds IDs to the fieldsets on the staff interface search form
(Search > Item search), to make CSS customization easier.

Test plan:
1. Go to Search > Item search in the staff interface.
2. Right click: Inspect(Q)
3. Use ithe Search HTML bar to search for fieldset IDs:
   - "librarylocation"
   - "access_and_condition"
   - "barcodesearch"
   - "callnumber_checkouts"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-29 14:02:28 -06:00
Matt Blenkinsop 23fe21df61
Bug 40868: Restore full list of permissions to the vendors app
This patch adjusts the logic to consider all permissions and not just the top level flags

Test plan:
1) Create or edit a user to have all acquisitions permissions except one (not relevant which one, any will do)
2) Log into the staff interface and go to acquisitions > vendors and click the vendor in the table
3) The left menu will be missing everything except invoices
4) Apply patch and restart_all
5) Refresh the page, the menu should now be populated

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-29 14:02:28 -06:00
Pedro Amorim 1eddff89a0
Bug 40005: Add accessurl to manage ILL request page
Test plan:
1) Enable ILLModule
2) Create a new ILL request, visit:
   <staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
3) Add 'type', cardnumber '42' and any library. Click 'Create'.
4) You are now on the ILL manage request page.
5) Some backends may use the accessurl to store the URL of a document, run the following SQL:
   UPDATE illrequests SET accessurl = 'https://koha-community.org/';
6) Refresh the page from 4) or visit the ILL manage request page for that request.
7) Verify the accessurl is now shown.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-29 14:02:27 -06:00