Commit Graph

13635 Commits

Author SHA1 Message Date
Alberto
a1d6885132 Merge pull request #3472 from consul/map-image
Always use map image from admin site customization images
2019-05-07 16:24:28 +02:00
decabeza
a57397dd6c Always use map image from admin site customization images 2019-05-07 14:43:04 +02:00
decabeza
f40787561d Remove all references to question and external_url fields 2019-04-30 16:42:07 +02:00
decabeza
367c2e7b78 Fix hound warnings 2019-04-30 12:06:56 +02:00
decabeza
1719a8ed28 Adds styles to admin site customization documents 2019-04-30 12:00:59 +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
decabeza
4193bb193c Adds documents to menu customization admin helper 2019-04-30 11:59:57 +02:00
voodoorai2000
19b7526421 Add document upload from admin section 2019-04-30 11:59:08 +02:00
decabeza
4648906591 Remove deprecated task proposals spec
After run the rake to move external_url to description for Proposals and Legislation proposals this spec is failing because external_url field doesn't exists anymore.
2019-04-30 11:39:04 +02:00
decabeza
5bdac5c4f5 Remove question and external_url fields from legislation proposals 2019-04-30 11:35:47 +02:00
decabeza
0995480b73 Remove question and external_url fields from proposals 2019-04-30 11:35:47 +02:00
Raimond Garcia
9df433eeda Merge pull request #3462 from consul/1.0.0-beta
Release version 1.0.0-beta
2019-04-30 01:56:12 +02:00
voodoorai2000
d1ac727a6b Update release version number to 1.0.0-beta 2019-04-29 18:52:03 -05:00
voodoorai2000
20d20fb98e Update CHANGELOG for release 1.0.0-beta 2019-04-29 18:52:00 -05:00
Raimond Garcia
f5794a9f5d Merge pull request #3465 from consul/rails5_paths
Add lib folder path to eager_load_paths
2019-04-30 01:41:37 +02:00
Julian Herrero
2ba7355b00 Add lib folder path to eager_load_paths
Because autoloading is disabled in production with Rails 5,
using autoload_paths will not load needed classes from
specified paths. The solution to this, is to ask Rails
to eager load classes.

https://sipsandbits.com/2017/02/14/upgrading-a-ruby-on-rails-application/
2019-04-29 17:45:58 -05:00
Raimond Garcia
08d7863bb5 Merge pull request #3464 from consul/cleanup_rails5_dashboard
Cleanup Rails5 dashboard
2019-04-29 21:30:03 +02:00
Javi Martín
44d9ba66b7 Use puma as development web server
It seems to be the default in Rails 5 (we even have a configuration file
for it under `config/puma.rb`) and Capybara seems to need it to run
system specs in Rails 5.1:

https://github.com/teamcapybara/capybara/#setup
2019-04-29 13:08:43 -05:00
Javi Martín
825367145c Remove redundant test order option
The test order is now random by default.
2019-04-29 13:08:43 -05:00
Javi Martín
c43b0fea64 Use Rails 5 conventions in Dashboard
These models and migrations were added on a branch based on Rails 4.
2019-04-29 13:08:43 -05:00
Javi Martín
8094417828 Remove best_in_place
It was only used in one place, so it's best to remove it and use the
patterns we use everywhere else.
2019-04-29 12:37:28 -05:00
Javi Martín
f284d5c09e Remove record_tag_helper
It was only used in one place, and could easily be replaced.

Note we usually use HTML classes like `map-location` instead of
`map_location`, but I've kept the underscore for compatibility with the
previous version.
2019-04-29 12:36:09 -05:00
Alberto
b35a729750 Merge pull request #3412 from consul/proposal-dashboard
Add proposal's dashboard
2019-04-29 17:45:57 +02:00
decabeza
9f973bf789 Add message on dashboard request to archived proposals 2019-04-29 15:46:44 +02:00
decabeza
47985df4f3 Fix request_to_administrators checkbox on admin dashboard actions 2019-04-29 15:46:38 +02:00
decabeza
197cbcd9bd Fix styles of dashboard poster 2019-04-29 15:46:35 +02:00
decabeza
de72b65151 Use proposal_poll_path on communities poll links 2019-04-29 15:46:32 +02:00
decabeza
55fb14c6e3 Always show dashboard buttons 2019-04-29 15:46:27 +02:00
decabeza
4b7d7f27a4 Fix typo 2019-04-29 15:45:44 +02:00
decabeza
e88c66c92c Dont use faker gem on simulate successful proposal rake 2019-04-29 15:45:35 +02:00
decabeza
3add160b4b Change i18n to resources on next goal
This resources always are locked when are shown on next goal section.
2019-04-29 15:45:04 +02:00
decabeza
ad41f23a98 Improve rake to add published_at to proposals 2019-04-29 15:44:47 +02:00
voodoorai2000
992f1d23a1 Change syntax to delay dashboard emails
After updating to Rails5 It seems the after_action[1] in the dashboard's mailer is not beind called.

Using this syntax the emails are still being delayed and the after_action being called correctly.

[1] https://github.com/AyuntamientoMadrid/consul/pull/1945/files#diff-fdf5590f3241c439fcc9d2225c3cf4d8R3
2019-04-29 15:44:45 +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
e139057001 Disable dashboard email deliveries
We have to doble check all emails deliveries from the dashboard.

Using a setting to skip all dashboard email deliveries for now.

Note that a rake task to activated the `Setting["dashboard.emails"]` will need to be addded when we want to activate deliveries of these emails.
2019-04-29 15:43:46 +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
34834889d8 Fix Answer's class conflict
We have two models called `Answer`: The `Answer` model and the `Poll::Answer` model.

This conflict ocurrs when trying to create a user generated poll for a proposal. from the Dashboard. In that case we are getting an exception, only in the development environment, as the class `Answer` is loaded before the class `Poll::Answer` which is the one we want to use.

With this commit we are explicitly requiring the correct model, solving the class conflict.
2019-04-29 15:43:06 +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
99023a01c9 Fix merge conflicts 2019-04-29 14:22:22 +02:00
decabeza
51ced318e0 Merge branch 'master' into proposal-dashboard 2019-04-29 13:48:23 +02:00
Javier Martín
e13c4d8d10 Merge pull request #3460 from consul/backport-fix_remove_ballot_spec
Fix flaky spec: Ballots Groups Change my heading
2019-04-25 22:22:30 +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
Javier Martín
95ce139e0a Merge pull request #3458 from consul/backport-fix_access_denied_exception
Handle AccessDenied in management sessions
2019-04-25 21:53:15 +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
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
Javier Martín
b33401ca0f Merge pull request #3452 from consul/backport-fix_interpolation_share_message
Update share messages interpolation variables
2019-04-25 20:13:18 +02:00