From 5d6e9a3599054cb57fbed06f224a91c5c7c90a5f Mon Sep 17 00:00:00 2001 From: kev-kev <32309015+kev-kev@users.noreply.github.com> Date: Sun, 12 Jul 2020 16:02:20 -0400 Subject: [PATCH] remove curriculum stories from attributes in curriculum_dashboard and remove files for curriculum story (#465) --- .../admin/curriculum_stories_controller.rb | 35 ---------- rails/app/dashboards/curriculum_dashboard.rb | 3 - .../dashboards/curriculum_story_dashboard.rb | 64 ------------------- 3 files changed, 102 deletions(-) delete mode 100644 rails/app/controllers/admin/curriculum_stories_controller.rb delete mode 100644 rails/app/dashboards/curriculum_story_dashboard.rb diff --git a/rails/app/controllers/admin/curriculum_stories_controller.rb b/rails/app/controllers/admin/curriculum_stories_controller.rb deleted file mode 100644 index 5f5c065c9..000000000 --- a/rails/app/controllers/admin/curriculum_stories_controller.rb +++ /dev/null @@ -1,35 +0,0 @@ -module Admin - class CurriculumStoriesController < Admin::ApplicationController - # Overwrite any of the RESTful controller actions to implement custom behavior - # For example, you may want to send an email after a foo is updated. - # - # def update - # foo = Foo.find(params[:id]) - # foo.update(params[:foo]) - # send_foo_updated_email - # end - - # Override this method to specify custom lookup behavior. - # This will be used to set the resource for the `show`, `edit`, and `update` - # actions. - # - # def find_resource(param) - # Foo.find_by!(slug: param) - # end - - # Override this if you have certain roles that require a subset - # this will be used to set the records shown on the `index` action. - # - # def scoped_resource - # if current_user.super_admin? - # resource_class - # else - # resource_class.with_less_stuff - # end - # end - - # See https://administrate-prototype.herokuapp.com/customizing_controller_actions - # for more information - - end -end diff --git a/rails/app/dashboards/curriculum_dashboard.rb b/rails/app/dashboards/curriculum_dashboard.rb index 923126a66..0c6e17ada 100644 --- a/rails/app/dashboards/curriculum_dashboard.rb +++ b/rails/app/dashboards/curriculum_dashboard.rb @@ -9,7 +9,6 @@ class CurriculumDashboard < Administrate::BaseDashboard # on pages throughout the dashboard. ATTRIBUTE_TYPES = { user: Field::BelongsTo, - curriculum_stories: Field::NestedHasMany.with_options(skip: :curriculum), stories: Field::HasMany, id: Field::Number, title: Field::String, @@ -35,7 +34,6 @@ class CurriculumDashboard < Administrate::BaseDashboard SHOW_PAGE_ATTRIBUTES = %i[ title description - curriculum_stories user created_at updated_at @@ -49,7 +47,6 @@ class CurriculumDashboard < Administrate::BaseDashboard title description stories - curriculum_stories ].freeze # COLLECTION_FILTERS diff --git a/rails/app/dashboards/curriculum_story_dashboard.rb b/rails/app/dashboards/curriculum_story_dashboard.rb deleted file mode 100644 index aef5840e2..000000000 --- a/rails/app/dashboards/curriculum_story_dashboard.rb +++ /dev/null @@ -1,64 +0,0 @@ -require "administrate/base_dashboard" - -class CurriculumStoryDashboard < Administrate::BaseDashboard - # ATTRIBUTE_TYPES - # a hash that describes the type of each of the model's fields. - # - # Each different type represents an Administrate::Field object, - # which determines how the attribute is displayed - # on pages throughout the dashboard. - ATTRIBUTE_TYPES = { - curriculum: Field::BelongsTo, - story: Field::BelongsTo.with_options(searchable: true), - id: Field::Number, - created_at: Field::DateTime, - updated_at: Field::DateTime, - display_order: Field::Number, - }.freeze - - # COLLECTION_ATTRIBUTES - # an array of attributes that will be displayed on the model's index page. - # - # By default, it's limited to four items to reduce clutter on index pages. - # Feel free to add, remove, or rearrange items. - COLLECTION_ATTRIBUTES = %i[ - story - display_order - ].freeze - - # SHOW_PAGE_ATTRIBUTES - # an array of attributes that will be displayed on the model's show page. - SHOW_PAGE_ATTRIBUTES = %i[ - curriculum - story - display_order - ].freeze - - # FORM_ATTRIBUTES - # an array of attributes that will be displayed - # on the model's form (`new` and `edit`) pages. - FORM_ATTRIBUTES = %i[ - curriculum - story - display_order - ].freeze - - # COLLECTION_FILTERS - # a hash that defines filters that can be used while searching via the search - # field of the dashboard. - # - # For example to add an option to search for open resources by typing "open:" - # in the search field: - # - # COLLECTION_FILTERS = { - # open: ->(resources) { where(open: true) } - # }.freeze - COLLECTION_FILTERS = {}.freeze - - # Overwrite this method to customize how curriculum stories are displayed - # across all pages of the admin dashboard. - # - # def display_resource(curriculum_story) - # "CurriculumStory ##{curriculum_story.id}" - # end -end