Commit graph

1040 commits

Author SHA1 Message Date
Michael Kohl
cfe288d8cc
[deploy] Start ignoring group column for profile fields (#10045)
* Start ignoring group column for profile fields

* Fix specs

Co-authored-by: mstruve <mollylbs@gmail.com>
2020-08-31 10:16:37 +07:00
rhymes
ba8b3dd443
[deploy] Add missing dependent clauses to User and cleanup relations (#10011)
* Add dependent: :destroy relation to user.notes

* Add cleanup script for orphaned notes

* Reorder relations and reorganize specs in User

* Update specs as notes are not needed after a user is deleted

* Tweets can just be nullified

* Add other cleanup scripts

* Tell the specs we keep tweets

* Fix comments

* Keep page_views and rating_votes when a user is deleted

* Fix specs
2020-08-28 20:19:24 +02:00
rhymes
c9e401758a
[deploy] Add dependent clauses to Article and fix Comment validation (#9990)
* Add dependent clauses to Article model

* Comment should be valid without a commentable

* Add cleanup scripts

* Cache the comments ids before destroying the article

* Add dependent clause to Article.user_subscriptions as well

* Fix specs
2020-08-28 18:24:28 +02:00
Ben Halpern
0dd04ea45a
Create initial "register by email and password" beta/MVP in prep for "setup mode" (#10039)
* Modify registrations controller

* A bit of progress

* More work

* a bit pf progress on confirmation emails

* Get basic functionality in place

* Remove comments

* First basic test

* Add tests

* Fix code styles

* Remove sessions spec

* Remove sessions spec

* Remove extra markup
2020-08-28 09:46:56 -04: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
Molly Struve
a7928838f4
[deploy] Optimization:Break Github Repo Updates into Individual Sidekiq Jobs (#10040) 2020-08-27 16:01:36 -05: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
Molly Struve
c2f2a02676
Bug Fix:Dont Kill Entire Job When User is Missing a Github Identity (#10030) 2020-08-26 19:58:46 -04:00
Jacob Herrington
2c645c9ace
Allow greater flexibility for footer mascot image (#10004)
* Allow greater flexibility for footer mascot image

This change allows admins to set a footer mascot image of any dimension
and manage the forced dimensions in their site config options.

* Update site config copy based on PR feedback
2020-08-26 12:33:52 -04: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
Molly Struve
0947256f13
[deploy] Refactor:Fetch New Github Repos From Sidekiq Cron (#9986) 2020-08-25 12:42:33 -05:00
Ridhwana
b0bacf60fb
Profile Fields Admin UI v2 (#9830)
* feat: add a select and a new text field

* feat: groups need to be unique and present

* feat: make the ui a little better

* chore: update the label

* chore: just present

* feat: add some js ( still a work in progress)

* feat: update the interface to work better :)

* chore: indent

* feat: make sure the toggles work

* chore: rename more aptly

* refactor: toggling pulled out into two functions

* refactor: move group form to a partial so that we can reuse it

* chore: move the js to the group form

* chore: update alignment and nav element

* chore: update text

* chore: update specs
2020-08-25 17:39:12 +02:00
rhymes
66b5cb513f
[deploy] Add dependent clauses to relations for Organization and add cleanup scripts (#9932)
* Add dependent clauses to has_many relations in Organization

* Add cleanup scripts

* Update script

* Destroy organizations listings

* Update lib/data_update_scripts/20200822082229_remove_orphaned_notifications_by_organization.rb

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

Co-authored-by: Molly Struve <mollylbs@gmail.com>
2020-08-24 19:35:02 +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
Michael Kohl
5e59f7b79d
[deploy] Stop using ProfileField#active Part 1 (#9910)
* Stop using ProfileField#active

* Fix specs
2020-08-24 11:55:53 +07:00
Mac Siri
76de9a0317
[deploy] Replace #cloudinary with #optimized_image_url (#9876) 2020-08-21 14:46:00 -04:00
Vaidehi Joshi
9e40e68682
Allow Nginx cached static content to be purged (#9857) [deploy]
* Only bust_fastly_cache if fastly is enabled

* Conditionally bust nginx cache from CacheBuster#bust

* Don't _actually_ call out to openresty

* Remove redundant check for FASTLY_API_KEY in CacheBuster

* Clean up and add a spec

* Do not call .purge_ methods if fastly is not configured

* Add OPENRESTY_ ENV vars to .env_sample

* Remove extra / prepending path

* Remove ConfigurationError, clean up Purgeable concern

* Use raise instead of fail like fastly-ruby

* No longer check for Rails.env.production?

* Use let! to create article in BustMultipleCachesWorker spec
2020-08-21 09:31:23 -07: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
Ben Halpern
36ccfd55dd
[deploy] Add Twitter and GitHub keys to SiteConfig (#9899)
* Add Twitter and GitHub keys to SiteConfig

* Change docs

* Add notice about not taking affect right away
2020-08-20 15:58:15 -04: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
Michael Kohl
b3e7384e24
[deploy] Automatically refresh profile accessors (#9843)
* Rename method

* Add ProfileFields::Add service

* Add ProfileFields::Remove service

* Use remove_method instead of undef_method

* All hail undef_method
2020-08-19 21:25:59 -04:00
Ben Halpern
e76f6cbbba
Set Stripe dynamically instead of at boot (#9862)
* Set Stripe dynamically instead of at boot

* Add stripe SiteConfig

* Fix capitalization
2020-08-19 21:24:19 -04:00
Molly Struve
437a9b2d5f
[deploy] Optimization:Locally Cache any_admin? For User Instance (#9879) 2020-08-19 17:12:34 -05:00
Ben Halpern
986eb87ce8
[deploy] Remove unneeded Analytics update script (#9852)
* Remove unneeded Analytics update script

* Remove constants
2020-08-19 15:57:27 -04:00
Ben Halpern
6c71369df5
[deploy] Add community_name to site config (#9864)
* Add community_name to site config

* Fix a spec

* Remove SiteConfig from constants

* Change subjects to method

* Fix subjects method

* Fix linting
2020-08-19 14:54:40 -04:00
Ben Halpern
83ab44c75b
Allow staff_user_id to be modified (#9869) 2020-08-19 13:33:17 -04:00
rhymes
7e3c4413e7
Rubocop: Fix ListingCategory has_many relation to Listing (#9853)
* Rubocop: Fix ListingCategory has_many relation to Listing

* Trigger Travis correctly
2020-08-19 19:23:49 +02:00
Ben Halpern
f452086280
[deploy] Move community_copyright_start_year to SiteConfig (#9863)
* Move community_copyright_start_year to SiteConfig

* Properly translate year to string

* Change year logic

* Add env default to copyright year

* Fix logic

* Fix codeclimage issue

* Add view element

* Add constants in properly and use dynamic date
2020-08-19 10:19:11 -04:00
Brunno Souza
5b7db97336
Reduce arguments method buff! at model buffer_update (#9793)
* Reduce arguments method buff! at model buffer_update

* Rename args and remove brackets as suggested

* Remove unnecessary args and improve buffer class

* Change constant name at buffer update and how call them
2020-08-18 19:42:01 +02: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
f5d35c6506
Rubocop: Enable and fix Style/StringConcatenation (#9844) 2020-08-18 14:50:15 +02:00
ludwiczakpawel
877bdba176
Typography fix & Optimization (#9650)
* flare tag line height

* .

* dropdown fix + actions bar fix

* actions bar on mob

* fixing typography and improving font handling

* cleanup

* variables naming

* fonts swapping

* Makes user's default font render as SiteConfig.default_font

* Trigger checks

* Fixes missing user model specs

* Fixes storybook CI error import & logged out user font set with default

* Limits default_font config to serif, sans-serif & open-dyslexic

* Default font description text

Co-authored-by: Fernando Valverde <fdov88@gmail.com>
2020-08-18 08:05:51 -04:00
Fernando Valverde
5342602298
Social Auth generalization refactor (#9837)
* Add gem omniauth-apple

* Integrate omniauth-apple

* Integrate callback

* Add fields

* Add tests, fix bugs and make it all work

* Show only enabled providers for the current user

* Add default profile image for Apple

* Remove localhost patch

* Bring over the changed Apple username if the user changes it

* More specs fixed

* Incorporate feedback from PR

* Fix specs

* Simplify code and fix spec

* Fix Broadcast generators to take into account the new provider

* Fix spec

* Generate a truly unique apple_username

* Fix user specs

* Add omniauth-apple-0.0.2 to vendor cache

* Fix merge conflict and spec

* Update VCR fastly sloan cassette

* Revert "Generate a truly unique apple_username"

This reverts commit 2462875575b0bbd6b3c1d56b25afcd3189671608.

* Fix user specs

* Fix specs

* Fix specs

* Hide Connect Apple button behind a feature flag

* Revert "Hide Connect Apple button behind a feature flag"

This reverts commit 105bde0373389a4eb9b6e948f60734c7e0e99cba.

* Fix line lengths

* Fix spec

* ES tag

* CSRF bypass for Apple callback

* custom user_nickname in Apple provider with small tweaks + omniauth-apple bump

* Fixes username specs

* Makes Apple users default image Users::ProfileImageGenerator

* Fallback to mascot_image_url in test environment to avoid breaking Travis

* Fixes Apple CSRF error + makes default nickname more readable

* Trigger Travis

* Removes CSRF Apple fix from Omniauth callbacks

* Removes Envfile

Co-authored-by: rhymes <rhymesete@gmail.com>
Co-authored-by: rhymes <rhymes@hey.com>
2020-08-17 20:09:44 -04: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
Mac Siri
a081810946
[deploy] Migrate ImageResizer to Images::Optimizer (#9720) 2020-08-14 09:44:30 -04:00
rhymes
0f6baaf4ba
[deploy] Remove orphaned DisplayAdEvent rows (#9765)
* Remove orphaned DisplayAdEvent rows

* Add dependent in the has_many relationship between ads and ad events
2020-08-14 09:29:08 -04:00
Steven Wu
1896c707fc
Refactoring constants reduce lines (#9729)
* Refactoring constants reduce lines

* Update constants name

* Fix typo
2020-08-11 16:33:10 +02:00
Michael Kohl
2555de8a5f
Add profile model (#9648)
* Create profiles table

* Add store_attribute gem

* Add profile model

* Add default value to data column

* Add and update factories

* Add cascading delete

* Make field non-nullable

* Add specs

* Fix cascading delete for profiles
2020-08-11 10:15:22 +07:00
rhymes
085c60992b
Rubocop: Enable and fix Style/OptionalBooleanParameter cop (#9711)
* Enable and fix Style/OptionalBooleanParameter cop

* Keep regular parameters for workers

* Keep regular parameters for workers

* Fix spec

* Trigger Travis correctly
2020-08-10 19:35:55 +02:00
Molly Struve
a16fc46f84
[deploy] Revert "Async Handle Notifications for Comments When Saved (#9680)" (#9686)
This reverts commit 852223dd86.
2020-08-08 20:16:27 -05:00
Molly Struve
852223dd86
[deploy] Async Handle Notifications for Comments When Saved (#9680) 2020-08-08 17:59:17 -05:00
Andy Zhao
1e21815ce7
[deploy] Add new support admin role (#9681)
* Add new support admin role

* Allow support admins to banish users

* Fix spec order for new support admin role
2020-08-07 22:52:13 -04:00
Ridhwana
a191fd2ca7
[deploy] Profile Admin UI Setup Screen Refactor (v1.5) (#9649)
* implement some suggestions from https://github.com/forem/forem/pull/9610

* chore: update the errors based on suggestions

* feat: make query readable on blazer
2020-08-07 17:35:18 -04:00
rhymes
b6e0723031
Fix Rails/HasManyOrHasOneDependent for Broadcast and Collection (#9662) 2020-08-07 14:27:24 -04:00
Mac Siri
3c5b01d490
[deploy] Implement ImageResizer module (#9652)
* Create ImageResizer module

* Refactor HtmlVariant

* Refactor CloudCoverUrl

* Fix broken spec

* Refactor PodcastEpisode

* Refactor Message

* Fix broken spec

* Refactor Articles::SocialImage

* Refactor ProfileImage & add spec

* Fix broken spec
2020-08-07 11:04:31 -04:00
Brunno Souza
00b9d0ea12
Refactoring ChatChannel - distributing into services (#9253) 2020-08-07 10:41:34 +02:00
Alex
c988481004
[deploy] Cleanup preferred_languages language_settings for users (#9641)
* Cleanup language settings for users

* Remove logic for old language format

* Make preferred_langagues_array.include? nil safe
2020-08-06 10:00:01 -04:00