Replace Hints with Suggested Resources #1351
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why these changes are being introduced:
We've replaced the Hints system built into Bento with the Suggested Resources detector, provided by TACOS API. Since Bento is already logging search terms to TACOS in production, it makes sense to switch to using Suggested Resources.
Relevant ticket(s):
How this addresses that need:
This removes the Hint feature and replaces it with Suggested Resources. We are currently triggering Suggested Resources in the same way as Hints (and the other controllers), but it might make sense to refactor this feature using a tool like Stimulus or Turbo. I've opened (ENGX-283)[https://mitlibraries.atlassian.net/browse/ENGX-283] to track further work on this.
While discussing this feature, we realized that GraphQL returns an array for
suggestedResourceseven though that detector will only return a single resource. We are handling this in Bento by just callingfirston the array, but we should reconsider whether the GraphQL type is returning the correct data structure. The spike ticket TCO-84 will further explore this problem space.Side effects of this change:
Developer
our guide and
all issues introduced by these changes have been resolved or opened as new
issues (link to those issues in the Pull Request details above)
Code Reviewer
(not just this pull request message)
Requires database migrations?
NO
Includes new or updated dependencies?
YES