Commit Graph

8937 Commits

Author SHA1 Message Date
Angel Perez
0bf4afe8bc Replace PhantomJS/Poltergeist config with Headless Chrome 2018-03-27 14:47:48 -04:00
Angel Perez
e098e7b7bb Replace poltergeist with selenium-webdriver 2018-03-27 14:47:48 -04:00
Raimond Garcia
0b4b896a6a Merge pull request #2522 from wairbut-m2c/fix/dev_seed_flaky_spec_backport
Fix `rake db:dev_seed` task flaky spec
2018-03-27 20:22:28 +02:00
Raimond Garcia
4260c05f30 Merge pull request #2537 from consul/budgets-ui
Fixes budgets ui for all phases
2018-03-27 20:21:45 +02:00
Raimond Garcia
678faa17ec Merge pull request #2539 from consul/admin-budget-investments
Admin budget investment info
2018-03-27 20:21:03 +02:00
Raimond Garcia
f76ad2be84 Merge pull request #2540 from consul/user_segment_except_budget_supporters
User segment for users that haven't supported in budget
2018-03-27 20:13:57 +02:00
Raimond Garcia
c83dc13c56 Merge pull request #2538 from consul/admin-users
Admin users
2018-03-27 20:12:53 +02:00
Raimond Garcia
9526f489b7 Merge pull request #2550 from wairbut-m2c/docs/add-missing-nodejs-requirement
Add Node.js as requirement on README (spanish)
2018-03-27 20:05:07 +02:00
Raimond Garcia
9290f31d88 Merge pull request #2552 from consul/budgets_map_improvements
Backport: Budgets map improvements
2018-03-27 17:49:23 +02:00
María Checa
4713d37346 Add budget/investments#json_data method permissions 2018-03-27 15:26:48 +02:00
María Checa
064089926d Add ajax request for marker investment info 2018-03-27 15:26:46 +02:00
María Checa
535a96603a Add budget/investments#json_data method 2018-03-27 15:25:55 +02:00
María Checa
cd1a0548ba Add map_location#json_data method 2018-03-27 15:17:31 +02:00
Bertocq
7bfaf3c9c1 Fix read notifications translations 2018-03-27 00:29:41 +02:00
Alberto Calderón Queimadelos
3b1d79f3bc Merge pull request #2545 from consul/loofah_gem_update
Update loofah gem to 2.2.1 version
2018-03-26 21:11:17 +02:00
Angel Perez
92d7c44639 Add Node.js as requirement on README (spanish) 2018-03-25 21:46:40 -04:00
Raimond Garcia
0300d971b7 Merge pull request #2549 from consul/read_notifications
Extend notifications to be marked as read or unread
2018-03-23 22:30:23 +01:00
rgarcia
c9cad05a95 Fix dev seed specs 2018-03-23 19:57:51 +01:00
rgarcia
b35c750865 Remove unrelated budget recommendation's link
During the backport for “Read Notifications”[1] this link was added,
which belongs to a different backport “Budget Recommendations” which is
not quite ready to bring to upstream, yet 😌

[1] https://github.com/AyuntamientoMadrid/consul/pull/1304
2018-03-23 19:31:48 +01:00
Bertocq
92c9ad4e1b Add Notifications partial to admin menu 2018-03-23 11:48:43 +01:00
decabeza
6824086f30 Adds styles for notifications views 2018-03-23 11:48:28 +01:00
rgarcia
f7bfe5e171 Extend dev seeds to have notifications for all users
Even though an action that triggers a notification is made, the
notification is created in a separate step, reflecting how it is done
in the corresponding controller

https://github.com/AyuntamientoMadrid/consul/blob/master/app/controllers
/comments_controller.rb#L16
2018-03-23 11:48:16 +01:00
rgarcia
09c44ee583 Extend notifications to be marked as read and unread 2018-03-23 11:47:06 +01:00
Raimond Garcia
c4ad9b940c Merge pull request #2546 from consul/vote_in_multiple_headings
Allow supporting investments on more than one heading per group
2018-03-22 23:33:24 +01:00
rgarcia
073cf74818 Fix edge case
The user was able to vote as many investments as wanted in the first
heading voted. However in the second heading voted, only one investment
could be voted

This was due to the previous implementation, where you could only vote
in one heading. Note the `first` call in method
`heading_voted_by_user?(user)`

This commits simplifies the logic and allows voting for any investment
in any heading that the user has previously voted in
2018-03-22 23:08:41 +01:00
rgarcia
5c6eaa76ff Add headings_voted_by_user
This method was used only in Madrid’s fork, but it is now needed to
complete the backport for voting in multiple headings

There wasn’t a test in Madrid, so here goes one too. Even though, the
responsibility should probably be moved soon to the `Budget::Heading`.
For consistency with the related methods and tests it has been left in
the investment_spec
2018-03-22 22:24:58 +01:00
rgarcia
0398bb23cb Consistent spacing
Temporarily… because there are 2 kinds of Ruby developers, those who
indent methods under `private` and does who don’t

https://gist.github.com/joefiorini/1049083#gistcomment-37692
2018-03-22 22:24:58 +01:00
rgarcia
24fc2f9199 Improve translation text and make it a default
There was some inconsistency in this file, the `confirm_group` key was
in both the custom translations file and the default translations file.

