Commit Graph

19502 Commits

Author SHA1 Message Date
Senén Rodero
33f5f4cdb9 Merge pull request #5096 from consul/bump_leaflet
Bump Leaflet from 1.5.1 to 1.9.3
2023-04-14 17:39:51 +02:00
Senén Rodero Rodríguez
c3439ab539 Keep the same attribution as it was in previous versions 2023-04-14 14:38:53 +02:00
Senén Rodero Rodríguez
dd368ad650 Bump leaflet from 1.5.1 to 1.9.3
Newer versions have more capabilities and also fix lot of errors,
usability and accessibility issues.

Note that we're using an external gem to rails-assets.org as it's
not supports the rails-assets pipeline. This gems wraps the
original one and make the code work with the default rails assets
pipeline as usual.
2023-04-14 14:36:58 +02:00
Javi Martín
03a12ea60b Merge pull request #5074 from consul/ruby3.0
Upgrade Ruby to version 3.0.6
2023-04-13 17:32:41 +02:00
Javi Martín
f298715f78 Add Style/HashExcept Rubocop rule
We were already using it because Rails adds the `Hash#except` method for
Ruby 2.7 and earlier, but since the method wasn't part of Ruby itself,
the Rubocop rule only works with Ruby 3.0 and later.
2023-04-13 16:41:15 +02:00
Javi Martín
b911284b86 Update Style/RedundantFreeze rule for Ruby 3.0
In Ruby 3.0, Regexp and Range literals are frozen objects, and so we
don't need to freeze them.
2023-04-13 16:41:15 +02:00
Javi Martín
6c8445e3d7 Upgrade Ruby to version 3.0.6
Note the structure of the Gemfile changes slightly because Ruby 3.0
includes a new version of the Bundler gem.
2023-04-13 16:41:07 +02:00
Javi Martín
4d11d8a395 Specify translation class name in dummy test class
These tests were failing with Ruby 3.0 because we were getting an error
when loading the `translations` association of the dummy class:

```
NameError:
  uninitialized constant
  DummyBanner::#<Class:0x000055630e4dccd8>::Translation
```

Specifying the `class_name` of the `translations` association solves the
issue.
2023-04-13 16:31:28 +02:00
Senén Rodero
8e0acb8592 Merge pull request #5097 from consul/map_scroll_wheel
Disable scroll wheel for zooming in favor of map zoom buttons
2023-03-28 16:34:46 +02:00
Javi Martín
26f806b7fa Merge pull request #5095 from consul/one_server_on_preproduction
Use only one server when deploying to preproduction
2023-03-28 16:05:37 +02:00
Senén Rodero Rodríguez
3341c45e61 Disable scroll wheel for zooming in favor of map zoom buttons
It's causing annoying behaviour for desktop users when scrolling
the page to the bottom and there is more content below the
map.

The behaviour of touchable devices does not seem to be
affected by this change and keeps behaving the same.
2023-03-28 12:15:26 +02:00
taitus
c1529303e4 Use the same rules that we have defined in Consul 2023-03-22 11:13:56 +01:00
Sebastia
f1d0e41132 Merge pull request #119 from consul/update_remote_translations
Update remote translation docs
2023-03-22 09:05:15 +01:00
Javi Martín
bbf6a31a05 Simplify deploy secrets example configuration file
So now it's similar to our database example file.
2023-03-21 19:15:25 +01:00
Javi Martín
8aa113a47c Unify deploy secret keys for the main server
We were using `server` on staging but `server1` and `server2` on
preproduction and production.

The reason behind it is we've always used one server on staging but
sometimes we've used several servers on preproduction and production.

However, this is a bit of a mess on installations which have only one
server on preproduction or production and need to use the `server` key
for the staging environments but `server1` for other environments.

So, in order to keep compatibility with existing Consul installations,
we're now allowing either `server` or `server1` on any environment.
2023-03-21 19:01:28 +01:00
Javi Martín
b115b0cc8d Use only one server when deploying to preproduction
It doesn't make much sense that by default we use one server on
production on two servers on preproduction.

