Commit graph

29 commits

Author SHA1 Message Date
Fernando Valverde
8c836430ca
API V1 transition (#17835)
* API Articles v0-v1 restructure

* Remove unused helper

* Bulk move API controllers into concerns + add V1 controllers

* Extract API routes + some fixes

* Fix v1 api_controller authenticate! + add more article_controller specs

* Completed spec/requests/api/v1/articles_spec.rb

* specs up to listings

* All v1 specs except for 9 skips

* mime_types cleanup + authenticate! relocation

Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
2022-06-23 14:26:00 -06:00
Michael Kohl
b22ad4c976
Remove Doorkeeper from API (#15750)
Co-authored-by: Dan Uber <dan@forem.com>
2021-12-16 09:57:26 -06:00
Michael Kohl
08d82e7256
Profile generalization: cleanup (#12947)
* Remove hardcoded instances of education field

* WIP Access display_email_on_profile via User Settings

* Remove unused profile column

* WIP Fix reference to bg_color_hex and text_color_hex

* WIP fix issues revealed by systems specs

* WIP fix issues revealed by services specs

* WIP Fix failing tests

* WIP Fix spec failures

* wip

* Move two attributes from controller to decorator

* Update comment

* Match user settings changes

* More consistently use user.tag_line

Even before the profile changes we sometimes used the user.summary
attribute directly but used the user.tag_line method in other places.

* Remove delegation, rename inline concern

* Drop profile columns from users table

* Remove duplicated work display from header

* Update work profile field handling

* Update DUS + spec

* Delegate more carefully

* Update delegation guard

* Adapt for removed delegation

* Undo accidental schema changes

* Fix seeds

* Remove accidentaly change

* Fix User#processed_website_url

* Update guard clause

* Update profile card content

* Add Organization#profile

* Be more conservative with profile fields

* Spec fixes round 1

* Fix typo

* Update spec

* Limit number of header fields and update card content

* Decorate correct model

* Update factory

* Update schema.rb

* Fix validation

* How bad could this possibly be?

* Pretty bad, nevermind

* Remove obsolete code

* Reset profile fields during test runs

* Move profile fields back to before(:suite)

* Spec fixes

* Remove accidentally re-added files

* More spec fixes

* Specs

* Change User#tag_keywords_for_search

* More spec fixes

* Add comment

* Undo accidental schema changes

* Attempt spec fix

* Remove fix attempt

* Fix e2e test

* Update spec

* Remove guard clause

* Remove hardcoded instances of education field

* WIP Access display_email_on_profile via User Settings

* Remove unused profile column

* WIP fix issues revealed by systems specs

* WIP fix issues revealed by services specs

* WIP Fix failing tests

* WIP Fix spec failures

* wip

* Move two attributes from controller to decorator

* Update comment

* More consistently use user.tag_line

Even before the profile changes we sometimes used the user.summary
attribute directly but used the user.tag_line method in other places.

* Remove education

* Add comment

* WIP

* Clean up mostly_work_with

* WIP

* Update work profile field handling

* More work-related changes

* Remove settings_only from display_area enum

* Remove quickfix from _metadata partial

* Remove special attributes

* Remove leftover spec

* Retrieve location from profile, not user

* Profile.special_attributes no longer exists

* Update specs

* More spec fixes

* Update UsersController

* Update UsersController and spec

* Fix e2e seeds

* Minor cleanup

* More e2e seed fixes

* Fix profile field CSV

* Fix e2e seeds

* Move one more attribute in e2e seeds

* Remove duplicate line

* Clear inputs before typing in them

* Fix formatting issues

* Profiles::Update -> Users::Update

* Remove RegistrationsController#resolve_profile_field_issues

* Fix schema.rb

* More cleanup

* Fix specs

* Fix remaining spec

Co-authored-by: Jacob Herrington <jacobherringtondeveloper@gmail.com>
2021-08-20 16:36:02 +02:00
Jean-Francis Bastien
9ff7f82664
[deploy] API - New endpoint to retrieve the articles in the reading list of the authenticated user (#10540) 2020-10-14 13:20:03 -05:00
Ben Halpern
da6a6739e5
[deploy] Invite users to join and create password (#9294)
* Initial invitation work

* Add more invitation code

* Add proper registration page

* Fix up tests

* Fix failings

* Fix spec

* Add self-serve auth config

* Add registered condition

* Change profile image call and registered_at test

* Change comment

* Fix copy test

* Stub emojipedia

* Linting

* Add registered at to factory

* Ensure registered for user tag

* Update app/views/internal/invitations/index.html.erb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Update app/controllers/internal/invitations_controller.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Slight changes

* Update recover password flow

* Update app/views/internal/invitations/index.html.erb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Update app/controllers/internal/invitations_controller.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Update db/schema.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>
2020-07-15 11:37:19 -04:00
rhymes
1166370818
Rubocop: activate Layout/ClassStructure (#9304) 2020-07-14 18:28:18 +02:00
Michael Kohl
244ab297c8
Move user following suggestions to internal API (#6601) [deploy] 2020-03-13 13:37:24 +01:00
Ben Halpern
d0dd79ac29
Make sure profile images show up in onboarding (#6134) [deploy] 2020-02-17 20:19:06 -05:00
rhymes
fd5643bc9d
Improve API controllers efficiency by selecting only columns needed for serialization (#5805) [deploy] 2020-02-06 07:36:56 -05:00
rhymes
2d6df70dea Return an empty result set instead of 404 in case users are not available. (#5238)
A common response in collection endpoint with REST APIs is to return an empty result set when the requested params end up in an empty result. The reason for this is that the resource itself exists (the collection always exists), it just is empty.

See https://github.com/thepracticaldev/dev.to/pull/5192
2019-12-24 13:08:10 -05:00
Molly Struve
212a2a430d Return not_found response if we cant return users via the api (#5192) 2019-12-20 13:43:14 -05:00
Anna Buianova
3c49073c2b Limit access to the API actions when authorized by doorkeeper token (#4170) 2019-10-02 13:17:47 -04:00
Mac Siri
3b32b29937 Update core API endpoints to support access_token (#3644)
* Update specs for doorkeeper test

* Add bang

* Create #authenticate

* Create /api/articles/ endpoint

* Update specs

* Update me.json.jbuilder

* Fix typo and spacing

* Support pagination for #me

* Update #authenticate! to support cookies

* Make per_page a param

* Disable method-complexity check

* Enable refresh_token

* Create /api/users/me endpoint
2019-08-08 15:55:23 -03:00
rhymes
ff929fcf14 Some small performance improvements (#2876)
* Improve a few idioms with their faster counterparts

* Remove unused routes and some dead code

* Add the option to use bullet in testing mode and move rack host redirect

* Go back to the classic fetch to make mocking work

* Reorder gems and fix code climate issue
2019-05-20 18:53:31 -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
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
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
rhymes
e588fa7ece Code cleanups (#659)
* Initial automatic cleanup with rubocop

* Fix syntax error introduced by rubocop

* Cleanup seeds file

* Cleanup lib folder

* Exclude bin folder because it contains auto generated files

* Make Rubocop a little bit more chatty

* Block length should not include comments in the count

* Cleanup config folder

* Cleanup specs

* Updated Rubocop version and generated a todo file

* Fix broken ArticlesApi spec

* Fix tests

* Restored rubocop pre-commit hook
2018-08-07 11:00:13 -04:00
Ben Halpern
94e5154668
Add initial invitation framework for chat channels (#528)
* Add initial invitation framework for chat channels

* Update chat_channel specs

* Add DIY concept of accepting invite

* Add some js and fix spec

* Add full invite accept functionality

* Remove console.log from chat
2018-07-02 16:31:20 -04:00
Ben Halpern
03e4f6531f
Add a few tests and fix user tag color bug (#482) 2018-06-22 10:22:53 -04:00
Ben Halpern
fb20b8adf7
Add content sidecar for chat (#413)
* Rearchitect chat channel subscriptions

* Add browser push notifications (attempt)

* Add content sidecar for chat

* Add live code basics

* Add content features to chat

* Fix chat_channels test
2018-06-11 11:00:51 -04:00
Mac Siri
923e1acbda Create Suggester service object (#372)
* Create Suggester::Article::Boosted

* Fix lint & Remove .compact

* Expand Suggester service-object WIP

* Create Suggester::Users

* Remove ClassicArticle

* Replace old refactored classes

* Move Suggester specs into appropriate folder

* Fix broken spec & Fix lint

* Fix lint

* Fix lint

* Fix broken code
2018-06-08 17:17:20 -04:00
Ben Halpern
e713710c4c Fix who to follow issues 2018-05-01 11:36:35 -04:00
Andy Zhao
d6e3344da7 [Updated] Suggested Follows Sidebar (#240)
* MVP of follow sidebar

* Prettier linted stuff

* More prettier lint

* Load only one widget

* fix github issue comment liquid tag (#242)

* Adjust Flatiron school copy/link (#241)

Per Flatiron School request, updating the homepage copy and link

* Add sticky sidebar to article show page (#243)

* Add sidebar sticky elements

* Add sticky sidebar to article show page

* Add saved changes check to user

* Fix missing CSS variable in sticky nav file

* Add date joined as default summary

* Remove accidentally-included file

* Add check for published on article sidebar

*  Fix styling issues on side nav (#244)

* Add sidebar sticky elements

* Add sticky sidebar to article show page

* Add saved changes check to user

* Fix missing CSS variable in sticky nav file

* Add date joined as default summary

* Remove accidentally-included file

* Add check for published on article sidebar

* Fix styling issues on side nav

* Ben/article show redesign (#245)

* Add sidebar sticky elements

* Add sticky sidebar to article show page

* Add saved changes check to user

* Fix missing CSS variable in sticky nav file

* Add date joined as default summary

* Remove accidentally-included file

* Add check for published on article sidebar

* Fix styling issues on side nav

* Modify article order

* Fix issue in side bar

* Fix issue in side bar

* Ben/article show redesign (#246)

* Add sidebar sticky elements

* Add sticky sidebar to article show page

* Add saved changes check to user

* Fix missing CSS variable in sticky nav file

* Add date joined as default summary

* Remove accidentally-included file

* Add check for published on article sidebar

* Fix styling issues on side nav

* Modify article order

* Fix issue in side bar

* Fix issue in side bar

* Not show author image as other images

* Remove current article id from potential queried articles (#247)

* Add optimistic rendering for follow buttons

* Remove redundant line

* Fix inline stylesheet issue (#248)

* Remove current article id from potential queried articles

* Fix inline stylesheet issue

* Modify sticky_articles source to be more similar to post

* Move assign sticky nav around

* Modify sticky articles

* Attempt to fix sticky

* Fix article show to call 404

* Fix

* Conditional

* Add tag_line to org admin and add conditional on hiring post (#250)

* Modify sticky_article criteria (#251)

* Add tag_line to org admin and add conditional on hiring post

* Modify sticky_article criteria

* Move suggestions to single route

* Exclude self and already followed from suggestions

* Update readme with new API key instructions (#252)

* Modify query to be more performant and correct

* Add br instead of hr for last element

* Remove code for development woops

* Add user articles to sidebar (#253)

* Add user articles to sidebar

* Add organization save-all functionality

* Adjust articles that show up in side sticky bar (#254)

* Add user articles to sidebar

* Add organization save-all functionality

* Adjust articles that show up in side sticky bar

* Add conditional for @user_stickies to show up

* Misc change to styles (#255)

* Add user articles to sidebar

* Add organization save-all functionality

* Adjust articles that show up in side sticky bar

* Add conditional for @user_stickies to show up

* Misc change to styles

* Slight change

* Modified footer center show stuff

* Remove current article author from sticky sidebar (#256)

* Fix article preview issue (#257)

* Update blackbox's API endpoint (#259)

* Modify user tag follow suggestions
2018-04-30 17:45:01 -04:00
Zhao-Andy
70e0329f5a Modify query to be more performant and correct 2018-04-27 17:04:09 -04:00
Zhao-Andy
71254cebb7 Move suggestions to single route 2018-04-26 16:51:25 -04:00
Zhao-Andy
be14ed029d MVP of follow sidebar 2018-04-25 13:56:04 -04:00
Andy Zhao
7c843ba354 Prevent Less than 1 day old accounts from Following Other Users (#159)
* Show empty array of users for potential spammers

* Use user columns for better accuracy and perf

* Use user instead of identity for flagging

* Fix boolean

* Add page skipping logic for young accounts

* Fix test and show team to follow for spammers

* Fix broken link

* Remove page skip logic for back button
2018-03-29 17:12:30 -04:00
Ben Halpern
8a1f9991f1
Add users to signup modal (and other adjustments) (#124)
* Add a missing bounty hunter

* Add a msg about updating social usernames

* Add mailto: link for yo@dev in terms

* Use render partial for help tag

* Lint a file

* Add first draft of onboarding follow users

* WIP onboarding

* Change users api controller

* Create FollowSuggester to return suggested follows for user

* Create initial follow users flow in onboarding

* Move follow user logic to top lvl

* Add follow api end point for onboarding

* Add profile img and update follow action

* Remove checkbox and use a tag instead

* Lint and update tests

* Remove incomplete test for now

* Final adjustments to signup modal

* Update jest snapshot

* Add more jest tests and fix typo
2018-03-22 18:29:22 -04:00