Commit Graph

232 Commits

Author SHA1 Message Date
taitus
25501c74bb Add suggestions list with goals and targets
This will allow autocomplete for the loaded values in suggestions settings.
We remove commas on tag to allow to jquery.amsify.suggestag.js use comma
as delimiter.
2021-01-20 19:18:02 +01:00
taitus
334d803332 Add related list selector component
This component allows you to add Goals and Targets in a single
input to relate it to any resource.
We use the new added library to render them as tags.
2021-01-20 19:18:01 +01:00
Javi Martín
a7bbdb1bd0 Simplify rendering a banner
Now the banner component accepts either a banner or a section and loads
the banner if it's a section, so we don't have to add the `@banners`
variable in several controllers.
2021-01-20 17:22:05 +01:00
Javi Martín
c3147a1bb6 Simplify conditions to render a banner 2021-01-19 15:35:18 +01:00
Senén Rodero Rodríguez
c6407d82e3 Add filters to SDG relations controller
We have three filters: "pending", "all" and "reviewed". Where "pending"
is the default one.

Now we are rendering the `shared/_filter_subnav` partial we need to stub
helper methods defined at the controller and the helper methods that
rely on the request parameters to test the component.
2021-01-19 14:56:30 +01:00
Javi Martín
c66a5a30ef Allow using table actions in different namespaces
This way we can reuse it in sections like SDGManagement and URLs will be
automatically generated as expected.
2021-01-14 17:35:38 +01:00
Javi Martín
2968275a1c Add empty SDG homepage configuration page
Here we'll eventually display links to edit the homepage and the cards
in it.
2021-01-14 17:35:38 +01:00
Javi Martín
e8e920ee50 Rename Widgets components to Widget
So naming is consistent with the way Admin::Widget controllers are
named.
2021-01-12 14:50:37 +01:00
Javi Martín
36037bbc55 Merge pull request #4300 from consul/sdg_filters
Add SDG filters to advanced search
2021-01-11 13:11:09 +01:00
Javi Martín
cee4613d87 Merge pull request #4305 from consul/sdg_icons_in_index
Add SDG icons to related records
2021-01-11 13:07:11 +01:00
Javi Martín
75fc4315ba Add goal filter to advanced search 2021-01-10 15:54:23 +01:00
Javi Martín
8024c4bb69 Fix goal order in goal select 2021-01-10 15:54:23 +01:00
Javi Martín
142f9b300b Add filters by SDG to processes sidebar
It appears on every process where a tag cloud appears: debates,
proposals and budget investments.
2021-01-10 15:52:22 +01:00
Javi Martín
c5a6ee74c4 Fix component specs using "within"
These specs were passing because the `within` method does not work in
components specs. We have to use `page.find` instead.
2021-01-09 15:48:12 +01:00
Javi Martín
ceed3c18d3 Display SDG icons alongside tags
We're using the translation fallbacks for the icons, just like we do for
texts.

Note we use the `render?` method provided by view_component to make sure
the component will not be rendered when certain features are disabled.

Also note the `find_asset` method works differently in development and
production, and so we use different approaches here.
2021-01-09 14:53:54 +01:00
Javi Martín
53af5749b9 Extract class to check SDG rendering conditions
This class provides a method which shows whether a certain process is
enabled.

Even if it uses a helper, this class is inside the models folder because
the helper it uses actually only uses model methods. We might eventually
remove/simplify this helper and cache inside the model, like we did with
I18n content translations in commit 41dba842a.
2021-01-09 14:19:00 +01:00
Javi Martín
83400b9ed4 Display a message when feeds have no items
This is a scenario which will likely take place for at least some of the
goals.
2020-12-27 21:42:42 +01:00
Javi Martín
cc9ab70fbb Add processes to goal view
Note the link to see all processes does not filter by goal because the
legislation section does not have any search filters.
2020-12-27 21:42:42 +01:00
Javi Martín
2bb0a2dfaf Make "see all" links filter per goal 2020-12-27 21:42:42 +01:00
Javi Martín
ee06dcc05a Disable SDG sections when settings are disabled 2020-12-21 18:04:48 +01:00
Senén Rodero Rodríguez
e9d52b5e11 Add subnavigation component to targets and goals
Add a new SDG component to make easier to create subnavigation menus.

Co-Authored-By: Javi Martín <35156+javierm@users.noreply.github.com>
2020-12-04 15:15:32 +01:00
Javi Martín
7cb0a4135b Extract component for admin officers table
This way we can remove duplication and simplify the code in the view.

Note we're not using the "within" method in the tests to access a row,
because it doesn't seem to work in components tests when passing the
`text:` option.
2020-10-21 13:19:52 +02:00
Javi Martín
08c2bfc255 Extract component to add/remove admin/mod/manager
We remove some duplication by doing so.
2020-10-21 13:19:52 +02:00
Javi Martín
02e27e13dc Extract component for budget actions
We can omit passing a parameter to the helper method thanks to that, and
we group related code together.
2020-10-21 13:19:52 +02:00
Javi Martín
1537f25739 Extract component for organization actions
We remove duplication by doing so, and now we only need to add the call
do render Admin::TableActionsComponent once.
2020-10-21 13:19:52 +02:00
Javi Martín
eb3f2bc2ca Extract component for restore and hide actions
By doing so, we remove a lot of duplication.
2020-10-21 13:19:52 +02:00
Javi Martín
fb23df2e5b Allow additional links in table actions component
This way we'll be able to make these links consistent.
2020-10-21 13:19:49 +02:00
Javi Martín
e3753b1ad9 Allow custom options in links to actions
Some links were using options like `remote: true`.
2020-10-19 18:56:02 +02:00
Javi Martín
497963817c Allow different confirmation texts in destroy link 2020-10-19 18:56:02 +02:00
Javi Martín
b1f9ca4ad5 Allow custom URLs in links to actions
There were a couple of cases where these links didn't point to the
default actions.
2020-10-19 18:56:02 +02:00
Javi Martín
738646a565 Allow different texts in links to actions
The texts were different for a few models, so the component needs to be
updated.
2020-10-19 18:56:02 +02:00
Javi Martín
10c095d821 Move table actions partial to a component
This partial was going to get too complex since in some places we've got
different texts, different URLs or different confirmation messages.
While we should probably try to be more consistent and that would make
the partial work in most cases, there'll always be some exceptions, and
using a partial (with, perhaps, some helper methods) will become messy
really quickly.
2020-10-19 18:56:02 +02:00