Commit graph

9 commits

Author SHA1 Message Date
Anna Buianova
7d053471f8
Rubocop fixes in spec/requests (#18946)
* Rubocop fixes in spec/requests

* Fixed spec/requests/api/v0/articles_spec.rb

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2023-01-12 19:10:16 +03:00
Mac Siri
678dda8cf4
Routine Rubopcop lint fixes (#17844)
* Routine Rubopcop lint fixes

* Undo app_secrets_spec changes

* Fix broken spec
2022-06-07 10:17:16 -04:00
Mac Siri
9be5c8c6b0
Routine Rubocop fixes (#16838) 2022-03-09 09:32:50 -05:00
Vaidehi Joshi
036a6c50b8
Improve error message of User Subscriptions (#11689) 2020-12-01 08:41:49 -08:00
Michael Kohl
8425c847c3
Update CODEOWNERS and team names in TODO comments (#9460)
* Update CODEOWNERS

* Update teams in TODO comments

* Remove mentions of team cool
2020-07-24 12:17:20 +07:00
rhymes
5b62811c98
[deploy] Rubocop: fix violations of Layout/LineLength (#9197) 2020-07-08 08:36:36 -05:00
Alex
9ee024f9d0
UserSubscription backend refactor (#9060)
* Refactor controller validations to model

* Update specs and move current email validation back

* Refactor #subscribed

* Cleanup UserSubscriptions::Create service

* Refactor service

* Move source inside of call for clarity

* Specs for UserSubscription::Create

* Cleanup spec

* Fix Article spec

* Updated for subscriber_email

* Add comment for explicitness of subscriber_email

* Fix reference in comment...oops!

* I know what I'm doing...sometimes...maybe

* Rename CachChecker - Subscription to IsSubscribed

* Use include vs eq in specs for error messages

* attr_accessor --> attr_reader

* Don't explicitly set nil

* Rename Create service to CreateFromService

* Use errors_as_sentence

* Rename service to CreateFromControllerParams

* Assign Struct to a new constant
2020-07-02 12:08:37 -04:00
Alex
db4e37781f
[deploy] User subscriptions liquid tag MVP (#8871)
* UX (view, style, JS) progress

* base_data updates

* More JS updates

* Remove unnecessary param of author_id

* Remove author_id from controller

* Restrict email to admins

* Introduce profile images

* Remove base_data and update tag for source

* Use .key?

* I gotchu Codeclimate, don't worry :)

* Add click event listeners to modal buttons

* Refactor

* More refactor

* Refactor subscriber

* Use userData() for subscriber

* Reorganize

* Code cleanup

* Add subscription API call and favor textContent

* Fix API call and showSubscribed

* Add Apple Auth logic and change links to buttons

* Update success message

* Add Apple email check and spec

* Fix default sign in state

* Remove email from async_info :(

* Refactor markdown classes

* Single quote consistency

* Modal bug attempt & subscriber image on success

* Refactor passing source to tags and fix preview
2020-06-25 13:13:19 -04:00
Alex
8714a36d27
[deploy] User subscriptions API and backend updates (#8779)
* Create "blank" EmailSubscriptionTag

* Refactor liquid_tags_used with spec

* Create /user_subscriptions#create

- Update liquid tag name to UserSubscriptionTag

* Add rate limiting and specs

* Add counter_culture for user_subscriptions

* Update /async_info/base_data

- Alphabetize user_data
- Add email
- Add subscription_source_article_ids
- Cache subscription_source_article_ids on User model

* Add stale email check and specs

* Change user_email to subscriber_email for clarity

* Restrict UserSubscriptionTag

* Rename RESTRICTED_TAGS to RESTRICTED_LIQUID_TAGS

* Make TODO comment more clear

* Refactor error responses and update specs

* Update type to source_type in error message

* Use constantize over safe_constantize

* Add check for active source

* Refactor checking of current_user's subscriptions

- Remove data from async_info
- Create a new service to fetch/cache a user's existing subscriptions

* Restrict email in base_data to admin roles

* Oops! Rename liquid tag file

* Change error back to result...oops!

* It's not goodbye, it's see you later. RIP email :/

* Add current_email to /user_subscriptions/base_data

* Revert adding current_email

* Undo async_info_controller changes/fix conflict

* Move params to constant

* Refactor SubscriptionCacheChecker

* Remove duplicate status code in JSON response

* Remove duplicate status code for #subscribed

* Use response.parsed_body

* Remove user guard in SubscriptionCacheChecker
2020-06-23 13:43:32 -04:00