[Bug 31228] New: Fix Coce JavaScript to hide single-pixel cover images in both the staff client detail and results pages
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 Bug ID: 31228 Summary: Fix Coce JavaScript to hide single-pixel cover images in both the staff client detail and results pages Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Templates Assignee: oleonard@myacpl.org Reporter: alexbuckley@catalyst.net.nz QA Contact: testopia@bugs.koha-community.org As reported by Jonathan in bug 31217 koha-tmpl/intranet-tmpl/js/coce.js hides the coce-coverimg class. - In koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt coce-coverimg is a class. - In koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt coce-coverimg is an ID, not a class. As ID's are more specific, coce-coverimg should be changed to an ID in koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt And koha-tmpl/intranet-tmpl/js/coce.js should be changed to: $("#coce-coverimg").remove(); -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=31217 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com --- Comment #1 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- results will have several nodes, you cannot use an id there. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 --- Comment #2 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Oh course, thanks Jonathan. So we should aim to make coce-coverimg a class in koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt, correct? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 --- Comment #3 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- That's certainly the best we can do, yes. We could also search for the ID and fallback to class if it does not exist. The main challenge in my opinion is to keep both opac and staff code as similar as possible (ie. switch to class for the OPAC if we decide so for staff) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 --- Comment #4 from Alex Buckley <alexbuckley@catalyst.net.nz> --- (In reply to Jonathan Druart from comment #3)
That's certainly the best we can do, yes. We could also search for the ID and fallback to class if it does not exist.
The main challenge in my opinion is to keep both opac and staff code as similar as possible (ie. switch to class for the OPAC if we decide so for staff)
Ahh yep, thanks for that Jonathan! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 --- Comment #5 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Created attachment 138112 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=138112&action=edit Bug 31228: Intraneyt coce.js is not hiding the coce-coverimg div for single-pixel images This is because the intranet detail.tt has coce-coverimg as an ID. Intranet results.tt has coce-coverimg as a class. Intranet coce.js targets coce-coverimg as a class. Intranet detail.tt should be changed to have coce-coverimg as a class. This is inline with the change made to the OPAC in bug 31217 Test plan: 1. Set your system preferences: - CoceHost = https://coce.mykoha.co.nz - CoceProviders = Select all - IntranetCoce = Enable 2. Add the ISBN of '9780262336499' to a biblio 3. Open a "Incognito" window in your browser (recommended to use Google Chrome to test this) 4. View the biblio detail page in the intranet. Observe a 'Coce image from Amazon' box loads with a spinner 5. Apply patch and restart services 6. Clear your browser cache 7. Reload the same biblio detail page in the intranet. Observe no image is displayed. 8. Do an intranet search to get the biblio returned in search results page. Confirm no cover image box is displayed 9. View the intranet search result and detail pages for a different biblio that you know Coce should be displaying the cover image of and confirm that it is correctly displayed with the source of that image listed: For example 'Coce image from Amazon.com' is displayed Sponsored-by: Catalyst IT, New Zealand -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #138112|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 --- Comment #6 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Created attachment 138113 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=138113&action=edit Bug 31228: Intranet coce.js is not hiding the coce-coverimg div for single-pixel images This is because the intranet detail.tt has coce-coverimg as an ID. Intranet results.tt has coce-coverimg as a class. Intranet coce.js targets coce-coverimg as a class. Intranet detail.tt should be changed to have coce-coverimg as a class. This is inline with the change made to the OPAC in bug 31217 Test plan: 1. Set your system preferences: - CoceHost = https://coce.mykoha.co.nz - CoceProviders = Select all - IntranetCoce = Enable 2. Add the ISBN of '9780262336499' to a biblio 3. Open a "Incognito" window in your browser (recommended to use Google Chrome to test this) 4. View the biblio detail page in the intranet. Observe a 'Coce image from Amazon' box loads with a spinner 5. Apply patch and restart services 6. Clear your browser cache 7. Reload the same biblio detail page in the intranet. Observe no image is displayed. 8. Do an intranet search to get the biblio returned in search results page. Confirm no cover image box is displayed 9. View the intranet search result and detail pages for a different biblio that you know Coce should be displaying the cover image of and confirm that it is correctly displayed with the source of that image listed: For example 'Coce image from Amazon.com' is displayed Sponsored-by: Catalyst IT, New Zealand -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|oleonard@myacpl.org |alexbuckley@catalyst.net.nz Status|NEW |Needs Signoff Change sponsored?|--- |Sponsored -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #138113|0 |1 is obsolete| | --- Comment #7 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 138187 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=138187&action=edit Bug 31228: Intranet coce.js is not hiding the coce-coverimg div for single-pixel images This is because the intranet detail.tt has coce-coverimg as an ID. Intranet results.tt has coce-coverimg as a class. Intranet coce.js targets coce-coverimg as a class. Intranet detail.tt should be changed to have coce-coverimg as a class. This is inline with the change made to the OPAC in bug 31217 Test plan: 1. Set your system preferences: - CoceHost = https://coce.mykoha.co.nz - CoceProviders = Select all - IntranetCoce = Enable 2. Add the ISBN of '9780262336499' to a biblio 3. Open a "Incognito" window in your browser (recommended to use Google Chrome to test this) 4. View the biblio detail page in the intranet. Observe a 'Coce image from Amazon' box loads with a spinner 5. Apply patch and restart services 6. Clear your browser cache 7. Reload the same biblio detail page in the intranet. Observe no image is displayed. 8. Do an intranet search to get the biblio returned in search results page. Confirm no cover image box is displayed 9. View the intranet search result and detail pages for a different biblio that you know Coce should be displaying the cover image of and confirm that it is correctly displayed with the source of that image listed: For example 'Coce image from Amazon.com' is displayed Sponsored-by: Catalyst IT, New Zealand Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #8 from Fridolin Somers <fridolin.somers@biblibre.com> --- I see results.js contains : if( div.hasClass("coce-coverimg") ){ Would be better to use this instead of : else if( div.attr("class") == "cover-image coce-coverimg" ){ No ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #138187|0 |1 is obsolete| | --- Comment #9 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Created attachment 139095 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139095&action=edit Bug 31228: Intranet coce.js is not hiding the coce-coverimg div for single-pixel images This is because the intranet detail.tt has coce-coverimg as an ID. Intranet results.tt has coce-coverimg as a class. Intranet coce.js targets coce-coverimg as a class. Intranet detail.tt should be changed to have coce-coverimg as a class. This is inline with the change made to the OPAC in bug 31217 Test plan: 1. Set your system preferences: - CoceHost = https://coce.mykoha.co.nz - CoceProviders = Select all - IntranetCoce = Enable 2. Add the ISBN of '9780262336499' to a biblio 3. Open a "Incognito" window in your browser (recommended to use Google Chrome to test this) 4. View the biblio detail page in the intranet. Observe a 'Coce image from Amazon' box loads with a spinner 5. Apply patch and restart services 6. Clear your browser cache 7. Reload the same biblio detail page in the intranet. Observe no image is displayed. 8. Do an intranet search to get the biblio returned in search results page. Confirm no cover image box is displayed 9. View the intranet search result and detail pages for a different biblio that you know Coce should be displaying the cover image of and confirm that it is correctly displayed with the source of that image listed: For example 'Coce image from Amazon.com' is displayed Sponsored-by: Catalyst IT, New Zealand -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139095|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #138187|1 |0 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 --- Comment #10 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Created attachment 139096 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139096&action=edit Bug 31228: (Alternate patch) Intranet coce.js is not hiding the coce-coverimg div for single-pixel image This is because the intranet detail.tt has coce-coverimg as an ID. Intranet results.tt has coce-coverimg as a class. Intranet coce.js targets coce-coverimg as a class. Intranet detail.tt should be changed to have coce-coverimg as a class. This is inline with the change made to the OPAC in bug 31217 Test plan: 1. Set your system preferences: - CoceHost = https://coce.mykoha.co.nz - CoceProviders = Select all - IntranetCoce = Enable 2. Add the ISBN of '9780262336499' to a biblio 3. Open a "Incognito" window in your browser (recommended to use Google Chrome to test this) 4. View the biblio detail page in the intranet. Observe a 'Coce image from Amazon' box loads with a spinner 5. Apply patch and restart services 6. Clear your browser cache 7. Reload the same biblio detail page in the intranet. Observe no image is displayed. 8. Do an intranet search to get the biblio returned in search results page. Confirm no cover image box is displayed 9. View the intranet search result and detail pages for a different biblio that you know Coce should be displaying the cover image of and confirm that it is correctly displayed with the source of that image listed: For example 'Coce image from Amazon.com' is displayed Sponsored-by: Catalyst IT, New Zealand -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 --- Comment #11 from Alex Buckley <alexbuckley@catalyst.net.nz> --- (In reply to Fridolin Somers from comment #8)
I see results.js contains : if( div.hasClass("coce-coverimg") ){
Would be better to use this instead of : else if( div.attr("class") == "cover-image coce-coverimg" ){
No ?
Hi Fridolin, I have attached an alternate patch, is that what you had in mind regarding the above? Thanks, Alex -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #138187|0 |1 is obsolete| | Attachment #139096|0 |1 is obsolete| | --- Comment #12 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 139217 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139217&action=edit Bug 31228: Intranet coce.js is not hiding the coce-coverimg div for single-pixel image This is because the intranet detail.tt has coce-coverimg as an ID. Intranet results.tt has coce-coverimg as a class. Intranet coce.js targets coce-coverimg as a class. Intranet detail.tt should be changed to have coce-coverimg as a class. This is inline with the change made to the OPAC in bug 31217 Test plan: 1. Set your system preferences: - CoceHost = https://coce.mykoha.co.nz - CoceProviders = Select all - IntranetCoce = Enable 2. Add the ISBN of '9780262336499' to a biblio 3. Open a "Incognito" window in your browser (recommended to use Google Chrome to test this) 4. View the biblio detail page in the intranet. Observe a 'Coce image from Amazon' box loads with a spinner 5. Apply patch and restart services 6. Clear your browser cache 7. Reload the same biblio detail page in the intranet. Observe no image is displayed. 8. Do an intranet search to get the biblio returned in search results page. Confirm no cover image box is displayed 9. View the intranet search result and detail pages for a different biblio that you know Coce should be displaying the cover image of and confirm that it is correctly displayed with the source of that image listed: For example 'Coce image from Amazon.com' is displayed Sponsored-by: Catalyst IT, New Zealand Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 --- Comment #13 from Fridolin Somers <fridolin.somers@biblibre.com> --- (In reply to Alex Buckley from comment #11)
(In reply to Fridolin Somers from comment #8)
I see results.js contains : if( div.hasClass("coce-coverimg") ){
Would be better to use this instead of : else if( div.attr("class") == "cover-image coce-coverimg" ){
No ?
Hi Fridolin,
I have attached an alternate patch, is that what you had in mind regarding the above?
Thanks, Alex
Yes perfect. I've passed QA this patch, obsoleted the other and removed the "alternate" text in commit message. I also reported the signoff line from Owen. Best regards ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 --- Comment #14 from Alex Buckley <alexbuckley@catalyst.net.nz> --- (In reply to Fridolin Somers from comment #13)
(In reply to Alex Buckley from comment #11)
(In reply to Fridolin Somers from comment #8)
I see results.js contains : if( div.hasClass("coce-coverimg") ){
Would be better to use this instead of : else if( div.attr("class") == "cover-image coce-coverimg" ){
No ?
Hi Fridolin,
I have attached an alternate patch, is that what you had in mind regarding the above?
Thanks, Alex
Yes perfect.
I've passed QA this patch, obsoleted the other and removed the "alternate" text in commit message. I also reported the signoff line from Owen.
Best regards ;)
Thanks very much Fridolin! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 --- Comment #15 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Also, just to note I have updated the OPAC coce fix ( bug 31217 ) to be consistent in using: else if( div.hasClass("coce-coverimg" ) ){ -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |22.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 --- Comment #16 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 22.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Status|Pushed to master |Pushed to stable Version(s)|22.11.00 |22.11.00, 22.05.06 released in| | --- Comment #17 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 22.05.x for 22.05.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |RESOLVED CC| |victor@tuxayo.net Resolution|--- |FIXED --- Comment #18 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed. Nothing to document it seems, marking resolved. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|22.11.00, 22.05.06 |22.11.00,21.11, 22.05.06 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 --- Comment #19 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- Thanks! Pushed to 21.11 for 21.11.12 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31228 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|22.11.00,21.11, 22.05.06 |22.11.00,22.05.06,21.11.12 released in| | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org