Commit graph

19 commits

Author SHA1 Message Date
Vaidehi Joshi
a3d12e03a3
Add set_up_profile notification, check for active broadcasts (#7054) [deploy]
* Replace current onboarding notification with set_up_profile welcome notification

Also ensure that only "active" set_up_profile welcome notification is sent, and that "inactive" ones are ignored.

* Notify only if broadcast active, log error if broadcast not found

* Reports to Honeybadger if an active broadcast cannot be found

* Reorganize order of generator specs

* Ensure welcome_broadcast can be written to in spec

* Remove redundant spec
2020-04-02 15:56:29 -07:00
Mac Siri
2c5e12268f
Implement authentication welcome notification (#6846) 2020-03-27 15:21:40 -04:00
rhymes
118762ca9b
Some RSpec fixes (#6757)
* Fix spec/uploaders/profile_image_uploader_spec.rb

* Additional ordering based fixes

* Fix spec/requests/comments_spec.rb

* Fix spec
2020-03-24 13:16:19 -04:00
Julianna Tetreault
e8183189a7
Add welcome thread welcome notification (#6221) [deploy]
* Add Welcome Thread Broadcast to generator.rb

* Add welcome trait to broadcasts.rb

* Add additional tests around welcome_broadcasts:
- ensure that the correct Broadcast is sent
- ensure that a User only receives a single Notification
- ensure that only certain Users receieve the Notification

* Refactor and remove unncessary code from generator.rb and generator_spec.rb

* Refactor generator_spec and eagerly load welcome_thread_comment to get spec passing

* Initialize user in place of receiver_id in generator.rb

* Add before action to make generator_spec more readable

* Add latest_published_thread method to generator.rb

  * Update generator.rb to be reusable with latest_published_thread
  * Update generator_spec to use welcome tags for Article obj
  * Create mascot_account using let to reduce User creation in spec

* Adjust expectation for a User who should not receive a notification
2020-03-19 18:57:32 +01:00
Vaidehi Joshi
3bc0f49861
Only send notifications that belong to an active broadcast (#6319) [deploy]
* Use active in place of sent on internal broadcast routes

* Add and use active scope on broadcasts

* Update seeds + specs to use active broadcasts

* Add note about active broadcasts to /internal/broadcasts page
2020-02-27 08:02:45 -08:00
rhymes
4bf323bc83
Skip moderation notification if the user is the moderator (#6200)
* Skip moderation notification if the user is the moderator

* Update spec/workers/notifications/moderation_notification_worker_spec.rb

Co-Authored-By: Vaidehi Joshi <vaidehi.sj@gmail.com>

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
2020-02-20 14:09:43 -05:00
Vaidehi Joshi
f71c8b16e7
Allow dynamic authoring of welcome notifications (#6045) [deploy]
* Add "Welcome" type to Broadcasts, allow dynamic "authoring" of Broadcasts

This adds a new `type_of` to the Broadcast model: "Welcome". As we begin to create a new "welcome notification" workflow, we'll categorize them by making them all of the same type.

This also adds a concept of a "welcoming user", which can be set via an ENV var. The WELCOMING_USER_ID will allow us to explicitly set (and change) which user in the database is the one that "sends" welcoming notification. In production, we plan for this to be dev.to/sloan.

* Allow WelcomeNotificationWorker to accept + send any kind of broadcast

This abstracts out the logic of deciding which broadcast to send from the woker into the calling method. This will help us send many different kinds of welcome notifications using one, resuable worker class.

* Raise if a Notification can't be created

* Add STAFF_USER_ID as an ENV var

This is in preparation for moving away from SiteConfig.staff_user_id, and replacing it with an ENV var. We will need to set this in production first, and then make a separate PR to replace all instances of staff_user_id with the newly-set ENV var.
2020-02-12 13:50:37 -08:00
Alex
6a100415cc
Move Notifications::TagAdjustmentNotificationJob to Sidekiq (#5909) [deploy]
* Create TagAdjustmentNotificationWorker

* Create TagAdjustmentNotificationWorker spec

* Update references and specs for new worker

* Future proof specs
2020-02-05 09:52:21 -08:00
Lucas Hiago
d5a5c53419 Change Notifications::UpdateJob to Notifications::UpdateWorker and move to sidekiq (#5689) [deploy] 2020-01-28 12:43:50 -05:00
Lucas Hiago
587d1040dc Change ModerationNotificationJob to ModerationNotificationWorker and move to sidekiq (#5683) [deploy] 2020-01-28 08:42:26 -05:00
serena
1297f1cb3e Replace Notifications::NotifiableActionJob with Notifications::NotifiableActionWorker for Sidekiq (#5588) [deploy] 2020-01-22 09:40:55 -05:00
Alex
e1e075479b Create new NewFollowerWorker and start sending jobs to it (#5556) [deploy] 2020-01-17 15:08:50 -05:00
Lucas Hiago
97aac4ef9b Change Notifications::MilestoneJob to Notifications::MilestoneWorker and move to sidekiq (#5454) [deploy] 2020-01-15 13:21:56 -05:00
Lucas Hiago
74f9decc56 Change Notifications::RemoveAllJob to Notifications::RemoveAllWorker and move to sidekiq (#5451) 2020-01-15 12:34:12 -05:00
Anna Buianova
05884acd19 Fixed rubocop issues (#5506) 2020-01-14 09:45:26 -06:00
serena
6e9539415e Move welcome notification job to worker for Sidekiq (#5465) [deploy] 2020-01-13 13:28:23 -06:00
Mukesh Chaudhary
48edaab5bc Migrate new reaction job 5305 (#5401)
* Add New Reaction Worker

* Add Specs for the New Reaction Worker

* Update Worker Calls in Notification Model

* Update Notification Model Specs

* Fix Code Climate Issues

* Fix notification specs to remove instance variable and complex logic

* Fix Worker Spec

* Fix Review Comments

* Undo Job Specs

Co-authored-by: Mukesh Chaudhary <45253983+mukeshchdy@users.noreply.github.com>
2020-01-09 09:51:56 -05:00
serena
252027ad9c use new_badge_achievement_worker instead of active job (#5358) [deploy] 2020-01-07 08:16:17 -05:00
serena
51df32552c Change MentionJob to MentionWorker and move to sidekiq (#5312) [deploy] 2020-01-02 07:57:08 -05:00