Commit Graph

18435 Commits

Author SHA1 Message Date
Javi Martín
f285dfcbac Simplify HTML in proposal/debates recommendations
This way it's going to be easier to style the link on focus, since
styles like `box-shadow` weren't working properly when we had an inline
link with block elements inside, and adding the `display: inline-block`
element to the link didn't play well with the layout we were using for
the recommendations.

We're also fixing the focus outline on recommendations, which didn't
look properly because of the border added with:

```
.recommended-index {
  // (...)
  @include full-width-border(top, 1px solid #fafafa);
}
```

The border was on top of the outline, breaking it. Increasing the
`z-index` of the element containing the outline solves the issue.

In a similar way, we're making sure the button to hide recommendations
stays visible so it's easier to click it.
2023-10-10 15:03:21 +02:00
Javi Martín
d874697310 Remove redundant CSS properties set to none
These are default values that aren't needed.
2023-10-10 15:03:21 +02:00
Sebastia
db759bdd08 Merge pull request #5118 from consuldemocracy/undo-votes
Allow undoing "like/unlike" votes
2023-10-10 06:44:43 +02:00
taitus
00ff47e7e6 Add component in order to reduce duplicated code
Co-authored-by: Javi Martín <javim@elretirao.net>
2023-10-09 07:38:01 +02:00
taitus
718fcba6d8 Allow undo votes in comments votes component 2023-10-09 07:38:01 +02:00
taitus
f87a332c3e Refactoring: Move 'vote' action to Comments::VotesControllers
As far as possible I think the code is clearer if we use CRUD actions
rather than custom actions. This will make it easier to add the action
to remove votes in the next commit.

Note that we are adding this line as we need to validate it that a vote
can be created on a comment by the current user:

```authorize! :create, Vote.new(voter: current_user, votable: @comment)```

We have done it this way and not with the following code as you might
expect, as this way two votes are created instead of one.

```load_and_authorize_resource through: :comment, through_association: :votes_for```

This line tries to load the resource @comment and through the association
"votes_for" it tries to create a new vote associated to that debate.
Therefore a vote is created when trying to authorise the resource and
then another one in the create action, when calling @comment.vote.
2023-10-09 07:21:49 +02:00
taitus
b39b64a674 Remove unnecessary 'shallow' in comments routes
Since this commit 6e27917d6e it seems that it is no longer necessary
to continue using shallow.
2023-10-09 07:21:49 +02:00
taitus
e0dc7c96c3 Use polimorphic path in favor against component 2023-10-09 07:21:49 +02:00
taitus
108a05a66d Allow undo votes in favor against component 2023-10-09 07:21:49 +02:00
taitus
fd5fa2da79 Refactoring: Move 'vote' action to Votes Controllers
As far as possible I think the code is clearer if we use CRUD actions
rather than custom actions. This will make it easier to add the action
to remove votes in the next commit.

Note that we are adding this line as we need to validate it that a vote
can be created on a debate by the current user:

```authorize! :create, Vote.new(voter: current_user, votable: @debate)```

We have done it this way and not with the following code as you might
expect, as this way two votes are created instead of one.

```load_and_authorize_resource through: :debate, through_association: :votes_for```

This line tries to load the resource @debate and through the association
"votes_for" it tries to create a new vote associated to that debate.
Therefore a vote is created when trying to authorise the resource and
then another one in the create action, when calling @debate.vote_by (which
is called by @debate.register_vote).
2023-10-09 07:21:49 +02:00
taitus
c96e3b027f Replace Partials with Direct Component Rendering
In this commit, we have performed a refactoring to enhance code organization.
Several partials that were solely responsible for rendering components have been removed.

