Commit Graph

24 Commits

Author SHA1 Message Date
Andrew Davis
8991bb0302 replace the word message with notification on proposal notification screens 2021-06-04 20:05:57 +08:00
Javi Martín
c1c84507b8 Make card title mandatory
We didn't add any validation rules to the card model. At the very least,
the title should be mandatory.

The fact that the label field is marked as optional in the form but the
other fields are not probably means description and link should be
mandatory as well. However, since there might be institutions using
cards with descriptions but no link or cards with links but no
description, so we're keeping these fields optional for compatibility
reasons. We might change our minds in the future, though.
2021-01-12 14:44:29 +01:00
Javi Martín
ff93f5a591 Use "resolve" for polymorphic hierarchy paths
In the past, we couldn't use `polymorphic_path` in many places. For
instance, `polymorphic_path(budget, investment)` would return
`budget_budget_investment_path`, while in our routes we had defined
`budget_investment_path`.

With the `resolve` method, introduced in Rails 5.1, we can use symbols
to define we want it to use `investment` instead of `budget_investment`.
It also works with nested resources, so now we can write
`polymorphic_path(investment)`.

This makes the code for `resource_hierarchy_for` almost impossible to
understand. I reached this result after having a look at the internals
of the `resolve` method in order to get its results and then remove the
symbols we include.

Note using this method will not make admin routes compatible with
`polymorphic_path`. Quoting from the Rails documentation:

> This custom behavior only applies to simple polymorphic URLs where a
> single model instance is passed and not more complicated forms, e.g:
> [example showing admin routes won't work]

Also note that now the `admin_polymorphic_path` method will not work for
every model due to inconsistencies in our admin routes. For instance, we
define `groups` and `budget_investments`; we should either use the
`budget_` prefix in all places or remove it everywhere. Right now the
code only works for items with the prefix; it isn't a big deal because
we never call it with an item without the prefix.

Finally, for unknown reasons some routing tests fail if we use
`polymorphic_path`, so we need to redefine that method in those tests
and force the `only_path: true` option.
2020-06-15 11:54:05 +02:00
Javi Martín
61a63ddd59 Use label text instead of ID to fill in comments
This way tests are easier to read (and easier to write).
2020-05-12 23:57:57 +02:00
Javi Martín
5d362ced1f Fix duplicate HTML IDs in comment forms
Since there were many on the page, the resulting HTML was invalid.
2020-05-12 23:57:57 +02:00
Andy Sims
74fbde09f1 Support creates follow (Merge pull request #3895)
* Supporting a proposal will create a follow relationship
* Only followers receive notifications
2020-04-06 15:26:47 +02:00
decabeza
4c5b2723f4 Create new messages section for proposal's dashboard 2019-05-31 11:42:15 +02:00
decabeza
f06cdc5fbb Change my activity menu to my content 2019-05-17 17:47:40 +02:00
decabeza
cb22e6cbfb Merge branch 'master' into proposal-dashboard 2019-04-23 17:12:47 +02:00
Angel Perez
7ddbf5ff35 Use separator key when parameterizing arguments 2019-04-17 17:40:55 +02:00
decabeza
eda6ea7f12 Merge branch 'master' into dashboard 2019-03-26 16:45:48 +01:00
Julian Herrero
31ac8b7f55 Change single quotes to double quotes 2019-02-15 11:40:39 +01:00
Javi Martín
a326bcb0a1 Update admin notifications translatable fields
The same way we did for banners.

We needed to add new translation keys so the labels are displayed in the
correct language. I've kept the original `title` and `body` attributes
so they can be used in other places.

While backporting, we also added the original translations because they
hadn't been backported yet.
2018-10-22 15:43:56 +02:00
decabeza
546105d989 Merge branch 'master' into dashboard-master 2018-10-19 01:48:37 +02:00
Juan Salvador Pérez García
488e7e081f Merge branch 'dashboard' into rebase_consul_master 2018-09-27 09:18:27 +02:00
Marko Lovic
f6749049c9 Make Admin Notifications translatable 2018-09-19 12:15:26 +02:00
Javi Martín
a64a290392 Extract commentable_path to an initializer
By doing so and including it in ActionDispatch::Routing::UrlFor, we make
it available in controllers, helpers and specs, and so we can remove the
duplication we had there with methods dealing with the same problem.

Even if monkey-patching is ugly, using a different module and executing
ActionDispatch::Routing::UrlFor.send(:include, MyModule) wouldn't make
the method available in the controller.
2018-09-17 20:28:55 +02:00
decabeza
8b6a8703e0 Adds missing fill_in_admin_notification_form in common actions 2018-07-25 19:13:31 +02:00
Juan Salvador Pérez García
26d2a500ef Fixes #204
Send message to the community has been moved outside of dashboard.
2018-07-17 17:59:11 +02:00
Juan Salvador Pérez García
921d567110 Implements #175
General menu has been refactored to look like the mockups.
The progress menu has been refactored as well.
2018-07-17 17:57:30 +02:00
Juan Salvador Pérez García
a2e185c221 Fixed proposal notification specs 2018-07-17 17:57:30 +02:00
Juan Salvador Pérez García
358aa14ed3 Fixed failing specs 2018-07-17 17:50:47 +02:00
Adan Amarillas
9210d8928e Clean up newly created modules 2018-06-04 08:55:53 -07:00
Adan Amarillas
ee877888b3 Split spec common actions support helper 2018-06-04 08:55:53 -07:00