Commit graph

291 commits

Author SHA1 Message Date
Anna Buianova
4ef7635ae0 Don't make additional SQL query on remembering user (#2335)
* Don't save when remembering user on sign in (WIP)

* Specs for AuthorizationService
2019-04-08 10:12:19 -04:00
rhymes
a1787d0702 Fixed some Style/* rubocop violations (#2314)
* Fix Style/FormatString and Style/TrivialAccessors

* Fix Style/NegatedIf and Style/DoubleNegation

* Style/ClassAndModuleChildren is already enabled by default

* Fix Style/GlobalVars

* Group all style/ cops inside rubocop config file
2019-04-06 14:24:33 -04:00
Anna Buianova
1b9f2432f6 Conditional validations for user github_username and twitter_username #2061 (#2312)
* Conditional validation for usernames

* Allow nil, not blank for usernames
2019-04-05 11:35:26 -04:00
Ben Halpern
1552df98d2
Add ability for trusted users to suggest social copy for posts (#2306)
* Add ability for trusted users to suggest social copy for posts

* Fix schema

* Fix tests

* Fix test
2019-04-04 17:01:58 -04:00
rhymes
3a53d5797e Upgrade Rails to 5.2.3 (#1408) 2019-04-03 13:08:59 -04:00
Anna Buianova
509c11e86f New comment notifications to Active Jobs #1996 (#2287)
* Send new comment notification service + specs

* Call new comment notification service from the model

* Return to non-bang notifications create

* An ActiveJob for the new comment notifications

* Call comments notification ActiveJob from Notification
2019-04-03 11:38:30 -04:00
Anna Buianova
1a0d4667c5 Unique twitter and github usernames #2061 (#2255)
* Set github and twitter usernames to nil if they are blank

* Verify github and twitter username in the Admin::UsersController (just in case)

* Add unique indexs on users twitter_username and github_username
2019-04-02 18:16:29 -04:00
Ben Halpern
5cc1109de4
Conditionally run feed validation (#2292) 2019-04-02 17:48:53 -04:00
Anna Buianova
d1db3abc35 Optimize sign in: User (#2237)
* Unique index on users email, conditional user unique validations

* Only uniqueness validations are conditional
2019-04-02 17:12:35 -04:00
Anna Buianova
75a977172c Fix notifications about the new child comments (#2233) 2019-03-29 12:51:10 -04:00
Anna Buianova
4b02fe87a4 Optimize sign in: Identity #2061 (#2231)
* Add unique index to identity

* Conditional uniqueness validations on identities

* Remove redundant Identity specs
2019-03-28 16:10:23 -04:00
Anna Buianova
9c56e4413a Rubocop fixes (#2232)
* Enable ClassVars cop

* Enable Style/MultilineBlockChain cop

* Enable Style/SignalException

* Remove config parts matching with the default config

* Fix rubocop issue

* Moved cops that need to be fixed into the .rubocop_todo.yml
2019-03-28 07:35:17 -04:00
Lito
2ebd37aba2 Improved article slug generation (#2218)
* Improved article slug generation

Ruby on Rails has a built-in slug generator since Rails 2.2

This generator fix the slug generation when non english characters are used on title improving SEO. For example: https://dev.to/lito_ordes/redimensionando-imgenes-en-tiempo-de-ejecucin-con-packer-57c6

* Ruby on Rails has a built-in slug generator since Rails 2.2

This generator fix the slug generation when non english characters are used on title improving SEO. For example: https://dev.to/lito_ordes/redimensionando-imgenes-en-tiempo-de-ejecucin-con-packer-57c6

* Ruby on Rails has a built-in slug generator since Rails 2.2 

This generator fix the slug generation when non english characters are used on title improving SEO. For example: https://dev.to/lito_ordes/redimensionando-imgenes-en-tiempo-de-ejecucin-con-packer-57c6

* Ruby on Rails has a built-in slug generator since Rails 2.2

This generator fix the slug generation when non english characters are used on title improving SEO. For example: https://dev.to/lito_ordes/redimensionando-imgenes-en-tiempo-de-ejecucin-con-packer-57c6

* Ruby on Rails has a built-in slug generator since Rails 2.2 

This generator fix the slug generation when non english characters are used on title improving SEO. For example: https://dev.to/lito_ordes/redimensionando-imgenes-en-tiempo-de-ejecucin-con-packer-57c6

* Fix downcase transform on event model
2019-03-26 13:39:35 -04:00
Mario See
91968e3860 block/report abuse in dev-connect (#2074)
* block chat method

* block and report buttons

* styling

* more styling

* add id redirect

* remove whitespace

* authorize channel in block_chat method

* remove trailing whitespace

* make variable local

* validate using policy

* check channel direct

* fix comparison in chat_channel model

* fix channel variable
2019-03-26 11:53:30 -04:00
Ben Halpern
50c765ed10
Add several recommended tags for onboarding (#2217) 2019-03-26 10:51:36 -04:00
Anna Buianova
e1968e815b Extract new reaction notification to ActiveJob (#2122) 2019-03-25 13:54:21 -04:00
Abraham Williams
9cb40e546b Enables Rails cops (#2186)
* Enable Rails cops

* Fix Rails/DynamicFindBy

* Fix Rails/HttpStatus

* Fix Rails/Blank

* Fix Rails/RequestReferer

* Fix Rails/ActiveRecordAliases

* Fix Rails/FindBy

* Fix Rails/Presence

* Fix Rails/Delegate

* Fix Rails/Validation

* Fix Rails/PluralizationGrammar

* Fix Rails/Present

* Fix Rails/Output

* Fix Rails/Blank

* Fix Rails/FilePath

* Fix Rails/InverseOf

* Fix Rails/LexicallyScopedActionFilter

* Add Rails/OutputSafety to TODO

* Add Rails/HasManyOrHasOneDependent to TODO

* Add Rails/SkipsModelValidations to TODO
2019-03-25 09:25:55 -04:00
Jess Lee
1b0cb47916 Merge user and give pro users trusted role (#2176)
* remove pro privelges from other roles and add trusted role for pros

* add merge user routes and methods

* add specs

* add more specs

* update languauge on /internal for clarity

* fix code climate error
2019-03-22 16:20:31 -04:00
Ben Halpern
7f27aa32c7
Add areas for DEV Shop displays on left sidebar (#2162)
* Add areas for DEV Shop displays

* Update display_ad spec

* Add organization to spec

* Add orgs to specs properly
2019-03-22 09:57:37 -04:00
cyrillefr
a2fcbdc4a4 Enable performance rubocop cops (#2140) 2019-03-21 16:01:45 -04:00
rhymes
116d6b3278 Replace puts with proper logging (#2139) 2019-03-21 13:00:21 -04:00
Tim Lange
3494264404 Enabled rubocop/lint (#2130)
* WIP: Enabled rubocop/lint

* FIX: Fixed failing test

* FIX: Small change to return

* FIX: Changed indent
2019-03-21 10:53:44 -04:00
Anna Buianova
f0e9c0cfef Extract sending new follower notification to a separate job (#2030) 2019-03-20 12:51:09 -04:00
Ben Halpern
91bd6322ad
Add organic page view sums and modify seo boostables (#2109)
* Add organic page view sums and modify seo boostables

* Add score minimum for SEO boostable
2019-03-19 09:32:26 -04:00
Anna Buianova
825128edc4 Fix reaction notification json data when a reaction is destroyed (#2112)
* Add specs for notification sending when a destroyed reaction is passed

* Keep only persisted reactions data in the notification
2019-03-19 08:34:24 -04:00
Jess Lee
9c1e10cd9f Improve Internal Dashboards features(#2043) 2019-03-18 16:29:11 -04:00
Ben Halpern
2b2ecaa115
Add proper css vars to user style config (#2105) 2019-03-18 15:22:23 -04:00
Keshav Biswa
8d57d45ecc Rubocop Style cops enabled (#2056)
* Rubocop enabled style/alias

* Enabled Style/ArrayJoin Cop

* Enabled Style/Attr

* Enabled Case Equality

* Enabled CharacterLiteral

*  Enabled ColonMethodCall Cop

* Enabled CommentAnnotation cop

* Enabled PreferredHashMethods Cop

*  Enabled DoubleNegation Cop

* Enabled EachWithObject Cop

* Enabled EmptyLiteral Cop

* Enabled EvenOdd Cop

* Enabled IfWithSemicolon Cop

* Enabled Lambda and LambdaCall Cop

* Enabled LineEndConcatenation Cop

* Enabled ModuleFunction Cop;

* Enable NegatedIf and NegatedWhile Cop

* Enabled NilComparison Cop

* Enabled Not Cop

* Enabled NumericLiterals Cop

* Enabled OneLineConditional Cop

* Enabled PercentLiteralDelimiters Cop

* Excluded internal/users_controller from negated_if cop

* Reverted the double negation change from github_issue_tag and github_issue.rb"

* Enabled PerlBackrefs Cop

* Changed Regexp.last_match(1) to Regexp.last_match(0)

* Enabled proc cop

* Enabled RaiseArgs Cop

* Reverted Regexp.last_match(0) to Regexp.last_match(1)

* Enabled SelfAssignment Cop

* Enabled SingleLineMethods Cop

* Enabled SpecialGlobalVars Cop

* Enabled VariableInterpolation Cop

* Enabled WhenThen Cop

* Enabled WhileUntilModifier Cop

* Enabled WordArray Cop

* Enabled IfUnlessModifier Cop

* Enabled GuardClause Cop
2019-03-15 18:33:54 -04:00
Mario See
d8709c0334 Implement open inbox for dev-connect (#1563) 2019-03-15 14:39:57 -04:00
Ben Halpern
d6ab255a45
Allow users to configure to use night mode (beta) and sans-serif article body (#2072)
* Initial work for config

* Add config for users

* Fix schema
2019-03-15 13:11:53 -04:00
Andy Zhao
f93af16fbe Remove notifications when banishing and deleting a user (#2039)
* Make remove_notifications a public method

* Remove notifications when banishing or deleting
2019-03-13 17:54:47 -04:00
Anna Buianova
96de5a4f60 Don't send new follower notification when followable is a tag #2041 (#2050)
* Enable djs to confirm follow spec fail

* Don't send new follower notification when followable is a tag
2019-03-13 08:16:20 -07:00
Ben Halpern
825aa9be91
Add page_view model (#1985)
* Add page_view model

* Uncomment DJ routes

* Add time on site max and don't update article page views every time
2019-03-07 11:53:33 -08:00
Andy Zhao
d94f11fbf7 Add ability to add pro role to internal (#1980)
* Add ability to add pro role in internal

* Remove debug statement
2019-03-05 10:44:56 -08:00
Anna Buianova
0ac8eb1f73 Make less queries when displaying articles flare tags (#1957)
* Make less queries when displaying flare tag

* Make less sql queries to display articles flare tags
2019-03-05 07:27:51 -08:00
Ben Halpern
fd83b33603
Add shecoded template to v2 (#1972) 2019-03-04 12:41:37 -08:00
Ben Halpern
8d0f0946a0
Basics of pro dashboard (#1971) 2019-03-04 12:10:09 -08:00
Andy Zhao
b157190ef0 Add missing data for org milestone notifications (#1939)
* Remove duplicate line

* Add missing json_data for org notifications
2019-03-01 13:42:38 -08:00
Andy Zhao
8b8dbd0172 Add Milestone Notifications (#1920)
* Test milestone notifications

* Add initial milestone notifications

* Add extra milestone goalposts

* Move send reaction milestone

* Use proper twilio-video package version

* Add random giphys gifs to milestones

* Make images responsive and add addl gifs

* Add guard statement for older articles

* Update app/views/notifications/_milestone.html.erb

Link to Giphy page instead of source page

* Generate gifs via class and factor in aspect ratio

* Add border radius to gifs

Co-Authored-By: Zhao-Andy <andyzhao.zhao@gmail.com>
2019-03-01 12:25:45 -08:00
Mario See
16a8aaa6f3 quick exit if comment is on podcast ep (#1931)
via andy's suggestion
2019-02-28 13:33:27 -08:00
Ben Halpern
532903c688
Add experience level averaging to articles (#1922)
* Add experience level averaging to articles

* Adjust copy on /mod ratings page
2019-02-28 08:17:29 -08:00
Ben Halpern
59cf1e5852
Add missing CloudinaryHelper inclusion in HtmlVariant (#1923)
* Add missing CloudinaryHelper inclusion in HtmlVariant

* Add test
2019-02-28 06:57:05 -08:00
Anna Buianova
8d60177d45 Remove old methods from reactions #1621 (#1924)
* Remove old methods from reactions

* Return the needed Reaction methods
2019-02-28 06:50:29 -08:00
Anna Buianova
875114395c Fix delayed job errors related to reactions #1621 (#1883)
* Add delayed_job_web to dev environment for debugging

* Add specs for the current Follow callbacks implementation

* Move follower touching to ActiveJob

* Spec for the touch followers job

* Move Follow#create_chat_channel to ActiveJob and make the job safe

* Add ActiveJob to send email notifications about follows

* Enqueue SendEmailNotificationJob after the follow is created

* Specs to wnsure jobs are enqueued on Follow creation

* Make CreateChatChannelJob queue name more specific

* Reaction specs for Reaction after_save callbacks logic

* Touch user job

* Call Users::TouchJob on reaction create

* Move updating reactable to a separate job

* Move busting reactable cache to a separate job

* Bust homepage cache after reaction save in a separate job

* Spec for enqueueing Users::TouchJob on reaction create

* Refactor Reactions::UpdateReactable job

* Fix observer spec
2019-02-27 16:19:01 -08:00
Anna Buianova
32b20c6d95 Remove unused Follow methods (#1915) [ci skip] 2019-02-27 10:38:30 -05:00
Andy Zhao
5ace9a5fc9 Organization Notifications (#1762)
* Add spec for org reaction notification

* Add organization_id to notifications

* Add validations for user and org IDs

* Move comment json_data out of loop

* Use actual column names instead

* Add organization filters

* Remove extra text-align

* Add organization filtering

* Refactor to reduce complexity

* Add receiver argument to handle orgs

* Add has_many notifications for orgs

* Add follow notifications for orgs

* Add comment notifications for orgs

* Rename some tests for specificity

* Add mark org notifications as read functionality

* Add radix to parseInt

* Define json_data outside of loop

* Notify org followers of a new post as well

* Move test to proper location

* Add test for aggregated method

* Make send org reaction notification more readable

* Test the rest of the notification model

* Refactor tag adjustment spec

* Fix extra html
2019-02-25 14:25:37 -08:00
Anna Buianova
e45c61a308 Bust cache on article destroy instead of resave articles #1621 (#1801)
* Bust cache on article destroy instead of resave articles

* Change articles delayed job queue
2019-02-23 19:41:06 -08:00
Anna Buianova
58b2013377 Fix delayed job errors related to follows #1621 (#1835)
* Add delayed_job_web to dev environment for debugging

* Add specs for the current Follow callbacks implementation

* Move follower touching to ActiveJob

* Spec for the touch followers job

* Move Follow#create_chat_channel to ActiveJob and make the job safe

* Add ActiveJob to send email notifications about follows

* Enqueue SendEmailNotificationJob after the follow is created

* Specs to wnsure jobs are enqueued on Follow creation

* Make CreateChatChannelJob queue name more specific
2019-02-23 18:16:20 -08:00
Ben Halpern
5eab8d4962
Modify fetch_video_duration to use m3u8 chunks (#1814)
* Modify fetch_video_duration to use m3u8 chunks

* Remove ffprober gem
2019-02-16 22:29:56 -04:00
Ben Halpern
5d1370c3b4
Add padding to video duration (#1812)
* Add proper padding in video_duration_in_minutes

* Add proper padding in video_duration_in_minutes

* Remove ffmpeg from travis for now
2019-02-16 19:31:58 -04:00