Bugzilla – Attachment 188641 Details for
Bug 39320
Create a 'landing page' for ERM
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39320: (ERMCounts QA follow-up): Clean-up previous ERMCounts implementation
Bug-39320-ERMCounts-QA-follow-up-Clean-up-previous.patch (text/plain), 6.84 KB, created by
Pedro Amorim
on 2025-10-30 12:52:28 UTC
(
hide
)
Description:
Bug 39320: (ERMCounts QA follow-up): Clean-up previous ERMCounts implementation
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2025-10-30 12:52:28 UTC
Size:
6.84 KB
patch
obsolete
>From a94fafb458d6859ed84fcb3eacdcfd0354b35ef6 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@openfifth.co.uk> >Date: Thu, 30 Oct 2025 12:42:35 +0000 >Subject: [PATCH] Bug 39320: (ERMCounts QA follow-up): Clean-up previous > ERMCounts implementation > >--- > api/v1/swagger/definitions/erm_counts.yaml | 7 -- > api/v1/swagger/paths/erm_counts.yaml | 38 -------- > api/v1/swagger/swagger.yaml | 7 -- > .../prog/js/fetch/erm-api-client.js | 9 -- > t/db_dependent/api/v1/erm_counts.t | 91 ------------------- > 5 files changed, 152 deletions(-) > delete mode 100644 api/v1/swagger/definitions/erm_counts.yaml > delete mode 100644 api/v1/swagger/paths/erm_counts.yaml > delete mode 100755 t/db_dependent/api/v1/erm_counts.t > >diff --git a/api/v1/swagger/definitions/erm_counts.yaml b/api/v1/swagger/definitions/erm_counts.yaml >deleted file mode 100644 >index a47d7dd358c..00000000000 >--- a/api/v1/swagger/definitions/erm_counts.yaml >+++ /dev/null >@@ -1,7 +0,0 @@ >---- >-type: object >-properties: >- counts: >- type: object >- description: List of ERM resources counts >-additionalProperties: false >diff --git a/api/v1/swagger/paths/erm_counts.yaml b/api/v1/swagger/paths/erm_counts.yaml >deleted file mode 100644 >index dfb91605eed..00000000000 >--- a/api/v1/swagger/paths/erm_counts.yaml >+++ /dev/null >@@ -1,38 +0,0 @@ >---- >-/erm/counts: >- get: >- x-mojo-to: ERM#counts >- operationId: getERMcounts >- description: This resource returns a list of ERM resources counts >- summary: get the ERM counts >- tags: >- - erm_counts >- produces: >- - application/json >- responses: >- 200: >- description: The ERM counts >- schema: >- $ref: "../swagger.yaml#/definitions/erm_counts" >- 400: >- description: Bad request >- schema: >- $ref: "../swagger.yaml#/definitions/error" >- 403: >- description: Access forbidden >- schema: >- $ref: "../swagger.yaml#/definitions/error" >- 500: >- description: | >- Internal server error. Possible `error_code` attribute values: >- >- * `internal_server_error` >- schema: >- $ref: "../swagger.yaml#/definitions/error" >- 503: >- description: Under maintenance >- schema: >- $ref: "../swagger.yaml#/definitions/error" >- x-koha-authorization: >- permissions: >- erm: 1 >diff --git a/api/v1/swagger/swagger.yaml b/api/v1/swagger/swagger.yaml >index 4b8e21c402e..14e41bd327f 100644 >--- a/api/v1/swagger/swagger.yaml >+++ b/api/v1/swagger/swagger.yaml >@@ -50,8 +50,6 @@ definitions: > $ref: ./definitions/desk.yaml > edifact_file: > $ref: ./definitions/edifact_file.yaml >- erm_counts: >- $ref: ./definitions/erm_counts.yaml > erm_config: > $ref: ./definitions/erm_config.yaml > erm_agreement: >@@ -337,8 +335,6 @@ paths: > $ref: "./paths/deleted_biblios.yaml#/~1deleted~1biblios~1{biblio_id}" > /erm/config: > $ref: ./paths/erm_config.yaml#/~1erm~1config >- /erm/counts: >- $ref: ./paths/erm_counts.yaml#/~1erm~1counts > /erm/agreements: > $ref: ./paths/erm_agreements.yaml#/~1erm~1agreements > "/erm/agreements/{agreement_id}": >@@ -1208,9 +1204,6 @@ tags: > - description: "Manage ERM configuration\n" > name: erm_config > x-displayName: ERM configuration >- - description: "Get ERM resources counts\n" >- name: erm_counts >- x-displayName: ERM counts > - description: "Manage ERM counter files\n" > name: erm_counter_files > x-displayName: ERM counter files >diff --git a/koha-tmpl/intranet-tmpl/prog/js/fetch/erm-api-client.js b/koha-tmpl/intranet-tmpl/prog/js/fetch/erm-api-client.js >index 49e1bad5964..b618e0d672b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/fetch/erm-api-client.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/fetch/erm-api-client.js >@@ -447,15 +447,6 @@ export class ERMAPIClient { > }), > }; > } >- >- get counts() { >- return { >- get: () => >- this.httpClient.get({ >- endpoint: "counts", >- }), >- }; >- } > } > > export default ERMAPIClient; >diff --git a/t/db_dependent/api/v1/erm_counts.t b/t/db_dependent/api/v1/erm_counts.t >deleted file mode 100755 >index ec0f5c454f1..00000000000 >--- a/t/db_dependent/api/v1/erm_counts.t >+++ /dev/null >@@ -1,91 +0,0 @@ >-#!/usr/bin/env perl >- >-# This file is part of Koha. >-# >-# Koha is free software; you can redistribute it and/or modify it >-# under the terms of the GNU General Public License as published by >-# the Free Software Foundation; either version 3 of the License, or >-# (at your option) any later version. >-# >-# Koha is distributed in the hope that it will be useful, but >-# WITHOUT ANY WARRANTY; without even the implied warranty of >-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >-# GNU General Public License for more details. >-# >-# You should have received a copy of the GNU General Public License >-# along with Koha; if not, see <https://www.gnu.org/licenses>. >- >-use Modern::Perl; >- >-use Test::NoWarnings; >-use Test::More tests => 2; >-use Test::Mojo; >- >-use t::lib::TestBuilder; >-use t::lib::Mocks; >- >-use Koha::ERM::Agreements; >-use Koha::ERM::Documents; >-use Koha::ERM::EHoldings::Packages; >-use Koha::ERM::EHoldings::Titles; >-use Koha::ERM::Licenses; >-use Koha::ERM::EUsage::UsageDataProviders; >- >-use Koha::Database; >- >-my $schema = Koha::Database->new->schema; >-my $builder = t::lib::TestBuilder->new; >- >-my $t = Test::Mojo->new('Koha::REST::V1'); >- >-subtest 'count() tests' => sub { >- >- plan tests => 3; >- >- $schema->storage->txn_begin; >- >- Koha::ERM::Agreements->search->delete; >- Koha::ERM::Documents->search->delete; >- Koha::ERM::EHoldings::Packages->search->delete; >- Koha::ERM::EHoldings::Titles->search->delete; >- Koha::ERM::Licenses->search->delete; >- Koha::ERM::EUsage::UsageDataProviders->search->delete; >- >- my $librarian = $builder->build_object( >- { >- class => 'Koha::Patrons', >- value => { flags => 2**28 } >- } >- ); >- >- my $password = 'thePassword123'; >- $librarian->set_password( { password => $password, skip_validation => 1 } ); >- my $userid = $librarian->userid; >- >- ## Authorized user tests >- my $agreement = $builder->build_object( >- { >- class => 'Koha::ERM::Agreements', >- } >- ); >- >- my $license = $builder->build_object( >- { >- class => 'Koha::ERM::Licenses', >- } >- ); >- >- $t->get_ok("//$userid:$password@/api/v1/erm/counts")->status_is(200)->json_is( >- { >- counts => { >- agreements_count => 1, >- documents_count => 0, >- eholdings_packages_count => 0, >- eholdings_titles_count => 0, >- licenses_count => 1, >- usage_data_providers_count => 0 >- } >- } >- ); >- $schema->storage->txn_rollback; >-}; >-- >2.39.5
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 39320
:
187513
|
187514
|
187515
|
187516
|
187517
|
187518
|
187519
|
187520
|
187521
|
187522
|
187563
|
187568
|
187635
|
187636
|
187637
|
187638
|
187639
|
187640
|
187641
|
187642
|
187643
|
187644
|
187645
|
188094
|
188095
|
188096
|
188097
|
188098
|
188099
|
188100
|
188101
|
188102
|
188103
|
188104
|
188151
|
188279
|
188280
|
188281
|
188282
|
188283
|
188284
|
188285
|
188312
|
188315
|
188372
|
188375
|
188376
|
188637
|
188638
|
188639
|
188640
|
188641
|
188830
|
188831
|
188832
|
188833
|
188834
|
188835
|
188836
|
188837
|
188838
|
188839
|
188840
|
188841
|
188842
|
188843
|
188844
|
188845
|
188846
|
188847
|
188848
|
188849
|
188850
|
188851
|
188852
|
188853
|
188854
|
188855
|
188856
|
188857
|
188858
|
188859
|
188860
|
188861
|
188862
|
188863
|
188864