Spotlight Configurations refactor
I think it's time to consider a refactor of the SpotlightConfiguration
. We have a concrete view of what is actually needed now that the GALILEO Search project is realized and the user views have been worked out.
Institution links have been moved to the Institution
, so all that remains on the SpotlightConfiguration
is limited to just the data about those Spotlight resources on the GALILEO Search homepage. So why don't we just have a Featured
model?
Features
will still need to maintain a polymorphic-style relation between Institution
and InstitutionGroup
models so we can handle "defaults" for each Institution without having to create lots of duplicate Featured
records for each institution.
Featured
:
-
view_type
- optional - can be null, elementary, middle, high_school or educator -
position
- required - an integer value (1-6) representing the position of this feature on the GS homepage -
link_url
- required - link -
link_label
- required - label for link (and alt tag...) -
link_description
- required - description (with length validation) -
image
- optional (we show the GALILEO logo in GS if there's no image) - same as we have now
I think this will make the code for this significantly easier to understand and work with. It could also simplify the UI and indexing processes for this information.
So what needs to be done:
-
Create new ActiveRecord model Feature
(must replace existing PORO Feature) -
Create polymorphic relation betwixt new Feature
andInstitution
`InstitutionGroup` -
Load "default" features in DOOR import -
CRUD for Features -
Indexing service for Institution
save - using defaults when necessary and re-indexing when Features change