Bug 28910

Summary: Correct eslint errors in OPAC basket.js
Product: Koha Reporter: Owen Leonard <oleonard>
Component: OPACAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: fridolin.somers, kyle
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.11.00,21.05.05
Bug Depends on:    
Bug Blocks: 23833, 28901    
Attachments: Bug 28910: Correct eslint errors in OPAC basket.js
Bug 28910: Correct eslint errors in OPAC basket.js
Bug 28910: Correct eslint errors in OPAC basket.js

Description Owen Leonard 2021-08-27 11:26:42 UTC
Following coding guideline JS8: "Follow guidelines set by ESLint," some errors should be corrected in the OPAC's copy of basket.js
Comment 1 Owen Leonard 2021-09-17 13:35:54 UTC Comment hidden (obsolete)
Comment 2 David Nind 2021-10-24 22:24:38 UTC
Created attachment 126813 [details] [review]
Bug 28910: Correct eslint errors in OPAC basket.js

This patch corrects eslint errors in the OPAC copy of basket.js:
Indentation inconsistencies, undeclared variables, unused functions,
etc.

To test, apply the patch and test the "Cart" functionality in the
OPAC:

- In the OPAC, add an item to the cart.
- A popup message should appear telling you the item has been added.
- The "Add to cart" link should update to read "In your cart."
- The count if cart items in the header should be updated.
- The "In your cart (remove)" link should work correctly.
- Test this process from both the search results and
  detail pages.
- Open the cart.
- The cart should open correctly.
- In the cart, test all the controls:
  - More details
  - Send
  - Download
  - Empty and close
  - Hide window
  - Print
  - Select all / clear all
  - With checked items:
    - Remove
    - Add to list
    - Place hold
    - Tag

The following unused functions were removed: readCookieValue,
AllAreChecked, SelectAll, and quit. A search of the Koha codebase should
return no results from the opac-tmpl directory.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Katrin Fischer 2021-10-31 00:43:58 UTC
Created attachment 127121 [details] [review]
Bug 28910: Correct eslint errors in OPAC basket.js

This patch corrects eslint errors in the OPAC copy of basket.js:
Indentation inconsistencies, undeclared variables, unused functions,
etc.

To test, apply the patch and test the "Cart" functionality in the
OPAC:

- In the OPAC, add an item to the cart.
- A popup message should appear telling you the item has been added.
- The "Add to cart" link should update to read "In your cart."
- The count if cart items in the header should be updated.
- The "In your cart (remove)" link should work correctly.
- Test this process from both the search results and
  detail pages.
- Open the cart.
- The cart should open correctly.
- In the cart, test all the controls:
  - More details
  - Send
  - Download
  - Empty and close
  - Hide window
  - Print
  - Select all / clear all
  - With checked items:
    - Remove
    - Add to list
    - Place hold
    - Tag

The following unused functions were removed: readCookieValue,
AllAreChecked, SelectAll, and quit. A search of the Koha codebase should
return no results from the opac-tmpl directory.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Jonathan Druart 2021-11-02 15:53:33 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 5 Kyle M Hall 2021-11-05 14:44:37 UTC
Pushed to 21.05.x for 21.05.05
Comment 6 Fridolin Somers 2021-11-11 01:22:20 UTC
Removes some methods, I prefer not to push in 20.11.x