Commit graph

10 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
b5fa02bf33
Create Broadcasts.rake (#7010) 2020-04-02 17:24:39 -04:00
Vaidehi Joshi
e23e69d4b2
Prompt users to ask a question/start a discussion (#7007) [deploy]
* Add a discuss/ask notification(s) to seeds + factories

* Add a start discussion/ask question welcome notification

* Add a scope for finding articles published by a user + with a certain tag.

* Some clean up/refactoring in the generator

* Reorganize welcome notification sending, add specs for discuss/ask notification
2020-04-01 11:57:50 -07:00
Mac Siri
fc728af0cd
Prompt new users to customize their feed (#6979) 2020-03-31 17:32:11 -04:00
Vaidehi Joshi
28956d90a5
[deploy] Prompt new users to customize their experience (#6959)
* Rename find_broadcast to find_auth_broadcast

* Fix broken div rendering on /notifications tab

* Allow customize notification to be enqueued

* Add specs for customize welcome notification

Also clean up existing specs to match!

* Rename customization notification method for clarity

* Remove some redundant assertions in generator spec
2020-03-30 19:17:52 -04:00
Mac Siri
2c5e12268f
Implement authentication welcome notification (#6846) 2020-03-27 15:21:40 -04:00
Vaidehi Joshi
c12cea9b02
Allow users to opt-out of welcome notifications (#6852) [deploy]
* Update some test descriptions in notifications_spec

The descriptions of these tests didn't actually match the test's assertions!

* Add welcome_notifications column to users table

Also ensures that welcome_notifications cannot be set to `nil`.

* Show an opt-out message for Welcome broadcast notifications

* Add opt-out link to notifications + welcome notification box to settings

* Allow welcome notification subscription to be updated

* Add tests for unsubscribed to welcome notification users

Also refactor generator specs a bit.

* Fix up paths, copy, tests

Use rails path helpers instead of hardcoding paths. Improve copy in a few locations.
2020-03-26 11:26:19 -07:00
Mac Siri
84e84af8d7
Create Article#admin_published_with scope (#6794) 2020-03-24 18:15:43 -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
76fe99b76a
Add Broadcast seeds + generator service to set up for welcome notifications (#6080)
* Add more Broadcasts to seeds for welcome notification flow

* Remove unnecessary welcoming_user_id from development config

* Add basic service class for generating appropriate broadcast per user

Eventually, this should be called from a rake task that will rely on this service to determine which broadcast, if any, is the appropriate one to send to newly signed-up users, and will enqueue a worker to create/send a welcome notification when appropriate.

* Add a few TODOs, plus some general cleanup

* Add some skipped tests for WelcomeNotification::Generator
2020-02-14 12:30:25 -08:00