Commit Graph

11379 Commits

Author SHA1 Message Date
Julian Nicolas Herrero
1be64a5dc3 Merge pull request #3098 from consul/backport-1742-new_most_active_algorithm
[Backport] New algorithm for filter 'most active'
2018-12-13 12:46:18 +01:00
Javier Martín
e1620dfe8d Merge pull request #3103 from consul/backport-update_legislation_milestone_form
Edit only existing languages in milestones summary
2018-12-13 12:09:10 +01:00
Javier Martín
0e252b618f Merge pull request #3102 from consul/backport-milestone_status_texts
Update milestone status texts
2018-12-13 12:07:47 +01:00
Javier Martín
33ea9219ae Merge pull request #3101 from consul/backport-fix_milestone_validation
Fix milestone validation
2018-12-13 12:05:31 +01:00
Julian Herrero
ef835bef1c new algorithm for filter 'most active' 2018-12-13 11:42:22 +01:00
Julian Herrero
96dfa2fd65 add setting for new 'most active' algorithm 2018-12-13 11:41:27 +01:00
Alberto
e7ab3778b5 Merge pull request #3104 from consul/seeds-widgets
[Backport] Widgets dev seeds
2018-12-13 07:14:39 +01:00
decabeza
534ef9c492 Hides process on index if draft dates match with date current 2018-12-12 18:23:17 +01:00
decabeza
df221b43a0 Fixes hound warnings on legislation processes 2018-12-12 18:23:11 +01:00
decabeza
c7309369b4 Updates deprecated constants on dev_seed widgets 2018-12-12 18:07:38 +01:00
Javi Martín
449f810255 Edit only existing languages in milestones summary
Adding languages using this form would result in validation errors since
there's no way to fill in the title for the new translation.
2018-12-12 15:15:01 +01:00
Javi Martín
70b4225542 Extract partial to display language tabs 2018-12-12 15:15:00 +01:00
Javier Martín
8bcf713d10 Merge pull request #3100 from consul/backport-2743-add_milestones_to_legislation_processes
Add milestones to legislation processes
2018-12-12 15:12:36 +01:00
Javier Martín
908c06bece Merge pull request #3099 from consul/backport-2740-add_milestones_to_proposals
Add milestones to proposals
2018-12-12 15:05:01 +01:00
Javier Martín
a1df90c1b7 Merge pull request #3097 from consul/fix_milestone_translations_migration
Fix budget investment milestone translations migration
2018-12-12 14:48:59 +01:00
Javi Martín
1ff6390950 Fix proposal info rendering for managers
We were looking for the partial in management/proposals/info instead of
proposals/info.
2018-12-12 13:43:03 +01:00
Julian Herrero
01033e5371 change coordinates to make the map to be centered in Madrid 2018-12-12 11:00:16 +01:00
Javi Martín
041e1f3f7b Remove obsolete reference to investment milestones 2018-12-11 20:27:54 +01:00
Javi Martín
f96cab2f1c Update references to investment status
We've made milestone status polymorphic, and so the texts need to be
updated.
2018-12-11 20:27:54 +01:00
Javi Martín
dca95d608f Display description validation error in milestones
We had a validation rule for milestones which made sure either the
status or the description was present. However, since the description is
now translatable, the validation error wasn't being displayed in the
admin form.

Moving the validation rule to the translation object fixes the problem.
However, the translation object needs to check an attribute in the
milestone object in order to know whether the description is required or
not. This is tricky because by default it loads the milestone object
from the database, meaning it doesn't work with new records and it
ignores params sent by the browser.

The solution is to manually assign the globalized model before
validating the object. It's a hack, but apparently Rails doesn't provide
a better way to handle this case [1].