Note we're keeping `server1` instead of using just `server` in order to
keep compatibility with existing installation.
2023-03-21 18:53:18 +01:00
taitus
a5205cfda9 Update remote translation docs
Due to the change of the translator-text gem to the bing_translator gem,
the documentation has been reviewed and changes have been detected
in the links, prices and azure administration panel.

We removed the Google and DeepL prices, since we will not be reviewing
the prices of the different providers and they may be out of date.
2023-03-21 13:50:47 +01:00
Javi Martín
39574040e0 Merge pull request #5093 from consul/bump_erb_lint
Bump erb_lint from 0.0.37 to 0.3.1
2023-03-20 17:51:30 +01:00
Javi Martín
99b0ef07f2 Enable CommentSyntax ERB Linter
It's a default linter in erb_lint 0.3.0, and it's useful during
development since I'm always unsure about the right way to add ERB
comments.
2023-03-20 17:07:09 +01:00
Javi Martín
09a62d6f2c Bump erb_lint from 0.0.37 to 0.3.1
We also need to update pronto-erb_lint since the old version depended on
erb_lint 0.0.x.
2023-03-20 17:07:09 +01:00
Javi Martín
4ddcfde529 Explicitly enable ERB linters
I thought SelfClosingTag was enabled since it was on the list and the
`enabled: false` got lost among all the `enabled: true`. ERB Lint 0.1
and later will also add RequireInputAutocomplete as a default linter,
and we're not interested in it, at least for now.

