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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

User Subscriptions feature starting point #171

Merged
merged 10 commits into from
Dec 19, 2016

Conversation

danguita
Copy link
Contributor

@danguita danguita commented Dec 19, 2016

Connects to #166.

What does this PR do?

This PR introduces a new feature which allows any signed in User to subscribe to determined system resources in both generic and specific contexts. To do that, we're adding a new model called User::Subscription to the system and a simple interface to access it.

It also allows any not signed in User to subscribe to those exposed resources by starting a new User registration process with the pre-created User::Subscription item.

Extra 馃幈

  • We are preparing the User namespace here by trying to keep the default layout generic and extracting a new one for User namespace only.
  • There has been some progress in the User namespace localisation process, and any new implementations are being localised as well.
  • We are taking care of the "every-interaction-has-a-form-object" approach by covering any missing scenarios around there, and making those form objects contain most of the model logic instead of the ActiveRecord models itself.

How should this be manually tested?

As an integration sample, the GobiertoBudgetConsultations::Consultation model has been set up as a the only "subscribable" resource for now, so these are the available user interactions:

A. When signed in as a User

The subscription box should be shown as follows:

Generic context URL: http:https://madrid.gobierto.dev/consultas_presupuestos/

screen shot 2016-12-19 at 07 26 01

Specific context URL: http:https://madrid.gobierto.dev/consultas_presupuestos/<consultation_id>

screen shot 2016-12-19 at 09 02 30

B. When not signed in

The subscription box should be shown as follows:

Generic context URL: http:https://madrid.gobierto.dev/consultas_presupuestos/

screen shot 2016-12-19 at 07 25 56

Specific context URL: http:https://madrid.gobierto.dev/consultas_presupuestos/<consultation_id>

screen shot 2016-12-19 at 09 02 37

鉁忥笍 Known improvements

Finally, I'm keeping some known improvements here for future iterations:

  • Detect when a signed in user has already subscribed to the current resource, and show an "Unsubscribe from this" button instead.
  • Perform any subscribe/unsubscribe actions asynchronously to avoid the annoying redirections.

@danguita danguita force-pushed the 166-user-subscriptions-feature-set-up branch from bb9d07d to 8dfad1e Compare December 19, 2016 13:30
@ferblape
Copy link
Member

Looks very promising! Merging after the catalan magic.

@danguita
Copy link
Contributor Author

Yo, thanks for that! 馃憦

@ferblape ferblape merged commit 051ebcc into master Dec 19, 2016
@ferblape ferblape deleted the 166-user-subscriptions-feature-set-up branch December 19, 2016 16:46
@danguita
Copy link
Contributor Author

The build has just passed in master branch. I'm rebuilding this one's for mental sanity.

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