Skip to content

GetThis feature + Regex config file support#4359

Open
rominail wants to merge 120 commits into
vufind-org:devfrom
MSU-Libraries:getThis
Open

GetThis feature + Regex config file support#4359
rominail wants to merge 120 commits into
vufind-org:devfrom
MSU-Libraries:getThis

Conversation

@rominail
Copy link
Copy Markdown
Member

@rominail rominail commented May 5, 2025

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.phtml We were not sure how to name the item when the call number is not present to be displayed in the dropdown

TODO:

@demiankatz demiankatz added new feature new language strings adds new text in need of translation labels May 6, 2025
Copy link
Copy Markdown
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread config/vufind/GetThis.yaml Outdated
Comment thread config/vufind/GetThis.yaml Outdated
Comment thread languages/en.ini Outdated
Comment thread languages/en.ini Outdated
Comment thread languages/en.ini Outdated
Comment thread themes/bootstrap5/templates/RecordTab/holdingsils/standard.phtml Outdated
Comment thread themes/bootstrap5/templates/ajax/status-full.phtml Outdated
Comment thread themes/bootstrap5/templates/record/get-this.phtml Outdated
Comment thread themes/bootstrap5/theme.config.php Outdated
Comment thread themes/bootstrap5/templates/record/get-this/remote-delivery.phtml Outdated
…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
Comment thread config/vufind/GetThis.yaml Outdated
Comment thread languages/en.ini Outdated
Copy link
Copy Markdown
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Comment thread config/vufind/GetThis.yaml Outdated
Comment thread config/vufind/GetThis.yaml Outdated
Comment thread config/vufind/GetThis.yaml Outdated
Comment thread config/vufind/GetThis.yaml Outdated
Comment thread config/vufind/GetThis.yaml Outdated
Comment thread module/VuFind/src/VuFind/Regex/RegexFactory.php Outdated
Comment thread module/VuFind/src/VuFind/RecordDriver/DefaultRecord.php Outdated
Comment thread themes/bootstrap5/templates/RecordTab/holdingsils/standard.phtml Outdated
Comment thread themes/bootstrap5/templates/ajax/status-full.phtml Outdated
Comment thread config/vufind/Regex.yaml
rominail and others added 11 commits May 8, 2025 11:16
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>
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
Comment thread config/vufind/GetThis.yaml Outdated
rominail and others added 6 commits May 8, 2025 15:24
@rominail
Copy link
Copy Markdown
Member Author

I implemented all your comments, I left open the cache and translator discussions

Copy link
Copy Markdown
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread themes/bootstrap5/templates/record/get-this/holdings.phtml Outdated
Comment thread module/VuFind/src/VuFind/GetThis/GetThisLoader.php Outdated
use VuFind\ILS\Logic\AvailabilityStatusInterface;
use VuFind\Log\LoggerAwareTrait;
use VuFind\Regex\Regex;
use VuFind\View\Helper\Root\Translate;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread module/VuFind/tests/unit-tests/src/VuFindTest/GetThisLoaderTest.php Outdated
Comment thread module/VuFind/tests/unit-tests/src/VuFindTest/GetThisLoaderTest.php Outdated
@demiankatz
Copy link
Copy Markdown
Member

@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!

rominail added 6 commits May 8, 2026 13:37
# 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
@rominail
Copy link
Copy Markdown
Member Author

I implemented the translation comment, feel free to close or comment the thread
We hope to get it merged for 11.1
Let me know if there is anything else

Copy link
Copy Markdown
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread themes/bootstrap5/templates/RecordTab/holdingsils/standard.phtml
Comment thread themes/bootstrap5/templates/record/get-this/place-request.phtml Outdated
Comment thread themes/bootstrap5/templates/record/get-this/holdings.phtml Outdated
Comment on lines +53 to +54
<?=$this->icon('open-dropdown', 'fa-square-caret-down') ?>
<?=$this->icon('close-dropdown', 'fa-square-caret-up') ?>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These icon calls don't look quite right. I think these second parameters are unnecessary.

Suggested change
<?=$this->icon('open-dropdown', 'fa-square-caret-down') ?>
<?=$this->icon('close-dropdown', 'fa-square-caret-up') ?>
<?=$this->icon('open-dropdown') ?>
<?=$this->icon('close-dropdown') ?>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not entirely comfortable with font awesome, however if I remove the second parameter, the icons are not displayed anymore

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread themes/bootstrap5/templates/record/get-this/holdings.phtml Outdated
Comment thread themes/bootstrap5/templates/ajax/status-full.phtml Outdated
Comment thread themes/bootstrap5/templates/ajax/status-full.phtml Outdated
Comment thread themes/bootstrap5/templates/ajax/status-full.phtml Outdated
Comment thread themes/bootstrap5/templates/ajax/status-full.phtml Outdated
Comment thread languages/en.ini Outdated
@demiankatz
Copy link
Copy Markdown
Member

@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.

@rominail
Copy link
Copy Markdown
Member Author

I made most of the modifications you suggested, I look at the tests now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature new language strings adds new text in need of translation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants