Commit graph

108 commits

Author SHA1 Message Date
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
Mac Siri
7147428821 Update Rails version on README [ci skip] 2019-04-03 14:15:17 -04:00
rhymes
3a53d5797e Upgrade Rails to 5.2.3 (#1408) 2019-04-03 13:08:59 -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
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
Ben Halpern
490645ea92
Add sponsors to sponsors page and add sponsor order field (#2284)
* Add sponsorship page

* Fix schema

* dev => DEV
2019-04-01 18:24:47 -04:00
Ben Halpern
cc0e4b40dd
Allow orgs to be marked as sponsors (#2282)
* Allow orgs to be marked as sponsors

* Remove community sponsor condition
2019-04-01 16:41:25 -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
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
Abraham Williams
953c555c36 Switch fix-db-schema-conflicts to published version (#2161) [ci skip] 2019-03-21 14:52:49 -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
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
Ben Halpern
158640e3f0
Add originally published at migration (#2085) 2019-03-16 21:15:29 -04:00
Ben Halpern
e3760fc215
Add originally_published_at for more accurate crossposted info (#2076) 2019-03-16 18:11:39 -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
Anna Buianova
343f109c0f Optimize stories (#1988)
* Add db index to articles path

* Slight stories optimizations

* Select only needed fields for the flare tag

* Revert the last commit (to check builds)

* Return selecting only needed fields for tag
2019-03-12 16:38:22 -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
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
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
Ben Halpern
bce0b4fff6
Remove harsh video restriction and add video duration (#1811)
* Remove harsh video restriction and add video duration

* Fix video meta data and tests

* Modify video tests

* Rescue video duration fetch error

* Change log to puts in test
2019-02-16 17:42:44 -04:00
Ben Halpern
92b24a9978
Add html_variant split testing to /badge (#1763)
* Add /badge html_variant

* Fix some of the linting
2019-02-08 12:45:14 -04:00
Ben Halpern
71a419e5ee
Add profile_updated_at and github_repos_updated_at to avoid extra fet… (#1754)
* Add profile_updated_at and github_repos_updated_at to avoid extra fetches

* Fix variant_number issue

* Fix test
2019-02-06 20:39:15 -04:00
Ben Halpern
2d97a5d837
Improve performance for additional content boxes and tags index (#1750)
* Improve performance for additional content boxes and tags index

* Modify followed_articles endpoint with new classic article api
2019-02-06 16:50:35 -04:00
Ben Halpern
d7665fcc3f
Add comment template to post (#1692)
* add myself to the core contributors

* add comment template

* merge upstream

* make sure the template re-appears for top level comments after submission

* make interface admin only

* Adjust comment template form

* Fix merge conflicts

* Remove unnecessary comment template from json
2019-01-30 13:32:34 -05:00
Ben Halpern
7c7c39149c
Modify cache keys for well-trafficked views. (#1681)
* Add cache to sidebar sticky to make it stick longer

* Add last_article_at and last_comment_at

* Clean up schema.rb
2019-01-29 13:27:22 -05:00
Ben Halpern
47e8fbc9ec
Add feed_fetched_at for users to not refetch unnecessarily (#1555)
* Fix RSS issues by not refetching users as often

* Make rss fetch not forced in rake task

* Remove unnecesary schema line
2019-01-15 13:29:11 -05:00
Ben Halpern
d988bc71f9
Add reading time to articles (#1538)
* add comment template

* merge upstream

* Initial work

* make sure the template re-appears for top level comments after submission

* Small fix

* Fix git issues

* Account for missing reading times

* Add minimal score on sidebar

* Test for page to include min read

* rubocop cleanup

* Mess with test

* Add .to_i after score

* Modify search_score var
2019-01-14 15:58:33 -05:00
Andy Zhao
68807c6df7 Allow Organizations to Update Slug/Username (#1411)
* Close anchor tag typo

* Remove confusing message in profile

* Fix typo in spec

* Add old_slug and old_old_slug fields to org

* Test for check_for_slug_change method

* Add ability for orgs to change slug

* Update copy to match new org language

* Add redirect for organizations with old slugs

* Use less queries for handling org/user redirect

* Use consistent syntax for user creation

* Test for organization slug redirects

* Refactor user article redirect
2019-01-10 14:16:43 -05:00
Timothy Ng
84bd3a69d7 ApiSecret model for Developer API (#1369)
* Add ApiSecret model scaffold

* Add relationships between ApiSecret, User, Organization

* Add placeholder template to account tab

* Add description column to ApiSecrets

* Add very basic access token generation

* Add basic access token deletion

* Show access token on success flash

* Add placeholder message when user has no secrets

* Use cta style on token generation button

* Add presence validation for ApiSecret description

* Add ApiSecrets factory

* Add pundit policy for ApiSecret

* Nest form field within api_secret hash to allow rails strong params

* Use pundit to authorize ApiSecretController actions

* Add error message flash for ApiSecretsController actions

* Add specs for ApiSecretsController

* Add length validation to api secret description

* Flash model error instead of generic message on save failure

* Truncate ApiSecret factory objects descriptions to prevent validation error

* Remove length restriction on ApiSecret.description

* Use darker font color for token creation date

* Consolidate ApiSecret migrations
2019-01-08 12:30:54 -05:00
Mac Siri
bd4a81f539 Replace flipflop with sail migrations (#1361) 2018-12-18 16:48:17 -05:00
Mac Siri
06e0cbabbb Revert "Replace Flipflop with Sail (#841)"
This reverts commit 21870e805a.
2018-12-18 13:44:40 -05:00
Vinicius Stock
21870e805a Replace Flipflop with Sail (#841)
* Replace Flipflop with Sail

* Address PR comments

* Bump sail version to latest

* Bump Sail to latest version

* Move setting creation to config/sail.yml

* Bump Sail to latest version

* Use correct limit for cast_type in schema

* Update Sail's route
2018-12-18 12:42:30 -05:00
dependabot[bot]
f115cca714 Bump capybara from 3.10.0 to 3.12.0 (#1294)
* Bump capybara from 3.10.0 to 3.12.0

Bumps [capybara](https://github.com/teamcapybara/capybara) from 3.10.0 to 3.12.0.
- [Release notes](https://github.com/teamcapybara/capybara/releases)
- [Changelog](https://github.com/teamcapybara/capybara/blob/master/History.md)
- [Commits](https://github.com/teamcapybara/capybara/compare/3.10.0...3.12.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Update spec
2018-12-10 16:06:21 -05:00
Jibran Kalia
f569f33e4f [WIP] Really simple calculate reading time function (#1283)
* Really simple calculate reading time function

* Move parse_it so that the number of methods in MarkdownParser is at 20

* Added test and default value for reading time
2018-12-09 13:42:32 -05:00
Ben Halpern
6b96201265
[WIP] Allow mods to remove tags and send user notification (#1252)
* Initial tag adjustments

* Finalize tag adjustments and tag adjustments controller

* Fix schema.rb

* Finalize tag removal logic

* Adjust edge cases/tests for tag adjustment moderation

* Adjust tag adjustments spec
2018-12-04 16:45:32 -05:00
Michael Kohl
ffd24f791e Add Mastodon URL to profile (#1137) 2018-12-04 13:24:53 -05:00
Ben Halpern
651ab3ce35
Add point weights for tag follows (#1229)
* Add point weights for tag follows

* Adjust num articles to initially show up on home page

* Fix schema.rb

* Adjust follow policy spec

* Adjust dashboard styling for follow points form
2018-11-30 15:36:58 -05:00
Ben Halpern
db6232adf3
Add initial ios push notifications to server (#1207)
* Add initial push notification logic for iOS

* Adjust notification form css

* Clean up schema.rb

* Add mark-all-as-read functionality for ios notifications

* Update app/models/notification.rb

Fix `find` to `find_by`

Co-Authored-By: benhalpern <bendhalpern@gmail.com>
2018-11-27 17:40:43 -05:00
rhymes
915e2d77b6 Export articles/posts (#576)
* Add EditorConfig file for all editors

* Add article export service

* Add setting to request an export of all articles

* On the outside they are called posts

* Add articles exported email to mailer and service

* Refactor to one public method and test flags

* Trigger the export if it was requested and send the email

* Recreated migration file with generic export fields

* Rename fields and switch to a whitelist

* Refactor ArticleExportService into a more generic structure

* Rename articles_exported_email to export_email

* Fix notify mailer spec

* Rename Exporter::Exporter to Exporter::Service

* Remove commented out line

* Removed body_html, coordinates and updated_at from export

* Invert DJ config

* Update spec
2018-11-21 11:13:36 -05:00
Ben Halpern
115e52c748
Move follow and reaction aggregation into Notification model to avoid… (#1164)
* Move follow and reaction aggregation into Notification model to avoid re-compute

* Ugh. Fixing schema

* Update tests

* Skip some tests in notifications_spec
2018-11-20 15:00:21 -05:00
Andy Zhao
a1010201f2 Notifications part 2 (#1156)
* Remove stream and add new notification views

* Actually remove Stream

* Move followers query to async method

* Remove unused tests and fix query

* Try using without delay instead

* Add without delay and escape HTML

* Make all tests pending for now
2018-11-19 18:14:24 -05:00
Andy Zhao
2db2dd1e5a WIP Refactor/notifications (#1131)
* Add new columns to notifications table

* Remove stream from notifications and add new methods

* Turn off moderation comment notifications

* Add notifiable_type index to migration

* Stop creation of Stream-based notification model instances

* Add notification model create hooks

* Add badge achievement notification creation hook

* Fix some specs

* Add missing @ symbol

* Fix for tests and rename a few things

* forgot to uncomment code sigh
2018-11-19 16:09:02 -05:00
Ben Halpern
a1be99ebf0
Add reaction confirm/invalidate workflow for admins (#1134) 2018-11-16 18:53:36 -05:00
sidemt
62d8a33111 Add GitLab URL field to user profile (#1121)
* Add SVG file of GitLab icon

* Add gitlab_url column to users table

* Add gitlab_url to user model, controller and policy

* Add gitlab_url to views

* Add tests for gitlab_url
2018-11-15 16:09:35 -05:00
Ben Halpern
302e8f202d
Add HTML variants for cta optimization and other nav bar adjustments (#970)
* Add HTML variants for cta optimization and other nav bar adjustments

* Fix 1==1 non-random mistake

* Spruce up org call-to-action

* Change default text color

* Add html variant trial and success request specs

* Fix article sidebar caching issue

* One line adjustment

* Modify schema

* Add include ActionView::Helpers::TagHelper to user_tag_spec

* Modify follow_button to remove session context

* Dummy commit

* Change Edit Article to Edit Post

* Dummy commit

* Fix rubocop concerns

* Fix rubocop style
2018-10-22 17:03:57 -04:00
rhymes
1b60ee5009 Use timezone aware methods (#893)
* Use timezone aware datetime methods

* Use timezone aware date parse for GitHub issue tag

* Introduce a bit of chaos programming using Zonebie

Zonebie uses a random timezone to run tests, it's a really good way to see if the code is timezone dependent or not.

* Convert GitHub issue date as UTC
2018-10-18 16:26:29 -04:00
Ryan
95b2e181ff Add Medium URL to User's Profile (#943) 2018-10-18 11:39:39 -04:00