Commit Graph

20049 Commits

Author SHA1 Message Date
Javi Martín
10a86fd5a4 Update instructions to upgrade Consul Democracy
We now strongly recommend to upgrade one version at a time and to run
the tests before and after upgrading.

Note we use a `release` branch instead of an `upgrade` branch because
we've been mentioning the `release` branch in the release notes of every
release for years.
2025-03-06 17:22:47 +01:00
Javi Martín
f1f3724365 Merge pull request #5888 from consuldemocracy/remove_bin_update_script
Remove obsolete bin/update script
2025-03-06 11:32:23 +01:00
Javi Martín
21c28bdb81 Merge pull request #5912 from consuldemocracy/dependabot/bundler/uri-1.0.3
Bump uri from 1.0.2 to 1.0.3
2025-03-05 20:05:57 +01:00
dependabot[bot]
d5fdbb9c24 Bump uri from 1.0.2 to 1.0.3
Bumps [uri](https://github.com/ruby/uri) from 1.0.2 to 1.0.3.
- [Release notes](https://github.com/ruby/uri/releases)
- [Commits](https://github.com/ruby/uri/compare/v1.0.2...v1.0.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-05 18:38:54 +00:00
Sebastia
6cd10cd550 Merge pull request #5844 from consuldemocracy/remove-unused-css
Remove unused CSS
2025-03-05 16:48:05 +00:00
taitus
e094dc17d6 Remove unused CSS
* The `gender-and-channel` class isn't use since commit e3063cd24f
* The `first-comment` class added in commit e5fb90f954 was never used
* The `additional-info` class added in commit d47ce39b37 was never used
* The `title-quote` class isn't use since commit f317514258
* The `big-number` class added in commit aa1ed87725 was never used
* The `big-number-stat` class isn't used since commit cf32dcd6d5
* The `budget-investment-amount` and `budget-investment-description`
classes added in commit 4ade8325d7 were never used
* The `debate-quiz` class isn't use since commit d679c1eb79
* The `enquiries-list` class isn't use since commit 6aa96c4471
* The `investment-project-content` class isn't use since commit d0b8fef6b3
* The `leave-comment` class isn't use since commit ff6285d114
* The `poll-question-show` class isn't use since commit 8277e3cc2b
* The `questions-callout` class isn't use since commit ddf8d5f811
* The `budget-investments-inner` class isn't used since commit c6a9ffc19
* The `map-attributtion` class isn't use since commit 5a09b79da4
* The `postfix` class isn't use since commit 3752f3a53b
* The `translation-locale` added in commit a6e8fecc16 was never used
* The `changes-link`, `comment-advice`, `show-comments` and `comment-votes-number`
classes aren't use since commit d679c1eb79
2025-03-05 17:24:53 +01:00
Javi Martín
0e2d008d9e Remove obsolete bin/update script
This script was removed from Rails in Rails 6.0 [1] because the
`bin/setup` script is now idempotent and can be used to update the
application as well.

[1] See https://github.com/rails/rails/commit/8927eba83c
2025-03-05 16:47:31 +01:00
Sebastia
d84044cd73 Merge pull request #5886 from consuldemocracy/forks_list
Add list of open source forks and modifications
2025-03-05 15:30:27 +00:00
Javi Martín
2300f861b8 Merge pull request #5901 from consuldemocracy/downgrade_sass_to_1.77.5
Downgrade Sass to version 1.77.5
2025-03-05 16:13:29 +01:00
Javi Martín
dc05ff0fd6 Downgrade Sass to version 1.77.5
In commit 64bcedc8b, we upgraded Sass from version 1.70 to version 1.80.
However, since then we've noticed a couple of inconvenient things.

First, we're getting some deprecation warnings when compiling the
assets, related to a usage of `map-has-key` in Foundation which is
deprecated since Sass 1.80. Even with the `quiet_deps` flag, these
warnings aren't silenced.

Second, version 1.79 changed the way color functions work [1]. In
particular, functions like `color.adjust` or `darken` would now generate
RGB colors that include float numbers [2]. Browser support for float values
in RGB colors is about 98% at the time of writing [3], meaning some
browsers that are at least 5 or 6 years old will not render these
colors, sometimes resulting in white text over a white background, which
is of course impossible to read.

Finally, we get some deprecation warnings in our code when we remove the
`quiet_deps` flag, caused by the breaking change in mixed declaration
[4] from version 1.77.7 [5]. This warning is tricky; consider the following
code:

```
@mixin normal-selection {
  &::selection,
  *::selection {
    @include background-with-text-contrast($brand, brand, $check-invert-selection: false);
  }
}

.button.hollow {
  @include normal-selection;
  border: 1px solid;
}
```

In this scenario, since normal-selection is a mixin that generates a
nested rule, we're doing a declaration after a nested rule, which is now
deprecated.

The situation gets even more complicated when we define mixins that have
both nested rules and rules that apply to the element itself. Currently,
we sometimes include a mixin and then override some of the properties
the mixin defines, but we wouldn't be able to do so if we can't define
properties after including the mixin.

Right now, the solution seems to be adding `& { }` selectors
after including a mixin, like this:

```
.button.hollow {
  @include normal-selection;

  & {
    border: 1px solid;
  }
}
```

Which is incredibly cumbersome.

So, for now, we're downgrading to version 1.77.5 (we would downgrade to
version 1.77.6, but the sass-embedded gem skipped that version). That
version was released in June 2024, so it isn't very old yet. In the
future, we'll see what to do about the issues mentioned above, since
we'll have to upgrade at some point.

Note we're removing the `silence_deprecations` flag because Sass 1.77
doesn't raise warnings about using `import`.

[1] https://sass-lang.com/documentation/breaking-changes/color-functions/
[2] https://sass-lang.com/documentation/modules/color/#adjust
[3] https://caniuse.com/mdn-css_types_color_rgb_float_values
[4] https://sass-lang.com/documentation/breaking-changes/mixed-decls/
[5] https://sass-lang.com/documentation/js-api/interfaces/deprecations/#mixed_decls
2025-03-05 15:40:03 +01:00
Javi Martín
4dbc20f799 Merge pull request #5910 from consuldemocracy/dependabot/bundler/rspec-rails-7.1.1
Bump rspec-rails from 7.0.1 to 7.1.1
2025-03-05 15:39:10 +01:00
Javi Martín
1905d42578 Merge pull request #5900 from consuldemocracy/sass_calc_warnings
Fix Sass warnings in divisions without calc()
2025-03-05 15:31:26 +01:00
dependabot[bot]
3035855f4e Bump rspec-rails from 7.0.1 to 7.1.1
Note we aren't updating concurrent-ruby (which Dependabot would have
updated) due to an incompatibility with Rails 7.0.

Bumps [rspec-rails](https://github.com/rspec/rspec-rails) from 7.0.1 to 7.1.1.
- [Changelog](https://github.com/rspec/rspec-rails/blob/main/Changelog.md)
- [Commits](https://github.com/rspec/rspec-rails/compare/v7.0.1...v7.1.1)

---
updated-dependencies:
- dependency-name: rspec-rails
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-05 15:23:35 +01:00
Javi Martín
3334362c55 Merge pull request #5911 from consuldemocracy/dependabot/bundler/rack-2.2.12
Bump rack from 2.2.11 to 2.2.12
2025-03-05 15:23:06 +01:00
Javi Martín
f9d8191ba7 Merge pull request #5899 from consuldemocracy/missing_es_translation
Fix missing Spanish translation
2025-03-05 15:04:41 +01:00
Javi Martín
f460d3bc31 Add and apply function-calculation-no-interpolation rule
This stylelint-scss rule is useful because we were inconsistent when
using calc(); sometimes we added interpolation to Sass variables, and
sometimes we didn't. The reason why we originally added interpolation
was that it was necessary until we migrated to Dart Sass in commit
d54971e53. Since then, we can omit the interpolation, which is also what
the Sass documentation recommends [1].

[1] https://sass-lang.com/documentation/values/calculations/
2025-03-05 14:39:16 +01:00
Javi Martín
a60926c44b Fix wrong icon position in form header
We made a mistake when adding the `calc()` function in commit 6df813fdb,
since the `/` operator originally only affected the `$heading-icon-size`
part of the operation, but affected the whole operation after that
commit. This caused the icon to be positioned on top of another icon.
2025-03-05 14:34:40 +01:00
Javi Martín
cddce21f7b Simplify calc rules with rem-calc inside
The interpolation of the rem-calc function made the code harder to read.
Besides, for new code we've already agreed upon using rem units instead
of `rem-calc`.

For instance, we had the following code:

```
width: calc(100% - #{2 * rem-calc(10)});
```

Now, `2 * rem-calc(10)` is the same as `rem-calc(20)`, but we were using
`2 *` to make it clear that this value was related to the value of the
`margin-left` property, which was `rem-calc(10)`.

IMHO using `0.625rem` for the margin and `2 * 0.625rem` for the width
the code is easier to read because there are no interpolation and no
complex operations involved.
2025-03-05 14:34:40 +01:00
Javi Martín
f3fe1ac6c1 Fix Sass warnings in divisions without calc()
We forgot to add the `calc()` function in commits 4c0b6455f, 390c749d2
and dc54fda71.

We were getting a warning when compiling the assets without the
`quiet_deps` option:

```
DEPRECATION WARNING: Using / for division outside of calc() is
deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div($line-height, 3) or calc($line-height / 3)

More info and automated migrator: https://sass-lang.com/d/slash-div
```
2025-03-05 14:34:40 +01:00
dependabot[bot]
3b952f4b21 Bump rack from 2.2.11 to 2.2.12
Bumps [rack](https://github.com/rack/rack) from 2.2.11 to 2.2.12.
- [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.11...v2.2.12)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-05 11:46:48 +00:00
Sebastia
f188b64e91 Merge pull request #5880 from consuldemocracy/dependabot/bundler/rubocop-1.71.2
Bump rubocop from 1.66.1 to 1.71.2
2025-03-05 11:45:50 +00:00
taitus
202ba3a5f8 Enable new rule from RuboCop 1.71 2025-03-05 11:43:46 +01:00
taitus
ba22d7fdf7 Enable new rules from RuboCop 1.70 2025-03-05 11:43:46 +01:00
taitus
f4ffee3700 Add and apply Lint/RedundantSafeNavigation RuboCop rule
We've tested the updated behavior in RuboCop 1.69, found a new offense, and corrected it.
2025-03-05 11:43:44 +01:00
taitus
4c7fe8a5d9 Enable new rules from RuboCop 1.69 2025-03-05 11:42:47 +01:00
taitus
9081174dd7 Add and apply Style/KeywordArgumentsMerging rubocop rule
This rule was introduced in RuboCop 1.68 to encourage passing
additional keyword arguments directly instead of using merge.
2025-03-05 11:42:47 +01:00
taitus
ada35f51f2 Remove unnecessary EnforcedShorthandSyntax definition
Rubocop 1.67.0 sets EnforcedShorthandSyntax to "either" by default,
so explicitly defining it is no longer necessary.
2025-03-05 11:42:47 +01:00
dependabot[bot]
204704da06 Bump rubocop from 1.66.1 to 1.71.2
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.66.1 to 1.71.2.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.66.1...v1.71.2)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Note:
Fix SafeNavigation offense detected by RuboCop 1.67.0
Remove redundant condition that became unnecessary
after updating RuboCop.
2025-03-05 11:42:44 +01:00
Javi Martín
aeb3655541 Merge pull request #5851 from consuldemocracy/dependabot/bundler/rubocop-rspec-3.4.0
Bump rubocop-rspec from 3.1.0 to 3.4.0
2025-03-04 18:03:20 +01:00
dependabot[bot]
203b659de8 Bump rubocop-rspec from 3.1.0 to 3.4.0
Note we're renaming the RSpec/StringAsInstanceDoubleConstant rule to
RSpec/VerifiedDoubleReference because its name changed in version 3.4.0

Bumps [rubocop-rspec](https://github.com/rubocop/rubocop-rspec) from 3.1.0 to 3.4.0.
- [Release notes](https://github.com/rubocop/rubocop-rspec/releases)
- [Changelog](https://github.com/rubocop/rubocop-rspec/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rspec/compare/v3.1.0...v3.4.0)

---
updated-dependencies:
- dependency-name: rubocop-rspec
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-04 17:38:40 +01:00
Javi Martín
e438ec03c0 Merge pull request #5898 from consuldemocracy/fix_pronto_stylelint
Use pronto.yml to configure pronto-stylelint
2025-03-04 17:37:24 +01:00
Javi Martín
2a9321d988 Merge pull request #5852 from consuldemocracy/dependabot/bundler/rubocop-rails-2.29.1
Bump rubocop-rails from 2.26.2 to 2.29.1
2025-03-02 15:38:02 +01:00
dependabot[bot]
18a7167d2a Bump rubocop-rails from 2.26.2 to 2.29.1
Note we aren't updating concurrent-ruby (which Dependabot would have
updated) due to an incompatibility with Rails 7.0.

Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.26.2 to 2.29.1.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.26.2...v2.29.1)

---
updated-dependencies:
- dependency-name: rubocop-rails
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-02 15:19:12 +01:00
Javi Martín
fb69923f47 Merge pull request #5866 from consuldemocracy/dependabot/bundler/rubocop-performance-1.23.1
Bump rubocop-performance from 1.22.1 to 1.23.1
2025-03-02 01:07:09 +01:00
dependabot[bot]
a3265b3f5b Bump rubocop-performance from 1.22.1 to 1.23.1
Bumps [rubocop-performance](https://github.com/rubocop/rubocop-performance) from 1.22.1 to 1.23.1.
- [Release notes](https://github.com/rubocop/rubocop-performance/releases)
- [Changelog](https://github.com/rubocop/rubocop-performance/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-performance/compare/v1.22.1...v1.23.1)

---
updated-dependencies:
- dependency-name: rubocop-performance
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-01 23:51:41 +00:00
Javi Martín
3d9325f2fa Merge pull request #5882 from consuldemocracy/dependabot/bundler/pdf-reader-2.14.1
Bump pdf-reader from 2.12.0 to 2.14.1
2025-03-02 00:46:56 +01:00
dependabot[bot]
194a8dae59 Bump pdf-reader from 2.12.0 to 2.14.1
Bumps [pdf-reader](https://github.com/yob/pdf-reader) from 2.12.0 to 2.14.1.
- [Changelog](https://github.com/yob/pdf-reader/blob/main/CHANGELOG)
- [Commits](https://github.com/yob/pdf-reader/compare/v2.12.0...v2.14.1)

---
updated-dependencies:
- dependency-name: pdf-reader
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-01 23:30:47 +00:00
Javi Martín
19ed29258e Merge pull request #5835 from consuldemocracy/dependabot/bundler/capistrano-rails-1.7.0
Bump capistrano-rails from 1.6.3 to 1.7.0
2025-03-02 00:25:42 +01:00
dependabot[bot]
b71bf4a1ef Bump capistrano-rails from 1.6.3 to 1.7.0
Note we aren't updating concurrent-ruby (which Dependabot would have
updated) due to an incompatibility with Rails 7.0.

Bumps [capistrano-rails](https://github.com/capistrano/rails) from 1.6.3 to 1.7.0.
- [Release notes](https://github.com/capistrano/rails/releases)
- [Commits](https://github.com/capistrano/rails/compare/v1.6.3...v1.7.0)

---
updated-dependencies:
- dependency-name: capistrano-rails
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-02 00:07:06 +01:00
Javi Martín
a94ba293c5 Merge pull request #5809 from consuldemocracy/dependabot/bundler/capistrano-3.19.2
Bump capistrano from 3.19.1 to 3.19.2
2025-03-01 23:51:46 +01:00
dependabot[bot]
f4ea8137e5 Bump capistrano from 3.19.1 to 3.19.2
Note we aren't updating concurrent-ruby (which Dependabot would have
updated) due to an incompatibility with Rails 7.0.

Bumps [capistrano](https://github.com/capistrano/capistrano) from 3.19.1 to 3.19.2.
- [Release notes](https://github.com/capistrano/capistrano/releases)
- [Commits](https://github.com/capistrano/capistrano/compare/v3.19.1...v3.19.2)

---
updated-dependencies:
- dependency-name: capistrano
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-01 23:10:56 +01:00
Javi Martín
8e4c61fbb1 Merge pull request #5879 from consuldemocracy/dependabot/bundler/net-imap-0.5.6
Bump net-imap from 0.5.4 to 0.5.6
2025-03-01 23:04:30 +01:00
dependabot[bot]
2d6e39063c Bump net-imap from 0.5.4 to 0.5.6
Bumps [net-imap](https://github.com/ruby/net-imap) from 0.5.4 to 0.5.6.
- [Release notes](https://github.com/ruby/net-imap/releases)
- [Commits](https://github.com/ruby/net-imap/compare/v0.5.4...v0.5.6)

---
updated-dependencies:
- dependency-name: net-imap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-01 21:48:24 +00:00
Javi Martín
b751955241 Merge pull request #5773 from consuldemocracy/dependabot/bundler/faker-3.5.1
Bump faker from 3.4.2 to 3.5.1
2025-03-01 22:41:33 +01:00
dependabot[bot]
06f0aa0c61 Bump faker from 3.4.2 to 3.5.1
Note we aren't updating concurrent-ruby (which Dependabot would have
updated) due to an incompatibility with Rails 7.0.

Bumps [faker](https://github.com/faker-ruby/faker) from 3.4.2 to 3.5.1.
- [Release notes](https://github.com/faker-ruby/faker/releases)
- [Changelog](https://github.com/faker-ruby/faker/blob/main/CHANGELOG.md)
- [Commits](https://github.com/faker-ruby/faker/compare/v3.4.2...v3.5.1)

---
updated-dependencies:
- dependency-name: faker
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-01 22:24:49 +01:00
Javi Martín
005e4bcfb3 Merge pull request #5778 from consuldemocracy/dependabot/bundler/factory_bot_rails-6.4.4
Bump factory_bot_rails from 6.4.3 to 6.4.4
2025-03-01 22:22:07 +01:00
dependabot[bot]
bdc2fb0fbc Bump factory_bot_rails from 6.4.3 to 6.4.4
Note we aren't updating concurrent-ruby (which Dependabot would have
updated) due to an incompatibility with Rails 7.0.

Bumps [factory_bot_rails](https://github.com/thoughtbot/factory_bot_rails) from 6.4.3 to 6.4.4.
- [Release notes](https://github.com/thoughtbot/factory_bot_rails/releases)
- [Changelog](https://github.com/thoughtbot/factory_bot_rails/blob/main/NEWS.md)
- [Commits](https://github.com/thoughtbot/factory_bot_rails/compare/v6.4.3...v6.4.4)

---
updated-dependencies:
- dependency-name: factory_bot_rails
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-01 22:08:52 +01:00
Javi Martín
03d8d9e96d Merge pull request #5859 from DominikPeters/chromium-driver-dockerfile
Add chromium-driver to Dockerfile
2025-03-01 19:16:09 +01:00
Dominik Peters
bbcdb6f086 Add chromium-driver to Dockerfile
In the documentation about using docker, it says:

> System tests also work out of the box, although they might fail the
> first time while the tool running the tests downloads the right
> version of Chromedriver (which is needed to run them), and only
> "headless" mode (with a browser running in the background) is
> supported, which is the mode you'd probably use more than 95% of the
> time anyway.  For example, to run the tests for the homepage:
>
> POSTGRES_PASSWORD=password docker-compose run app bundle exec \
> rspec spec/system/welcome_spec.rb

For me, as predicted, the tests fail the first time, but they continue
to fail after. The errors are of form:

```
Failure/Error: example.run
Selenium::WebDriver::Error::WebDriverError:
  unable to connect to /home/consul/.cache/selenium/chromedriver/linux64
  /132.0.6834.110/chromedriver 127.0.0.1:9515
  # /usr/local/bundle/gems/selenium-webdriver-4.25.0/lib/selenium
  # /webdriver/common/service_manager.rb:132:in `connect_until_stable'
  # ... omitted ...
  # ./spec/spec_helper.rb:41:in `block (3 levels) in <top (required)>'
  # /usr/local/bundle/gems/i18n-1.14.6/lib/i18n.rb:353:in `with_locale'
  # ./spec/spec_helper.rb:40:in `block (2 levels) in <top (required)>'
```

Installing chromium-driver in the Dockerfile fixed it for me.
2025-03-01 18:57:38 +01:00
Javi Martín
1eb45299e2 Fix missing Spanish translation
When we renamed this internationalization key in d25f2e725, we forgot to
rename it in Spanish as well.
2025-02-28 12:21:43 +01:00