Commit Graph

16282 Commits

Author SHA1 Message Date
Javi Martín
7024f1edf5 Extract class to find assets
So its methods can be used in other places.
2021-05-29 14:34:46 +02:00
Javi Martín
08318171f0 Extract component to render help section 2021-05-29 14:34:46 +02:00
Javi Martín
fbb40eccff Merge pull request #4512 from consul/fix_header_card_factory
Fix header card factory
2021-05-29 14:34:10 +02:00
Javi Martín
216fe8f686 Merge pull request #4521 from consul/phases_exception
Validate process dates depending on enabled phases
2021-05-29 14:28:46 +02:00
Javi Martín
b196e83121 Fix header card factory
It was using methods which don't exist.
2021-05-29 14:18:31 +02:00
Javi Martín
f55d2ab891 Validate process dates depending on enabled phases
When configuring phases in a process, we were validating the start date
or the end date is present, the other date is present too.

However, in other parts of the application we were checking whether a
phase is enabled and then assumed its dates were present if the phase
was enabled. However, we weren't validating this behavior, so it was
possible to enable a phase and leaving its dates blank, causing the
application to crash.

So, as suggested by Alberto, we're changing the validation rule so
phase dates are mandatory when a phase is enabled.

With this rule, the old validation rules are not necessary. I've
considered leaving them in order to avoid database inconsistencies.
However, I realized records having a disabled phase with its start and
end dates have always been valid. This means applications checking for
the presence of these dates instead of checking whether the phase is
enabled have never worked properly.

