Bug 15850 - Correct eslint errors in cataloging.js
Summary: Correct eslint errors in cataloging.js
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on: 23183
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-17 17:45 UTC by Owen Leonard
Modified: 2020-05-02 14:28 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.05.00


Attachments
Bug 15850: Correct eslint errors in cataloging.js (12.23 KB, patch)
2020-01-06 17:21 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 15850: Correct eslint errors in cataloging.js (12.27 KB, patch)
2020-02-14 09:18 UTC, David Nind
Details | Diff | Splinter Review
Bug 15850: Correct eslint errors in cataloging.js (12.33 KB, patch)
2020-02-14 14:54 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2016-02-17 17:45:49 UTC
Following coding guideline JS8: "Follow guidelines set by JSHint," some errors should be corrected in cataloging.js

koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js: line 43, col 31, The array literal notation [] is preferable.
koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js: line 49, col 72, Use '!==' to compare with ''.
koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js: line 99, col 13, 'i' is already defined.
koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js: line 116, col 17, 'id_input' is already defined.
koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js: line 182, col 37, 'olddiv' is already defined.
koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js: line 183, col 37, 'oldcontrol' is already defined.
koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js: line 108, col 18, 'j' used out of scope.
koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js: line 108, col 26, 'j' used out of scope.
koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js: line 108, col 46, 'j' used out of scope.
koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js: line 109, col 27, 'j' used out of scope.
koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js: line 109, col 59, 'j' used out of scope.
koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js: line 110, col 28, 'j' used out of scope.
koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js: line 220, col 21, 'inputs' is already defined.
koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js: line 226, col 25, 'anchors' is already defined.
koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js: line 227, col 30, 'j' is already defined.
koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js: line 176, col 21, 'CloneButtonPlus' used out of scope.
koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js: line 280, col 13, 'i' is already defined.
koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js: line 280, col 17, 'len' is already defined.
koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js: line 287, col 13, 'i' is already defined.
koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js: line 287, col 17, 'len' is already defined.
koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js: line 296, col 13, 'oldcontrol' is already defined.
koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js: line 315, col 21, 'i' is already defined.
koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js: line 409, col 15, 'line' used out of scope.
koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js: line 425, col 34, 'line' used out of scope.
koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js: line 465, col 13, 'i' is already defined.
koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js: line 465, col 17, 'len' is already defined.
koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js: line 471, col 13, 'i' is already defined.
koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js: line 471, col 17, 'len' is already defined.
Comment 1 Owen Leonard 2020-01-06 17:21:43 UTC
Created attachment 96859 [details] [review]
Bug 15850: Correct eslint errors in cataloging.js

This patch makes corrections to cataloging.js so that there are no
issues flagged by eslint. The fewer eslint warnings we have to see makes
it more likely that real problems will be noticed.

Some functions were unused have been removed.

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

 - Open a MARC record for editing in the basic cataloging editor.
 - Test the JavaScript-driven functionality affected by the changed
   file:
    - Open the authority browser from a field (e.g. 100a) which is
      linked to an authority type.
    - Clone a repeatable tag.
    - Clone a repeatable subfield
    - "Unclone" a tag or subfield: This should remove the tag or
      subfield (if possible) or clear the contents of the tag or
      subfield if not.
    - Clone a subfield on the item edit page (In my MARC21 installation
      I had to modify the default framework in order to have a
      repeatable item subfield to test with).
Comment 2 David Nind 2020-02-14 09:18:03 UTC
Created attachment 98916 [details] [review]
Bug 15850: Correct eslint errors in cataloging.js

This patch makes corrections to cataloging.js so that there are no
issues flagged by eslint. The fewer eslint warnings we have to see makes
it more likely that real problems will be noticed.

Some functions were unused have been removed.

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

 - Open a MARC record for editing in the basic cataloging editor.
 - Test the JavaScript-driven functionality affected by the changed
   file:
    - Open the authority browser from a field (e.g. 100a) which is
      linked to an authority type.
    - Clone a repeatable tag.
    - Clone a repeatable subfield
    - "Unclone" a tag or subfield: This should remove the tag or
      subfield (if possible) or clear the contents of the tag or
      subfield if not.
    - Clone a subfield on the item edit page (In my MARC21 installation
      I had to modify the default framework in order to have a
      repeatable item subfield to test with).

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Katrin Fischer 2020-02-14 14:54:18 UTC
Created attachment 98957 [details] [review]
Bug 15850: Correct eslint errors in cataloging.js

This patch makes corrections to cataloging.js so that there are no
issues flagged by eslint. The fewer eslint warnings we have to see makes
it more likely that real problems will be noticed.

Some functions were unused have been removed.

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

 - Open a MARC record for editing in the basic cataloging editor.
 - Test the JavaScript-driven functionality affected by the changed
   file:
    - Open the authority browser from a field (e.g. 100a) which is
      linked to an authority type.
    - Clone a repeatable tag.
    - Clone a repeatable subfield
    - "Unclone" a tag or subfield: This should remove the tag or
      subfield (if possible) or clear the contents of the tag or
      subfield if not.
    - Clone a subfield on the item edit page (In my MARC21 installation
      I had to modify the default framework in order to have a
      repeatable item subfield to test with).

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Martin Renvoize 2020-02-17 10:45:55 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 5 Joy Nelson 2020-03-05 01:28:45 UTC
does not apply to 19.11.x.  not backported