Main Koha release repository https://koha-community.org
Find a file
Jonathan Druart 28033aea4e Bug 32898: ERM - Improve fetch
... and fix cypress tests

The main problem was that there were no more checkError call for fetchLocalTitleCount
and the error was not displayed on the UI.

This commit is doing several things:
- Refactor fetch.js to call the same fetch method (myFetch) in order to
deal with the error in a single place
- Have a new myFetchTotal JS function to get the X-Total-Count header
from the response and get the benefit of the previous refactoring
- Rename fetchCountLocalPackages with fetchLocalPackagesCount to match fetchLocalTitleCount
- Use fetchLocalPackagesCount on the Package list view
- Use checkError from components using fetch directly. Ideally the could
should be moved to fetch.js and myFetch should be used.
- checkError get a new flag in parameter to ask for the response instead
of the result (ie. the JSON of the response). That's useful when we need
the response status or the headers
- Make checkError throw a proper exception to stop propation. This
modify the error we display on the UI, it's why we have the following
changes in cypress tests:
-            "Something went wrong: Internal Server Error"
+            "Something went wrong: Error: Internal Server Error"
That's not ideal, we should have our own JS exception to avoid that
"Error" (coming from the toString call on the error)

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a294c5e901)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
2023-02-24 10:57:54 +00:00
acqui Bug 32377: Set param skiptotals on call of GetBudgetHierarchy in acqui/histsearch.pl 2023-02-01 15:18:30 +00:00
admin Bug 32922: Remove space in shebang 2023-02-24 07:51:37 +00:00
api Bug 30642: Make renewal_type an enum in spec and add test 2023-02-13 09:29:38 +00:00
authorities Bug 30250: Use ApplyFrameworkDefaults when importing a record 2022-11-09 14:03:22 -03:00
basket Bug 16522: (follow-up) MARC display templates and get_marc_host fixes 2023-01-31 17:15:27 +00:00
bin
C4 Bug 30642: Make renewal_type an enum in spec and add test 2023-02-13 09:29:38 +00:00
catalogue Bug 32583: Restore display of only one item in catalogue/moredetails 2023-01-31 14:28:20 +00:00
cataloguing Bug 32816: Fix cataloguing/value_builder/cn_browser.pl 2023-02-24 08:30:17 +00:00
circ Bug 32922: Remove space in shebang 2023-02-24 07:51:37 +00:00
clubs
course_reserves Bug 31893: Use checkauth and do not fetch about.tt template 2023-01-31 14:09:05 +00:00
debian Bug 32922: (follow-up) Fix two additional occurences 2023-02-24 07:51:48 +00:00
docs 22.11.00: Update history.txt 2022-11-25 15:20:02 -03:00
erm Bug 32922: Remove space in shebang 2023-02-24 07:51:37 +00:00
errors
etc Bug 32612: (QA follow-up) Remove superfluous line 2023-02-06 15:54:19 +00:00
ill
installer Increment version for 22.11.03 release 2023-02-23 17:37:21 +00:00
Koha Bug 30642: (follow-up) Change sql and adapt for translations 2023-02-13 09:28:58 +00:00
koha-tmpl Bug 32898: ERM - Improve fetch 2023-02-24 10:57:54 +00:00
labels Bug 31633: (follow-up) Group template params 2022-10-03 14:09:59 -03:00
lib/CGI/Session/Serialize
members Bug 31095: Remove GetDebarments from members/memberentry.pl 2023-02-01 15:35:28 +00:00
misc Bug 32922: Remove space in shebang 2023-02-24 07:51:37 +00:00
offline_circ
opac Bug 23247: Use EmbedItems in opac-MARCdetail.pl 2023-02-24 08:15:59 +00:00
patron_lists
patroncards
plugins
pos
recalls
reports Bug 32588: Make filters on 'items with no checkouts' report translatable 2023-01-31 18:06:13 +00:00
reserve Bug 32909: Load item type icons from the correct path 2023-02-16 09:41:30 -01:00
reviews
rotating_collections
serials
services
skel
suggestion Bug 32531: Restore behaviour of 'include archived' filter 2023-01-13 15:54:39 +00:00
svc Bug 15869: Change framework on overlay 2023-02-08 16:34:09 +00:00
t Bug 32898: ERM - Improve fetch 2023-02-24 10:57:54 +00:00
tags
tmp/modified_authorities
tools Bug 15869: (QA follow-up) Don't pass placeholder framework '_USE_ORIG' 2023-02-08 16:35:21 +00:00
virtualshelves Bug 16522: (follow-up) MARC display templates and get_marc_host fixes 2023-01-31 17:15:27 +00:00
xt Bug 32741: Regression tests 2023-02-06 15:50:58 +00:00
.editorconfig
.eslintrc.json
.gitignore Bug 32030: Add dist dir to .gitignore 2022-11-08 09:49:57 -03:00
.htaccess
.mailmap Bug 32582: Fix error in .mailmap 2023-01-25 14:39:04 +00:00
.perlcriticrc
.proverc.dist
.stylelintrc.json Bug 31528: (follow-up) A few additional rules 2022-10-03 08:23:15 -03:00
about.pl Bug 30808: Add support for version codenames 2022-11-25 15:20:00 -03:00
app.psgi
changelanguage.pl
cpanfile Bug 32673: Remove misc/load_testing/ scripts 2023-02-06 15:56:03 +00:00
cypress.json Bug 32030: Move cypress to t/ 2022-11-08 09:44:51 -03:00
fix-perl-path.PL
gulpfile.js Bug 32422: Hardcoded paths in _common.scss precent using external node_modules 2022-12-15 13:23:41 +00:00
help.pl
INSTALL
Koha.pm Increment version for 22.11.03 release 2023-02-23 17:37:21 +00:00
koha_perl_deps.pl
kohaversion.pl
LICENSE
mainpage.pl
Makefile.PL Bug 32030: Fix Makefile.t 2022-11-09 09:48:30 -03:00
MANIFEST.SKIP
package.json Bug 32212: (bug 32030 follow-up) Restore bootstrap 4 2022-11-17 14:49:07 -03:00
README
README.md
README.robots
rewrite-config.PL
tsconfig.json Bug 32030: Move cypress to t - fix build_js/watch_js 2022-11-08 09:44:52 -03:00
webpack.config.js Bug 32030: Move cypress to t/ 2022-11-08 09:44:51 -03:00
yarn.lock Bug 32212: Updated yarn.lock 2022-11-18 12:04:29 -03:00

Koha is a free software integrated library system (ILS).

Koha is distributed under the GNU GPL version 3 or later.

Note: Koha does not accept pull requests from git hosting sites.

Note: This project has its own bug tracker, to report a bug or submit a patch visit http://bugs.koha-community.org.

For guidelines on submitting patches for Koha please visit https://wiki.koha-community.org/wiki/SubmitingAPatch

The developers handbook can be found at https://wiki.koha-community.org/wiki/Developer_handbook

http://koha-community.org/

Koha Logo