Commit Graph

15767 Commits

Author SHA1 Message Date
taitus
574a5d0067 Update old migrations to maintain consistency
After merge "Bump paperclip from 5.2.1 to 6.1.0 #3905" as indicated in
the release_notes columns type for attachments are changed from integer
to bigint.
For this reason we edit old migrations so that they continue to
generate integer as before.
2020-09-08 11:00:19 +02:00
Javi Martín
c866a8667b Merge pull request #4117 from consul/legislation-process-default-attributes
Apply Legislation Process default colors to dev seeds
2020-09-08 10:30:05 +02:00
taitus
85ffc70f5f Apply Legislation Process default colors to dev seeds
Legislation Processes created through the admin form were getting the default color.
However, Legislation processes 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 Legislation processes
and simplify the code at the same time thanks to its `attribute` method.

Related commit:
https://github.com/consul/consul/pull/4080/commits/0b83be6
2020-09-08 10:07:43 +02:00
Javier Martín
a4e39e66ed Merge pull request #4051 from rockandror/upgrade_jquery
Upgrade to jQuery 3.5.1
2020-09-07 00:22:19 +02:00
Senén Rodero Rodríguez
d7efd748fa Apply jQuery 3.0 upgrade_guide recommendation
Use recommented way to define document-ready handlers. See [1]

[1] https://jquery.com/upgrade-guide/3.0/#deprecated-document-ready-handlers-other-than-jquery-function
2020-08-28 16:10:31 +02:00
Senén Rodero Rodríguez
b499c0dcdd Solve bindmethod deprecation warning
As mentioned at the jQuery 3.0 upgrade guide [1] the `bind` method is deprecated. Replace with `on` method.

[1] https://jquery.com/upgrade-guide/3.0/#deprecated-bind-and-delegate
2020-08-28 16:10:31 +02:00
Javi Martín
b8e352145c Use prop() instead of removeAttr()
According to the jQuery upgrade guide:

> It is almost always a mistake to use .removeAttr("checked") on a DOM
> element. The only time it might be useful is if the DOM is later going
> to be serialized back to an HTML string. In all other cases,
> .prop("checked", false) should be used instead.
2020-08-28 16:10:31 +02:00
Javi Martín
996062fa19 Reset language select after adding a language
It worked differently after upgrading to jQuery 3. According to the
jQuery upgrade guide:

> It is almost always a mistake to use .removeAttr("checked") on a DOM
> element. The only time it might be useful is if the DOM is later going
> to be serialized back to an HTML string. In all other cases,
> .prop("checked", false) should be used instead.
2020-08-28 16:09:41 +02:00
Senén Rodero Rodríguez
f4916a981a Fix focus deprecation warning 2020-08-28 16:09:41 +02:00
Senén Rodero Rodríguez
e138bbb04e Upgrade to jQuery 3.5.1
Latest version of jquery-rails gem includes latest jQuery 3 version with
all security patches. See [1].

[1] https://github.com/rails/jquery-rails/blob/v4.4.0/CHANGELOG.md#440
2020-08-28 16:09:41 +02:00
Javier Martín
3853557343 Merge pull request #4112 from consul/extra_admin_datepicker
Simplify banner form dates
2020-08-28 15:24:47 +02:00
Javi Martín
2d659b4113 Simplify date fields in admin banners form
I forgot to merge this change into commit fc9a87a8, so here it goes.
2020-08-28 14:46:16 +02:00
Javier Martín
8e38838040 Merge pull request #4111 from consul/remove_admin_datepicker
Use native HTML5 date fields in the admin section
2020-08-28 14:34:53 +02:00
Senén Rodero Rodríguez
871b58a4a0 Move datepicker initialization code to datepicker.js file
Now we have a file named 'datepicker.js' it should be easier to
have all code related to datepicker plugin within the same file.
2020-08-28 14:22:14 +02:00
Javi Martín
fc9a87a8ab Use native HTML5 date fields in the admin section
We've had to add a couple of hacks in order to make jQuery UI datepicker
work with Turbolinks, and one of our tests is failing because the
datepicker changes its height when changing from a month with 5 weeks to
a month with 6 weeks.

We could add a workaround so the test still passes (jQuery UI doesn't
provide a configuration option to always displays 6 weeks in the
datepicker), but I think it's easier to just use the HTML5 native date
input field, which also allows us to simplify the code a bit and IMHO it
improves the user experience, particularly when using mobile phones.

Since date fields are not supported in Safari and Internet Explorer,
we're still using the jQuery UI datepicker on those browsers (and on any
other browser not supporting date fields).

Due to these changes, we're moving the tests checking datepicker's
behaviour to the dashboard. I've choosing not to change the public pages
because I'm not 100% sure everybody would like this change (some people
prefer the datepicker because we can configure the way it looks).
2020-08-28 12:55:58 +02:00
Javier Martín
7ee2f15a2e Merge pull request #3624 from consul/add_errbit_support
Add support for Errbit self-hosted exception management
2020-08-27 16:53:27 +02:00
Javier Martín
69e17a3cf4 Merge pull request #4069 from consul/dependabot/bundler/rollbar-2.27.0
Bump rollbar from 2.18.0 to 2.27.0
2020-08-27 16:52:02 +02:00
Javi Martín
6db5e1ed55 Only enable rollbar if it's configured
Many users who didn't configure rollbar were getting exceptions when
trying to connect to the rollbar service.
2020-08-27 16:22:01 +02:00
Julian Herrero
83fb7a769c Ignore RecordNotFound exceptions in Errbit 2020-08-27 16:22:01 +02:00
Javi Martín
4ac36b91e2 Accept self-signed SSL certificates with airbrake
Since some people hosting errbit might be using it as an internal tool
with a self signed certificate, we need to patch Airbrake so it accepts
these certificates.
2020-08-27 16:22:01 +02:00
Javi Martín
f658126780 Support exception management with Airbrake+Errbit
With Errbit, you can set up your own server and host the information
regarding your exceptions there. You can also hire Airbrake's hosting
services or easily setup Errbit on Heroku.

We're still including the rollbar gem so we don't harm CONSUL users who
are using rollbar.

Note Errbit requires an old version of Airbrake which forced users to
configure the gem. So we're adding the current environtment to
`ignore_environments` when the project id isn't defined; this way the
application won't crash in this case.
2020-08-27 16:22:01 +02:00
Javier Martín
6714c1bd6d Merge pull request #4107 from consul/dependabot/bundler/omniauth-facebook-7.0.0
Bump omniauth-facebook from 4.0.0 to 7.0.0
2020-08-27 15:43:44 +02:00
dependabot-preview[bot]
c1693e24c4 Bump omniauth-facebook from 4.0.0 to 7.0.0
Bumps [omniauth-facebook](https://github.com/mkdynamic/omniauth-facebook) from 4.0.0 to 7.0.0.
- [Release notes](https://github.com/mkdynamic/omniauth-facebook/releases)
- [Changelog](https://github.com/simi/omniauth-facebook/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mkdynamic/omniauth-facebook/compare/v4.0.0...v7.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-27 09:08:08 +00:00
Javier Martín
0838ed3c60 Merge pull request #4084 from consul/dependabot/bundler/omniauth-google-oauth2-0.8.0
Bump omniauth-google-oauth2 from 0.4.1 to 0.8.0
2020-08-27 11:06:17 +02:00
Javier Martín
946f232c70 Merge pull request #4087 from consul/fix_hint
Fix invalid "hint" attribute in forms
2020-08-26 16:24:16 +02:00
dependabot-preview[bot]
3df4df3a61 Bump omniauth-google-oauth2 from 0.4.1 to 0.8.0
Bumps [omniauth-google-oauth2](https://github.com/zquestz/omniauth-google-oauth2) from 0.4.1 to 0.8.0.
- [Release notes](https://github.com/zquestz/omniauth-google-oauth2/releases)
- [Changelog](https://github.com/zquestz/omniauth-google-oauth2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zquestz/omniauth-google-oauth2/compare/v0.4.1...v0.8.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-26 09:01:07 +00:00
Javier Martín
8007a24241 Merge pull request #4103 from consul/dependabot/bundler/mdl-0.11.0
Bump mdl from 0.10.0 to 0.11.0
2020-08-25 15:31:18 +02:00
dependabot-preview[bot]
536fc64a06 Bump mdl from 0.10.0 to 0.11.0
Bumps [mdl](https://github.com/mivok/markdownlint) from 0.10.0 to 0.11.0.
- [Release notes](https://github.com/mivok/markdownlint/releases)
- [Changelog](https://github.com/markdownlint/markdownlint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mivok/markdownlint/compare/v0.10.0...v0.11.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-25 13:13:42 +00:00
Javier Martín
59b7b524d4 Merge pull request #4097 from consul/downgrade_sassc
Downgrade sassc from 2.4.0 to 2.2.1
2020-08-25 12:53:18 +02:00
Javier Martín
2e71ba139a Merge pull request #4090 from consul/dependabot/bundler/initialjs-rails-0.2.0.9
Bump initialjs-rails from 0.2.0.8 to 0.2.0.9
2020-08-25 11:46:38 +02:00
Javi Martín
e6db50e9b9 Downgrade sassc from 2.4.0 to 2.2.1
Using sassc 2.4.0, we were getting several warnings when compiling
Foundation's assets:

DEPRECATION WARNING (...) !global assignments won't be able to declare
new variables in future versions.

According to issue 12080 in Foundation's repository, it won't be fixed
before Foundation 7.

Using sassc 2.3.0 my machine froze when trying to compile the assets in
our current master branch, so I'm downgrading to version 2.2.1.
2020-08-24 20:24:18 +02:00
Javier Martín
8531d78bb2 Merge pull request #4096 from rockandror/sticky_fixes
Fix sticky element on medium/large screens
2020-08-24 20:05:21 +02:00
Senén Rodero Rodríguez
46af09e348 Destroy Sticky elements before leaving the page
When Foundation initializes a page that has any sticky element, it
loads a window scroll listener into window object to handle the sticky
element positioning when scrolling. This works great until user moves
to a page without sticky elements and the window listeners remain
attached to the window object on this new page too when there is no
need to run the scrollListener and there is no sticky elements so the
window scroll listener cannot find the sticky object on that page a lot
of errors are thrown when user scrolls.

With this approach we are destroying sticky elements before leaving
the page which also remove the Sticky scrollListener from the window
object.

I do not know how to write a test to demonstrate this fix, but at least
there is some steps to reproduce this behavior:

0. Undo this commit
1. Go to any proposal page
2. Click on any link (with Turbolinks enabled)
3. Scroll the page
4. Check the console log. Yo will find as error occurrences as pixels you scrolled.
2020-08-24 19:41:14 +02:00
Senén Rodero Rodríguez
b2196561e2 Override proposal sticky top property when anchored
It's known that Foundation Sticky causes some renderization problems
when rendering sticky elements in anchored position.

The problem seems to be that Foundation Sticky is showing the
support box on medium and up devices overlapped with "Share" and
"Community" sidebar boxes when loading proposal page through
Turbolinks and when restoring the page from brwoser history.
Foundation seems to be doing some top property dynamic calculation
(javascript) and is setting top property to `206px` when it should be
`0px`. Notice that this do not happen on page first load (without
Turbolinks). Check foundation/foundation-sites issue 11098.

Another workaround could be to remove sticky feature for bigger that
small devices (medium large xlarge xxlarge).
Check foundation/foundation-sites issue 9892.
2020-08-24 19:41:14 +02:00
Javier Martín
9735dad792 Merge pull request #4100 from consul/dependabot/bundler/database_cleaner-1.8.5
Bump database_cleaner from 1.7.0 to 1.8.5
2020-08-24 16:14:34 +02:00
dependabot-preview[bot]
853119437b Bump database_cleaner from 1.7.0 to 1.8.5
Bumps [database_cleaner](https://github.com/DatabaseCleaner/database_cleaner) from 1.7.0 to 1.8.5.
- [Release notes](https://github.com/DatabaseCleaner/database_cleaner/releases)
- [Changelog](https://github.com/DatabaseCleaner/database_cleaner/blob/master/History.rdoc)
- [Commits](https://github.com/DatabaseCleaner/database_cleaner/compare/v1.7.0...v1.8.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-24 13:17:00 +00:00
Javi Martín
c5f4cd6229 Fix invalid "hint" attribute in forms
Using `hint: false` was generating an input with `hint="false"` instead
of generating no hint at all.
2020-08-22 23:00:14 +02:00
Javi Martín
f49745d7ba Simplify passing the object in the form builder
The object is already a method, so we don't need to pass it around.
2020-08-22 23:00:14 +02:00
Javier Martín
9761558d01 Merge pull request #4092 from consul/dependabot/bundler/capistrano-rails-1.6.1
Bump capistrano-rails from 1.4.0 to 1.6.1
2020-08-22 17:05:39 +02:00
Javier Martín
6023ee5c0e Merge pull request #4088 from consul/dependabot/bundler/web-console-3.7.0
Bump web-console from 3.3.0 to 3.7.0
2020-08-22 15:54:18 +02:00
Javier Martín
daf11cbfb3 Merge pull request #4095 from consul/dependabot/bundler/font-awesome-sass-5.13.0
Bump font-awesome-sass from 5.8.1 to 5.13.0
2020-08-22 15:39:13 +02:00
dependabot-preview[bot]
cce9d0dd55 Bump font-awesome-sass from 5.8.1 to 5.13.0
Bumps [font-awesome-sass](https://github.com/FortAwesome/font-awesome-sass) from 5.8.1 to 5.13.0.
- [Release notes](https://github.com/FortAwesome/font-awesome-sass/releases)
- [Commits](https://github.com/FortAwesome/font-awesome-sass/compare/5.8.1...5.13.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-22 13:24:17 +00:00
dependabot-preview[bot]
e28fa4be3b Bump web-console from 3.3.0 to 3.7.0
Bumps [web-console](https://github.com/rails/web-console) from 3.3.0 to 3.7.0.
- [Release notes](https://github.com/rails/web-console/releases)
- [Changelog](https://github.com/rails/web-console/blob/master/CHANGELOG.markdown)
- [Commits](https://github.com/rails/web-console/compare/v3.3.0...v3.7.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-22 13:08:17 +00:00
Javier Martín
affd12a046 Merge pull request #4093 from consul/dependabot/bundler/scss_lint-0.59.0
Bump scss_lint from 0.55.0 to 0.59.0
2020-08-22 15:06:33 +02:00
dependabot-preview[bot]
f7f532ab47 Bump initialjs-rails from 0.2.0.8 to 0.2.0.9
Bumps [initialjs-rails](https://github.com/dgilperez/initialjs-rails) from 0.2.0.8 to 0.2.0.9.
- [Release notes](https://github.com/dgilperez/initialjs-rails/releases)
- [Changelog](https://github.com/dgilperez/initialjs-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/dgilperez/initialjs-rails/compare/v0.2.0.8...v0.2.0.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-22 13:02:48 +00:00
Javier Martín
3178f388ea Merge pull request #4094 from consul/dependabot/bundler/i18n-tasks-0.9.31
Bump i18n-tasks from 0.9.29 to 0.9.31
2020-08-22 15:01:04 +02:00
Javier Martín
94f261f667 Merge pull request #4091 from consul/dependabot/bundler/capybara-webmock-0.5.5
Bump capybara-webmock from 0.5.3 to 0.5.5
2020-08-22 14:56:56 +02:00
dependabot-preview[bot]
8be7facf15 Bump i18n-tasks from 0.9.29 to 0.9.31
Bumps [i18n-tasks](https://github.com/glebm/i18n-tasks) from 0.9.29 to 0.9.31.
- [Release notes](https://github.com/glebm/i18n-tasks/releases)
- [Changelog](https://github.com/glebm/i18n-tasks/blob/master/CHANGES.md)
- [Commits](https://github.com/glebm/i18n-tasks/compare/v0.9.29...v0.9.31)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-18 13:14:56 +00:00
dependabot-preview[bot]
1367b30934 Bump scss_lint from 0.55.0 to 0.59.0
Bumps [scss_lint](https://github.com/sds/scss-lint) from 0.55.0 to 0.59.0.
- [Release notes](https://github.com/sds/scss-lint/releases)
- [Changelog](https://github.com/sds/scss-lint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sds/scss-lint/compare/v0.55.0...v0.59.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-18 13:14:12 +00:00
dependabot-preview[bot]
d8e4dac573 Bump capistrano-rails from 1.4.0 to 1.6.1
Bumps [capistrano-rails](https://github.com/capistrano/rails) from 1.4.0 to 1.6.1.
- [Release notes](https://github.com/capistrano/rails/releases)
- [Commits](https://github.com/capistrano/rails/compare/v1.4.0...v1.6.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-17 13:17:20 +00:00