Commit Graph

2547 Commits

Author SHA1 Message Date
María Checa
c2457e36a5 Add budget stats permissions for normal users and admins 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
f22a97468b makes code heading_id agnostic 2019-05-16 14:45:46 +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
be757f79d0 cleans up 2019-05-16 13:37:47 +02:00
rgarcia
b628631769 fixes specs 2019-05-16 13:37:47 +02:00
rgarcia
1f8d19c8ba adds basic graph specs 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
Javi Martín
9c991297c5 Fix typo 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
Javier Martín
9c02f5d0c2 Merge pull request #3486 from consul/backport-fix_typo_in_executions_spec
Fix typo in budget executions spec
2019-05-10 17:09:46 +02:00
Javi Martín
5812779974 Fix typo in budget executions spec
We were expecting the page not to have content which is actually there.
The test passed (most of the time) because before clicking the
"Milestones" link the content was not present, and we checked the page
content before the AJAX request generated by clicking the link had
finished.
2019-05-10 15:17:34 +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
a57397dd6c Always use map image from admin site customization images 2019-05-07 14:43:04 +02:00
decabeza
367c2e7b78 Fix hound warnings 2019-04-30 12:06:56 +02:00
decabeza
b023ceabdd Fixes not_to hound warnings 2019-04-30 12:00:54 +02:00
decabeza
62a29e2cf9 Adds missing i18n 2019-04-30 12:00:46 +02:00
voodoorai2000
19b7526421 Add document upload from admin section 2019-04-30 11:59:08 +02:00
decabeza
9f973bf789 Add message on dashboard request to archived proposals 2019-04-29 15:46:44 +02:00
decabeza
20f505ab7c Fix specs 2019-04-29 15:44:41 +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
voodoorai2000
6f3b213612 Refactor proposal poll routes
Moving routes from custom file to the proposal's routes file.
2019-04-29 15:43:25 +02:00
voodoorai2000
93972eeb33 Use custom url for proposal poll results 2019-04-29 15:42:27 +02:00
voodoorai2000
93ff173a0d Use a custom url for proposal polls
Before we used the standard poll url (vota/:id) for a user generated poll.

However this url is considered too important for this kind of polls, so we are changing it to a namespaced url (proposals/:proposal_id/polls/:id)
2019-04-29 15:42:04 +02:00
decabeza
51ced318e0 Merge branch 'master' into proposal-dashboard 2019-04-29 13:48:23 +02:00
Javi Martín
ca40e657fb Check page after an AJAX call removing a ballot
We were sending a new request without checking the previous one had
finished, and if it hadn't finished, the test failed.

This test started to fail after upgrading to Rails 5, since we removed
the change done in commit eda47eff which set `config.allow_concurrency`
to `false` in the test environment.

While we could re-introduce that configuration option, which might have
side effects, an easier solution is to check an AJAX request has been
completed before sending a new request depending on the previous one
seems to be a more solid option.

Note this test failed with two possible errors: "undefined method
`heading' for nil:NilClass" and "stale element reference: element is not
attached to the page document". This change fixes the second error; it
might fix the first error as well, but since I couldn't reproduce it
locally, we'll only be sure when this test stops failing in travis
builds.
2019-04-25 20:57:19 +02:00
decabeza
0994ef2342 Hide request to admin button for archived proposals 2019-04-24 14:08:22 +02:00
decabeza
0a40c747a3 Add default actions list on admin dashboard actions index 2019-04-24 14:05:05 +02:00
decabeza
4100bf2ddf Update dashboard specs 2019-04-24 14:00:38 +02:00
decabeza
c76b465ce8 Show message when request a resource to admins 2019-04-24 13:58:42 +02:00
decabeza
5b8fe4bb98 Add truncate to proposed action description
The show description link only appears if the description is longer than defined length.
2019-04-24 13:58:37 +02:00
decabeza
19c158f4eb Add pending and done filters to dashboard administrator tasks 2019-04-24 13:58:27 +02:00
decabeza
cb22e6cbfb Merge branch 'master' into proposal-dashboard 2019-04-23 17:12:47 +02:00
Raimond Garcia
b230cd29ab Merge pull request #3414 from consul/upgrade_to_rails_5
Upgrade to rails 5
2019-04-23 16:26:14 +02:00
Julian Herrero
7e422f2187 Fix bug management print voted investments
If budget is in balloting phase and there are voted investments, it
was not possible to print budgets investments because the ballot was
never being loaded in the controller and therefore an error was raised
when rendering the view.

Failure/Error: <% if ballot.has_investment?(investment) %>

  ActionView::Template::Error:
    undefined method `has_investment?' for nil:NilClass
      app/views/budgets/investments/_ballot.html.erb:3
      app/views/budgets/investments/_investment.html.erb:88
      app/views/custom/management/budgets/investments/print.html.erb:26
2019-04-17 14:19:32 +02:00
Julian Herrero
e714713d0c Refactor long lines
Also, use method `have_link' instead of `have_css' to make tests more
readable
2019-04-17 14:18:35 +02:00
Julian Herrero
879591cc5c Use let instead of an instance variable 2019-04-17 14:16:54 +02:00
rgarcia
d8fdc10ed6 fixes activity specs 2019-04-16 17:28:07 +02:00
Juanjo Bazán
f740a868f5 fixes specs with current devise response implementation 2019-04-16 17:28:07 +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
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
decabeza
7bd0f9c1d7 Adds spec to do not show questions section on budget poll 2019-04-03 22:28:19 +02:00
lalo
237a03552f Move admin budget investments tabs filters to advanced filters component 2019-04-03 22:27:48 +02:00
rgarcia
431c313487 Use scenario instead of it in feature specs 2019-04-03 22:23:27 +02:00
rgarcia
6fa7562181 Automatically create a budget poll if it does not exist 2019-04-03 22:23:22 +02:00