So, just like we do for Rubocop, we're disabling all linters and
enabling the ones we use explicitly.
2023-03-20 17:06:05 +01:00
Javi Martín
448e9574b1 Merge pull request #5092 from consul/dependabot/bundler/rack-2.2.6.4
Bump rack from 2.2.6.3 to 2.2.6.4
2023-03-16 18:45:07 +01:00
dependabot[bot]
35153ad154 Bump rack from 2.2.6.3 to 2.2.6.4
Bumps [rack](https://github.com/rack/rack) from 2.2.6.3 to 2.2.6.4.
- [Release notes](https://github.com/rack/rack/releases)
- [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rack/rack/compare/v2.2.6.3...v2.2.6.4)

---
updated-dependencies:
- dependency-name: rack
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-16 16:18:14 +01:00
Sebastia
9bbde19d8d Merge pull request #5089 from consul/bing-translator
Use Bing Translator instead of TranslatorText
2023-03-15 17:50:51 +01:00
taitus
306e7356c3 Allow translate locales that need to be mapping
It has been detected that for the :pt-BR, :zh-CN and :zh-TW locales,
the translate button was being displayed, but when requesting the
translation, the remote translation validation failed due to:

'''
validates :locale, inclusion: { in: ->(_) {
     RemoteTranslations::Microsoft::AvailableLocales.available_locales }}
'''

That available_locales method did not contemplate these 3 languages
in the format used by the application.

To solve this problem the api response is mapped to return all
locales in the format expected by the application.

Add remote translation model test to ensure that a remote translation
is valid when its locale is pt-BR.

Co-Authored-By: Javi Martín <35156+javierm@users.noreply.github.com>
2023-03-15 15:52:51 +01:00
Javi Martín
33c62ccbd7 Merge pull request #5090 from consul/dependabot/bundler/rack-2.2.6.3
Bump rack from 2.2.6.2 to 2.2.6.3
2023-03-10 17:30:58 +01:00
dependabot[bot]
f188a0321b Bump rack from 2.2.6.2 to 2.2.6.3
Bumps [rack](https://github.com/rack/rack) from 2.2.6.2 to 2.2.6.3.
- [Release notes](https://github.com/rack/rack/releases)
- [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rack/rack/compare/v2.2.6.2...v2.2.6.3)

---
updated-dependencies:
- dependency-name: rack
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-10 01:00:02 +01:00
taitus
c64b49b128 Change gem from TranslatorText to BingTranslator
TranslatorText isn't compatible with Ruby 3, so we need to use a
different gem.

The 'translator-text' gem response was an array of one or more objects.
Now with the 'bing_translator' gem the response is an array with one or
several translated texts.

We remove the concept of object in the code. And we also remove the
"create_response" method from the specs since it is no longer necessary
to emulate that object and we can simply use arrays with texts to emulate
the new response.
2023-03-09 06:00:41 +01:00
Javi Martín
63d0e316cf Replace instance variable usage with a method
We usually use this approach because methods are easier to override and
stub.
2023-03-09 05:50:27 +01:00
Javi Martín
b030a198a3 Include SentencesParser inside the right class
We were including it in the Object class, making its methods
available everywhere.
2023-03-09 05:50:16 +01:00
Javi Martín
922632052c Merge pull request #5054 from consul/coverage_on_master
Run test coverage just on the master branch
2023-03-04 01:59:18 +01:00
Javi Martín
c614b0bc97 Run test coverage just on the master branch
Since we changed the way we integrate coveralls in commit 8ed8cc8b9,
we're getting 6 additional checks displayed in our pull requests.

We don't need these checks, and they only add noise. The only reason we
use coveralls is to know the test coverage in our master branch.

So we're changing the code so coveralls only runs on the master branch.

There's also a chance that the test suite will be faster because it
doesn't need to keep track of the coverage, although I haven't noticed any
significant differences during my tests.

I haven't found a more elegant way to say that a certain step should
only be run on push on master, so I'm setting the environment variable
we were already using.
2023-03-04 01:29:03 +01:00
Javi Martín
5d16964f15 Merge pull request #118 from consul/graphql_typos
Fix format typos in graphql guide
2023-03-04 01:28:16 +01:00
Javi Martín
462792d018 Merge pull request #5087 from consul/doc_folder
Clean up doc folder
2023-03-03 16:07:39 +01:00
Javi Martín
4425f0f482 Merge pull request #4983 from sashashura/patch-1
GitHub Workflows security hardening
2023-03-01 17:41:23 +01:00
Javi Martín
56e42f209d Fix API examples
We were getting many errors when trying to run them, from uninitialized
constant `HTTP` to undefined method `headers`.

We might move these examples to the documentation repository in the
future, but we need to look for possible side-effects first.
2023-03-01 17:25:21 +01:00
Javi Martín
e4992ffb8d Remove README in the doc folder
This documentation is obsolete and there's documentation in the official
consulproject website containing user guides like this one.
2023-03-01 17:25:21 +01:00
Javi Martín
fcaba88879 Remove unused images in doc folder
We added them in commit 2e4601bbb, but it looks that they've never been
used.
2023-03-01 17:25:21 +01:00
Javi Martín
8b7a9d147a Use the demo URL in API examples 2023-03-01 17:25:21 +01:00
Javi Martín
ae8975def4 Remove API documentation
It's already present in the consul/docs repository.

We're keeping the examples folder for now because it isn't in the
consul/docs repository yet.
2023-03-01 17:25:21 +01:00
Javi Martín
025f509400 Don't end headings with semicolons 2023-03-01 17:02:43 +01:00
Javi Martín
43ab93e756 Use one blank line around headings 2023-03-01 17:02:43 +01:00
Javi Martín
74c5589cb1 Fix format typos in graphql guide 2023-03-01 17:02:18 +01:00
Sebastia
3662172d21 Merge pull request #117 from pitmonticone/master
Clean docs
2023-02-23 15:23:59 +01:00
Sebastia
8f01a25ced Merge pull request #4900 from consul/ballot_hidden_money
Do not show money with hidden money
2023-02-23 15:22:24 +01:00
Sebastia
a26f05f9f9 Merge pull request #4997 from consul/legislation_question
Add description to Legislation questions
2023-02-23 15:21:57 +01:00
decabeza
9ef90b1e49 Do not show money with hidden money 2023-02-22 19:27:28 +01:00
Pietro Monticone
763e8aeaf7 Update introduction.md 2023-02-22 19:22:48 +01:00
Pietro Monticone
80e40d1af4 Update graphql.md 2023-02-22 19:21:37 +01:00
taitus
d96a91710f Fix broken h3 tag
Since we're now allowing <h2> and <h3> tags in the description, we
remove the broken <h3> tag from quiz-question class. Since its content
is also in the <title> element, and in order to be consistent with other
show actions in the public area, we change this tag to <h1>.

We add <h2> tag in the "Share" heading and we replace the broken <h4>
tag above adding new styles.
2023-02-22 19:19:27 +01:00