Commit graph

99 commits

Author SHA1 Message Date
Anna Buianova
07ffb2e3be
Removed spammers from followers list (#20603)
* Remove spam and suspended users from followers list (api and dashboards)

* Fixed the api followers endpoint

* Fixed issue with follower_ids query
2024-02-08 13:57:15 +00:00
Anna Buianova
df0b134ec4
Added followers count to /api/users/me endpoint (#20378)
* Added followers_count to /api/users/me

* Updated the api user docs

* Rubocop fixes fro swagger_helper

* Added me jbuilder view for api/v0
2023-11-22 20:22:06 +00:00
Anna Buianova
3e27e9c986
Added user badge_ids to the api (#20365) 2023-11-17 17:01:55 +00:00
Anna Buianova
5ac786c9a1
Add email to the users api (#20241)
* Add email to the users api if display_public_email_on_profile is set to true

* Fixed selected user fields in the api

* A separate partial for user data with email (for the api)
2023-10-13 16:27:21 +03:00
PJ
453c2eeccb
Manual Audience Segments API read endpoints (#19542)
* getting and listing segments

* get list of users in segment

* docs???
2023-05-26 15:10:26 +01:00
Ridhwana
e67454fa53
Preparation of endpoint and files required for ChatGPT Plugin (#19394)
* feat: add the ./wellknown/ai-plugin.json file

* feat: add a logo

* feat: firts attempt at open_api file with endpoint we thought we'd use

* feat: add a search action to teh articles controller that build up teh appropriate json

* feat: add a query param to the article index

* feat: add some chatgpt endpoints and file paths to CORS

* feat: update the openapi yml file to reflect the article search endpoint

* fix: use the correct concept

* feat: replace the logo

* feat: update the ai-json file

* feat: update the openapi file

* feat: update the api and it's params

* feat: update the search query

* fix: ordering

* feat: cors debug

* fix: logic with markdown

* chore: fix test

* spec: article

* spec: article

* spec: article

* Update public/.well-known/ai-plugin.json

* Update public/openapi.yml

---------

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2023-04-27 16:51:24 -04:00
Fernando Valverde
815b98168e
Include user_id fields in a couple API endpoint responses (#18214)
* Include user_id fields in a couple API responses

* Replace v0 partial within API v1 jbuilder views
2022-08-03 10:51:35 -06:00
Fernando Valverde
c6c39813a1
New suspend user API endpoint (#18043)
* New suspend user API endpoint

* Restrict admin access only to suspend action

* Add suspended? check on new endpoint spec

* Replace POST with PUT action

* Replace redundant response payload with empty 200 response

* Rely on user_policy instead of before_action method

* Use alias with matching method name instead of unpublish

* Use already existing toggle_suspension_status? method in policy

* Remove manual creation of note

* Update suspend success spec
2022-07-15 09:07:57 -06:00
Fernando Valverde
5df1855103
Unpublish comments+articles by user id in API v1 (#18058)
* unpublish comments+articles by user id in API v1

* Update spec/requests/api/v1/users_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Rely on user_policy instead of before_action method

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-07-14 11:47:44 -06:00
Fernando Valverde
b8abbda72e
Unpublish post service class + V1 API endpoint (#18031)
* Unpublish post service + API

* Apply PR feedback

* Use module_function on service class
2022-07-08 09:08:55 -06:00
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
Takuya N
05fcdfcb2e
Replace forem/forem instead of thepracticaldev/dev.to (#17626)
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2022-05-10 07:26:50 -04:00
Jeremy Friesen
c8e259a5b2
Adding ID to API organization response document (#17600)
Closes forem/forem#17590
2022-05-09 09:20:44 -04:00
Dwight Scott
ab224d34b2
Add ability to bulk search tags by name or id (#16671)
* Trigger Build

* Remove cache header before_action and add ability to search by tag name

* Remove cache header before_action and add ability to search by tag name

* Add internal bulk tag endpoint to get tags by array of  names or ids

* Restore V0 tags controller
2022-02-24 12:34:50 -05:00
Dwight Scott
509e7d0e78
Modify tags api index to allow for bulk GET of tags (#16417) 2022-02-09 15:30:15 -05:00
yheuhtozr
e45536af37
app/models i18n (#16124)
* app/models etc i18n

* delete ja.yml

* fix for PR review

* fix for spec

* delete ja.yml

* fix for spec updated
2022-02-03 13:41:42 -05:00
Jeremy Friesen
a65954107f
Refactoring to add helper method (#16064)
* Refactoring to add helper method

Prior to this commit, we made view level calls to service modules.  This
refactor provides convenience methods on the model.

Furthermore, it addresses a few Rubocop violations that "come along for
the ride."

* Ensuring cached entity squaks like User

* Fixing broken spec

* Fixing typo
2022-01-12 11:21:44 -05:00
Michael Kohl
06d6b68d9d
Remove webhooks and related code (#15827) 2021-12-28 10:56:37 +07:00
yheuhtozr
74b065be58
I18nize views misc & non-HTML templates (#15136) 2021-12-08 11:28:16 -05:00
Michael Kohl
1ebec4b67f
Remove hardcoded user profile fields (#14079)
* 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

Co-authored-by: Jacob Herrington <jacobherringtondeveloper@gmail.com>
2021-08-18 11:44:53 +07:00
Michael Kohl
231ce5d3cb
[15-minute fix] Add created_at to listings API response (#14437)
* Add created_at to listings API response

* Add created_at listing attribute to org controller
2021-08-10 08:53:03 -05:00
rhymes
0d58de830b
API: Add reading_time_minutes to /api/articles/me (#14318) 2021-07-26 17:47:50 +02:00
rhymes
ff3be35d6e
API: Remove orphan Admin Config jbuilder file (#13953) 2021-06-15 18:18:52 +02:00
Michael Kohl
6dfabd578f
Rename SiteConfig to Settings::General (#13573)
* Rename SiteConfig

* More renaming

* Update spec

* Update mandatory settings mapping

* More renaming

* e2e test fixes

* You have a rename, and you have a rename

* Spec fix

* More changes

* Temporarily disable specs

* After-merge update

* Undo rename for migration

* undo rename of DUS

* Fix DUS

* Fix merge problem

* Remove redundant DUS

* Fix specs

* Remove unused code

* Change wrong class name

* More cleanup

* Re-add missing values to constant

* Fix constant

* Fix spec

* Remove obsolete fields

* Add accidentally removed field

* Update spec

* Move methods from Settings::General to ForemInstance

* Remove unneeded model

* Change mentions of 'site config'
2021-05-21 14:45:37 +02:00
Daniel Uber
2f1dad4e37
Add reading_time to articles api responses (#13446)
* Add reading_time to articles api responses

Fixes #13436

* Update api docs to match changes to the articles response

* Follow up docs updates

- increment api docs version
- add reading_time to articles/me responses
- add reading time to the show response example format

* Change reading_time attribute to reading_time_minutes

Update the article builder to use `article.reading_time` and present
it as `"reading_time_minutes"`.

Update the api spec to expect the new property name instead of the attribute.

* Update api documentation to reflect the new name

- Change reading_time -> reading_time_minutes.
- I decided to keep the (possibly redundant) description text here.
2021-04-19 17:11:55 -05:00
Michael Kohl
d1c3380161
Update GET /followers API endpoint (#13287)
* Add created_at to API followers controller

* Add sorting

* Update API docs

* Update app/controllers/api/v0/followers_controller.rb

Co-authored-by: Jamie Gaskins <jgaskins@gmail.com>

* Update app/controllers/api/v0/followers_controller.rb

Co-authored-by: Jamie Gaskins <jgaskins@gmail.com>

* Use correct date format

* Update API docs

* Add JsonApiSortParams concern

* Update controller to use concern

* Rename and add docs

* Update API docs

* Remove leftover file

* Undo gem changes

* Consistently use field vs param

* Reset vendor/cache for git dependencies

Co-authored-by: Jamie Gaskins <jgaskins@gmail.com>
2021-04-13 10:12:42 +07:00
Spencer
27648a938b
API: Endpoint to get an organization's articles (#12237)
* update route

* add controller action

* add article jbuilder/update shared files

* add tests

* update api docs

* add published to query

* render articles index/delete articles jbuilder

* call articles index attributes const

* put back article/flare partials

* bug fix for readinglist index

* bug fix for render partial in jbuilder
2021-01-13 13:09:58 +01:00
Spencer
6e2aab623e
API: Endpoint to get an organization's listings (#11823)
* add tests

* add route

* add controller action

* add jbuilder file

* update api docs

* update query

* update jbuilder listing

* add organization/user and category to listing

* update api docs/spec file
2020-12-18 12:20:35 -05:00
Ben Halpern
54937fa5a7
Add configs/show api for admins (#11358)
* Add configs/show api for admins

* Add initial test

* Add test

* Update docs/api_v0.yml

Co-authored-by: rhymes <rhymes@hey.com>

* Change to single resource

* Change authentication approach

* Change to status code spec

* Fix spec path

* Final touches

* Update spec/requests/api/v0/admin/configs_spec.rb

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

* Proper stubbing

Co-authored-by: rhymes <rhymes@hey.com>
Co-authored-by: Michael Kohl <citizen428@dev.to>
2020-12-01 12:22:07 -05:00
Spencer
de3d62bc40
API: Endpoint to get an organization's users (#11514)
* add tests

* add route

* add users action to organizations controller

* add jbuilder file

* update api docs

* add recource routes

* make updates to organizations controller

* remove org_users from api docs

* update spec

* add users show jbuilder

* bug fix for user show
2020-11-25 12:50:57 +01:00
Krzysztof Rybka
d6956180ad
Return video_source_url in API V0 Videos index (#11040) 2020-11-09 06:27:28 +01:00
Spencer
c0168df2a8
API: Endpoint to get an organization's details (#10931)
* add organizations api request spec

* add organizations api controller

* add organizations api show route

* add show jbuilder file

* fix merge conflict on routes

* add organization show to api docs

* update created_at to iso format

* api docs add format field/cleanup
2020-10-30 16:22:30 -04:00
Diogo Osório
2b72a35d3d
[deploy] Introduce /api/profile_images/:username endpoint (#10547)
* Documents the new /profile-images/:username API endpoint

* Introduces the /api/profile_images/:username endpoint

This endpoint receives either an user or organization username as input
via the URL path and returns the profile image information for that
user/orgnization.

* Updates the /api/profile_images/:username response

Adapts the response according to the review comments:

1. Removes the cache directives
1. Tweaks how the user query is being done
1. Adds a `image_of` property to the response

* Bump API version

Co-authored-by: rhymes <rhymes@hey.com>
Co-authored-by: Molly Struve <mollylbs@gmail.com>
2020-10-14 14:24:25 -05: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
Dana Scheider
24641d537a
API: Add route for fetching a user's followed tags (#9108)
* Add route for fetching a user's followed tags

* Move followed tags route to FollowsController instead of TagsController and add JSON view

* Add missing new line

* Change the dots for our linter

Co-authored-by: rhymes <rhymes@hey.com>
Co-authored-by: Molly Struve <mollylbs@gmail.com>
2020-09-18 16:28:42 -05:00
Mac Siri
9ebd742712
[deploy] Reintroduce sticky_nav changes (ab81f36 & 7f92855) (#10263)
* Revert "[deploy] Revert removal of unneeded eager load (if needed) (#10179)"

This reverts commit 11c7b148da.

* Revert "[deploy] Revert "Migrate ProfileImage to Images::Profile (#10055)" (#10149)"

This reverts commit 5657067e55.
2020-09-09 15:33:13 -04:00
rhymes
2d881ef571
Routine rubocop fixes (#10237) 2020-09-08 12:06:47 -04:00
Molly Struve
5657067e55
[deploy] Revert "Migrate ProfileImage to Images::Profile (#10055)" (#10149)
This reverts commit ab81f36a38.
2020-09-01 18:28:58 -05:00
Mac Siri
ab81f36a38
[deploy] Migrate ProfileImage to Images::Profile (#10055) 2020-09-01 17:16:03 -04:00
jkrsn98
dbdc6ead38
[deploy] API: add created_at datetime to comments (#9829)
* added created_at to comments in api response

* added test to ensure a date is returned for comment

* fix offenses in test

* updated docs to include addition of created_at to comment api response
2020-08-17 20:10:24 -04:00
rhymes
8126c5c2c1
Rubocop: Address Metrics/BlockLength violations (#9246)
* Address Metrics/BlockLength violations

* Add jbuilder to package auto correct
2020-07-10 13:53:32 -04:00
Michael Kohl
7f75f99560
[deploy] Rename classified listings (#7910)
* Change models and related files

* Update controllers and specs

* More renaming

* Seek and destroy, I mean search and replace

* Round up the stragglers

* Ground control to Major Travis...

* More fixes

* PR feedback

* Various fixes

* Rename view

* Fix list query builder

* Unify request specs

* Fix some API spec errors

* Fix remaining API specs

* Make spec conform to API

* Fix leftover problems

* Fix JS tests

* Fix column name in select

* Fix API specs

* Fix search specs

* Paging Mr. Travis
2020-05-27 13:35:09 +00:00
Andy Zhao
c42fd3461e
[deploy] Rename positive_reactions_count to public_reactions_count in logic (#7926)
* Rename positive_reactions_count to public_reactions_count

* Add positive reactions count back in so we can remove it

* Use public_category method for reactions

* Add positive_reactions_count in case any old caches rely on it

* Add positive_rxn_count to account for API endpoints

* Remove unused method

* One more spot...

* Add method back in because of caches

* Update specs to match new functionality

* Fix typo

* Remove unused methods
2020-05-26 12:36:28 -04:00
Ben Halpern
8f2c32249c
[deploy] Fix podcast pagination client/API mismatch (#7375)
* Fix podcast pagination API

* Adjust css for podcast header

* Adjust test

* Adjust test
2020-04-28 10:07:36 -04:00
Michael Kohl
02d23a0673
Refactor jbuilder (#7411)
* Refactor jbuilder for articles

* Refactor remaining jbuilder files

* Fix specs

* Remove content_truncated from response template JSON

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2020-04-24 12:49:12 +02:00
Michael Kohl
9df68f3920
Use new classified listing categories (#7250)
* Add ClassifiedListingCategoryModel

* Add data update script for classified listing categories

* Refactor and fix specs

* Resolve conflict

* Incorporate PR feedback
2020-04-23 10:06:58 +07:00
Michael Kohl
244ab297c8
Move user following suggestions to internal API (#6601) [deploy] 2020-03-13 13:37:24 +01:00
Michael Kohl
f975c4c9f3
Move chat_channel info to internal API (#6581) [deploy] 2020-03-11 13:57:21 +01:00
rhymes
01e4a0b0f1
API: add docs for /followers/users and remove organizations endpoint (#6551)
* Use api-key for api tests

* Remove /api/followers/organizations endpoint

* Add more tests

* Add documentation for /api/followers/users
2020-03-11 10:56:43 +01:00
rhymes
21fca3e0f2
Comments API: hide deleted and hidden comments (plus docs) (#6482) [deploy]
* Modernize index test

* Hide comments body_html and user info if the comment is either deleted or hidden

* Shorten lines a bit

* Freeze repeated strings

* Document all /comments

* Document /comments/{id}
2020-03-07 09:02:10 +01:00