DemocracyOS / democracyos

Democracia en Red is focusing on specific implementations of DemocracyOS. We are working now working with governments and activists all over Latin America. If you are interested in our online participation tools you can check them out on our site.
https://democraciaos.org/en/
GNU General Public License v3.0
1.77k stars 616 forks source link

[v3] Reaction Instance #1516

Closed guillecro closed 6 years ago

guillecro commented 6 years ago

After creating a Post, ask if the user wants to create a Reaction Instance. If the users agrees, show the reaction rules available for the post (show only those reactions that fits with the settings of the post). Let the user choose if he wants to create a new reaction rule for the post.

guillecro commented 6 years ago

I failed.

Naaaa jk. Ok so the problem with this idea of redirecting the admin to create a reaction instance, won't be possible. According to the admin-on-rest documentation for the redirect prop for :

Possible values are “edit”, “show”, “list”, and false to disable redirection.

Which, are CRUD verbs.. and according to the documentation on :

allows you to define a component for each CRUD operation, using the following prop names: - list - create - edit - show - remove

So.. looks like i cannot leave from those options. I will think in a workaround. One way is to redirect the user to the Show component of the Post and add a field that if there is no reaction instance for the post, show a notification asking if the user is interested to do it.

Another possibility is to just add the field in the Content creation form.

I am tagging @florlafuente @luarar @franciclo cause why not c;

florlafuente commented 6 years ago

Oops! i'm thinking in a custom action button at the end of the post form. Any other opinion?

guillecro commented 6 years ago

Psst. The redirect prop accepts a path inside admin-on-rest. So thats cool!

The strategy is:

  1. It redirects to /reaction-instance/create?fromCreation=true
  2. The <Create> component has a "custom field" that checks if the query has a param called fromCreation
  3. If its true it shows a dialog encouraging the admin to create a reaction instance.