* Add a/b test for which comments to show in feed
* Adjust figure
* Started at
* Add custom_display_label to billboards and update API
* Add custom_display_label to billboards and update API
* Refactor API user suspend, make room for more roles
* Handle adding limited
* Handle remove limited
* And swagger docs
* Update & refactor roles spec
* Remove old route
* Remove old specs
* api v1 endpoint for creating an organization
* address failing specs, regenerate swagger docs
* remove old comment in destroy now that woreker call takes third argument
* refactor our services for profile images into images folder
* define api routes and create controllers, sketch out index and create actions
* add api v1 organizations CRUD spec and docs spec, need to run swagger
* swagger dry run on admin organizations routes, typo fix in api.rb
* flesh out specs and sketch out admin actions
* move actions out of concerns/include pattern and into v1 inline
* remove private constant call
* add v1 accept header to doc spec, fix syntax in a before block
* update controllers to address failing specs
* simplify controller and clarify route config
* flesh out tests for errors
* fix long line
* add missing commas
* return username show route to v0 concern controller
* create separate show route and action name, remove nesting from create/update params requirement
* clean up syntax in controller params and update show path in specs; move routes
* fix up syntax in params permit
* create organization in index spec
* one more syntax tweak for org params
* refactoring to one show route that handles username or id
* tweak spec syntax to expect the right array
* tweak controller and specs, simplify routing to show
* remove create route, action, and specs from this branch
* add clarifying comment in show controller action
* add explicit not found return to show route
* fix controller formatting causing 404 errors
* remove comment, update specs
* remove commment and fix id show response and specs
* fix show route and request spec for username param
* update unauthorized user specs to use put for now instead of post, regenerate swagger docs
* adjust update 422 spec to break org validity
* fix admin update spec, rerun swagger
* reorganiza controller actions, update specs, ensure authorized update and delete
* improve spec, handle finding one org more gracefully, delete via worker
* copy routes into api namespace instead of moving them from general namespace
* update param in v0 show route to fit more general naming
* regenerate v1 swagger docs
* use profile image url getter in update controller response
* update swagger docs and remove unneeded comment from org' model
* configure organizations destroy action for super admins only (for now)
* DisplayAd audience_segment_id in API
* Rubocop
* Manual not valid if missing id
* manual-type requires an id
* Better audience_segment_type reader
* Use inclusion validation
* Swagger update
* Remove unnecessary
* add composite index to segmented_users table
* bulk queries for segmented users
* create segment endpoint
* adding and removing users
* deleting segments 😪
* fix time precision in specs
* api docs 🎉
* pluck improvements that couldn't be cherry-picked
* better service objects; also introduce batch upserting
* docs???
* Refactor for_display to pass article instead of params
* Refactor: use options in FilteredAdsQuery, deconstruct article in DisplayAd.for_display
* Typo
* Restore applicable comments
* Trying some models for audience segmentation
* AudienceSegment basics
* Attach AudienceSegment to DisplayAd
* Possibly use a DUS to populate AudienceSegments
* Add to display ad form UI
* Add to display ad API
* Refresh strategy for audience segments
* Add user_id to async ads query
* Maybe :testing -> :manual, for no-refresh segment
* Test & tweak segment refresh
* Testing audience_segment#refresh logic
* Coverage: testing human_readable
* Scope segment refresh to recently active users
* Tweak logic for when to refresh
* Tweak experience levels to match SettingsHelper
* Test for front-end logic
* Fix test, hope this helps coverage?
* Better test names
* One worker for all, many workers for each, perform_bulk
* Fix audience segment UI, needs to use id, not enum
* cron/schedule should RefreshAll
* Singular id in RefreshWorker
* feat: add a route to the async_info for display ads
* feat: load the billboard asyncronously
* feat: move the methods to the display_ads controller
* feat: handle params better
* feat: cache control headers
* feat: test fastly caching headers on display ads
* fix: surrogate key test
* feat: use safe navigation operator to handle cases where there is no article id
* fix: article id present then find the article
* feat: add a response test
* Fragment caching
* feat: update the article decorator
* feat: update cache keys for fragment
* feat: remove an empty line
* feat: add article id
* feat: bust cache
* feat: setup dropdown for billboard
* chore: add chunk to same line
* feat: add to safe params for caching
* Update app/controllers/display_ads_controller.rb
Co-authored-by: Joshua Wehner <joshua@forem.com>
* feat: remove the cache deletion
* feat: update the routes to follow a new scope
* feat: update the cache params
* feat: get and replace all ads on the article page
* feat: do not go into the if statement if there is no async url property so that the ad fails gracefully
* chore: remove duplicate pack
* Update app/views/articles/show.html.erb
Co-authored-by: Joshua Wehner <joshua@forem.com>
* Update app/views/articles/_sticky_nav.html.erb
Co-authored-by: Joshua Wehner <joshua@forem.com>
* chore: add other params
* feat: allows adding placeholder content in the ad if need be
---------
Co-authored-by: Joshua Wehner <joshua@forem.com>
* Add exclude_article_ids int array
* Add specs, normalize inputs better
* Add to form & controller
* Add exclude_article_ids to DisplayAd API
* Use exclude_article_ids in query
* Rubocop
* Comment typo
* Tweak rspec example length config
* Arguments all the way down
* Typo
* Update spec/requests/api/v1/docs/display_ads_spec.rb
Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
* Update spec/requests/api/v1/docs/display_ads_spec.rb
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
* Swagger schema for Display Ad
---------
Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
* Pages API pt 1 (read/get/index+show)
* Update spec/requests/api/v1/docs/pages_spec.rb
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
* Update spec/requests/api/v1/docs/pages_spec.rb
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
* API Key not required for index & show
* API Feature flag has long since been removed
* Page schema
* Fix spec broken by merge
* Temporary bugfix: slug uniqueness not working for Page
* Pages API endpoints for create, update, and destroy
* Fix swagger error
---------
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
* Pages API pt 1 (read/get/index+show)
* Update spec/requests/api/v1/docs/pages_spec.rb
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
* Update spec/requests/api/v1/docs/pages_spec.rb
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
* API Key not required for index & show
* API Feature flag has long since been removed
* Page schema
* Fix spec broken by merge
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
* Try a create endpoint
* Try an update endpoint for display_ads
* Try a delete endpoint for display_ads (unpublish)
* Unpublish
* Permit tags as well
* Update docs for DisplayAd tags via API/swagger
* add ENV["API_PER_PAGE_LIMIT"]
* cast to int
* add private_constant PER_PAGE_MAX
* use 1000 int
* typo
* use reduced count for ListingsController
* typo
* set max/default in ArticleApiIndexService
* update initializer in ArticleApiIndexService
* Update app/controllers/concerns/api/articles_controller.rb
Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
* Apply suggestions from code review
Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
* update API docs
Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
* Try an idempotentish reaction create API
* Add tests for create API endpoint
* Try -> ReactionHandler
* Fix existing tests first
* Tests for .toggle; fix broken handle_existing
* Use the Handler
* Tweak http status for reaction create
* Use the category reader
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>