Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Draper, Reorganize FacetValue Presenters #1446

Merged
merged 3 commits into from
Jan 31, 2020

Conversation

mbarnett
Copy link
Contributor

@mbarnett mbarnett commented Jan 31, 2020

Context

As part of the introduction of presenters for the Metadata renderers for OAI, we've decided to bring in the Draper gem for presenters/decorators. Metadata renderers are being finalized in a separate branch/PR.

Changes

  • Adds a dependency on Draper.
  • Moves existing facet presenters into a top-level decorators directory for consistency with Draper decorators, and changes the terminology accordingly. Facet decorators continue to use a non-Draper base class, as each decorator translates an individual value of FacetValue, whereas Draper is based on wrapping a class. We could explore changing the way FacetValues are wrapped entirely, but the two approaches co-exist transparently from the view layer's perspective via a consistent helper interface.
  • Changes the present and presenter_for helpers which wrap models in presenters for the view to use Draper decorators where applicable.

@mbarnett mbarnett requested a review from murny January 31, 2020 01:10
@ualbertalib-bot
Copy link

ualbertalib-bot commented Jan 31, 2020

1 Warning
⚠️ There are code changes, but no corresponding tests. Please include tests if this PR introduces any modifications in behavior.

Generated by 🚫 Danger

Copy link
Contributor

@murny murny left a comment

Choose a reason for hiding this comment

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

Nice work 👍

@mbarnett mbarnett merged commit b19756d into integration_postmigration Jan 31, 2020
@murny murny deleted the msb/draperization branch April 24, 2020 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants