Commit Graph

19791 Commits

Author SHA1 Message Date
taitus
2408caf9da Release version 2.2.1 2024-10-03 20:04:22 +02:00
Javi Martín
347b7b3126 Merge pull request #5728 from consuldemocracy/fix_user_content_translations_images
Fix images layout in user content translations
2024-10-03 19:58:54 +02:00
Sebastia
1d6c38f44c Merge pull request #5729 from consuldemocracy/i18n_crowdin
Update translations from Crowdin
2024-10-03 19:47:38 +02:00
Consul Bot
b470a50496 Update translations from Crowdin 2024-10-03 19:06:23 +02:00
Javi Martín
b5d3df5ee5 Fix images layout in user content translations
Depending on the size of the window, these images can look pretty bad
when they're displayed right after some text, since on GitBook they
might appear in the middle of the paragraph.
2024-10-03 14:14:10 +02:00
Sebastia
c6e239b13e Merge pull request #5710 from consuldemocracy/user_content_translations_docs
Update user content translations documentation
2024-10-02 16:02:18 +02:00
taitus
9c191890ae Improve user content translations docs
Note that a step suggesting to run a rake task has been removed,
which is no longer necessary.
2024-10-02 15:59:38 +02:00
Sebastia
255e0c963e Merge pull request #5709 from consuldemocracy/local_census_docs
Update local census documentation
2024-10-02 14:00:51 +02:00
taitus
f5f4eefc58 Improve local census documentation 2024-10-02 12:50:21 +02:00
Sebastia
7f5dff278e Merge pull request #5708 from consuldemocracy/configure_census_conection_docs
Update remote census configuration documentation
2024-10-02 12:02:19 +02:00
taitus
d23b1e9856 Update remote census configuration docs
Remove some unhelpful images from the documentation.
2024-10-02 11:57:15 +02:00
Sebastia
3b41a6610f Merge pull request #5707 from consuldemocracy/oauth-docs
Update OAuth documentation
2024-09-30 19:30:19 +02:00
taitus
bd6bdfcff8 Improve oauth docs 2024-09-30 19:28:06 +02:00
Sebastia
4114dcfb9d Merge pull request #5696 from consuldemocracy/servers-docs
Update documentation for Production and Staging servers
2024-09-30 19:19:06 +02:00
taitus
ff74960ba3 Update mail server configuration instructions 2024-09-30 18:25:07 +02:00
taitus
c267679aeb Update Heroku instructions
Note that the variable related with the "hostname" is removed
from the Heroku instructions as it is not necessary to configure
the Bucket.
2024-09-30 18:25:07 +02:00
taitus
c27a32a5f3 Update digital ocean instructions 2024-09-30 18:25:07 +02:00
taitus
6316938e3b Update manual installation instructions 2024-09-30 18:25:07 +02:00
taitus
cee4f3f027 Update ssh key instructions 2024-09-30 18:25:07 +02:00
taitus
d425b88f26 Update create deploy user instructions 2024-09-30 18:25:07 +02:00
taitus
81ab194831 Update installer installation instructions 2024-09-30 18:25:07 +02:00
taitus
ac23dc162f Update servers installation instructions 2024-09-30 18:25:07 +02:00
Javi Martín
06c15ef481 Merge pull request #5695 from consuldemocracy/graphql_docs
Update GraphQL documentation
2024-09-30 12:23:37 +02:00
Javi Martín
7b393a8f89 Merge pull request #5706 from consuldemocracy/graphql_limits
Bring back GraphQL security limits
2024-09-30 12:19:51 +02:00
Javi Martín
d00b431f58 Move GraphQL code examples to the GraphQL docs
While this leads to a bit of duplication, since now the same code is in
both the Spanish and English texts, and it makes it harder to actually
run the code, it'll make it easier for people reading the documentation
to find the code, and we get rid of the confusingly-named `doc/` folder.
2024-09-30 12:09:08 +02:00
Javi Martín
a5aa39f6e2 Update GraphQL documentation
We don't use the `config/api.yml` file since commit c984e666f, and the
`.delete("\n").delete(" ")` in the code examples isn't necessary (we
should have probably added it in commit 56e42f209).

We're also changing the responses so there are no references to any
specific city.
2024-09-30 12:09:08 +02:00
Javi Martín
5f80a75161 Limit GraphQL queries complexity once again
We accidentally removed the code for maximum complexity in commit
c984e666f. As mentioned in the documentation:

> The main risk factor is multiple collections of resources being
> requested in the same query.