[1] https://github.com/rails/rails/issues/32024
2018-12-11 20:25:38 +01:00
Javi Martín
6974b7d03a Remove redundant specs
The same cases are tested in the previous `describe` block.
2018-12-11 20:25:38 +01:00
Javi Martín
281155dde5 Remove duplicate spec 2018-12-11 20:25:37 +01:00
Javi Martín
a42f5fab37 Add milestones summary to legislation processes 2018-12-11 20:19:48 +01:00
Javi Martín
b95ca9df8a Add milestones to legislation process view 2018-12-11 20:18:53 +01:00
Javi Martín
87f7e6aa2e Extract milestones content into a partial
We aren't going to use the `.tabs-panel` part when rendering milestones
in legislation processes.
2018-12-11 20:18:53 +01:00
Javi Martín
03dc43a500 Manage legislation process milestones 2018-12-11 20:18:53 +01:00
Javi Martín
2fcbee6261 Manage proposal milestones 2018-12-11 20:09:47 +01:00
Javi Martín
8c45be7887 Show proposal info in admin 2018-12-11 20:09:30 +01:00
Javi Martín
d3f11c3b55 Add search form to proposals admin index 2018-12-11 20:09:30 +01:00
Javi Martín
4770217373 Add proposals index in admin 2018-12-11 20:09:30 +01:00
Javi Martín
7891efee32 Add milestones to proposals 2018-12-11 20:09:30 +01:00
Javier Martín
81e0931988 Merge pull request #3095 from consul/backport-share_milestoneable_code
Make milestones code reusable
2018-12-11 20:08:07 +01:00
Javier Martín
db53be75d2 Merge pull request #3096 from consul/backport-1630-fix_flaky_localization_specs
Fix flaky localization specs
2018-12-11 19:56:37 +01:00
Javi Martín
df29b49d05 Make milestones view reusable 2018-12-11 19:22:55 +01:00
Javi Martín
3e83b5893c Make milestone specs reusable 2018-12-11 19:22:55 +01:00
Javi Martín
64d6b7491a Make partial listing milestones reusable
So it isn't specific to budget investments anymore.
2018-12-11 19:22:55 +01:00
Javi Martín
6f342baf7d Move milestones scope to milestoneable concern 2018-12-11 19:22:55 +01:00
Javi Martín
abe8527e54 Randomize milestones per record in dev seeds 2018-12-11 19:22:55 +01:00
Javi Martín
1c531cfc00 Randomize milestones publication date in dev seeds 2018-12-11 19:22:55 +01:00
Javi Martín
2fdd367f22 Move milestone dev seeds to their own file 2018-12-11 19:22:55 +01:00
Julian Herrero
fcfee3a906 apply missing requeriments in PR #3043
In this PR https://github.com/consul/consul/pull/3043
there were some change requests. In order to keep moving
we decided to merge the PR and do the changes ourselves.
2018-12-11 18:21:14 +01:00
Julian Nicolas Herrero
9e759e0a39 Merge pull request #3043 from milber/content_blocks_for_headings
Added feature to add content block to headings in sidebar
2018-12-11 16:44:02 +01:00
Julian Nicolas Herrero
6aa54d6c62 Merge branch 'master' into content_blocks_for_headings 2018-12-11 16:40:25 +01:00
Julian Nicolas Herrero
9aab3ddd7b Merge pull request #3038 from MatheusMiranda/add_map_to_heading_page
Add map to sidebar on Heading's page
2018-12-11 16:32:35 +01:00
Javi Martín
b685419b28 Fix "Remove obsolete model usage"
We accidentally changed the schema when modifying an existing migration.
It wasn't critical because we're going to remove that table in the
future, but it resulted in conflicts for users who had already run the
migration before its modification.

This commit fixes commit 4a7f479.
2018-12-11 13:54:38 +01:00
Alberto
05abcbe944 Merge pull request #3081 from consul/featured-proposals
[Backport] Featured proposals
2018-12-10 22:17:51 +01:00
Alberto
22790535c7 Merge pull request #3080 from consul/ui-design
[Backport] UI design
2018-12-10 22:16:32 +01:00
Javi Martín
34e83292a9 Reload I18n after stubbing available locales
Not doing so might cause the following test to use translations for
only one locale. This scenario happens if the previous test executes
I18n.reload!, which resets I18n.config.backend's "@translations"
instance variable.

So, the sequence could be as follows:

1. The previous tests sets `@translations = nil`
2. This test stubs `available_locales` to `[:en]`
3. `@translations` gets only translations for `en`
4. The following test doesn't find translations for Spanish and fails
2018-12-10 20:37:30 +01:00
Javier Martín
bd363466a8 Merge pull request #3089 from consul/backport-polls-show
Polls voted by
2018-12-10 20:19:26 +01:00
Javier Martín
64e8dbf67b Merge pull request #3094 from consul/fix_trailing_whitespace
Remove trailing whitespace
2018-12-10 20:15:24 +01:00