Bug 36566 - Correct ESLlint errors in OPAC enhanced content JS
Summary: Correct ESLlint errors in OPAC enhanced content JS
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Owen Leonard
QA Contact: Kyle M Hall (khall)
URL:
Keywords:
Depends on:
Blocks: 23833
  Show dependency treegraph
 
Reported: 2024-04-10 11:29 UTC by Owen Leonard
Modified: 2024-09-18 04:02 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes various ESLint errors in enhanced content JavaScript files: - Consistent indentation - Remove variables which are declared but not used - Add missing semicolons - Add missing "var" declarations
Version(s) released in:
24.11.00,24.05.04,23.11.09
Circulation function:


Attachments
Bug 36566: Correct eslint errors in OPAC enhanced content JS (21.44 KB, patch)
2024-04-10 11:42 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 36566: Correct eslint errors in OPAC enhanced content JS (21.48 KB, patch)
2024-04-26 18:44 UTC, David Nind
Details | Diff | Splinter Review
Bug 36566: Correct eslint errors in OPAC enhanced content JS (21.54 KB, patch)
2024-07-19 11:45 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2024-04-10 11:29:42 UTC
Following coding guideline JS8: "Follow guidelines set by ESLint," some errors should be corrected in these OPAC scripts:

amazonimages.js
bakertaylorimages.js
google-jackets.js
localcovers.js
openlibrary.js
Comment 1 Owen Leonard 2024-04-10 11:42:34 UTC
Created attachment 164608 [details] [review]
Bug 36566: Correct eslint errors in OPAC enhanced content JS

This patch fixes various eslint errors in enhanced content JS files:

- Consistent indentation
- Remove variables which are declared but not used
- Add missing semicolons
- Add missing "var" declarations

To test, apply the patch and clear your browser cache if necessary.

- Go to Administration -> System preferences and enable these
  preferences:
  - OPACAmazonCoverImages
  - BakerTaylorEnabled
  - GoogleJackets
  - OPACLocalCoverImages
  - OpenLibraryCovers
- Go to the OPAC and confirm that covers from these services appear
  correctly in search results and on detail pages.
Comment 2 David Nind 2024-04-26 18:44:38 UTC
Created attachment 165694 [details] [review]
Bug 36566: Correct eslint errors in OPAC enhanced content JS

This patch fixes various eslint errors in enhanced content JS files:

- Consistent indentation
- Remove variables which are declared but not used
- Add missing semicolons
- Add missing "var" declarations

To test, apply the patch and clear your browser cache if necessary.

- Go to Administration -> System preferences and enable these
  preferences:
  - OPACAmazonCoverImages
  - BakerTaylorEnabled
  - GoogleJackets
  - OPACLocalCoverImages
  - OpenLibraryCovers
- Go to the OPAC and confirm that covers from these services appear
  correctly in search results and on detail pages.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2024-04-26 18:49:50 UTC
Testing notes (using KTD):

1. No changes noted after patch applied - continued to work as expected.

2. No console errors using web development tools (apart from 404 for Baker & Taylor images, as I have no credentials).

3. I have no Baker & Taylor credentials - placeholder/broken image displayed, so I'll assume it will display any available image if you do have credentials.

4. OPAC search results: with multiple cover image services enabled, the images display side-by-side to the right. I'm assuming that is how it should work (?). No difference in behavour before and after patch.
Comment 4 Kyle M Hall (khall) 2024-07-19 11:45:57 UTC
Created attachment 169206 [details] [review]
Bug 36566: Correct eslint errors in OPAC enhanced content JS

This patch fixes various eslint errors in enhanced content JS files:

- Consistent indentation
- Remove variables which are declared but not used
- Add missing semicolons
- Add missing "var" declarations

To test, apply the patch and clear your browser cache if necessary.

- Go to Administration -> System preferences and enable these
  preferences:
  - OPACAmazonCoverImages
  - BakerTaylorEnabled
  - GoogleJackets
  - OPACLocalCoverImages
  - OpenLibraryCovers
- Go to the OPAC and confirm that covers from these services appear
  correctly in search results and on detail pages.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 5 Martin Renvoize (ashimema) 2024-07-25 10:13:35 UTC
Thanks for all the hard work!

Pushed to main for the next 24.11.00 release as RM Assistant
Comment 6 Lucas Gass (lukeg) 2024-08-28 21:00:49 UTC
Backported to 24.05.x for upcoming 24.05.04
Comment 7 Fridolin Somers 2024-09-10 14:18:07 UTC
Pushed to 23.11.x for 23.11.09
Comment 8 Wainui Witika-Park 2024-09-18 04:02:36 UTC
Not backporting to 23.05.x unless requested