Commit Graph

20065 Commits

Author SHA1 Message Date
Javi Martín
3cdf7194a0 Use bundle exec to run delayed jobs on reboot
When running delayed_job on reboot using Consul Democracy 2.2.0, we were
getting an error:

```
`require': cannot load such file -- sassc-embedded (LoadError)
from <internal:rubygems/core_ext/kernel_require.rb>:86:in `require'
from config/application.rb:1:in
```

No idea why this gem isn't detected when running `bin/delayed_job`.
When deploying with Capistrano, we use `bundle exec bin/delayed_job`,
and that works fine, so we're using it here as well.

We had already fixed this issue in the Cosul Democracy installer [1],
but forgot to configure the Cron job to do the same.

[1] https://github.com/consuldemocracy/installer/commit/3dc69eb6
2024-09-18 14:13:22 +02:00
Javi Martín
ddfe723e25 Merge pull request #5688 from consuldemocracy/proposal_ui_tests
Make "show proposal" tests pass on GitHub Actions
2024-09-17 15:57:40 +02:00
Javi Martín
ec0bcd4277 Use a more realistic size for small window tests
The resolution of most devices is at least 640 pixels in at least one of
their dimensions. Since we need the width to be smaller than 640 pixels,
having a height of 479px wasn't realistic.

Doing so caused the tests checking the sticky "support proposal" tests
to fail because on 480px-high devices the sticky message covers the
whole screen.

This is a usability issue, but since I'm not sure how many people use
such a small window when browsing the web, for now I'm simply changing
the tests.

We're changing the width to 320px since it's the width required by the
Web Content Accessibility Guidelines 2.2. Quoting these guidelines [1]:

> Content can be presented without loss of information or functionality,
> and without requiring scrolling in two dimensions for:

> * Vertical scrolling content at a width equivalent to 320 CSS pixels;
> * Horizontal scrolling content at a height equivalent to 256 CSS
>   pixels.

Note that, using a height of 256px, the sticky message would make the
application unusable, though. IMHO we'll have to get rid of the sticky
message sooner or later.
2024-09-17 15:09:21 +02:00
Javi Martín
bedcb5bca2 Don't include videos in proposal factories
Since August 29, probably due to a change in the browser used by GitHub
Actions (since branches whose code we didn't change were suddenly
affected that day), many tests related to proposals are failing on
GitHub Actions. Although every time the test suite is run different
tests fail, on each run at least half a dozen tests fail.

Most tests have one thing in common: they click on an element on the
`proposals#show` page, and the click isn't done correctly.

One possible explanation is that the video included on the page causes
the page to scroll at the exact same time that Capybara is clicking on a
link, which results in a misclick.