We don't have to change the logic anywhere else because as mentioned we
were already checking phases are enabled before using their dates.
2021-05-29 14:13:48 +02:00
Javi Martín
d5b3b25e1e Refactor legislation phases date validation rules
So now they're easier to change and we make sure the same rules apply to
all phases.
2021-05-29 13:55:29 +02:00
Javi Martín
5bcc70eda8 Fix proposals phase end date validation
So now it uses the same rules as the other phases.
2021-05-29 13:55:29 +02:00
Javi Martín
53c53e26a8 Add tests for draft and proposal phases dates
We had tests for other phases, but not for these ones.
2021-05-29 13:55:29 +02:00
Javi Martín
89545db3c0 Fix typos in processes dates validation specs 2021-05-29 13:55:29 +02:00
Javi Martín
9466aed833 Merge pull request #4529 from consul/dependabot/bundler/nokogiri-1.11.6
Bump nokogiri from 1.11.2 to 1.11.6
2021-05-28 15:48:52 +02:00
dependabot[bot]
fd8388bef7 Bump nokogiri from 1.11.2 to 1.11.6
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.11.2 to 1.11.6.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.11.2...v1.11.6)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-28 13:15:14 +00:00
Javi Martín
2505883d00 Merge pull request #4525 from consul/rails_5.2.4.6
Bump rails from 5.2.4.5 to 5.2.4.6
2021-05-28 15:13:47 +02:00
Javi Martín
c16e29863b Merge pull request #4524 from consul/ruby_2.6.7
Upgrade Ruby to version 2.6.7
2021-05-28 14:29:51 +02:00
Javi Martín
cb49e1c6bb Bump rails from 5.2.4.5 to 5.2.4.6
Bumps [rails](https://github.com/rails/rails) from 5.2.4.5 to 5.2.4.6.
- [Release notes](https://github.com/rails/rails/releases)
- [Commits](https://github.com/rails/rails/compare/v5.2.4.5...v5.2.4.6)
2021-05-20 18:38:17 +02:00
Javi Martín
85f13f9501 Use namespace as symbol in polymorphic_path calls
Our `namespace` helper returns a string. However, Rails version 5.2.4.6
doesn't allow strings as arguments to polymorphic_path [1]

Since returning a symbol in our `namespace` helper would break other
places in the application, we're converting it to a symbol in the
methods calling `polymorphic_path`.

[1] https://github.com/advisories/GHSA-hjg4-8q5f-x6fm
2021-05-20 18:37:45 +02:00
Javi Martín
5f4dd48e25 Merge pull request #4500 from consul/dependabot/bundler/rexml-3.2.5
Bump rexml from 3.2.4 to 3.2.5
2021-05-20 17:05:39 +02:00
Javi Martín
a2113ae003 Upgrade Ruby to version 2.6.7
So get the latest security fixes in the 2.6.x series.
2021-05-20 16:43:56 +02:00
dependabot[bot]
74f18cc550 Bump rexml from 3.2.4 to 3.2.5
Bumps [rexml](https://github.com/ruby/rexml) from 3.2.4 to 3.2.5.
- [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.2.4...v3.2.5)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-20 14:11:37 +00:00
Javi Martín
c34de4b669 Merge pull request #4519 from consul/dependabot/bundler/puma-4.3.8
Bump puma from 4.3.6 to 4.3.8
2021-05-20 15:47:32 +02:00
dependabot[bot]
41f83b387e Bump puma from 4.3.6 to 4.3.8
Bumps [puma](https://github.com/puma/puma) from 4.3.6 to 4.3.8.
- [Release notes](https://github.com/puma/puma/releases)
- [Changelog](https://github.com/puma/puma/blob/master/History.md)
- [Commits](https://github.com/puma/puma/compare/v4.3.6...v4.3.8)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-19 07:31:40 +00:00
Javi Martín
f49d751ba1 Merge pull request #4391 from consul/release_1.3.0
Release version 1.3.0
2021-04-27 19:37:11 +02:00
Javi Martín
6de3bd9844 Merge pull request #4479 from consul/i18n_crowdin
Update translations from Crowdin
2021-04-27 19:01:19 +02:00
Javi Martín
e69a89f3c7 Fix typos in CHANGELOG 2021-04-27 12:37:34 +02:00
taitus
9e6c8bf5b3 Release version 1.3.0 2021-04-27 12:37:34 +02:00
Javi Martín
45448374e3 Merge pull request #4497 from consul/small_screen_footer
Fix footer overflow on small screens
2021-04-27 12:34:06 +02:00
Senén Rodero Rodríguez
77c75add3d Enable Ukrainian language by default 2021-04-27 10:53:47 +02:00
Senén Rodero Rodríguez
85e9addc21 Update translations from Crowdin 2021-04-27 10:53:47 +02:00
Javi Martín
963511d4cc Fix footer overflow on small screens
On small screens, sometimes the bottom of the footer didn't have the
footer's background color.

I'm not sure why the `min-height` rule affects this outcome. However,
since this rule usually results in footer with quite a bit of empty
space at the bottom, we can simpliy remove the rule and use padding to
guarantee there's a bit of space between the text in the footer and the
bottom of the screen.
2021-04-26 19:57:31 +02:00
Javi Martín
50bf83d417 Merge pull request #4487 from consul/dependabot/bundler/oauth-0.5.6
Bump oauth from 0.5.4 to 0.5.6
2021-04-23 16:23:05 +02:00
dependabot[bot]
1e9f4a2448 Bump oauth from 0.5.4 to 0.5.6
Bumps [oauth](https://github.com/oauth-xx/oauth-ruby) from 0.5.4 to 0.5.6.
- [Release notes](https://github.com/oauth-xx/oauth-ruby/releases)
- [Changelog](https://github.com/oauth-xx/oauth-ruby/blob/master/HISTORY)
- [Commits](https://github.com/oauth-xx/oauth-ruby/compare/v0.5.4...v0.5.6)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-23 14:01:36 +00:00
Javi Martín
39dd039faf Merge pull request #4489 from consul/pronto_dependabot
Fix checkout in Pronto on Dependabot pull requests
2021-04-23 15:59:07 +02:00
Javi Martín
8fcb9560e0 Merge pull request #4478 from consul/update_posgres_docker
Use a maintained PostgreSQL version in Docker
2021-04-23 12:50:57 +02:00
Javi Martín
a6cda37113 Use environment variable for password in Docker
We were getting an error since we started using the postgres 9.6 image:

```
Attaching to app_1, database_1
database_1  | Error: Database is uninitialized and superuser password is not specified.
database_1  |        You must specify POSTGRES_PASSWORD to a non-empty value for the
database_1  |        superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
database_1  |
database_1  |        You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
database_1  |        connections without a password. This is *not* recommended.
database_1  |
database_1  |        See PostgreSQL documentation about "trust":
database_1  |        https://www.postgresql.org/docs/current/auth-trust.html
```
2021-04-23 12:23:17 +02:00
Javi Martín
a5eada79c0 Fix Pronto on Dependabot pull requests
As explained in "GitHub Actions: Workflows triggered by Dependabot PRs
will run with read-only permissions" [1], we need to consider Dependabot
pull requests as external pull requests.

[1] https://github.blog/changelog/2021-02-19-github-actions-workflows-triggered-by-dependabot-prs-will-run-with-read-only-permissions/
2021-04-23 00:14:16 +02:00
Javi Martín
7378d2cd8d Update PostgreSQL dependency to version 9.5
Version 9.4 hasn't been maintained since February 2020, so we aren't
supporting it either. And we might start using `UPSERT` instead of
`find_or_create`, which was introduced in PostgreSQL 9.5.

We're still supporting PostgreSQL 9.5 even if it's also unmaintained
because it has only been officially unmaintained for a couple of months.
2021-04-21 19:08:21 +02:00
Javi Martín
01a1eb7f4d Use a maintained PostgreSQL version in Docker
Neither PostgreSQL version 9.4 nor version 9.5 are maintained anymore.
2021-04-21 19:08:21 +02:00
Javi Martín
972432ebd1 Merge pull request #4486 from consul/enable_sdg_processes
Make it easier for admins to enable SDG processes
2021-04-21 19:06:11 +02:00
Javi Martín
32a61f826c Make it easier for admins to enable SDG processes
In order to ensure compatibility with existing CONSUL installations, we
disabled all settings related to SDG. However, we also made it much
harder to enable SDG globally on the site, since administrators first
had to enable the SDG feature and then enable it for each process.

Most people will expect SDG is enabled for all processes once they
enable the SDG feature, so that's what we're doing. They can of course
disable specific processes should they wish to do so.
2021-04-21 18:37:54 +02:00
Javi Martín
24a4c46465 Merge pull request #4483 from consul/draft_budgets_text
Add draft info on unpublished budgets
2021-04-21 18:28:55 +02:00
Javi Martín
fc1a0f33e7 Add draft info on unpublished budgets
Before commit 28caabecd, it was clear which budgets were in draft mode
because their phase was "drafting".

Now the phase isn't "drafting" anymore, so we have to make it clear
somehow that the budget is a draft.

I'm using styles similar to the ones we added in commit 2f636eaf7 for
completed budgets but at the same time making them slightly different so
it's easy to differenciate completed and drafting budgets.
2021-04-21 17:12:12 +02:00
Javi Martín
0eedc7b6ab Use readable texts in admin budgets test
Particularly the line with `within "tr", text: "Finished budget" do` is
now easier to read.

This way we avoid a potential pitfall. Imagine that the factory which
creates a finished budget generated a budget with the name "COMPLETED
Budget 1". Then the test:

```
within "#budget_#{finished_budget.id}" do
  expect(page).to have_content("COMPLETED")
end
```

Would pass even if we didn't add the text "COMPLETED" anywhere else,
because it would be included in the name of the budget.
2021-04-21 17:12:12 +02:00
Javi Martín
c50e04e9cb Extact method to get the budget status HTML class 2021-04-21 17:12:12 +02:00
Javi Martín
9f671b9617 Extract method to get budget status text 2021-04-21 17:12:12 +02:00
Javi Martín
be10e1afb6 Merge pull request #4484 from consul/forks-pr-pronto
Fix checkout in Pronto on external pull requests
2021-04-21 17:11:26 +02:00
taitus
9272873cf8 Fix checkout in Pronto on external pull requests
Since the target branch was in a different repository, the action failed
since it couldn't find the reference.

The code here is based on a recent change in Pronto [1] and with a comparison
between the repo.url property of pull_request.head and pull_request.base
to determine if the pull request was created from a forked repository

[1] https://github.com/prontolabs/pronto/commit/4fe28418b6
2021-04-21 16:39:07 +02:00
Javi Martín
0654bcbad9 Merge pull request #4476 from consul/source_translations_typos
Fix source translations typos
2021-04-21 13:25:05 +02:00
Senén Rodero Rodríguez
10d77e021e Improve remote census translation
This translation was confusing for Crowdin users.
Translators were not sure about the direction of the data.
2021-04-17 11:04:25 +02:00
Javi Martín
3169f87e44 Merge pull request #4475 from consul/browser_tests_database
Reduce test database access after visiting a page
2021-04-16 15:57:58 +02:00
Javi Martín
3345dd67d9 Remove unnecessary in_browser clause
We only need to define one `in_browser`, which is the one opening the
session as an administrator.

This change is done to simplify the code, although there's a small
chance it might also make the test stop failing in our CI. Sometimes in
our CI the first `visit` in the `in_browser(:admin)` block fails for
unknown reasons, rendering a blank page.
2021-04-16 14:37:58 +02:00