Instead, we are now directly rendering the components within the views where these
partials were previously used.
2023-10-06 18:13:45 +02:00
taitus
5009bf6c37 Add aria-pressed to in comments votes component
In order to the users using screen readers know whether the button is pressed
or not.
2023-10-06 18:13:45 +02:00
taitus
10cfa0e59f Refactor scss for in favor against component
In order to reduce the code used to add styles to the buttons,
we removed the classes that had been added and handled it with
the new aria-pressed attribute
2023-10-06 18:13:45 +02:00
taitus
daf9692753 Add aria-pressed to in favor against component
In order to the users using screen readers know whether the button is pressed
or not.
2023-10-06 07:14:07 +02:00
Javi Martín
4f747c9b53 Merge pull request #5272 from jensconsul/master
update readme file
2023-10-04 23:05:47 +02:00
jensconsul
85ddb367fc Merge pull request #1 from jensconsul/jensconsul-readme-edit
Update README.md
2023-10-04 10:50:24 +02:00
jensconsul
aa0667e7cf Update README.md
These are Jens Kimmel proposed changes to the README file so as to include a reference to the Foundation and the global user community
2023-10-04 09:56:20 +02:00
Javi Martín
5fda3f33ed Merge pull request #5263 from consuldemocracy/dependabot/bundler/knapsack_pro-5.7.0
Bump knapsack_pro from 5.6.0 to 5.7.0
2023-10-04 02:25:31 +02:00
dependabot[bot]
8480b5f31e Bump knapsack_pro from 5.6.0 to 5.7.0
Bumps [knapsack_pro](https://github.com/KnapsackPro/knapsack_pro-ruby) from 5.6.0 to 5.7.0.
- [Changelog](https://github.com/KnapsackPro/knapsack_pro-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v5.6.0...v5.7.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-04 02:04:19 +02:00
Javi Martín
2d74ac0b61 Merge pull request #5264 from consuldemocracy/dependabot/bundler/groupdate-6.4.0
Bump groupdate from 6.2.1 to 6.4.0
2023-10-04 01:37:36 +02:00
dependabot[bot]
aabd5cf397 Bump groupdate from 6.2.1 to 6.4.0
Bumps [groupdate](https://github.com/ankane/groupdate) from 6.2.1 to 6.4.0.
- [Changelog](https://github.com/ankane/groupdate/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ankane/groupdate/compare/v6.2.1...v6.4.0)

---
updated-dependencies:
- dependency-name: groupdate
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-04 01:15:55 +02:00
Javi Martín
545e9a27e9 Merge pull request #5265 from consuldemocracy/dependabot/bundler/audited-5.4.0
Bump audited from 5.3.3 to 5.4.0
2023-10-04 00:15:33 +02:00
dependabot[bot]
4598af5256 Bump audited from 5.3.3 to 5.4.0
Bumps [audited](https://github.com/collectiveidea/audited) from 5.3.3 to 5.4.0.
- [Changelog](https://github.com/collectiveidea/audited/blob/main/CHANGELOG.md)
- [Commits](https://github.com/collectiveidea/audited/compare/v5.3.3...v5.4.0)

---
updated-dependencies:
- dependency-name: audited
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-03 21:46:13 +00:00
Javi Martín
50a3b9b451 Merge pull request #5266 from consuldemocracy/dependabot/bundler/rubocop-performance-1.19.1
Bump rubocop-performance from 1.19.0 to 1.19.1
2023-10-03 23:45:12 +02:00
dependabot[bot]
cc6668adfb Bump rubocop-performance from 1.19.0 to 1.19.1
Bumps [rubocop-performance](https://github.com/rubocop/rubocop-performance) from 1.19.0 to 1.19.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.19.0...v1.19.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-03 23:23:17 +02:00
Javi Martín
9077c060ed Merge pull request #5267 from consuldemocracy/dependabot/bundler/rubocop-1.56.4
Bump rubocop from 1.56.2 to 1.56.4
2023-10-03 22:45:41 +02:00
dependabot[bot]
3d094bbdc5 Bump rubocop from 1.56.2 to 1.56.4
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.56.2 to 1.56.4.
- [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.56.2...v1.56.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-03 20:13:35 +00:00
Javi Martín
ef4c438b96 Merge pull request #5269 from consuldemocracy/dependabot/bundler/rubocop-factory_bot-2.24.0
Bump rubocop-factory_bot from 2.23.1 to 2.24.0
2023-10-03 22:12:18 +02:00
dependabot[bot]
82e74969b9 Bump rubocop-factory_bot from 2.23.1 to 2.24.0
Bumps [rubocop-factory_bot](https://github.com/rubocop/rubocop-factory_bot) from 2.23.1 to 2.24.0.
- [Release notes](https://github.com/rubocop/rubocop-factory_bot/releases)
- [Changelog](https://github.com/rubocop/rubocop-factory_bot/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-factory_bot/compare/v2.23.1...v2.24.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-03 18:37:08 +00:00
Javi Martín
edcef9e8a8 Merge pull request #5270 from consuldemocracy/dependabot/bundler/view_component-3.6.0
Bump view_component from 3.5.0 to 3.6.0
2023-10-03 20:34:30 +02:00
dependabot[bot]
eb04ec1bf9 Bump view_component from 3.5.0 to 3.6.0
Bumps [view_component](https://github.com/viewcomponent/view_component) from 3.5.0 to 3.6.0.
- [Release notes](https://github.com/viewcomponent/view_component/releases)
- [Changelog](https://github.com/ViewComponent/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/viewcomponent/view_component/compare/v3.5.0...v3.6.0)

---
updated-dependencies:
- dependency-name: view_component
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-03 17:54:46 +00:00
Javi Martín
8cc772f187 Merge pull request #5261 from consuldemocracy/dependabot/bundler/dalli-3.2.6
Bump dalli from 3.2.5 to 3.2.6
2023-10-03 19:53:17 +02:00
dependabot[bot]
5f9295db18 Bump dalli from 3.2.5 to 3.2.6
Bumps [dalli](https://github.com/petergoldstein/dalli) from 3.2.5 to 3.2.6.
- [Changelog](https://github.com/petergoldstein/dalli/blob/main/CHANGELOG.md)
- [Commits](https://github.com/petergoldstein/dalli/compare/v3.2.5...v3.2.6)

---
updated-dependencies:
- dependency-name: dalli
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-03 17:31:14 +00:00
Javi Martín
a4441422f2 Merge pull request #5260 from consuldemocracy/dependabot/bundler/selenium-webdriver-4.13.1
Bump selenium-webdriver from 4.12.0 to 4.13.1
2023-10-03 19:15:27 +02:00
Sebastia
2e335df2f3 Merge pull request #5250 from consuldemocracy/content-block
Add new content block `footer_legal` to Footer
2023-10-03 14:03:50 +02:00
dependabot[bot]
7a587e2c12 Bump selenium-webdriver from 4.12.0 to 4.13.1
Bumps [selenium-webdriver](https://github.com/SeleniumHQ/selenium) from 4.12.0 to 4.13.1.
- [Release notes](https://github.com/SeleniumHQ/selenium/releases)
- [Changelog](https://github.com/SeleniumHQ/selenium/blob/trunk/rb/CHANGES)
- [Commits](https://github.com/SeleniumHQ/selenium/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-01 22:04:37 +00:00
Javi Martín
0e696331b1 Merge pull request #5258 from consuldemocracy/fix_knapsack
Update bash script to run Knapsack Pro
2023-09-29 17:30:23 +02:00
Javi Martín
54cefb918e Update bash script to run Knapsack Pro
We made a few experiments with forked repositeries after applying commit
dc1e0209a and everything seems to work fine, but it looks like that
isn't the case. For instance, on pull requests opened by external
contributors, the tests aren't running.

The fix we're applying is mentioned on the Knapsack Pro repository [1]
(pull request 197).

[1] https://github.com/KnapsackPro/knapsack_pro-ruby
2023-09-29 16:10:25 +02:00
Javi Martín
a7136f71db Merge pull request #5251 from dnsos/intuitive-admin-menu-sections
Move customizations to more intuitive admin menu section
2023-09-29 14:48:47 +02:00
Dennis Ostendorf
b1bc068cb9 Remove unnecessary admin menu condition
Previously the condition was needed because _without it_ the Admin::Poll::Questions::Answers::ImagesController would have resulted in settings? evaluating to true. This was undesired because that controller was scoped under Polls, so only polls? should have evaluated to true. Now that we have moved the images link to the customization menu, this check is not necessary anymore.
2023-09-29 14:18:28 +02:00
Dennis Ostendorf
a902f9e11f Move customizations to more intuitive admin menu section
There were already some menu items to customization pages under the "Site content" menu. It therefore makes sense to move "Custom images" and "Custom content blocks" (which were previously
located under "Settings") to "Site content" as well.
2023-09-28 19:49:49 +02:00
taitus
c2f03f869a Add new footer content block
Include a new content block called 'footer_legal' for additional legal footer items.
2023-09-26 17:43:20 +02:00
Javi Martín
5e483f6d33 Merge pull request #5242 from consuldemocracy/go_back_test
Don't depend on the "Help" link in tests
2023-09-25 13:45:50 +02:00
taitus
7fd773773a Unify votes specs 2023-09-21 08:19:30 +02:00
Senén Rodero
d28ed1d17b Merge pull request #5232 from consuldemocracy/custom_concerns
Make model concerns customization easier
2023-09-18 15:48:05 +02:00
taitus
75c9b66375 Refactor footer legal links for cleaner code
Removed inline '&nbsp;|' used as a separator between footer legal links.
2023-09-14 09:51:51 +02:00
Javi Martín
b050bf39bd Add missing expectation in draft versions test
Without this expectation, the test was freezing sometimes.
2023-09-13 23:32:25 +02:00
Javi Martín
9a1dd9992a Don't depend on the "Help" link in tests
In order to leave the page using turbolinks and then going back, we were
clicking on the "Help" page link, but this link doesn't have to be
available on every Consul Democracy installation.

So we're using the link to the homepage instead.
2023-09-13 23:32:25 +02:00
Javi Martín
aa7262a1b8 Merge pull request #5235 from consuldemocracy/dependabot_interval
Update gem dependencies once a month
2023-09-13 16:15:33 +02:00
Javi Martín
40e920844b Update gem dependencies once a month
We originally set a daily interval because we hadn't updated our gem
dependencies for a year.

However, we usually wait a few days/weeks between the time a gem is
released and the moment we update it, and there are gems releasing new
versions every few days, so maintaining daily updates would become
tedious quickly.

So we're now doing it once a month. We're also increasing the limit of
open pull requests so we don't need to worry about whether dependabot is
opening pull requests for every dependency.
2023-09-12 16:20:49 +02:00