Bug 25702 - Actions button on Search results from Z39.50 is displayed incorrectly
Summary: Actions button on Search results from Z39.50 is displayed incorrectly
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Z39.50 / SRU / OpenSearch Servers (show other bugs)
Version: master
Hardware: All All
: P3 normal (vote)
Assignee: Owen Leonard
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on: 25282
Blocks:
  Show dependency treegraph
 
Reported: 2020-06-09 20:52 UTC by Ján Kniez
Modified: 2021-12-13 21:08 UTC (History)
4 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:
20.11.00 20.05.01


Attachments
Screenshot of the wrong position of the menu launched by Actions button (174.91 KB, image/png)
2020-06-09 20:52 UTC, Ján Kniez
Details
Bug 25702: Actions button on Search results from Z39.50 is displayed incorrectly (13.94 KB, patch)
2020-06-13 00:15 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 25702: Actions button on Search results from Z39.50 is displayed incorrectly (13.99 KB, patch)
2020-06-16 13:20 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 25702: Actions button on Search results from Z39.50 is displayed incorrectly (14.05 KB, patch)
2020-06-19 13:34 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Ján Kniez 2020-06-09 20:52:08 UTC
Created attachment 105671 [details]
Screenshot of the wrong position of the menu launched by Actions button

When clicking on the Actions button in the Z39.50 Search Results window, sometimes the menu is not displayed correctly (actually it is displayed under or next to the table with Results and it is not visible in the displayed area).
Usually it happens after clicking on the table row and then on the Actions button.
Comment 1 Katrin Fischer 2020-06-11 19:19:48 UTC
Hi Jan, I don't see this behaviour in my 20.05/master installations.

Which browser are you using? Did you make any local changes? (I notice the window is quite big on your screenshot, did you change that manually or was something changed to achieve that?)
Comment 2 Owen Leonard 2020-06-12 12:03:54 UTC
I am able to reproduce this problem in master. I'm investigating.
Comment 3 Owen Leonard 2020-06-13 00:15:00 UTC
Created attachment 105851 [details] [review]
Bug 25702: Actions button on Search results from Z39.50 is displayed incorrectly

This patch modifies, again, the way the actions popup is implemented in
Z39.50 search results, whether it be in cataloging, authorities, or
acquisitions. The solution for Bug 25282 changed some markup which was
being referred to in JavaScript. This patch makes the markup more
consistent and unifies handling of the menu in one JavaScript file.

The solution changes the way a menu is generated when the user clicks
within the row of Z39.50 search results (not on the "Actions" button).
The script now creates a clone of the actions menu in that row and
appends it to the <td> the user clicked on.

To test, apply the patch and clear your browser cache if necessary. Test
these three areas in the same way:

1. Cataloging -> New from Z39.50 -> Search
2. Authorities -> New from Z39.50 -> Search
3. Acquisitions -> Vendor -> Add to Basket -> From an external source ->
Search.

In each case, test the functionality of the "Actions" menu button in the
last column ("Preview" in Acquisitions search results). The menu
should be positioned correctly and menu choice works correctly

Click anywhere else in the search results table. The same actions menu
should be triggered in that table cell. Confirm that these menu items
work correctly according to the row which was clicked.



Current depends: 25282
Comment 4 Owen Leonard 2020-06-13 00:16:03 UTC
> Current depends: 25282

Hm, I guess that doesn't actually update the "depends" field?
Comment 5 Jonathan Druart 2020-06-16 09:42:04 UTC
I don't recreate the problem on master (tested with Firefox and Chromium).
Comment 6 Owen Leonard 2020-06-16 11:27:21 UTC
Steps to reproduce in both Firefox and Chrome:

1. In the Z39.50 results window, click the "Actions" menu button for any result to expand it.
2. Click it again to close it.
3. Click elsewhere in the table row. A menu is supposed to appear but it doesn't.
4. Click the "Actions" menu again. The menu appears off screen.

https://zivotdesign.com/p/view.php?p=15923064298194

It also happens this way:

1. Click the "Actions" menu button.
2. Click anywhere in the table row without closing the actions menu first.
Comment 7 Jonathan Druart 2020-06-16 12:05:59 UTC
Sorry Owen, I did not get the "click somewhere in the row" trick.
Now I recreate.
Comment 8 Jonathan Druart 2020-06-16 12:08:46 UTC
How hard would it be to display the menu close to the cursor? Did you try already?
Comment 9 Owen Leonard 2020-06-16 12:34:55 UTC
(In reply to Jonathan Druart from comment #8)
> How hard would it be to display the menu close to the cursor? Did you try
> already?


.·´¯`(>▂<)´¯`·.


Pretty hard, it turns out, because of the way the Bootstrap menu is positioned. Maybe someone smarter than me could figure it out. The best I could do was to position the menu relative to the table cell which was clicked on.
Comment 10 Jonathan Druart 2020-06-16 13:20:31 UTC
Created attachment 105915 [details] [review]
Bug 25702: Actions button on Search results from Z39.50 is displayed incorrectly

This patch modifies, again, the way the actions popup is implemented in
Z39.50 search results, whether it be in cataloging, authorities, or
acquisitions. The solution for Bug 25282 changed some markup which was
being referred to in JavaScript. This patch makes the markup more
consistent and unifies handling of the menu in one JavaScript file.

The solution changes the way a menu is generated when the user clicks
within the row of Z39.50 search results (not on the "Actions" button).
The script now creates a clone of the actions menu in that row and
appends it to the <td> the user clicked on.

To test, apply the patch and clear your browser cache if necessary. Test
these three areas in the same way:

1. Cataloging -> New from Z39.50 -> Search
2. Authorities -> New from Z39.50 -> Search
3. Acquisitions -> Vendor -> Add to Basket -> From an external source ->
Search.

In each case, test the functionality of the "Actions" menu button in the
last column ("Preview" in Acquisitions search results). The menu
should be positioned correctly and menu choice works correctly

Click anywhere else in the search results table. The same actions menu
should be triggered in that table cell. Confirm that these menu items
work correctly according to the row which was clicked.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 11 Jonathan Druart 2020-06-16 13:21:48 UTC
Ok, works for me.

I noticed bug 25773 when testing.
Comment 12 Martin Renvoize 2020-06-19 13:34:13 UTC
Created attachment 106095 [details] [review]
Bug 25702: Actions button on Search results from Z39.50 is displayed incorrectly

This patch modifies, again, the way the actions popup is implemented in
Z39.50 search results, whether it be in cataloging, authorities, or
acquisitions. The solution for Bug 25282 changed some markup which was
being referred to in JavaScript. This patch makes the markup more
consistent and unifies handling of the menu in one JavaScript file.

The solution changes the way a menu is generated when the user clicks
within the row of Z39.50 search results (not on the "Actions" button).
The script now creates a clone of the actions menu in that row and
appends it to the <td> the user clicked on.

To test, apply the patch and clear your browser cache if necessary. Test
these three areas in the same way:

1. Cataloging -> New from Z39.50 -> Search
2. Authorities -> New from Z39.50 -> Search
3. Acquisitions -> Vendor -> Add to Basket -> From an external source ->
Search.

In each case, test the functionality of the "Actions" menu button in the
last column ("Preview" in Acquisitions search results). The menu
should be positioned correctly and menu choice works correctly

Click anywhere else in the search results table. The same actions menu
should be triggered in that table cell. Confirm that these menu items
work correctly according to the row which was clicked.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 13 Martin Renvoize 2020-06-19 13:34:45 UTC
Works as expected, passes QA scripts.. nice bit of refactoring.

Passing QA
Comment 14 Jonathan Druart 2020-06-23 08:29:54 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 15 Jonathan Druart 2020-06-23 08:41:30 UTC
backported to 20.05.x for 20.05.01
Comment 16 Aleisha Amohia 2020-06-23 22:29:27 UTC
missing dependencies, not backported to 19.11.x