Remove duplication and make it a default as it is a clearer message for
users. If an installation want to edit this message they can still do
it in the custom translations file
2018-03-22 22:24:58 +01:00
rgarcia
bdffb9765e Allow voting in multiple headings
Now that we have the option of voting in multiple headings per group,
the method of voting in a “different heading assigned” has become
deprecated and thus removed
2018-03-22 22:24:58 +01:00
rgarcia
730072e91e Add max votable headings to groups 2018-03-22 22:24:58 +01:00
Raimond Garcia
c1d7378c92 Merge pull request #2504 from consul/budget_group_name_edit
Allow Budget Group names to be edited
2018-03-22 22:12:04 +01:00
rgarcia
c8562e64dd Remove obsolete flag_count
No need for deprecation warnings in release notes, this is an attribute
that was used temporarily but did not make it to a Release
2018-03-22 20:48:19 +01:00
rgarcia
7a980d79e7 Removes use of slugs to edit group name
Changing a group’s `to_param` to return the slug instead of the id,
breaks many tests in the user facing interface

We should use slugs in upstream soon, but it should be done in a
separate PR, bringing the whole slug implementation from Madrid’s fork
and the corresponding test coverage
2018-03-22 20:06:53 +01:00
rgarcia
c908e91f00 Order budget headings by id
To maintain order after editing a heading’s name

We should probably add timestamps to `groups` and `headings` and order
by `created_at` instead

Could have done it in a separate PR, but gotta keep moving to other
priority issues. Creating issue for timestamps to do correctly and with
tests 😌
2018-03-22 10:20:07 +01:00
rgarcia
1083213ac7 Order budget groups by id
To maintain order after editing a group’s name

We should probably add timestamps to `groups` and `headings` and order
by `created_at` instead
2018-03-22 10:19:56 +01:00
rgarcia
86e4a5d853 Find group inside budget
We were having a problem were some groups where not updating correctly.

That was because it was finding the first group with that name. However
we were looking for another group with the same name from another budget

Apart from the group_id, we also get the budget_id in the params for
updating a group. By finding groups within that budget we get the
expected behaviour
2018-03-22 10:19:43 +01:00
Bertocq
68b914c364 Update loofah gem to 2.2.1 version
Details at https://github.com/flavorjones/loofah/issues/144
2018-03-21 23:25:43 +01:00
Alberto Calderón Queimadelos
7fad642f8d Merge pull request #2543 from wairbut-m2c/backport_1200_flaky_spec_poll_officing_officing_dashboard
Fix for flaky spec in Officing spec test file
2018-03-21 18:51:31 +01:00
Alberto Calderón Queimadelos
aeec82ca91 Merge pull request #2536 from wairbut-m2c/update_backport_1191_flaky_budget_investments_orders_random
Fix flaky spec: random investments order scenario
2018-03-21 18:41:44 +01:00
Raúl Fuentes
b9bd121655 Added test using have_content before selecting DNI or passport, the existence of the container is assured because have_conten waits for js to finish loading before checking 2018-03-21 17:24:00 +01:00
Alberto Calderón Queimadelos
8f2c357b95 Merge pull request #2542 from wairbut-m2c/backport-flaky-moderates-debates-hide
Fix Flaky spec: Moderate debates Hide
2018-03-21 17:17:04 +01:00
iagirre
7e90021cdf Change the method have_css for find
The old method have_css didn't wait, apparently,
the Capybara's max_wait_time.
It has been changed in favor of find,
one that waits the stablished time for
an element to appear in the screen.
2018-03-21 09:58:39 +01:00
Bertocq
2ecbfc76e0 Add Segment for users without supports on Budget
Created not_supported_on_current_budget at UserSegment along with model
spec scenario and translation strings.
2018-03-15 16:48:54 +01:00
decabeza
acebb07ddd Adds link to image and docs on admin budget investment info 2018-03-14 15:14:47 +01:00
decabeza
f05fdb88ea Adds link to username on admin users index view 2018-03-14 15:09:30 +01:00
decabeza
4fbc10d85e Fixes budgets ui for all phases 2018-03-14 15:01:56 +01:00
Raúl Fuentes
cd5923c41d updated test, changed fixed seeds for the new seed function 2018-03-14 11:13:59 +01:00
Alberto Calderón Queimadelos
bc03aee84d Merge pull request #2535 from consul/valuators_access_restriction
Restrict valuators access to edit/valute only on valuating phase
2018-03-13 00:56:05 +01:00
Bertocq
c0986c7bfb Fix investment creation for single budget usage
Budget Investment factory creates a secondary budget as a collateral
effect because it has a Heading factory that has a Group factory that
creates a Budget.

This was resulting in problems due to having two "active" Budgets created
and `current_budget` method not choosing the one that we expected
2018-03-12 23:06:32 +01:00
Bertocq
8fd6f8f1d6 Valuators access to edit/valute on right phase
When a valuator tries to edit/valuate an investment outside valuating
phase, an explanatory message will be shown along with a redirect to
prevent access.
2018-03-12 20:22:53 +01:00