Commit Graph

1983 Commits

Author SHA1 Message Date
rgarcia
51ab4a430e Load budget in stats controller 2019-05-16 22:01:42 +02:00
Bertocq
e0e02b47c0 Add Budgets Stats Controller, route and ability on reviewing ballots and finished budget 2019-05-16 22:01:42 +02:00
Javier Martín
668b6cfd73 Merge pull request #3499 from consul/backport-admin_stats
Add admin budget stats
2019-05-16 20:41:39 +02:00
Juanjo Bazán
110ee961e3 adds budget stats for final voting to admin stats 2019-05-16 14:45:46 +02:00
Juanjo Bazán
5be54b57da reduces current admin budget stats as supporting phase 2019-05-16 14:45:45 +02:00
rgarcia
11437a1d40 add budget investment stats 2019-05-16 13:41:49 +02:00
rgarcia
a31b62526b removes unused multiple lines per graph 2019-05-16 13:37:47 +02:00
rgarcia
cfe3f95f5c moves graphs to individual views 2019-05-16 13:37:47 +02:00
Javier Martín
c39a3d7525 Merge pull request #3492 from consul/backport-fix_delete_budget_with_polls
Don't destroy budgets with an associated poll
2019-05-16 13:07:18 +02:00
Javi Martín
1b323383a8 Don't destroy budgets with an associated poll
We were getting an exception due to foreign key database violations.
2019-05-13 13:44:58 +02:00
Alberto
60c02cc19a Merge pull request #3466 from consul/admin-documents
Add document uploads from admin section
2019-05-10 17:57:22 +02:00
Javi Martín
55c8fa3297 Fix obsolete respond_with_bip usage
Since we removed the `best_in_place` gem, this method doesn't exist
anymore. We're replacing it with what the method actually does.

Note the test doesn't check the poll is correctly updated. We could add
a `visit proposal_dashboard_polls_path(proposal)` before checking the
"Show results" field, but then we would enter a race condition between
this request and the AJAX request. A proper solution would be to provide
actual feedback to the user so they know the poll has been updated, and
then checking that feedback is present in the tests.
2019-05-09 19:41:04 +02:00
decabeza
1719a8ed28 Adds styles to admin site customization documents 2019-04-30 12:00:59 +02:00
voodoorai2000
19b7526421 Add document upload from admin section 2019-04-30 11:59:08 +02:00
voodoorai2000
d1ac727a6b Update release version number to 1.0.0-beta 2019-04-29 18:52:03 -05:00
decabeza
47985df4f3 Fix request_to_administrators checkbox on admin dashboard actions 2019-04-29 15:46:38 +02:00
voodoorai2000
dfbdc0568c Allow actions to be unexecuted
Before actions could be marked as executed. With this commit we are also allowing actions to be marked as unexecuted.
2019-04-29 15:43:53 +02:00
decabeza
51ced318e0 Merge branch 'master' into proposal-dashboard 2019-04-29 13:48:23 +02:00
Javier Martín
e0484e45ec Merge pull request #3459 from consul/backport-fix_cross_origin_exception
Fix InvalidCrossOriginRequest response
2019-04-25 22:01:51 +02:00
Javi Martín
d90efa15e4 Fix InvalidCrossOriginRequest response
When requesting files like `/hackattempt.js`, the pages controller was
responding with 404 status code.

However, since the request was considered a JavaScript request (because
of the `.js` extension), the response was also considered to be a
JavaScript one, and since the request wasn't an AJAX request, our
protection from forgery was preventing a potential security issue by
raising an InvalidCrossOriginRequest exception.

By setting HTML as content type, we correctly respond with a 404 status
code.

More info:

https://die-antwort.eu/techblog/2018-08-avoid-invalid-cross-origin-request-with-catch-all-route/
2019-04-25 20:48:38 +02:00
Javi Martín
286e0ca878 Handle AccessDenied in management sessions
We were raising a `CanCan::AcessDenied` and were getting a 500 Internal
Server Error.

I've chosen to do the same thing we do in the ApplicationController.
There are other options to handle this request, like redirecting to the
login page or returning a 401 Unauthorized HTTP status.
2019-04-25 20:36:50 +02:00
Juanjo Bazán
c63c06b7ec protect_from_forgery is not prepended by default
so it has to appear before devise's auth methods
2019-04-25 14:22:19 +02:00
decabeza
18f0697ef7 Fix proposal dashboard settings 2019-04-24 14:00:48 +02:00
decabeza
19c158f4eb Add pending and done filters to dashboard administrator tasks 2019-04-24 13:58:27 +02:00
decabeza
2cff3767c1 Remove open in new tab option for links 2019-04-24 13:58:13 +02:00
decabeza
cb22e6cbfb Merge branch 'master' into proposal-dashboard 2019-04-23 17:12:47 +02:00
Senén Rodero Rodríguez
97974a8bc7 Set globalize fallbacks for requests
New version of globalize uses RequestStore gem to store I18n.locale and
Globalize.fallbacks in a per request basis to avoid collissions between
different requests. This gem update broke Globalize.fallback results
because it tries to fetch fallbacks from RequestStore, where there is no
locale fallbacks definition.
2019-04-17 17:40:57 +02:00
Angel Perez
26b213c186 Use Legislation::BaseController on instead of ApplicationController 2019-04-17 17:40:56 +02:00
Senén Rodero Rodríguez
7c5fa253f5 Fix queries and scopes after column deletion
Some queries were accessing original column instead of the new
translatable one. This should have been causing unexpected behavior
for requests maded in a different locale than the application default.
2019-04-17 17:40:55 +02:00
Senén Rodero Rodríguez
596ef8d1ed Fix queries and scopes after column deletion
Some queries were accessing original column instead of the new
translatable one. This should have been causing unexpected behavior
for requests maded in a different locale than the application default.
2019-04-17 17:40:55 +02:00
Julian Herrero
1a21b779ac Fix deprecation warning calling `env' in controllers 2019-04-17 17:40:55 +02:00
Julian Herrero
fb81f45a73 Fix redirect_to :back deprecation warning 2019-04-17 17:40:55 +02:00
Angel Perez
e7f39bc454 Use head :ok when expecting an empty response body 2019-04-17 17:40:55 +02:00
Angel Perez
ee2b87aedf Use .where clause first when calling .destroy_all method 2019-04-17 17:40:55 +02:00
Angel Perez
37aa082943 Fix redirect_to deprecation warning on Admin::Legislation::Processes controller 2019-04-17 17:40:55 +02:00
rgarcia
90bcfe7a78 Fix parameterise deprecation warning
DEPRECATION WARNING: Passing the separator argument as a positional
parameter is deprecated and will soon be removed. Use `separator: '_'`
instead. (called from followable_translation_key at
/home/travis/build/consul/consul/app/controllers/follows_controller.rb:2
5)
2019-04-17 17:40:55 +02:00
rgarcia
f23fd6f3bb Remove parameterise deprecation warning
DEPRECATION WARNING: Passing the separator argument as a positional
parameter is deprecated and will soon be removed. Use `separator: '_'`
instead.
2019-04-17 17:40:55 +02:00
rgarcia
c6ab5dbe1b Remove before_filter deprecation warning
DEPRECATION WARNING: before_filter is deprecated and will be removed in
Rails 5.1. Use before_action instead. (called from
<class:RegistrationsController> at
/home/travis/build/consul/consul/app/controllers/users/registrations_con
troller.rb:3)
2019-04-17 17:40:55 +02:00
rgarcia
a4f0161aa8 fixes specs related to ActionController params 2019-04-17 17:40:55 +02:00
alejandro
bafab3b769 fixes some deprecation warnings 2019-04-17 17:40:52 +02:00
rgarcia
1077a632cb permits parameters in urls 2019-04-16 17:28:07 +02:00
rgarcia
4bce38bd64 Fix deprecated devise syntax
https://stackoverflow.com/questions/37341967/rails-5-undefined-method-fo
r-for-devise-on-line-devise-parameter-sanitizer
2019-04-16 17:28:07 +02:00
alejandro
4c5d58448e fixes deprecation warning for uniq 2019-04-16 17:28:07 +02:00
Javier Martín
bc9d66ea31 Merge pull request #3432 from consul/fix_exception_with_wrong_token
Fix exception when confirming an invalid token
2019-04-10 18:55:44 +02:00
María Checa
394177213c Adds Ballot Sheet model and business logic 2019-04-10 16:04:39 +02:00
María Checa
ccf8d3a8e2 Adds ballot sheets controller and main views 2019-04-10 16:03:47 +02:00
Javi Martín
78c6395e5f Respond with 404 when confirming an invalid token
We were getting a 500 Internal Server Error because `find_by` returned
`nil`, but the code assumed it returned an object responding to
`encrypted_password`. In this case, maybe some other status code (like
400 or 401) might be more appropriate, but I've kept 404 because it was
easier to implement and I wasn't sure which one was better.

Also note ideally we would test the controller using:

expect(response).to have_http_status(:not_found)

However, we would need to configure the test to show exceptions and not
to consider all requests local. I haven't been able to do so for
controller tests, and doing so for feature/request specs seems to
require changes in the test environment configuration which would affect
other tests.
2019-04-10 12:41:21 +02:00
Javier Martín
3ccdf039e4 Merge pull request #3344 from consul/backport-budget_ballots
Allow voting Budget Investments in booths
2019-04-09 13:54:00 +02:00
decabeza
94b8caffca Merge branch 'master' into proposal-dashboard 2019-04-04 14:08:30 +02:00
lalo
237a03552f Move admin budget investments tabs filters to advanced filters component 2019-04-03 22:27:48 +02:00