Bug 36566 - Correct ESLlint errors in OPAC enhanced content JS
Summary: Correct ESLlint errors in OPAC enhanced content JS
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 23833
  Show dependency treegraph
 
Reported: 2024-04-10 11:29 UTC by Owen Leonard
Modified: 2024-04-26 18:49 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


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

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.