I haven't been able to reproduce the issue on my machine, so I'm not
sure whether giving the video element a fixed height using CSS (so the
page doesn't scroll when the iframe is loaded) could solve the issue.
But, after using proposals without videos in the tests (except the tests
testing the videos themselves), all these tests are passing in the test
suite.

So, for now, we're simply removing the videos in the proposal factories.

Note this issue wasn't caused by the "no cookie" changes done in commit
ee64efe659, since running the tests in Cosul Democracy 2.1.1 (which
didn't contain those changes) also fails on GitHub Actions.
2024-09-17 15:09:17 +02:00
Javi Martín
3c6631d436 Merge pull request #5661 from consuldemocracy/dependabot/npm_and_yarn/micromatch-4.0.8
Bump micromatch from 4.0.7 to 4.0.8
2024-09-12 01:02:29 +02:00
Sebastia
6991bf08df Merge pull request #5655 from consuldemocracy/getting-started-docs
Update getting started instructions
2024-09-11 16:24:55 +02:00
taitus
d6efd4edb3 Update communication instructions 2024-09-11 14:13:11 +02:00
taitus
0a83661e95 Update 'Keep your fork updated' instructions 2024-09-11 14:13:11 +02:00
taitus
e858e226cd Update configuration instructions 2024-09-11 14:13:11 +02:00
Javi Martín
b42d4115cb Merge pull request #5685 from consuldemocracy/customization_docs
Update documentation to customize the application
2024-09-11 13:46:25 +02:00
Javi Martín
9d818b4ec2 Make it easier to add custom routes
Until now, people had to edit the original route files in order to add
custom routes.

This was inconsistent with the other customizations, since we use custom
folders or files for customizing controllers, components, views, ...
(which you usually customize as well when adding a new route).

So now we're providing a file for custom routes, which will make it
easier to know which routes are not present in Consul Democracy by
default.
2024-09-11 13:27:48 +02:00
Javi Martín
ee089a5209 Update customization docs introduction 2024-09-11 13:27:48 +02:00
Javi Martín
136edb97e9 Update documentation to customize translations 2024-09-11 13:27:48 +02:00
taitus
6f692abdf8 Update getting started and create instructions 2024-09-11 09:47:56 +02:00
Javi Martín
3a01e171b8 Add documentation about tests customization 2024-09-10 14:54:20 +02:00
Javi Martín
64d6460215 Update documentation to customize images 2024-09-10 14:54:20 +02:00
Javi Martín
9b08a73156 Update documentation for CSS customization 2024-09-10 14:29:51 +02:00
Javi Martín
ced834200a Update documentation to customize JavaScript
Note that, while it doesn't really affect the way the application
behaves (as long as the JavaScript code doesn't rely on the order it's
loaded) we're requiring `app/assets/javascripts/custom.js` after
requiring any files in the `app/assets/javascripts/custom/` folder. This
is done for consistency, since we load the content of
`app/assets/javascripts/application.js` after requiring everything else.
2024-09-10 14:29:51 +02:00
Javi Martín
a8250a6f46 Fix typos in gemfile customization docs 2024-09-10 14:07:43 +02:00
Javi Martín
58a5b7e627 Add documentation to customize other Ruby classes 2024-09-10 14:07:43 +02:00
Javi Martín
19e12d9053 Update documentation to customize components 2024-09-10 14:07:43 +02:00
Javi Martín
7a1f78ddf3 Update documentation to customize views 2024-09-10 14:07:43 +02:00
Javi Martín
a4063d0ec0 Update documentation to customize the application config 2024-09-09 16:44:51 +02:00
Javi Martín
0b928e52b1 Add documentation to customize controllers 2024-09-09 16:41:08 +02:00
Javi Martín
fce300a11a Update models customization documentation 2024-09-09 16:41:08 +02:00
Javi Martín
d3fa99332c Update files and folders used to customize the application 2024-09-04 13:20:00 +02:00
Javi Martín
f45ad68407 Move user translations docs to the features section
The documentation of user content translations doesn't really belong in
the customization introduction.
2024-09-02 15:18:13 +02:00
Javi Martín
8663778245 Add missing folders for custom code
We were loading these folders in `application.rb`, but they didn't exist
by default.
2024-09-02 15:03:24 +02:00
dependabot[bot]
c047a2d279 Bump micromatch from 4.0.7 to 4.0.8
Bumps [micromatch](https://github.com/micromatch/micromatch) from 4.0.7 to 4.0.8.
- [Release notes](https://github.com/micromatch/micromatch/releases)
- [Changelog](https://github.com/micromatch/micromatch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/micromatch/compare/4.0.7...4.0.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-29 15:25:59 +00:00
Javi Martín
e0ae3832ec Merge pull request #5658 from consuldemocracy/dependabot/bundler/rexml-3.3.6
Bump rexml from 3.3.3 to 3.3.6
2024-08-29 17:25:11 +02:00
Javi Martín
1addd96fde Merge pull request #5660 from consuldemocracy/custom_locales_order
Fix custom locales not taking precedence
2024-08-29 17:22:23 +02:00
Javi Martín
75ebc1bd98 Fix custom locales not taking precedence
When we upgraded to Rails 7 in commit 8596f1539, we broke the custom
locales since now all nested folders in `config/locales/` are loaded by
default [1]. This meant that the custom folder was now loaded before any
languages whose code alphabetically goes after the word "custom".

As a workaround, we're overwriting the default locales paths so they
don't include the custom folder. We're doing this step before the
`add_locales` initializer; that is, before the default locales paths are
used.

Unfortunately, I haven't found a way to add a test for this behavior,
since we would need to add a file in `config/locales/custom` that
overwrites an internationalization key for an existing language, but
only during a specific test, and the i18n load path is evaluated when
the application starts up.

[1] See pull request 41872 in https://github.com/rails/rails/
2024-08-28 14:34:12 +02:00
dependabot[bot]
9a98843e4b Bump rexml from 3.3.3 to 3.3.6
Bumps [rexml](https://github.com/ruby/rexml) from 3.3.3 to 3.3.6.
- [Release notes](https://github.com/ruby/rexml/releases)
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md)
- [Commits](https://github.com/ruby/rexml/compare/v3.3.3...v3.3.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-22 20:51:58 +00:00
Javi Martín
77452fc48d Merge pull request #5651 from consuldemocracy/ruby3.2.5
Upgrade Ruby to version 3.2.5
2024-08-19 17:11:54 +02:00
Javi Martín
497c542082 Upgrade Ruby to version 3.2.5
So get the latest fixes in the 3.2.x series.

We're also updating the parser gem so we don't get any warnings.
2024-08-19 16:04:38 +02:00
Sebastia
888d1c9fad Merge pull request #5652 from consuldemocracy/ubuntu-installation-docs
Update local installation instructions
2024-08-07 17:00:13 +02:00
taitus
e46fc35d31 Update macOS local installation instructions 2024-08-07 16:46:07 +02:00
Javi Martín
996885b8c8 Fix typos in local installation instructions 2024-08-07 16:34:41 +02:00
Javi Martín
37f737192e Add Docker as an option to develop using windows
For some people, this is easier than installing a virtual machine.
2024-08-07 15:48:50 +02:00
Javi Martín
b686489652 Update Debian local installation instructions
So now we install a specific version of Node.js and use the packages
required for Debian Bookworm.

For consistency, we're also making them similar to the Ubuntu
instructions and installing rbenv instead of RVM. Since we now suggest
rbenv in both cases as well as in the macOS instructions, we're also
listing rbenv as the first option in the generic local installation
instructions.
2024-08-07 15:48:50 +02:00
taitus
7845c7f78d Update ubuntu local installation instructions
So now we install a specific version of Node.js and use the packages
required for Ubuntu 24.04.
2024-08-07 15:48:50 +02:00
Javi Martín
0a3cabd8c8 Add rspec note to local installation instructions
This note was already present in the README, and it makes sense that we
mention it again in the other place where we recommend running the test
suite.
2024-08-07 15:48:50 +02:00
Javi Martín
9f5f0b3cf4 Remove UTF-8 PostgreSQL configuration instructions
Modern systems already use UTF-8 and so these instructions aren't
necessary.
2024-08-07 15:48:50 +02:00
Javi Martín
5b50040995 Simplify instructions to install rbenv
Some of these steps are no longer necessary since the rbenv installer
automatically configures the `~/.bashrc` file.
2024-08-07 15:48:50 +02:00
Javi Martín
9e3bbfd3aa Simplify wget command in Ubuntu instructions 2024-08-07 15:48:50 +02:00
Javi Martín
97c59afb0e Update instructions to install Node.js
We're using a specific version of Node.js since commit 55ed40e18.
2024-08-07 15:48:47 +02:00
Javi Martín
e666c28c5c Update instructions for the bin/setup command
This command simplifies some of the steps. However, there's a gotcha: it
might fail if the database requires username and password and they
haven't been configured before executing it.
2024-08-07 15:48:21 +02:00
Javi Martín
1b61e8e2e0 Add a more specific link for local installation docs
On our regular README, this link used to point to the documentation
site, which made sense because the documentation used to be on a
different repository. Now that the documentation is on this repository
as well, we can directly link to that file.

And, on the documentation README, we can also link to the local
installation instructions, just like we do in other places.
2024-08-06 15:48:14 +02:00
Javi Martín
4c5e446d02 Remove step to install the bundler gem
Bundler is included in Ruby since Ruby 2.6, so we don't have to
manually install the gem since commit 8e64d6c1a.
2024-08-06 15:48:14 +02:00
Javi Martín
5d9f02ae30 Fix typo in Spanish README 2024-08-06 15:48:14 +02:00