Commit Graph

15767 Commits

Author SHA1 Message Date
dependabot-preview[bot]
67f3b7dc67 Bump capybara-webmock from 0.5.3 to 0.5.5
Bumps [capybara-webmock](https://github.com/hashrocket/capybara-webmock) from 0.5.3 to 0.5.5.
- [Release notes](https://github.com/hashrocket/capybara-webmock/releases)
- [Commits](https://github.com/hashrocket/capybara-webmock/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-17 13:16:36 +00:00
Javier Martín
1ab1e68832 Merge pull request #4082 from consul/disable_phase
Disable phase date fields when a phase is disabled
2020-08-15 13:47:24 +02:00
Javi Martín
1e70a3db02 Disable phase date fields when a phase is disabled
The JavaScript involved wasn't working since we removed the disable-date
attribute in commit 73ff6881.

We're also improving the JavaScript in two ways:

First, we trigger the `change` event immediately, so when the page loads
date fields are disabled when phases are disabled.

And second, we don't remove the selected dates when disabling a phase,
so disabling it and enabling it again will keep the selected values.
2020-08-15 13:31:32 +02:00
Javi Martín
6172dd0a56 Group phase related fields in fieldsets
We were using a <label> tag with no associated field where a <legend>
tag was more appropriate. With a fieldset, we also make it obvious these
fields are related.
2020-08-15 13:31:32 +02:00
Javier Martín
146ffc8b9a Merge pull request #3905 from consul/dependabot/bundler/paperclip-6.1.0
Bump paperclip from 5.2.1 to 6.1.0
2020-08-14 23:17:12 +02:00
Javier Martín
9995d873bd Merge pull request #4075 from consul/dependabot/bundler/groupdate-5.1.0
Bump groupdate from 3.2.0 to 5.1.0
2020-08-14 23:11:40 +02:00
dependabot-preview[bot]
9d9824d1f3 Bump groupdate from 3.2.0 to 5.1.0
Bumps [groupdate](https://github.com/ankane/groupdate) from 3.2.0 to 5.1.0.
- [Release notes](https://github.com/ankane/groupdate/releases)
- [Changelog](https://github.com/ankane/groupdate/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ankane/groupdate/compare/v3.2.0...v5.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-14 20:42:18 +00:00
Javier Martín
b6153c9e08 Merge pull request #3935 from consul/dependabot/bundler/omniauth-1.9.1
Bump omniauth from 1.9.0 to 1.9.1
2020-08-14 22:40:29 +02:00
dependabot-preview[bot]
8419d7fbd7 [Security] Bump omniauth from 1.9.0 to 1.9.1
Bumps [omniauth](https://github.com/omniauth/omniauth) from 1.9.0 to 1.9.1. **This update includes a security fix.**
- [Release notes](https://github.com/omniauth/omniauth/releases)
- [Commits](https://github.com/omniauth/omniauth/compare/v1.9.0...v1.9.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-14 20:26:15 +00:00
dependabot-preview[bot]
7786e45114 Bump paperclip from 5.2.1 to 6.1.0
Bumps [paperclip](https://github.com/thoughtbot/paperclip) from 5.2.1 to 6.1.0.
- [Release notes](https://github.com/thoughtbot/paperclip/releases)
- [Changelog](https://github.com/thoughtbot/paperclip/blob/master/NEWS)
- [Commits](https://github.com/thoughtbot/paperclip/compare/v5.2.1...v6.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-14 20:24:08 +00:00
Javier Martín
9b955bdd67 Merge pull request #3665 from consul/dependabot/bundler/daemons-and-capistrano3-delayed-job-1.3.1
Bump daemons and capistrano3-delayed-job
2020-08-14 22:22:18 +02:00
dependabot-preview[bot]
f397d91e04 Bump daemons and capistrano3-delayed-job
Bumps [daemons](https://github.com/thuehlinger/daemons) and [capistrano3-delayed-job](https://github.com/AgileConsultingLLC/capistrano3-delayed-job). These dependencies needed to be updated together.

Updates `daemons` from 1.2.6 to 1.3.1
- [Release notes](https://github.com/thuehlinger/daemons/releases)
- [Changelog](https://github.com/thuehlinger/daemons/blob/master/Releases)
- [Commits](https://github.com/thuehlinger/daemons/compare/v1.2.6...v1.3.1)

Updates `capistrano3-delayed-job` from 1.7.5 to 1.7.6
- [Release notes](https://github.com/AgileConsultingLLC/capistrano3-delayed-job/releases)
- [Commits](https://github.com/AgileConsultingLLC/capistrano3-delayed-job/compare/v1.7.5...v1.7.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-14 20:09:08 +00:00
Javier Martín
3ae7148ff4 Merge pull request #4044 from consul/dependabot/bundler/wicked_pdf-2.1.0
Bump wicked_pdf from 1.1.0 to 2.1.0
2020-08-14 22:03:04 +02:00
dependabot-preview[bot]
0de2b7d56d Bump wicked_pdf from 1.1.0 to 2.1.0
Bumps [wicked_pdf](https://github.com/mileszs/wicked_pdf) from 1.1.0 to 2.1.0.
- [Release notes](https://github.com/mileszs/wicked_pdf/releases)
- [Changelog](https://github.com/mileszs/wicked_pdf/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mileszs/wicked_pdf/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-14 18:46:10 +00:00
Javier Martín
07a6279f58 Merge pull request #3710 from consul/dependabot/bundler/jquery-fileupload-rails-1.0.0
Bump jquery-fileupload-rails from 0.4.7 to 1.0.0
2020-08-14 20:42:36 +02:00
Javier Martín
4d947e5cd5 Merge pull request #3662 from consul/dependabot/bundler/rails-assets-markdown-it-9.0.1
Bump rails-assets-markdown-it from 8.2.2 to 9.0.1
2020-08-14 20:29:03 +02:00
dependabot-preview[bot]
7bbaad9f52 Bump jquery-fileupload-rails from 0.4.7 to 1.0.0
Bumps [jquery-fileupload-rails](https://github.com/tors/jquery-fileupload-rails) from 0.4.7 to 1.0.0.
- [Release notes](https://github.com/tors/jquery-fileupload-rails/releases)
- [Commits](https://github.com/tors/jquery-fileupload-rails/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-14 18:26:31 +00:00
dependabot-preview[bot]
637d162b74 Bump rails-assets-markdown-it from 8.2.2 to 9.0.1
Bumps rails-assets-markdown-it from 8.2.2 to 9.0.1.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-14 18:07:14 +00:00
Javier Martín
84a690f19e Merge pull request #3605 from consul/dependabot/bundler/rails-assets-leaflet-1.5.1
Bump rails-assets-leaflet from 1.2.0 to 1.5.1
2020-08-14 20:05:27 +02:00
Javier Martín
11204b0194 Merge pull request #4083 from consul/disable_buttons
Don't disable button to download emails
2020-08-14 18:37:07 +02:00
dependabot-preview[bot]
3ccc0cfcf0 Bump rails-assets-leaflet from 1.2.0 to 1.5.1
Bumps rails-assets-leaflet from 1.2.0 to 1.5.1.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-14 11:15:05 +00:00
Javier Martín
545501ae0f Merge pull request #3708 from consul/dependabot/bundler/cocoon-1.2.14
Bump cocoon from 1.2.11 to 1.2.14
2020-08-14 13:11:52 +02:00
Javier Martín
2094c25eba Merge pull request #3865 from consul/dependabot/bundler/acts-as-taggable-on-6.5.0
Bump acts-as-taggable-on from 6.0.0 to 6.5.0
2020-08-14 12:56:25 +02:00
dependabot-preview[bot]
c23ece99e1 Bump cocoon from 1.2.11 to 1.2.14
Bumps [cocoon](https://github.com/nathanvda/cocoon) from 1.2.11 to 1.2.14.
- [Release notes](https://github.com/nathanvda/cocoon/releases)
- [Changelog](https://github.com/nathanvda/cocoon/blob/master/History.md)
- [Commits](https://github.com/nathanvda/cocoon/compare/v1.2.11...v1.2.14)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-14 10:41:23 +00:00
Javier Martín
13e70ed492 Merge pull request #4077 from consul/fix_orbit
Fix poll answer images not being displayed
2020-08-13 18:27:57 +02:00
Javi Martín
e319b93dc6 Don't disable button to download emails
Rails automatically disables buttons when submitting a form. This works
fine most of the time: for AJAX requests, it enables them again after
the request is complete, and for non-AJAX requests, the button is
replaced by a new element when the new page loads.

However, there's an exception. When a request returns data so users can
download a fire, the request is not an AJAX one and the button is not
replaced. So users are left with a disabled button they can no longer
click.

So in this case, we aren't disabling the button after a user clicks it.
2020-08-13 18:11:02 +02:00
Javi Martín
38ebfed6ea Remove redundant code to prevent double submission
As mentioned in commit 7f30d0c6, Rails already does it automatically.
2020-08-13 18:11:02 +02:00
Javier Martín
373661025c Merge pull request #4080 from consul/banner_margin
Fix banner overlapping with other content
2020-08-12 18:25:41 +02:00
Javi Martín
e5f71d33d0 Fix poll answer images not being displayed
After updating foundation-rails in commit 58071fd6, the orbit slider
stopped working properly. That's because the `.orbit-slide` elements now
use a `position: absolute` rule, and so our rule for `.orbit-container`
elements making their height 100% (which we added in order to be able to
add images with different heights) makes them have a height of 0px,
since now the `.orbit-slide` elements are not part of the document flow
anymore.

Making the `.orbit-slide` elements have relative position fixes this
issue, but introduces a different one, producing a really bad-looking
animation when changing a slide.

So we're disabling the animation as well in order to avoid this jump.

This change also fixes another issue introduced in commit 58071fd6 which
caused slide controls to stop working when changing slides back and
forth.
2020-08-12 17:18:49 +02:00
Javi Martín
0b83be6837 Apply banner default colors to dev seeds
Banners created through the admin form were getting the default color.
However, banners created by other means (like the `db:dev_seed` rake
task) were not getting these default values.

This feature was originally implemented when we were using Rails 4.
With Rails 5, we can provide default values to all new banners and
simplify the code at the same time thanks to its `attribute` method.

Now, when creating a new banner, instead of getting a blank space, we
get an empty line with the banner's default background color, which most
users won't know what it's about until they fill in the banner's title.
So we're not displaying the content of the banner when it's empty,
thanks to the `:empty` CSS pseudoclass.
2020-08-12 17:16:11 +02:00
Javi Martín
361b7ee09d Fix banner text alignment
Unlike the rest of the page, it had no left margin nor padding
whatsoever.
2020-08-12 17:01:40 +02:00
Javi Martín
14a5d82377 Fix banner overlapping with other content
In some sections we had negative top margins to compensate the header
bottom margin. However, when adding a banner between the header and
those sections, the negative margin caused the content of those sections
to overlap with the content of the banner.

Removing the negative margins when a banner is present solves the issue.
2020-08-12 17:01:40 +02:00
Javi Martín
400c3a6fa0 Move header margin styles to CSS
Using HTML classes to apply styles to certain elements makes views
harder to customize.
2020-08-12 17:01:40 +02:00
Javier Martín
b8894eac70 Merge pull request #3699 from consul/upgrade_turbolinks
Bump turbolinks to 5.2.1
2020-08-12 14:34:19 +02:00
Javier Martín
a56c2d4a23 Merge pull request #4079 from consul/get_params
Fix redirect with GET params of after POST requests
2020-08-12 14:25:08 +02:00
Senén Rodero Rodríguez
b9ce68bc82 Set marker coordinates as map center when map location fields has valid coordinates
When a user recovers a page from browser history where placed a
marker in different map pane (visible map layer) marker was
successfully added to the map but the map center is the one
defined at Settings map properties so the marker was not visible
to the user.

Now when map_location form has valid coordinates we use them
instead of default map center settings. This will avoid the user to
have to rellocate the marker (or find the correct pane where the
marker was added) if already placed.
2020-08-12 10:10:58 +02:00
Senén Rodero Rodríguez
6aa94a787c Use map location form latitude, longitude and zoom when valid
When using an editable map is better to load marker latitude, longitude and
map zoom from form fields so we can show the marker at latest position defined
by user when the page was restored from browser history.

To reproduce this behavior:
0. Undo this commit
1. Go to new proposal page
2. Place the proposal map marker
3. Go away to any other page
4. Restore new proposal page from browser history.

At this point you should not see the recently placed marker.

The same thing happens when editing a proposal.
2020-08-12 10:10:58 +02:00
Senén Rodero Rodríguez
289426c1c3 Destroy maps before leaving the current page
If we do not do this a map could be initialized twice times or more
when restoring a page with a map causing weird UI effects and
loading some map layers also twice times or more.

Need to add a maps array to be able to store all initialized
(visible) maps so we can destroy them when needed. Notice that
we are destroying maps also when admin settings tabs changes
(only visible ones), this is again to avoid to re-initialize map more
than once when users navigate through settings tabs, another
option to the settings issue could be to detect if the map was
already initialized to skip uneeded initialization.
2020-08-12 10:10:58 +02:00
Senén Rodero Rodríguez
87339451de Reset columns_selector before caching the page
This will allow to initialize this module again without duplicating
columns checkboxes and without breaking the page.
2020-08-12 10:10:58 +02:00
Senén Rodero Rodríguez
137e0f5a64 Remove description for screen readers
It was being duplicated when restoring a page by using browser
history. With this solution we will avoid to have screen readers
descriptions more than once inside any sociual share button.
2020-08-12 10:07:35 +02:00
Senén Rodero Rodríguez
6b17452bd5 Fix "Publish comment" button when restoring a page from browser cache
We need to use page body event delegation so it will work with any
element even with the ones added through ajax, in this case the
annotation comments box form. By doing this way we do not need
this code on the server response anymore.

Furthermore JS events defined at ajax responses are not part of
application javascript and are lost when restoring a page from
browser cache, you can try to apply the same event delegation
technique to the `erb` file and it wont work just because events
added dinamically are not treated the same than `application.js`
code.

To reproduce the error:

  1. Load an annotatable draft version
  2. Move to any other page
  3. Go back

Now "Publish comment" button wont work.
2020-08-12 10:07:35 +02:00
Senén Rodero Rodríguez
fc0625df8b Destroy Annotator app before storing page into brwoser cache
If we do not destroy annotator app before storing the page at
browser cache we will unnecesarily initialize annotations twice (or
more) duplicating Annotator HTML markup and causing
unexpected  errors.

Without this commit you will find an error when restoring a page with
annotator, you can click on any annotation and you will see the annotation
comments are being loaded twice.

IMO this is an idempotency issue within Annotator JS library.
2020-08-12 10:07:35 +02:00
Senén Rodero Rodríguez
da658f3d8c Hack datepicker to make it work with Turbolinks 5.x
Patch extracted from here the comments on turbolinks issue 253 and
converted to vanilla javascript.

The hide action over datepickers ensures us that opened datepickers
will be closed before leving the page. Previously if you open any
datepicker and then move to previous page you will keep seeing the
datepicker in the restored page.
2020-08-12 10:07:35 +02:00
Javi Martín
83e4633643 Don't redirect to POST request URLs after sign out
Sometimes we define URLs for POST requests which are not defined for GET
requests, such as "/residence", so redirecting to it after signing out
results in a routing error.

So instead of using the request referer, we're using the stored location
devise uses, and we're not storing locations in POST requests.
2020-08-11 18:19:48 +02:00
Javi Martín
2fa8792a35 Redirect users in homepage to homepage after login
For reasons I'm not sure about, the homepage (and the welcome pages)
were an exception in our "redirect users to the same page they were"
policy.

I'm not sure about the welcome pages (no test was present indicating
they should behave in a special way), but in the case of the home page,
it was a bit annoying to be redirected to a different place after
signing in.
2020-08-11 18:19:27 +02:00
Andriy Iun
1ee750e042 Keep GET params in return URL
When signing in from a page containing GET params, like
`/budgets/1/investments?heading_id=4`, we were redirected to a URL
without those GET params; in this case, `/budgets/1/investments`.

Using the request fullpath, as recommended in the devise documentation,
keeps these parameters when redirecting.
2020-08-11 18:19:25 +02:00
dependabot-preview[bot]
d036f09002 Bump rollbar from 2.18.0 to 2.27.0
Bumps [rollbar](https://github.com/rollbar/rollbar-gem) from 2.18.0 to 2.27.0.
- [Release notes](https://github.com/rollbar/rollbar-gem/releases)
- [Changelog](https://github.com/rollbar/rollbar-gem/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollbar/rollbar-gem/compare/v2.18.0...v2.27.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-11 10:54:23 +00:00
Javier Martín
7a1bd06fa4 Merge pull request #4078 from consul/bump_mdl
Bump mdl from 0.5.0 to 0.10.0
2020-08-11 12:52:28 +02:00
Javier Martín
f22e508398 Merge pull request #4081 from consul/polls_feature_flag
Add feature flag exception for the module polls
2020-08-11 12:49:27 +02:00
Javi Martín
193316bac6 Apply spaces inside code span elements mdl rule 2020-08-11 12:13:23 +02:00