Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GobiertoCommon::Trackable extension and User Notifications feature starting point #173

Merged
merged 4 commits into from
Dec 20, 2016

Conversation

danguita
Copy link
Contributor

@danguita danguita commented Dec 20, 2016

Connects to #167.

What does this PR do?

This PR implements an extension library that allows any of the Form objects in the system to track changes on its managed resources. Those changes also produce events to be consumed through our pub/sub implementation.

To cover a complete first iteration, the GobiertoCommon::Trackable extension is being integrated into the GobiertoAdmin::GobiertoBudgetConsultations::ConsultationForm class so that we're producing events that are consumed by a custom Subscriber.

It also adds the User::Notification implementation which is the first resource populated through events within the trackable namespace. The logic for building those User::Notification records based on User Subscriptions is abstracted in the User::NotificationBuilder service class.

Some other details on the implementation can be found in the doc that comes with this PR: https://github.com/PopulateTools/gobierto-dev/blob/fb34ccd159c470238d3bc82fe0e0f2601f963a50/docs/trackable-extension.md

How should this be manually tested?

Since the User::Notification implementation is already there, a starting User notifications view can be reached at http:https://madrid.gobierto.dev/user/notifications. It is being populated through changes in the GobiertoBudgetConsultations::Consultation model which the user is subscribed to (see #171).

✏️ Known improvements

  • The User::Notification population process should be done asynchronously, in a background job.
  • The User's activity/alerts view should be formatted properly.
  • It would be great to have some end-to-end tests regarding changes in Trackable Form objects.

@ferblape
Copy link
Member

It's a very good starting point. In the next steps we´ll also adjust the kind of notifications per resource.

@ferblape ferblape merged commit ce272d4 into master Dec 20, 2016
@ferblape ferblape deleted the 167-user-notifications-feature-set-up branch December 20, 2016 11:23
@danguita
Copy link
Contributor Author

Yep, the idea was to develop the tools here and set them up later 👌 Thanks mate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants