GetThis feature + Regex config file support#4359
Conversation
demiankatz
left a comment
There was a problem hiding this comment.
Thanks, @rominail. I have not had a chance to try this hands-on yet, or to review every file carefully, but see below for a few thoughts based on a relatively quick look at the code.
…s, move the getThisAction from trait to the controller, add a supportGetThis method instead of a hardcoded class, switcyh getThis constructor params from yamlReader to config, change priority of js file
…ng from previous commit (oversight)
demiankatz
left a comment
There was a problem hiding this comment.
Thanks, @rominail, I've resolved all of the open conversation threads that have been fully addressed, and have opened a few new ones below (along with contributing to ongoing ones).
Co-authored-by: Demian Katz <demian.katz@villanova.edu>
Co-authored-by: Demian Katz <demian.katz@villanova.edu>
Co-authored-by: Demian Katz <demian.katz@villanova.edu>
Co-authored-by: Demian Katz <demian.katz@villanova.edu>
…x.yaml, renaming to microform_viewing_request_html
Co-authored-by: Demian Katz <demian.katz@villanova.edu>
…in GetThis config
… + use of it, switch to non-positional "and" operator in GetThis config
|
I implemented all your comments, I left open the cache and translator discussions |
demiankatz
left a comment
There was a problem hiding this comment.
Thanks for the progress, @rominail! See below for some minor new suggestions and a reply to an existing open thread.
I'll try to find time to give this another more thorough review after these things are resolved.
| use VuFind\ILS\Logic\AvailabilityStatusInterface; | ||
| use VuFind\Log\LoggerAwareTrait; | ||
| use VuFind\Regex\Regex; | ||
| use VuFind\View\Helper\Root\Translate; |
There was a problem hiding this comment.
If you want to implement it without the trait, you can simply use $container->get(\Laminas\Mvc\I18n\Translator::class) to retrieve the translator service in the factory, and then inject it directly through the constructor.
# Conflicts: # module/VuFind/src/VuFindTest/Integration/MinkTestCase.php
|
@rominail, I just replied to the open translation thread above. I think this PR has been on hold in part because we've been waiting for input from the Accessibility SIG which is currently forming. Hopefully that will be available soon! This is also another PR that touches controller code, so it would be good to get it wrapped up soon if we want to include it in 11.1; otherwise, we'll need to rework some of it as part of the 12.0 release. I also see there are a few conflicts here. Please let me know if you need help resolving them! |
# Conflicts: # languages/en.ini # module/VuFind/src/VuFind/RecordTab/HoldingsILS.php # themes/bootstrap5/css/compiled.css # themes/local_theme_example/css/compiled.css # themes/sandal5/css/compiled.css
|
I implemented the translation comment, feel free to close or comment the thread |
demiankatz
left a comment
There was a problem hiding this comment.
Thanks for the progress, @rominail. I haven't had a chance to re-review everything yet, but looking at this with fresh eyes led me to make a number of suggestions.
I'll try to review more and offer further suggestions later, but I wanted to get the conversation moving again with this partial review.
| <?=$this->icon('open-dropdown', 'fa-square-caret-down') ?> | ||
| <?=$this->icon('close-dropdown', 'fa-square-caret-up') ?> |
There was a problem hiding this comment.
These icon calls don't look quite right. I think these second parameters are unnecessary.
| <?=$this->icon('open-dropdown', 'fa-square-caret-down') ?> | |
| <?=$this->icon('close-dropdown', 'fa-square-caret-up') ?> | |
| <?=$this->icon('open-dropdown') ?> | |
| <?=$this->icon('close-dropdown') ?> |
There was a problem hiding this comment.
I'm not entirely comfortable with font awesome, however if I remove the second parameter, the icons are not displayed anymore
There was a problem hiding this comment.
Icons need to be defined in the 'aliases' array in the 'icons' section of theme.config.php in your chosen theme. I think what the old code was doing was requesting an undefined icon, and then forcibly overriding the result with a FontAwesome CSS class, which is definitely not the best way to do this. If you want open-dropdown/close-dropdown icons, you should define them in theme.config.php as "FontAwesome:fa-square-caret-down" and "FontAwesome:fa-square-caret-up" and then this should work correctly.
|
@rominail, I should also note that I tried running the test suite, and several of the new tests are failing for me. Please let me know if you need more detail about that. |
|
I made most of the modifications you suggested, I look at the tests now |
This is a rewrite of this feature we call "Get this" which allows having a button next to the holding to open a lightbox showing the option the patron has to "get this" record. The options include placing a request, request for a in-person delivery, inter library loan, ...
It's made to be flexible and easy to extend, in order to add other sections to the lightbox; ie : in our case some logic specific to our collections.
It relies on Regex for some logic. We didn't have the proposed logic implemented hence the code is new and it's a feature on it's own which is completely reusable for other components.
I plan to write the tests once most of the logic is agreed upon.
Please, propose new names (for variables, functions, ...) when they don't make sense or are not clear.
Line 13 of
themes/bootstrap5/templates/record/get-this/holdings.phtmlWe were not sure how to name the item when the call number is not present to be displayed in the dropdownTODO: