Commit Graph

9013 Commits

Author SHA1 Message Date
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
Bertocq
5f5e9c4f26 Fix phone note english translation 2018-03-10 10:11:49 +01:00
Raimond Garcia
182a6fd619 Merge pull request #2532 from consul/release_v014
Release v0.14
2018-03-09 16:30:02 +01:00
rgarcia
41067b02c0 Update consul.json to v0.14 2018-03-09 16:27:12 +01:00
rgarcia
f6cafeb21d Update CHANGELOG v0.14 2018-03-09 16:27:00 +01:00
rgarcia
70bb796348 Revert CHANGELOG release 0.14
Adding changes to a separate PR
2018-03-09 14:28:41 +01:00
Alberto Calderón Queimadelos
a8e9da8e1c Merge pull request #2406 from consul/totally_remove_investment_interal_comment
Totally remove investment's internal_comments
2018-03-09 13:37:50 +01:00
Alberto García
9aac19bd9e Merge pull request #2527 from consul/legislation-proposals
Cleans legislation proposals
2018-03-09 13:32:17 +01:00
Alberto García
527e680461 Merge branch 'master' into legislation-proposals 2018-03-09 13:32:03 +01:00
Alberto García
eba4a3c6cb Merge pull request #2528 from consul/budgets-message
Heading link on budgets message
2018-03-09 13:25:39 +01:00
Bertocq
04316a4460 Remove internal_comments usage in migration script
Internal comments on migration script from SpendingProposal to
Investments are no longer in use, so removal is best option.
2018-03-09 12:27:04 +01:00
Bertocq
a360cf4fbc Remove deprecated internal_comments column from Investments 2018-03-09 11:45:15 +01:00
Bertocq
6d55a0712d Remove no longer usable investments rake task 2018-03-09 11:44:51 +01:00
Alberto Calderón Queimadelos
a55218ad9f Merge pull request #2443 from consul/fix_currency_locale
Use user locale instead of default locale to format currencies
2018-03-08 18:03:52 +01:00
Alberto García
8c6c567c76 Merge pull request #2525 from consul/social-share
Fixes social share buttons
2018-03-08 17:46:24 +01:00
Alberto Calderón Queimadelos
0e1d5d95a7 Revert "Make config.time_zone configurable at secrets.yml" 2018-03-08 17:12:00 +01:00
Alberto Calderón Queimadelos
496d88b655 Merge pull request #2468 from consul/make_timezone_configurable
Make config.time_zone configurable at secrets.yml
2018-03-08 16:33:56 +01:00
rgarcia
3016df00a7 Update CHANGELOG Unreleased section 2018-03-08 16:27:50 +01:00
rgarcia
445808201c Update CHANGELOG v0.14 2018-03-08 16:11:06 +01:00
Bertocq
d3a572e542 Avoid explicity ID values on fixtures if possible
The specs don't care about the actual ID value, only about using the
same value. Fixed ID values cause flaky specs and high maintenance issues
2018-03-08 14:48:07 +01:00
Bertocq
6e843730b0 Replace format_price for Budget#formatted_amount
ApplicationHelper#format_price and Budget#formatted_amount has the same
objective and code, but the Budget#formatted_amount method also uses the
currency of the Budget to correctly give currencies format.

By replacing usage of format_price with formatted_amount we can remove
format_price and have a single location for currency format logic.
2018-03-08 13:26:36 +01:00
decabeza
0bc0a2b1e8 Makes smaller text on participation not allowed div 2018-03-08 11:50:30 +01:00
decabeza
d70c46e578 Extract BudgetHeadingsHelper#heading_link & use it
Why:

The logic to construct the link to a heading (if it exists) is in three
different places, this is a clear candidate for a helper method.

How:

Just checking at the helper method if `assigned_heading` and `budget`
has values and composing the link if so.
2018-03-08 11:50:23 +01:00
decabeza
0e9190bc43 Adds heading link on different heading message 2018-03-08 11:50:09 +01:00
Bertocq
f0dc2a02a5 Add Budget#formatted_amount unit test 2018-03-08 11:42:22 +01:00