Commit graph

310 commits

Author SHA1 Message Date
Michael Kohl
de119f59c1
Remove unused index_notifications_on_json_data (#11725)
Co-authored-by: rhymes <rhymes@hey.com>
2020-12-04 15:31:16 -05:00
rhymes
41fbe24235
Fix schema.db whitespace (#11729)
* Fix schema.db whitespace

* Disable flaky spec
2020-12-03 15:35:29 +01:00
Nenad Pantelić
ad04158b90
Add podcast_appearances joined table (forem#82) (#11354)
* Add podcast_appearances joined table (forem#82)

* Add podcast appearances keys unique constraint and creator property (forem#82)

* Add podcast_appearance role validation forem(#82)

* Add spec test for podcast_appearances model (forem#82)

* Small refactoring - place podcast appearance association by alphabetical order

* Adapt m2m association to pass rspec test (forem#82)

* Rename podcast appearance model to podcast episode appearance and remove fk indexing

* Rename podcast appearance model to podcast episode appearance and remove fk indexing

* Rename podcast episode appearance models and spec models. Update podcast episode and user spec tests (forem#82)

* Rename podcast episode appearances composite index to follow Rails naming pattern (forem#82)

* Remove ddl_transaction disabling and conurrent index adding from appearance migration

* Add role validation in model spec (forem#82)
2020-11-30 17:12:52 +01:00
Ben Halpern
d759ac4627
Add implicit points to follows to improve feed relevancy (in all algorithms) (#11513)
* Fix menu dropdown disable issue

* Initial base work

* Add real algorithm

* Add working object and test

* Fix schema

* Fix schema

* Fix schema

* Finalize

* Add update script and explict_points

* Proper implicit/explicit points

* Fix tests

* Add docs

* Fix tests

* Fix data update script test

* Fix data update script test

* Fix typo

* Improve efficiency and add more logic

* Changed to find_each

* Change to bulk insert

* Update tests and refactor logic

* Various improvements

* Fix typo

* Fix tests

* Remove extra line

* Fix tests

* Fix test typo

* Cache site-wide tag names
2020-11-25 16:09:51 -05:00
Manasa
b015690f4f
Podcast ownership join table (MLH Fellowship #81) (#11410)
* added podcast_ownership route

* added podcast_ownership table

* added podcast_ownership controller and pundit policy

* fixed codeclimate

* removed controller and pundit policy

* codeclimate

* codeclimate

* schema.rb

* schema.rb

* schema.rb

* user.rb

* made the suggested changes

* added validations

* fixed build error

* changed name to owned_podcasts

* added validation and tests

* added tests

* added tests

* changed spec

* added factory

* added factory

* merge conflict

* factory

* factory

* factory

* modified spec file

* modified spec file

* fix build error

* added class_name

* adjusted m2m relations

* made suggested changes

* fixed build error

* added subject

* schema

* ran migration

* removed index:true from singular fields

* changed schema file

* set index: false
2020-11-19 12:41:17 +01:00
rhymes
f40975701b
Add partial index on users.feed_url (#11411) 2020-11-16 17:10:48 +01:00
Molly Struve
de94a3fb9d
[deploy] Schema Fix:Removed accidentally added changes (#11168) 2020-10-29 16:14:00 -05:00
ludwiczakpawel
5d3691bcc5
Notifications redesign (#11084)
* notifications

* fix

* .

* REVERT

* .

* drop ccss

* REVERT

* specs

* drop colons

* fixse

* fix

* spec 1

* eh

* Fix notification specs

Co-authored-by: Molly Struve <mollylbs@gmail.com>
2020-10-29 20:38:17 +01:00
Molly Struve
bd96abcd1e
[deploy] Fix Reading List Counter Without last_reacted_at Default (#10933) 2020-10-19 13:26:19 -05:00
Molly Struve
4dbfc21407
[deploy] Revert "Fix reading list counter (#10763)" (#10932)
This reverts commit 1f17451c8e.
2020-10-19 12:54:31 -05:00
Takuma
1f17451c8e
[deploy] Fix reading list counter (#10763) 2020-10-19 11:22:57 -05:00
Michael Kohl
adb41a0a15
Uncheck email preferences by default (#10919)
* Uncheck email preferences by default

* Fix specs

* Update app/javascript/onboarding/components/__tests__/EmailPreferencesForm.test.jsx

Co-authored-by: Molly Struve <mollylbs@gmail.com>

Co-authored-by: Molly Struve <mollylbs@gmail.com>
2020-10-19 10:20:03 -04:00
Michael Kohl
621d9a2bf1
Remove Twitch-related columns from users table (#10750) 2020-10-09 14:17:35 -04:00
Ridhwana
19c78d6072
[deploy] Prepare the database for the configurable navigation items (#10662)
* feat: add the order of the navigational items to the database + admin interface

* refactor: rename :display_when_signed_in to :display_only_when_signed_in

* chore: rename all instances of display_when_signed_in to display_only_when_signed_in

* feat: add a data script that will setup the base urls

* feat: add a temporary rake file that will allow us to seed prod db's

* chore: oops rename file

* chore: remove the index for now

* chore: remove validation

* feat: change the order field to position and add an index o the name and url

* feat: update everything that uses order to position

* refactor: order by name as a secondary attr
2020-10-07 11:20:32 -04:00
Julianna Tetreault
8a01ed6a2c
Removes second_user_id and third_user_id From the Articles Table (#10383) [deploy]
* Removes second_user_id and third_user_id from the Articles table

* Adds updated schema file to (fingers crossed) resolve Travis failure

* Adds gaurd clause to data_update script to mitigate db issues
2020-10-02 13:14:32 -06:00
Ridhwana
21389ab05d
Admin Panel for Configurable Navigational Links (#9444) 2020-10-02 11:11:21 -04:00
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
rhymes
4e352020a9
[deploy] Remove additional superfluous indexes (#10530) 2020-10-02 16:20:08 +02:00
rhymes
aac94bb576
[deploy] Remove superfluous indexes on notifications (#10514) 2020-10-01 13:25:44 -04:00
rhymes
d7976a75d6
[deploy] Add missing FKs to BadgeAchievements BanishedUsers BufferUpdates (#10366)
* Add missing FKs to BackupData BadgeAchievements BanishedUsers BufferUpdates

* Add relations and specs

* Fix specs

* Trigger Travis CI

* Remove traces of backup_data has it has been removed on master

* Fix trailing whitespace
2020-09-29 21:43:14 +02:00
rhymes
0ca4e8b371
[deploy] Add missing FKs to FeedbackMessage, Note, Taggings, Tag, and UserRole (#10376)
* Add missing FKs to FeedbackMessage, Note, Taggings, Tag, and UserRole

* Add missing relations and specs

* Fix spec
2020-09-29 16:49:47 +02:00
Molly Struve
1a88905465
Refactor:Remove BackupData Table from Postgres (#10422) 2020-09-24 10:09:20 +07:00
Rafi
d570edcf07
Showing date in listing tile (#10217)
* Showing date in listing tile

* Displaying date in listing tile

1. Sending created_at in listing search API
2. Global util functions for short and long date formatting
3. New date util functions extend timestampToLocalDateTime
4. Converting div to time tag
5. Adding title attribute for date

* originally_published_at column

* Displaying originally_published_at date

* Fixing test in modal

* Fixing all listing test

* Fixing casing of dateTime

* Adding tests for originally_published_at

* Reverting to bumped_at

* Backfilling only published listing

* Removing ReIndexListingWithOriginallyPublishedAt
2020-09-21 10:14:26 +02:00
rhymes
5ba8c44b05
[deploy] Add missing foreign keys to ahoy_messages and articles (#10321)
* Add FK between ahoy_messages and feedback_messages

* Add FKs between articles.second_user_id, articles.third_user_id and users

* Fix associations and specs

* Add more validations

* Remove FKs to articles.second_user_id and .third_user_id as they are about to be removed
2020-09-16 19:47:03 +02:00
rhymes
f0b124cc26
[deploy] Add unique index on articles user_id, title and body_markdown (#10284)
* Add unique index on articles user_id, title and body_markdown

* Add test
2020-09-14 16:11:12 +02:00
Molly Struve
111dc4ea9d
[deploy] Bug Fix: Add New Migration to Remove Active from Profile Fields (#10279) 2020-09-11 08:49:27 +02:00
Michael Kohl
4ae59b56e3
Add custom profile fields (#10202)
* Add custom_profile_fields table

* Add CustomProfileField model and refactor

* Remove trailing whitespace

* Stop ignoring removed column

* Add explanatory comment

* Update service object

* Fix bug in service object

* Refactor and fix specs

* Increase limit from 3 to 5

* Update comment to reflect code changes
2020-09-09 14:37:15 +00:00
rhymes
5c7fc79507
[deploy] Add unique index on articles feed_source_url (#10208)
Co-authored-by: Molly Struve <mollylbs@gmail.com>
2020-09-08 14:34:34 -05:00
rhymes
99b239bb80
[deploy] Add unique index on articles canonical_url (#10161) 2020-09-04 14:19:13 -05:00
Molly Struve
636eddb1a9
[deploy] Optimization:Add Index for User ID and Mailer to Ahoy Messages (#10175) 2020-09-03 12:18:07 -05:00
rhymes
6298715612
[deploy] Add unique index on articles slug user_id (#10126) 2020-09-01 18:35:03 +02:00
Michael Kohl
ce9ed24090
[deploy] Remove group column from profile_fields (#10046) 2020-08-31 10:18:13 -04:00
rhymes
1a147a3176
[deploy] Add missing foreign keys to models related to users (#10018)
* Add missing foreign keys to models related to users

* Fix specs

* Change FK for page_views and rating_votes to nullify

* Improve rating vote validation and fix Users::Delete specs

* Revert "Spec Fix:Nullify Rating Votes when Deleting Users (#10071)"

This reverts commit 12dfe4ab3b.
2020-08-31 15:39:57 +02:00
rhymes
83c2e1427c
[deploy] Add foreign keys between buffer_updates, rating_votes and articles (#10016)
* Add foreign keys between buffer_updates, rating_votes and articles

* Trigger Travis CI
2020-08-29 00:00:28 +02:00
Michael Kohl
161ed7d55e
[deploy] Introduce ProfileFieldGroup model (#10007)
* Introduce ProfileFieldGroup model

* Make profile_fields_groups name column unique

* Fix some specs

* feat: allow the page to work again

* Add guard clause to data update script

* Remove unused file

* Fix specs

* Add foreign key

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2020-08-28 10:51:33 +07:00
rhymes
56f1f2d777
[deploy] Set UserSubscription sourceable columns to nullable (#10033)
* Set UserSubscription sourceable columns to nullable

* Fix spec
2020-08-27 16:25:48 +02:00
Josh Puetz
d47d02f090
[deploy] Log in with Facebook (#9922)
* First draft of facebook auth

* Add Facebook welcome broadcast to seeds, data script

* Tests!

* Documentation

* Update docs with pictures

* User siteconfig/app config

* Adjust dropdown menu width to avoid wrap for Facebook button

* Add Facebook auth keys to SiteConfig properly

* Remove unnecessary VCR cassette

* Add omniauth facebook gem to vendor cache

* Use uid instead of email for nickname randomization

* Test fix, test for missing email in Facebook

* Update docs/backend/auth-facebook.md

Co-authored-by: Molly Struve <mollylbs@gmail.com>

* Typo fix!

* Don't default facebook auth settings to ApplicationConfig

Co-authored-by: Molly Struve <mollylbs@gmail.com>
2020-08-26 12:04:20 -04:00
rhymes
36358293ce
[deploy] Add foreign keys to models related to Organization (#9933)
* Add foreign keys to models related to Organization

* Fix specs

* Use on_delete: :cascade for listings -> organizations FK
2020-08-25 20:20:47 +02:00
Michael Kohl
1f66056f28
[deploy] Stop using ProfileField#active Part 2 (#9911)
* Remove ProfileField#active

* Add schema.rb
2020-08-24 13:13:51 +07:00
Emma Goto
34e5b68182
[deploy] Add ability to turn off reaction notifications in notification settings (#9435)
* Add ability to turn off reaction notifications in notification settings

* Rename article_reaction_notifications to react-Notifications

* Rename platform notification settings to general notification settings and add reactions toggle

* Fix new_reaction_worker_spec

Co-authored-by: rhymes <rhymes@hey.com>
Co-authored-by: Molly Struve <mollylbs@gmail.com>
2020-08-23 16:54:36 +02:00
Michael Kohl
b318b0a139
Add display columns to ProfileField (#9886)
Co-authored-by: rhymes <rhymes@hey.com>
2020-08-21 10:25:54 +07:00
rhymes
24b65c0c27
[deploy] Add relations and foreign keys between Podcast related models (#9888)
* Add proper relations and dependent clauses

* Add foreign key between podcast_episodes and podcasts
2020-08-20 16:53:53 +02:00
rhymes
99615705ca
[deploy] Add relations and foreign keys between Poll related models (#9854) 2020-08-20 11:14:54 +02:00
Raphael Noriode
30b3592488
[deploy] Listing endorsements: models setup (#9841)
* create listing endorsement model and write test to validate it

* create the classified_listing_endorsements table

* create model associations with seed data and test validations

* modify test and create more seed date for endorsement

* modify the model naming, changed seed data to become radomized and updated the test file

* remove unnecessary function
2020-08-20 11:13:44 +02:00
Michael Kohl
eff28766fc
[deploy] Migrate profile data (#9750)
* Add temporary Rake task for creating profile fields

* Fix problems after splitting branch

* Add profile migration Rake task

* Add unique index to profiles

* Add migration code to users

* Be smarter about updating profiles

* Update spec

* Update Bullet config

* Fix typo

* Change temporary rake task to data update script

* Re-add profile factory and update spec

* Change private declaration to make CodeClimate happy

* Update comment

* Drop validation in favor of DB default

* Update spec
2020-08-20 11:17:57 +07:00
rhymes
a86f4c83f2
[deploy] Add relations and foreign keys between HtmlVariant related models (#9846)
* Add inverse has_many relation betwen User and Ahoy::[Event|Visit
]

* Add FKs and proper relations to HtmlVariant models
2020-08-18 11:33:38 -04:00
rhymes
7c82487842
[deploy] Add missing foreign keys to DisplayAdEvent (#9786) 2020-08-17 16:46:40 +02:00
Michael Kohl
2b3242087c
[deploy] Start using profile model (#9724)
* Persist attribute_name for profile fields

* Update fields

* Add temporary Rake task for creating profile fields

* Update specs

* Fix problems after splitting branch
2020-08-17 09:57:50 +07:00
Molly Struve
b9d7202ec0
[deploy] Optimization:Migrate Final Small Table PKs to Bigints (#9706) 2020-08-11 15:51:54 -05:00
rhymes
d337f5ee41
[deploy] Add foreign keys to Ahoy models (#9636)
* Add foreign keys to Ahoy models

* Empty incorrect script

* Delete with SQL

* Moved cleanup script in #9710

* Trigger Travis correctly
2020-08-11 20:46:17 +02:00