Skip to content

Instantly share code, notes, and snippets.

@rjswenson
Last active August 29, 2015 14:22
Show Gist options
  • Save rjswenson/ea1624e20bef303d2edd to your computer and use it in GitHub Desktop.
Save rjswenson/ea1624e20bef303d2edd to your computer and use it in GitHub Desktop.
dashboards_spec.md

Models

####DashboardComponent::Base

  • accept and descend 'tags' throughout dashboard
  • handle user-specific 'dashboards'
    • include Rules Module

####DashboardComponent::Wrapper

  • has_one relationship with Carousel/Layout/Misc
  • unify components as one 'dashboard package' for delivery

####DashboardComponent::Carousel

  • Image and Video subcomponents embedded within
  • store order, url_link, and subcomponent for top banner

####DashboardComponent::Layout

  • store widget list (do we want to only send negative list?)
  • store widget order

####DashboardComponent::ContentRibbon

  • link-url, image, img-name
  • paperclip store images (how can we reuse the carousel classes here?)
  • validation for warnings on asset size, type, aspect_ratio

####DashboardComponent::NavBar

  • list nav_items and their order (negative list?)

####DashboardComponent::Links

  • list/save link_url, link_name, order

####CarouselItem::Base

  • polymorphic relationship with image/video
  • stored within DashComp::Carousel

####CarouselItem::Image

  • img_name, img_url(external)
  • paperclip upload and store on S3
  • validation warnings for out of aspect, img size, img type

####CarouselItem::Video

  • vid_name, vid_url(external)
  • paperclip uploade and store on S3
  • validation warnings for aspect, type

####Notification

  • store date, text, urgency?, url?
  • follow / handle dash component rules (user_id and tags)
    • include Rules module

####Dashboard Rules Module

  • user_id and tag handling
    • 'klass_by_tags' <- returns notifications and/or dashboard based on tags
    • 'klass_by_uid' <- returns notifications and/or dashboard based on uid (overwrites tag selection)

####Edit User Model

  • 'dummy' field to denote preview user

CSP / Active Admin

####Preview Functionality

  • preview option added to CSP Dash index
  • click creates 'dummy' user with restricted access rights
    • scramble or skillet checks for 'dummy' ?

####Dashboard Index

  • list all dashboard_wrappers, clickable into component parts
  • edit, show, preview, delete actions
  • publish/unpublish checkbox next to list items with bottom button to confirm
  • no validation for multipublished, conflicting dashboards (eg same tagset)

####Notification Index

  • list all notifications sep from dashboards
  • edit, show, delete actions
  • publish/unpublish checkbox

####Unified Create Form

  • section-by-section accordian with + sign
  • contains all component forms aggregated into one
  • each section individually submittable?

####Rules Form

  • 3 column multiselect populated by aggregated customer role_tags
    • region
    • brand
    • user_type
  • triple nil available for clients without role_tags (single default)

####Navigation Form

  • multiselect of all Nav items
  • negative select (items selected are removed from nav)

####Carousel Form

####Widget Form

  • utilize order_history style 2 column order/choice selector
  • no min/max widget #

####Content Ribbon Form

  • identical layout to Carousel Form except images only

####Social Aggregator Form

  • 2 field form
    • facebook link
    • instagram link

####Links Form

  • 2 column form
    • link_title
    • link_url
  • max 5 links

####Notification Form

  • separate from single-form
  • text, date(automatically pulled?), urgency?

Other

####Social Media Aggregator

####Notifications Controller

  • gate notification by tags and uid identically to Dashboard

####DashboardWrapper Controller as Dashboard

  • QUESTION: should we instead have a controller for each component model?

  • show

    • user_id primacy over tag matching if present
    • restrict by 'publish' state
    • tags specificity handling
      • return dash where tags MOST match current_user's tags (3 tags match vs 2 match)
      • how to handle equal primacy dashboards? (2 match vs 2 match)
  • create

    • restrict 'region' tag to AdminUsers containing said region
    • validate presence of tags OR user_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment