20684 Commits

Author SHA1 Message Date
68a9b46726 full width banner image
Some checks failed
tests / tests (0, 5) (push) Has been cancelled
tests / tests (1, 5) (push) Has been cancelled
tests / tests (2, 5) (push) Has been cancelled
tests / tests (3, 5) (push) Has been cancelled
tests / tests (4, 5) (push) Has been cancelled
tests / coveralls (push) Has been cancelled
schema / schema (push) Has been cancelled
2025-12-11 11:28:59 +03:00
9a52ec378f add KES currency
Some checks failed
schema / schema (push) Has been cancelled
tests / tests (0, 5) (push) Has been cancelled
tests / tests (1, 5) (push) Has been cancelled
tests / tests (2, 5) (push) Has been cancelled
tests / tests (3, 5) (push) Has been cancelled
tests / tests (4, 5) (push) Has been cancelled
tests / coveralls (push) Has been cancelled
2025-12-10 21:18:23 +03:00
2492347fa6 basic customization
Some checks failed
schema / schema (push) Has been cancelled
tests / tests (0, 5) (push) Has been cancelled
tests / tests (1, 5) (push) Has been cancelled
tests / tests (2, 5) (push) Has been cancelled
tests / tests (3, 5) (push) Has been cancelled
tests / tests (4, 5) (push) Has been cancelled
tests / coveralls (push) Has been cancelled
2025-12-10 17:21:40 +03:00
41c6d0e259 add repo url
Some checks failed
schema / schema (push) Has been cancelled
tests / tests (0, 5) (push) Has been cancelled
tests / tests (1, 5) (push) Has been cancelled
tests / tests (2, 5) (push) Has been cancelled
tests / tests (3, 5) (push) Has been cancelled
tests / tests (4, 5) (push) Has been cancelled
tests / coveralls (push) Has been cancelled
2025-12-10 13:01:05 +03:00
Javi Martín
9bf5ff6546 Merge pull request #6146 from consuldemocracy/release_2.4.1
Some checks failed
schema / schema (push) Has been cancelled
tests / tests (0, 5) (push) Has been cancelled
tests / tests (1, 5) (push) Has been cancelled
tests / tests (2, 5) (push) Has been cancelled
tests / tests (3, 5) (push) Has been cancelled
tests / tests (4, 5) (push) Has been cancelled
tests / coveralls (push) Has been cancelled
Release version 2.4.1
2025-11-17 18:17:58 +01:00
Javi Martín
c0624cd19b Release version 2.4.1 2025-11-17 18:02:46 +01:00
Javi Martín
17e7a6fa36 Merge pull request #6149 from consuldemocracy/bump_js_yaml
Bump js-yaml from 4.1.0 to 4.1.1
2025-11-17 18:02:21 +01:00
Javi Martín
b4b66f0382 Bump js-yaml from 4.1.0 to 4.1.1
We're getting a Dependabot alert because of this [1], but currently
Dependabot is unable to open the pull request fixing it [2].

Code generated by running `npm audit fix`.

[1] https://github.com/advisories/GHSA-mh29-5h37-fv8m
[2] Issue 13551 in https://github.com/dependabot/dependabot-core
2025-11-17 17:49:07 +01:00
Javi Martín
5e70cbdc1c Merge pull request #6148 from consuldemocracy/add_label_to_edit_form_map_markers
Add ARIA labels to admin settings map marker
2025-11-17 16:43:12 +01:00
Javi Martín
5a432da498 Update old usages of investments JSON data
We aren't using these properties since commit 3fa3c90db. An old test was
failing when checking for Axe accessibility issues because of this.
2025-11-17 15:45:28 +01:00
Javi Martín
288f62cdd2 Use coordinates as marker labels when there's only one mappable
When editing/showing a proposal or an investment, the most relevant
information regarding the marker are the coordinates. The title of the
proposal or investment is redundant because we already know the marker
is about that proposal/investment.

There's one problem with this approach, though: when editing a proposal
or an investment, the aria-label of the marker isn't updated
automatically when we move the marker to a different place. This
behaviour will only affect people who use both a screen reader and a
mouse, since keyboard users can't change the position of the marker in
the first place. We'll deal with this issue when we make it possible to
change the position of a marker using the keyboard.
2025-11-17 15:39:36 +01:00
Javi Martín
99696cb302 Add aria-label to markers in admin map settings
We forgot to do so in commit b896fc4bb. Back then, we said:

> Note that we aren't providing a proper aria-label for markers on the
> map we use in the form to create a proposal or an investment. Adding
> one isn't trivial given the current code, and keyboard users can't add
> a marker in the first place. We'll have to revisit this issue when we
> add keyboard support for this.

However, in the admin section, the marker is already there, so it should
have a label. In this case, we're using the coordinates as label because
it's the most relevant text for the marker in the context of a form. We
could also use "Default map location" instead, but that information is
already present on the page.

Axe was reporting the same accessibility error we mentioned in commit
b896fc4bb in this situation.
2025-11-17 15:39:36 +01:00
Javi Martín
1693aa5d9c Use render_map to render the admin settings map
This way we remove duplication.

Note that to check whether to render the button to remove a marker,
we're checking whether the map location belongs to a mappable. This
means we're changing the code that renders the map in the "new proposal"
and "new investment" forms so the map location belongs to a proposal or
investment. We're association the map location to a new record because
writing something like:

```
def map_location
  proposal.map_location || MapLocation.new(proposal: proposal)
end
```

Would change the `proposal` object because of the way Rails treats
non-persisted `has_one` associations. Although probably safe in this
case, changing an object when rendering a view could have side effects.

Also note that we're changing the HTML ID of the map element from
`admin-map` to `new_map_location` (the latter is returned by the
`dom_id` method).  We were only using this ID in tests since commit
289426c1c, so changing it doesn't really affect us.
2025-11-17 15:39:36 +01:00
Javi Martín
8a575ae83c Remove duplicate map location translations
We were using the same texts twice. For the remove marker label text,
however, we were using the text defined in proposals for both proposals
and investments.

Ideally the translation keys for these texts would go in another
namespace, since they no longer refer to just proposals. However,
renaming the translation keys would mean losing the existing
translations in every language we manage through Crowdin. So we aren't
doing so.
2025-11-17 15:39:31 +01:00
Javi Martín
b9adef481a Simplify variable name in map location fields
The `m_l` prefix isn't really necessary when we're talking about map
locations, and sometimes when searching the project I think `m_l_`
stands for "machine learning" and get confused.
2025-11-17 15:37:20 +01:00
Javi Martín
29e5adc233 Move map location fields partial to a component
This way it'll be easier to test it and refactor it.
2025-11-17 15:37:06 +01:00
Javi Martín
67e00654bd Extract methods to get map location in form components
This way changing them will be easier.
2025-11-17 15:28:57 +01:00
Javi Martín
8b3ac5ac97 Use a legend instead of a label in map location fields
The label was invalid HTML since it wasn't referencing any existing
element.
2025-11-17 15:28:52 +01:00
Javi Martín
86a12b23ad Test admin map settings from the user's point of view
People using these settings don't know about the hidden fields, but they
do know about the fields that are actually displayed on the page. So we
check that these fields are updated when the marker is updated.
2025-11-17 15:14:20 +01:00
Javi Martín
a6908f2017 Group similar map tests together
We're about to change some of these tests, and we usually group similar
system tests in order to make the test suite a bit faster.
2025-11-17 15:14:16 +01:00
Javi Martín
2d85bd5351 Remove duplication rendering map location fields
We're going to move the partial to a component, and this makes it
easier.
2025-11-17 02:04:11 +01:00
Javi Martín
0ec7c65b9b Don't pass unused parameter to map location fields partial
We don't use this parameter since commit c34aa5412.
2025-11-17 02:04:11 +01:00
Javi Martín
d0b57868af Move settings map inside the form
That's what we usually do, and it makes sense since clicking on the map
changes the content of hidden fields in the form.
2025-11-17 02:04:11 +01:00
Javi Martín
dd2fb6469f Merge pull request #6144 from consuldemocracy/serious_accessibility_issues
Fix most Axe serious accessibility issues
2025-11-14 15:49:51 +01:00
Sebastia
ebac669fd0 Merge pull request #6125 from consuldemocracy/remove-obsolete-scopes
Add missing investments filter on admin activity page
2025-11-14 15:38:25 +01:00
Sebastia
2e4a05f6b9 Merge pull request #6040 from consuldemocracy/remove-redundant-tests
Remove redundant tests
2025-11-14 15:38:08 +01:00
taitus
873968ee0a Unify related tests in wizard phases spec 2025-11-14 15:11:50 +01:00
taitus
3dc0de34bc Unify related tests in wizard headings spec 2025-11-14 15:11:50 +01:00
taitus
d43654be42 Unify related tests in wizard groups spec 2025-11-14 15:11:50 +01:00
taitus
42ef5b65bd Unify similar tests in wizard budgets spec
We are unifying the test "Create budget - Knapsack voting (default)" with
"A new budget is always created in draft mode" because they are almost the same.

