Bug 29616 - Replace library information popup in the OPAC with a modal
Summary: Replace library information popup in the OPAC with a modal
Status: CLOSED FIXED
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: release-notes-needed
Depends on:
Blocks: 30011
  Show dependency treegraph
 
Reported: 2021-12-01 17:54 UTC by Owen Leonard
Modified: 2022-12-12 21:24 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:
22.05.00


Attachments
Screenshot showing the modal information window (91.50 KB, image/png)
2021-12-01 17:54 UTC, Owen Leonard
Details
Bug 29616: Replace library information popup in the OPAC with a modal (9.97 KB, patch)
2021-12-01 20:09 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 29616: Replace library information popup in the OPAC with a modal (10.03 KB, patch)
2022-01-06 14:39 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 29616: Replace library information popup in the OPAC with a modal (10.09 KB, patch)
2022-01-07 16:13 UTC, The Minh Luong
Details | Diff | Splinter Review
Bug 29616: Replace library information popup in the OPAC with a modal (10.14 KB, patch)
2022-01-30 12:58 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 29616: (QA follow-up) Use /public endpoints on OPAC (1.21 KB, patch)
2022-05-05 12:12 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 Owen Leonard 2021-12-01 17:54:59 UTC
Created attachment 128138 [details]
Screenshot showing the modal information window

If you have "OPAC info" for any of your libraries this information will show up as a popup when the user, viewing the bibliographic detail page, hovers over the library name in the holdings table.

I think it would be more user-friendly to have the user click to show this information in a modal dialog.
Comment 1 Owen Leonard 2021-12-01 20:09:20 UTC Comment hidden (obsolete)
Comment 2 Lucas Gass 2022-01-04 22:19:49 UTC
Do you think in Case B the link should include the target="_blank" attribute so it opens in a new window?
Comment 3 Katrin Fischer 2022-01-06 14:00:38 UTC
(In reply to Lucas Gass from comment #2)
> Do you think in Case B the link should include the target="_blank" attribute
> so it opens in a new window?

Might be something people argue about. I really like the idea of it opening in a separate tab as this has less surprise and you are leaving the current site. Others might argue that they want the catalog and the website to be perceived as the same website?
Comment 4 Lucas Gass 2022-01-06 14:37:25 UTC
> Might be something people argue about. I really like the idea of it opening
> in a separate tab as this has less surprise and you are leaving the current
> site. Others might argue that they want the catalog and the website to be
> perceived as the same website?

I typically set links to open in a different tab if it is a different domain but I also think you are right about libraries wanting the OPAC and library website to be perceived as one.

It's always possible to add the attribute via jQuery
Comment 5 Lucas Gass 2022-01-06 14:39:28 UTC Comment hidden (obsolete)
Comment 6 The Minh Luong 2022-01-07 16:13:32 UTC Comment hidden (obsolete)
Comment 7 Katrin Fischer 2022-01-30 12:58:00 UTC
Created attachment 129978 [details] [review]
Bug 29616: Replace library information popup in the OPAC with a modal

This patch modifies the OPAC bibliographic detail page so that
information stored in libraries' "OPAC info" field can be displayed in a
modal window instead of in a tooltip. This will make it more readable,
especially for libraries with so much info content that the popup can
disappear off the bottom of the page.

To test, apply the patch and make sure you have at least one library
configured according to each of these:

A. One with both branches.branchurl and branches.opac_info
B. One with branches.branchurl but not branches.opac_info
C. One with branches.opac_info but not branches.branchurl
D. One with neither branches.branchurl nor branches.opac_info

View the bibliographic detail page in the OPAC for title(s) which have
holdings from the libraries you configured above. In the holdings table,
check the behavior of the library name in the "Current library" or "Home
library" columns *

- Case A: The library name appears as a link with an "info" icon.
  Clicking it shows the library information in a modal window. In the
  modal footer, a "Visit web site" button should take you to the correct
  URL.
- Case B: The library name appears as a link without an icon. Clicking
  the link takes you to the correct URL.
- Case C: The library name appears as a link with an "info" icon.
  Clicking it shows the library information in a modal window. In the
  modal footer there is no "Visit web site" button.
- Case D: The library name is plain text.

* Display of "Current library" and/or "Home library" is controlled by
  the OpacLocationBranchToDisplay system preference.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: The Minh Luong <the-minh.luong@inlibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 8 Katrin Fischer 2022-01-30 12:59:16 UTC
There is a bright dark blue on the buttons when clicking them, but I notice that this is true for all the buttons (like "Go") right now - so not a blocker.
Comment 9 Lucas Gass 2022-02-03 16:22:07 UTC
(In reply to Katrin Fischer from comment #8)
> There is a bright dark blue on the buttons when clicking them, but I notice
> that this is true for all the buttons (like "Go") right now - so not a
> blocker.

That appears to be from this rule in the OPAC CSS file:

.btn-primary:not(:disabled):not(.disabled).active, .btn-primary:not(:disabled):not(.disabled):active, .show > .btn-primary.dropdown-toggle {
  color: #fff;
  background-color: #0062cc;
  border-color: #005cbf;
}

Do we file a new bug? It seems like perhaps it was intentional to have the blue.
Comment 10 Fridolin Somers 2022-02-16 20:38:21 UTC
(In reply to Lucas Gass from comment #9)
> 
> Do we file a new bug? It seems like perhaps it was intentional to have the
> blue.
Yep, please open another bug report.
We will close invalid if it is on purpose.
Comment 11 Fridolin Somers 2022-02-16 20:42:20 UTC
Whaooo this is reeeeeeeeeeeeeeally better
Comment 12 Fridolin Somers 2022-02-16 21:52:02 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄
Comment 13 Katrin Fischer 2022-02-26 23:19:21 UTC
(In reply to Fridolin Somers from comment #10)
> (In reply to Lucas Gass from comment #9)
> > 
> > Do we file a new bug? It seems like perhaps it was intentional to have the
> > blue.
> Yep, please open another bug report.
> We will close invalid if it is on purpose.

Done:
Bug 30190 - Green buttons turn blue for a second when clicking them
Comment 14 Martin Renvoize 2022-05-05 11:58:13 UTC
There are a couple of issues here.. well one really..

1) This fails when the user is not yet logged in
2) We should be using /public/ routes for the OPAC to restrict what information is sent out for open sessions.

As we already pushed a public endpoint for libraries in bug 28948 we should just be able to switch the endpoint in the API call.
Comment 15 Martin Renvoize 2022-05-05 12:12:58 UTC
Created attachment 134638 [details] [review]
Bug 29616: (QA follow-up) Use /public endpoints on OPAC

This patch updates the new modal to use the /public version of the
libraries endpoint for fetching library data. This ensure the feature
works as expected prior to patron login.
Comment 16 Martin Renvoize 2022-05-05 12:16:41 UTC
Follow-up varified and now pushed :)