We reject these requests by limiting the complexity.

The `max_complexity` option depends on the page size being set. Without
it, we get an error:

```
Can't calculate complexity for User.public_debates, no `first:`,
`last:`, `max_page_size` or `default_max_page_size`
```

So we're also adding a default max page size.

Note that the documentation mentioned that the default page size was 25.
However, before commit c984e666f, we were using a page size of 50 in
some cases. We're going with the one mentioned in the documentation
since we don't fully understand the old code.
2024-09-30 12:06:42 +02:00
Javi Martín
90bb7484a5 Add max_depth limit to GraphQL queries once again
We accidentally removed this code in commit c984e666f. As mentioned in
our GraphQL documentation, limiting the depth of the queries helps
against DoS attacks.
2024-09-30 11:52:39 +02:00
Javi Martín
d28854802e Merge pull request #5637 from consuldemocracy/api_public_find
Make sure we only return public records in the API
2024-09-30 11:52:01 +02:00
Javi Martín
b01364d26b Make sure we only return public records in the API
When returning a collection of records in the API, we were making sure
we only returned public ones. However, when returning individual
records, we were not checking that.

In practice, this wasn't a big issue, since most `public_for_api`
methods return all records, but it could affect Consul Democracy
installations which might have customized their `public_for_api` method.
The only exception was the `budget` method, since it was returning
budgets that were still in drafting.
2024-09-30 11:35:15 +02:00
Javi Martín
ba558b1490 Reorganize graphql specs
Back in commit c984e666f, we reorganized the code related to the GraphQL
API, but we didn't reorganize the tests.

So we're doing it now, since we're going to fix a potential issue and
add some tests for it.
2024-09-30 11:35:15 +02:00
Javi Martín
b1b963f90a Fix public_for_api association tests
These tests were always passing because they were stubbing the response
of the same method they were testing. For example, we were testing the
result of `Comment.public_for_api` and stubbing it at the same time.

So we're now stubbing the result of the associations; for example, in
order to test `Comment.public_for_api`, we're stubbing the response of
`Debate.public_for_api`. Now the tests fail if, for instance, the
implementation of `Comment.public_for_api` returns all comments.
2024-09-30 11:35:15 +02:00
Javi Martín
b44d217b00 Merge pull request #5571 from cyrillefr/Cannot_Access_Budget_Investments_Using_The_GraphQ_LAPI
Add new GraphQL types for budget investments
2024-09-30 11:33:39 +02:00
cyrillefr
18323a36c3 Add new GraphQL type for milestones
- added the milestone type to be displayed with investments
- the corresponding spec
2024-09-30 11:14:01 +02:00
cyrillefr
5ec6337d47 Add new GraphQL types for budget investments
- added 2 new types
- modified the models to get data through graphQL
- modified the corresponding spec
- also testing that hidden comments do not show up
- modified comments specs bc now it returns comments on budget
  investments
2024-09-30 11:14:01 +02:00
taitus
94ad81274d Add consistency to Omniauth keys in secrets.yml.example
The keys to configure Omniauth for WordPress were only added
to the production environment, so we unified all the keys across
the staging and preproduction environments.
2024-09-27 12:42:02 +02:00
Javi Martín
5a45049273 Merge pull request #5700 from consuldemocracy/dependabot/bundler/google-protobuf-4.27.5
Bump google-protobuf from 4.26.0 to 4.27.5
2024-09-25 11:43:01 +02:00
Javi Martín
b00dcda1c4 Merge pull request #5704 from consuldemocracy/dependabot/bundler/webrick-1.8.2
Bump webrick from 1.8.1 to 1.8.2
2024-09-25 11:40:15 +02:00
Javi Martín
7db38c50d2 Merge pull request #5699 from consuldemocracy/multitenancy_docs
Update multitenancy documentation
2024-09-24 19:12:31 +02:00
dependabot[bot]
a3b3421fd6 Bump google-protobuf from 4.26.0 to 4.27.5
Bumps [google-protobuf](https://github.com/protocolbuffers/protobuf) from 4.26.0 to 4.27.5.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/protobuf_release.bzl)
- [Commits](https://github.com/protocolbuffers/protobuf/commits)

---
updated-dependencies:
- dependency-name: google-protobuf
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-24 16:56:00 +00:00
dependabot[bot]
b92c0daff0 Bump webrick from 1.8.1 to 1.8.2
Bumps [webrick](https://github.com/ruby/webrick) from 1.8.1 to 1.8.2.
- [Release notes](https://github.com/ruby/webrick/releases)
- [Commits](https://github.com/ruby/webrick/compare/v1.8.1...v1.8.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-24 16:53:51 +00:00
Javi Martín
0a8870ef7d Merge pull request #5701 from consuldemocracy/dependabot/bundler/puma-5.6.9
Bump puma from 5.6.8 to 5.6.9
2024-09-24 18:53:02 +02:00
Javi Martín
08cceceed8 Update multitenancy documentation
Most of it was up-to-date, except for the fact that Consul Democracy
already uses Rails 7.0 and that it's possible to use different languages
per tenant since commit 6de4737b7.
2024-09-24 18:47:13 +02:00
Javi Martín
32d9118d1e Fix typos in multitenancy documentation 2024-09-24 18:47:13 +02:00
Javi Martín
53c7d19b8b Merge pull request #5689 from consuldemocracy/remotely_translatable_test
Directly select language in remotely translatable tests
2024-09-24 17:51:24 +02:00
Javi Martín
3e44eeaee0 Directly select language in remotely translatable tests
The test "request a translation of an already translated text" was
failing sometimes on our CI since August 29, maybe due to a change in
GitHub Actions since the test had been passing for a year and a half and
we didn't change any code around that time (we were updating the
documentation). While the root cause is unknown, debugging shows that
sometimes (usually the first time this test is executed on our CI, and
only the first time, since running it 600 tests in a row also resulted
in only one failure) the request done by clicking on "Traducir página"
is done with a user session where the locale is in English.

This doesn't make much sense, since both user sessions are already in
Spanish (and we had either explicit or implicit expectations to confirm
that), and debugging shows that the session is indeed in Spanish during
the previous request.

In any case, we're solving it by never using English during the test,
since it wasn't necessary; it was only done that way because all the
tests on this file used the language selector to get to the Spanish
pages. We're simplifying some of the other tests the same way.

The test failure was:

```
Failure/Error: expect(page).to have_content "Se han solicitado
correctamente las traducciones"
expected to find text "Se han solicitado correctamente las traducciones"
in
"Idioma: \n
\nEnglish\nDeutsch\nEspañol\nFrançais\nNederlands\nPortuguês
brasileiro\n中文\n
Entrar\nRegistrarse\nDebates\nPropuestas\nVotaciones\nLegislación
colaborativa\nPresupuestos participativos\nODS\nAyuda\n×\nTranslations
have been correctly requested.\nPropuestas más activas\nAhora mismo no
hay propuestas\nDebates más activos\nndfrrqufrp\nVer todos los
debates\nProcesos abiertos\nAhora mismo no hay procesos
abiertos\nGobierno abierto\nEste portal usa la aplicación CONSUL
DEMOCRACY que es software de código abierto.\nParticipación\nDecide cómo
debe ser la ciudad que quieres.\nCONSUL DEMOCRACY, 2024 Política de
privacidad Condiciones de uso Accesibilidad"
```

Note that most of the text is in Spanish (as expected) but the flash
message itself is in English.
2024-09-24 16:54:02 +02:00
Javi Martín
314019bee7 Remove database expectations in remotely translatable tests
In the past, having this kind of expectations after the process running
the browser has started has resulted in flaky issues with the database
connection.

In one case, we're removing the test because there are controller tests
covering the same scenario and a system test checking what happens from
the user perspective.

In the other case, we're replacing the expectations with expectations
from the user's point of view.
2024-09-24 16:54:02 +02:00
Javi Martín
3ab9fb1d27 Simplify similar remotely translatable tests
We were using the same setup in these tests, and we were only changing
the expectations or adding an extra step.

Note we're also using `refresh` to simplify the code and because we were
using `select "Español", from: "Idioma:"` when that language was already
selected.
2024-09-24 16:54:02 +02:00
Javi Martín
95dc70acee Remove parentheses in remove translatable expectations
So it's consistent with both the rest of the file and what we usually
do.
2024-09-24 16:53:53 +02:00
Javi Martín
d636f1fe75 Add missing expectations in remotely translatable tests
After changing the language, we were checking that certain content isn't
there.

However, the content wasn't there before changing the language either,
so the test will pass even if the request to change the language hasn't
finished.

Although this is probably OK because we aren't changing the language
using an AJAX request, and so Capybara will correctly wait until the
request is finished before finishing the test, confirming that the page
has changed after a request is something we try to do in every test.
2024-09-24 16:53:45 +02:00