Commit Graph

16 Commits

Author SHA1 Message Date
taitus
7fa594e3e3 Rename sdg_related_list to related_sdg_list
To maintain consistency with the current names in the database with fields:
:related_sdg_type and :related_sdg_id
2021-01-26 19:18:11 +01:00
taitus
41ead2b37c Allow add local targets to RelatedListSelectorComponent 2021-01-26 19:16:57 +01:00
Javi Martín
101625ebab Touch the associated record when assigning targets
So the cache will expire properly.
2021-01-22 17:54:18 +01:00
Javi Martín
b5ccae2f40 Allow assigning both targets and local targets
Particularly useful in tests, because writing `targets` is shorter than
writing `global_targets` and `local_targets`.
2021-01-22 16:34:26 +01:00
Javi Martín
39d68a1779 List local targets alongside targets 2021-01-22 16:34:26 +01:00
Javi Martín
176839c905 Rename sdg_targets association
We use `sdg_global_targets` because we will add a new `sdg_targets`
method which will return both targets and local targets.
2021-01-22 16:34:26 +01:00
Javi Martín
14e4c528e9 Allow filtering by local target in SDG management 2021-01-22 16:34:26 +01:00
taitus
7b1821fc9b Prepare relatable concern and relations controller
Allow send Goals and Targets from edit component input field
2021-01-20 19:17:59 +01:00
Senén Rodero Rodríguez
a0c9eba41d Add scope to filter SDG relations by review status 2021-01-18 13:17:37 +01:00
Senén Rodero Rodríguez
0368aa459f Add SDG::Review model
and its relation with relatables

Note about sdg_review factory: Cannot use the constantize method on
the relatable_type as long as the relatable classes will be loaded and
this will throw an exception because the database is not available at
factiry definition time.
2021-01-18 13:17:37 +01:00
Javi Martín
74962ef05f Add filter by target 2020-12-21 18:27:27 +01:00
Javi Martín
c9362ffeb4 Add filter by goal 2020-12-21 18:27:27 +01:00
Javi Martín
f76279a4dd Add form to assign targets to a record 2020-12-21 18:04:48 +01:00
Javi Martín
ed51c5dcd3 Add basic SDG Management content section
Note using `params[:relatable_type].classify` is recognized as a
security risk by some tools. However, it's a false positive, since we've
added constraints to the URL so that paramenter can only have the values
we trust.
2020-12-21 18:04:48 +01:00
Senén Rodero Rodríguez
2ad66409e2 Add SDG LocalTarget model 2020-12-08 11:30:46 +01:00
Javi Martín
42699275a1 Add relations between relatable models and SDGs
Note we cannot directly get all related SDGs through SQL because they're
spread through different tables.
2020-12-04 18:27:49 +01:00