On the other hand, we also merged the test "update budget" with "submit the
form with errors and then without errors". Just like in the previous case, there
were two ways to access the edit page, so we removed the one that is already
tested in other specs.
2025-11-14 15:11:22 +01:00
taitus
4e455578d1 Rename User.by_authors to with_ids
The "by_authors" scope was the last remaining name from the removed
family of `by_author` scopes. It no longer reflects its purpose: it
simply loads users by IDs.
2025-11-14 14:52:52 +01:00
taitus
a9129158c1 Make moderation tests easier to read
- reuse aria-labels instead of DOM selectors when checking moderation checkboxes
- drop redundant 'first' in the within
2025-11-14 14:52:52 +01:00
taitus
a3a44f527b Give purpose to previously unused on_budget_investments scope
The "on_budget_investments" scope in Activity has never been used
anywhere in the codebase. It was introduced in commit d9d38482b3
("extends Activity to include Investment valuations") but no references
were ever added.

Instead of removing it, we make use of the scope by adding the missing
"Budget investments" filter to the admin Activity section. This aligns
it with the rest of the activity filters and gives the scope the purpose
it was originally intended for.
2025-11-14 14:31:01 +01:00
taitus
0332160627 Remove unused by_official_level scope from Proposal
The "by_official_level" scope in Proposal is no longer used anywhere in
the code. Its last use was removed in commit 9f1f912d84 ("Remove
official level filter from advanced search").
2025-11-14 13:56:11 +01:00
taitus
4183734468 Remove unused sort_by_most_commented scope from Debate
The "sort_by_most_commented" scope in Debate is no longer used anywhere in
the code. Its last use was removed in commit b89f39bfef ("Removes
unused orders from debates controller")
2025-11-14 13:56:11 +01:00
taitus
8938b781c3 Remove unused created_by scope from Proposal
The "created_by" scope in Proposal is no longer used anywhere in the code.
It was introduced in 77dd604 and its last usage was dropped in commit 64258baf97
("Refactor getting the public activity information").
2025-11-14 13:44:12 +01:00
taitus
29f4edd466 Remove unused scopes from Legislation::Proposal
The "for_render", "sort_by_hot_score" and "sort_by_most_commented"
scopes in Legislation::Proposal are no longer used
anywhere in the code. They were all introduced in commit 335399e571
("Created Legislation Proposals model") and have never been
referenced since.
2025-11-14 13:44:12 +01:00
taitus
c4368b077a Remove unused by_geozone_id scope from Poll
The "by_geozone_id" scope in Poll is no longer used anywhere in the code.
It was first introduced in commit 20cb044015 ("adds search and filter
for poll questions") and later moved to the Poll model in commit
d024505960 ("moves geozones from poll question to poll in models"),
but has never been referenced since.
2025-11-14 13:44:12 +01:00
taitus
151b12bd35 Remove unused by_email scope from VerifiedUser
The "by_email" scope in VerifiedUser is no longer used anywhere in the
code. Its last occurrence was removed in commit 76daee1fb0 ("removes
unmasked emails and phones in forms").
2025-11-14 13:44:12 +01:00
Javi Martín
9a898495ac Add menuitem role to sign out button
Back in commit c6f0a3761, we replaced the link to sign out with a
button. However, this button is a child of a data-responsive-menu
dropdown element. Since Foundation adds the `menubar` role to responsive
menus, its children are supposed to have a `menuitem` role. So we're
adding it.

Note we're adding the role with JavaScript because, when JavaScript is
disabled, Foundation won't change the `responsive-menu` role to
`menubar`. So we can't have a `menuitem` in this case.

Axe was reporting the following issue:

```
Found 1 accessibility violation:

1) aria-required-children: Certain ARIA roles must contain
   particular children (critical)
    https://dequeuniversity.com/rules/axe/4.11/aria-required-children?application=axeAPI
    The following 1 node violate this rule:

        Selector: .account-menu
        HTML: <ul class="account-menu menu dropdown"
                  data-responsive-menu="medium-dropdown" role="menubar"
                  data-dropdown-menu="cabp3q-dropdown-menu"
                  data-mutate="ph8tvp-responsive-menu">
        Fix any of the following:
        - Element has children which are not allowed: button[tabindex]
```
2025-11-14 12:53:56 +01:00
Javi Martín
b896fc4bba Add aria-label to map markers
Axe was reporting an accessibility error:

```
Found 1 accessibility violation:

1) aria-command-name: ARIA commands must have an accessible name
   (serious)
   https://dequeuniversity.com/rules/axe/4.11/aria-command-name?application=axeAPI
   The following 1 node violate this rule:

     Selector: .leaflet-marker-icon
     HTML: <div class="leaflet-marker-icon map-marker
                       leaflet-zoom-animated leaflet-interactive"
                tabindex="0" role="button">
                <div class="map-icon"></div>
           </div>
     Fix any of the following:
     - Element does not have text that is visible to screen readers
     - aria-label attribute does not exist or is empty
     - aria-labelledby attribute does not exist, references elements
       that do not exist or references elements that are empty
     - Element has no title attribute
```

Using the title of the proposal/investment as the text of the marker is
definitely a good solution when there are several markers on the map.
Not sure whether there's a better option when there's only one marker,
though.

Note that we aren't providing a proper aria-label for markers on the map
we use in the form to create a proposal or an investment. Adding one
isn't trivial given the current code, and keyboard users can't add a
marker in the first place. We'll have to revisit this issue when we add
keyboard support for this.

We're also changing a test to make sure that titles with quotes in their
names don't break the markup due to an invalid aria-label attribute.
2025-11-14 12:53:37 +01:00
Javi Martín
b5d939565b Make fullscreen editor preview focusable
This part of the page can be scrolled independently with the mouse, and
so the same should be possible with a keyboard.

Axe was reporting this error:

```
1) scrollable-region-focusable: Scrollable region must have
   keyboard access (serious)
    https://dequeuniversity.com/rules/axe/4.11/scrollable-region-focusable?application=axeAPI
    The following 1 node violate this rule:

      Selector: .fullscreen > .markdown-preview.medium-6.small-12
      HTML: <div class="small-12 medium-6 column markdown-preview">
      Fix any of the following:
      - Element should have focusable content
      - Element should be focusable
```
2025-11-07 16:25:37 +01:00
Javi Martín
4aa650325a Merge pull request #6050 from consuldemocracy/dependabot/npm_and_yarn/stylistic/stylelint-plugin-4.0.0
Bump @stylistic/stylelint-plugin from 3.1.2 to 4.0.0
2025-11-06 15:54:48 +01:00
dependabot[bot]
b6a2ff2cd6 Bump @stylistic/stylelint-plugin from 3.1.2 to 4.0.0
Bumps [@stylistic/stylelint-plugin](https://github.com/stylelint-stylistic/stylelint-stylistic) from 3.1.2 to 4.0.0.
- [Release notes](https://github.com/stylelint-stylistic/stylelint-stylistic/releases)
- [Changelog](https://github.com/stylelint-stylistic/stylelint-stylistic/blob/main/CHANGELOG.md)
- [Commits](https://github.com/stylelint-stylistic/stylelint-stylistic/compare/v3.1.2...v4.0.0)

---
updated-dependencies:
- dependency-name: "@stylistic/stylelint-plugin"
  dependency-version: 4.0.0
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-06 13:39:21 +00:00
Javi Martín
82c6e2c8dc Merge pull request #6140 from consuldemocracy/bump_rails_to_7.1.6
Bump rails from 7.1.5.2 to 7.1.6
2025-11-06 14:37:15 +01:00
Javi Martín
c6da88f3fa Bump rails from 7.1.5.2 to 7.1.6
This is the latest security release in the Rails 7.1.x series.
2025-11-06 14:00:39 +01:00
Javi Martín
2c74f9f35b Merge pull request #6123 from consuldemocracy/max_empty_lines
Add and apply stylistic/max-empty-lines rule
2025-11-06 13:25:39 +01:00
Javi Martín
a563108a03 Merge pull request #6124 from consuldemocracy/menu_button_flashing
Don't flash the menu button on desktop screens
2025-11-06 13:25:00 +01:00
Javi Martín
2927fd4a05 Merge pull request #6134 from consuldemocracy/dependabot/npm_and_yarn/stylelint-16.25.0
Bump stylelint from 16.20.0 to 16.25.0
2025-11-06 13:23:38 +01:00
Javi Martín
3584ab048c Replace word-break: break-word with overflow-wrap
According to W3C documentation [1]:

> For compatibility with legacy content, the word-break property also
> supports a deprecated break-word keyword. When specified, this has the
> same effect as word-break: normal and overflow-wrap: anywhere,
> regardless of the actual value of the overflow-wrap property.

This is currently *not* detected by the `property-no-deprecated`
stylelint rule. However, since this rule detects other places where we
should use `overflow-wrap`, we're changing it as part of the same pull
request.

Note that, as of November 2025, 98.22% of the browsers support
`overflow-wrap: anywhere`. We're still making this change because we
only use this property in two specific places and it isn't very likely
that long words will really be a problem with the remaining 1.78%.

By the way, I'm not sure why we use this property in the budget
invesment show paragraphs and not in other similar places. It was
introduced in commit e3878ff43, alongside other changes which don't seem
to be related. When in doubt, we leave things as they were, so we're
doing the same thing here.

[1] https://www.w3.org/TR/css-text-3/#word-break-property
[2] https://caniuse.com/mdn-css_properties_overflow-wrap_anywhere
2025-11-05 20:16:19 +01:00