docbrown/app/dashboards
Julianna Tetreault c87974b7ac
[deploy] Add co_author_ids to Articles (#10339)
* Replaces second_user_id and third_user_id with co_author_ids on the Articles table

* Adjusts migration that adds co_author_ids to also add array: true

* Replaces second_user_id and third_user_id with co_author_ids in all applicable files
  - Use co_author_ids in _individual_article view
  - Use co_author_ids in articles and stories controllers
  - Use co_author_ids in article and podcast_episode models
  - Use co_author_ids in article_dashboard
  - Use co_author_ids in comments_helper
  - Use co_author_ids in articles_spec

* Replaces second_user_id and third_user_id with co_author_ids in article.rb model

* Remove unused #assign_co_authors method from the Stories::Controller

* Add #co_authors and #co_author_name_and_path to article_decorator.rb

* Adds a descriptive form field for co_author_ids for Admins in /admin/articles

* Adds a conditional in article/show.html.erb to render co_author names on an Article in a human-readable way

* Replaces get_co_author_name_and_path with proper method name, co_author_name_and_path in show.html.erb

* Adds latest schema to (hopefully) resolve Travis conflicts

* Adds the safe operator to show.html.erb

* Adjusts articles_spec.rb to use an array in the first test

* Replaces unless &.empty? with if ./present? in articles/show.html.erb

* Replaces second_user_id with co_author_ids in stories_show_spec.rb test

* Replaces elsif with else in articles/show.html.erb

* Cleans up show.html.erb by removing conditional in favor of decorator method

* Refactors splitting of params in Articles::Controller and optimizes query in #co_authors

* Reverts removal of second_user_id and third_user_id and migration file

* Adds a data_update script to update co_author_ids with existing second and third user_ids

* Adds validations to co_authors and flash_messages to indicate whether an update was successful or not
  - Adds to methods to article.rb to validate the IDs of co_authors and authors
  - Adds flash messages to the Admin::Articles::Controller and a redirect to the show page
  - Removes the JS highlighting upon submit when updating an Article in Admin
  - Refactors #update action in Admin::Articles::Controller

* Adds tests to article_spec.rb around co_author_id validations in article.rb

* Adjusts #validate_co_authors_must_not_be_the_same to use .include? instead

* Uses Field::Select.with_options in article_dashboard.rb to properly display co_author_ids

* Reverts removal of assigning co_author_ids in the Stories::Controller

* Adjusts error message and adjusts return logic in article.rb (thanks, Fernando!)

* Fixes failing article_spec.rb test that checks for co_author_ids uniqueness

* Adds a default array to co_author_ids and checks if they are .blank?

* Refactor data_update script to use a single SQL statement (thank you, Michael)

* Preserve array order of co_author_ids in article_decorator.rb

* Add db file for default: []

* Add validation to fix bug related to text inputs and invalid users when adding co_authors

* Adds tests to ensure that co_author_ids are both an integer and an integer > 0

* Updates admin/articles_spec.rb to default [] instead of nil

* Adjusts validations in article.rb to be DRY-er and more consistent

* Consolidates validations further

* Refactors validations in article.rb to use procs

* Refactors data_update script to remove nil values from array
2020-10-02 11:06:11 -04:00
..
article_dashboard.rb [deploy] Add co_author_ids to Articles (#10339) 2020-10-02 11:06:11 -04:00
badge_achievement_dashboard.rb Fix URL Validations and Update Admin Dashboard (#1392) 2018-12-26 18:00:02 -05:00
badge_dashboard.rb Fix rubocop lints (#794) 2018-10-03 13:00:09 -04:00
collection_dashboard.rb Fix rubocop lints (#794) 2018-10-03 13:00:09 -04:00
comment_dashboard.rb Fix URL Validations and Update Admin Dashboard (#1392) 2018-12-26 18:00:02 -05:00
dashboard_manifest.rb [deploy] HTML Variant admin dashboard (#10188) 2020-09-28 09:22:13 -06:00
display_ad_dashboard.rb Ignore unused display_ads columns (#6785) 2020-03-25 17:59:53 -04:00
email_message_dashboard.rb Fix rubocop lints (#794) 2018-10-03 13:00:09 -04:00
feedback_message_dashboard.rb Fix rubocop lints (#794) 2018-10-03 13:00:09 -04:00
follow_dashboard.rb Fix rubocop lints (#794) 2018-10-03 13:00:09 -04:00
listing_category_dashboard.rb [deploy] Rename classified listings (#7910) 2020-05-27 13:35:09 +00:00
organization_dashboard.rb [deploy] Remove ignored column (#6981) 2020-03-31 14:44:32 -04:00
podcast_dashboard.rb Introduced published field to podcasts (#3593) 2019-08-01 09:29:13 -04:00
podcast_episode_dashboard.rb Ignore unused podcast_episodes columns (#6939) [deploy] 2020-03-30 15:38:22 +02:00
reaction_dashboard.rb Fix URL Validations and Update Admin Dashboard (#1392) 2018-12-26 18:00:02 -05:00
sponsorship_dashboard.rb Add organization membership functionality to internal (#3541) 2019-07-31 14:38:36 -04:00
tag_dashboard.rb Ignore unused tags columns (#6947) 2020-03-30 16:57:13 +02:00
user_dashboard.rb [deploy] Saving youtube url (#7516) 2020-04-27 14:14:07 -04:00