Commit Graph

17462 Commits

Author SHA1 Message Date
Javi Martín
e7b271fb47 Remove obsolete comment in environment files
We removed the assets initializer in commit 91cd1ce1b.
2022-07-19 23:13:35 +02:00
Javi Martín
7b91adb16f Use the same config for staging and preproduction
We were already doing so by duplicating the code; now we're doing it
explicitly.

This is going to help because we're going to do a few changes in the
environment files, and this way we don't have to do everything twice.

Note that, after we're finished with these changes, the staging and
production environments will be mostly identical and we could simply
require the production environment configuration in the `staging.rb`
file. We aren't doing so because some Consul installations might have
customized these files and it'd be hard for them to deal with all these
changes at once. So, for now, they'll only have to deal with the
possible differences between their staging and preproduction
environments.

Changes to the preproduction environment that won't be applied to the
staging environment can be added like this:

require Rails.root.join("config", "environments", "staging")

Rails.application.configure do
  config.log_level = :warn
end
2022-07-19 23:13:08 +02:00
Sebastia
299ca4cee6 Merge pull request #4852 from consul/release_1.5.0
Release version 1.5.0
2022-07-11 15:01:48 +02:00
taitus
5a2c875115 Release version 1.5.0 2022-07-11 14:43:28 +02:00
Senén Rodero
b8b7056e81 Merge pull request #4866 from consul/i18n_crowdin
Update translations from Crowdin
2022-07-08 10:14:04 +02:00
Javi Martín
a996fbe1d4 Merge pull request #4870 from consul/auto_assign
Assign pull request author automatically
2022-07-07 15:17:30 +02:00
Javi Martín
4ef4a5c0dd Merge pull request #4868 from consul/kanban_repo
Don't run kanban assignment on forks
2022-07-07 14:59:27 +02:00
Javi Martín
4c25b20891 Assign pull request author automatically
We've been doing manually for too long ;).

The reason why we're assigning the author is it makes it easy to filter
pull requests by assignee on our kanban; it isn't so easy (actually,
might be impossible) to filter by author.
2022-07-07 14:43:04 +02:00
Javi Martín
b86c4ec100 Use a better name for the kanban workflow
The word "assign" was ambiguous, because it could have meant we were
assigning the author.

We were also displaying the same name twice.
2022-07-07 14:28:02 +02:00
Javi Martín
5b31e2ab08 Merge pull request #4867 from consul/dependabot/bundler/rails-html-sanitizer-1.4.3
Bump rails-html-sanitizer from 1.3.0 to 1.4.3
2022-07-06 20:29:37 +02:00
dependabot[bot]
4054751bb0 Bump rails-html-sanitizer from 1.3.0 to 1.4.3
Bumps [rails-html-sanitizer](https://github.com/rails/rails-html-sanitizer) from 1.3.0 to 1.4.3.
- [Release notes](https://github.com/rails/rails-html-sanitizer/releases)
- [Changelog](https://github.com/rails/rails-html-sanitizer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rails/rails-html-sanitizer/compare/v1.3.0...v1.4.3)

---
updated-dependencies:
- dependency-name: rails-html-sanitizer
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-06 20:08:09 +02:00
Javi Martín
187e6ee1d6 Don't run kanban assignment on forks
Without this condition, the kanban assignment would be run on every
CONSUL fork and that would result in unpredictable results since they
would try to write on our kanban, and they don't have permission to do
so.

Note that, much to my dismay :D, the code only works if we use single
quotes in the name of the repository owner; it doesn't work if we use
double quotes.
2022-07-06 16:33:54 +02:00
Javi Martín
50857639f9 Merge pull request #4853 from consul/assign_project
Add kanban automation for new pull requests
2022-07-06 15:35:25 +02:00
Consul Bot
a00c3dad2a Update translations from Crowdin 2022-07-05 13:19:58 +02:00
Senén Rodero
2c405acde8 Merge pull request #4756 from consul/interpolations
Fix translations interpolations errors
2022-06-14 11:20:36 +02:00
Senén Rodero
ddf26aa344 Merge pull request #4851 from consul/i18n_crowdin
Update translations from Crowdin
2022-06-14 11:19:59 +02:00
Senén Rodero Rodríguez
320e1948fc Do not render message when there are zero participants without demographic data 2022-06-14 10:48:48 +02:00
Senén Rodero Rodríguez
184a856538 Remove translation duplicates
At some point we duplicated these keys unintentionally.
2022-06-14 10:48:48 +02:00
Consul Bot
576164b192 Update translations from Crowdin 2022-06-14 10:47:13 +02:00
Javi Martín
6c852e3ea0 Merge pull request #4858 from consul/spacing_fixes
Fix Rubocop convention offenses
2022-06-13 19:07:39 +02:00
Javi Martín
582498428f Merge pull request #4856 from consul/digest_spec
Disable JavaScript in notification digest spec
2022-06-13 19:06:11 +02:00
Senén Rodero
ce918e70bc Merge pull request #4696 from consul/set_request_locale
Enable the `Rails/I18nLocaleAssignment` cop to scan all the application ruby files
2022-06-13 18:43:35 +02:00
Javi Martín
f5de0a6102 Add empty line after access modifier
Rubocop was complaining about Layout/EmptyLinesAroundAccessModifier in
the tags controller.

This issue was introduced in commit e76735031. Unfortunately, it looks
like Pronto doesn't detect this issue because the access modifier was
already there; only the lines below it were introduced in that pull
request.
2022-06-13 17:39:53 +02:00
Javi Martín
7e663f8bcf Fix spacing issues after removing lines
Rubocop was complaining about a Layout/ExtraSpacing in a couple of
places.

These issues weren't detected by Pronto because they didn't affect lines
changed in the pull request. These lines were fine until we removed the
lines next to them in commits 4b42a68b6 and 00f0c4410.
2022-06-13 17:39:53 +02:00
Javi Martín
8f7a3bfb35 Disable JavaScript in notification digest spec
This test has been failing many times because it checks the database
after starting the process running the browser.

We're disabling JavaScript like we do in every other test using the
`create_proposal_notification` method. This way, Capybara will use the
rack driver and there'll be no risk of errors that currently might take
place if both the process running the browser and the process running the
test access the database.
2022-06-13 17:39:21 +02:00
Javi Martín
1271b96d6d Merge pull request #4857 from consul/fix_admin_debate_comments_link
Fix link to comments on admin view for debates
2022-06-13 17:33:46 +02:00
Julian Herrero
b9ec40325c Fix link to comments on admin view for debates 2022-06-13 17:04:51 +02:00
Senén Rodero Rodríguez
c263a6fc2f Configure Rails/I18nLocaleAssignment cop to scan all Ruby files
This cop scans only the tests files by default, but we prefer to scan all
application Ruby files, so when a developer uses the class method
`I18n.locale=`, the cop will embrace using the method
`I18n.with_locale` instead. By doing this way, the cop will help
developers to avoid unexpected translation errors.

Quoting the Rails 6 guides:
> I18n.locale can leak into subsequent requests served by the same
thread/process if it is not consistently set in every controller. For
example executing I18n.locale = :es in one POST requests will have
effects for all later requests to controllers that don't set the locale,
but only in that particular thread/process. For that reason, instead of
I18n.locale = you can use I18n.with_locale which does not have this
leak issue.

Now we enabled the cop for all application Ruby files; we have to
remove the assignments at the controller level to set the request
locale. As Rails 6 guides suggest [1], we can use the `around_action`
controller callback to set each request locale without breaking the
rule.

This cop will warn CONSUL developers when using `I18n.locale`
assignment embracing them to use the `I18n.with_locale`instead.

[1] https://guides.rubyonrails.org/i18n.html#managing-the-locale-across-requests
2022-06-13 15:45:32 +02:00
Javi Martín
7015f41e3a Add kanban automation for new pull requests
So now, newly opened pull requests will automatically be added to the
"Reviewing" column, while newly opened draft pull requests will
automatically be added to the "Doing" column.

I've added the "reopened" event just in case (and was indeed very useful
while testing this feature), although we rarely reopen pull requests.

Note that this only works on pull requests that aren't already in the
project; that is, if a pull request is already in the "Doing" column,
closing it and reopening it will *not* move it to the "Reviewing
column".

So it looks like we won't easily be able to extend this feature in order
to automatically move pull requests when they're marked as ready for
review.
2022-06-08 15:49:03 +02:00
Senén Rodero
845f12879a Merge pull request #4850 from consul/changing_language_text_direction
Disable Turbolinks for languages with different text direction
2022-06-08 14:00:09 +02:00
Senén Rodero
494f1de80b Merge pull request #4837 from joaoGabriel55/fix_bug_when_creating_admin_tags
Fix bug when creating admin tags
2022-06-08 13:57:01 +02:00
Sebastia
2b45e2fa40 Merge pull request #4811 from iraline/fix_require_email
Fix Registration Without E-Mail
2022-06-08 13:03:19 +02:00
Senén Rodero Rodríguez
64278c663c Do not exclude spec_helper.rb from Rails/I18nLocaleAssignment cop
Use the around action to set the desired locale so we do not break the rule.
2022-06-08 12:21:41 +02:00
Senén Rodero Rodríguez
ede6a3f73f Disable Turbolinks page loading for language links
Only when the current language has a different text direction
than the localization link to generate.
2022-06-08 07:12:29 +02:00
Iraline
5eb2dc5a9c adding limitation to not save blank email in model 2022-06-07 14:17:37 -03:00
Javi Martín
9938ab0017 Merge pull request #4849 from consul/more_browser_tests_database
Reduce conflicting queries/requests in system tests
2022-06-07 13:48:57 +02:00
joaoGabriel55
e767350314 Fixed bug when creating admin tags
Minor fix

Implemented specs for tags_controller and tag model

Code review
2022-06-07 08:43:27 -03:00
Javi Martín
5c1da85dca Merge pull request #4848 from consul/banner_destroy_notice
Add notice after destroying a banner
2022-06-07 11:31:06 +02:00
Javi Martín
9127e562b7 Merge pull request #4845 from consul/installation_processes
Describe enabled processes in the consul.json URL
2022-06-06 13:19:31 +02:00
Javi Martín
fb9b206e08 Merge pull request #4844 from consul/allow_removing_supports_by_default
Allow removing investment supports by default
2022-06-06 13:18:48 +02:00
Javi Martín
40e04863e1 Merge pull request #4842 from consul/ruby_2.7.6
Upgrade Ruby to version 2.7.6
2022-06-06 13:18:22 +02:00
Javi Martín
4f1f7eaa40 Merge pull request #4846 from consul/unused_css
Remove unused CSS containing a typo
2022-06-03 20:42:18 +02:00
Javi Martín
03aa52c4a0 Remove unused CSS containing a typo
It was accidentally added in commit ddc4ff329. The issue had already
been fixed in commit 0950a98dd.
2022-06-03 20:16:00 +02:00
Javi Martín
0f9d6c47a3 Merge pull request #4847 from consul/legacy_annotations_route
Remove legacy annotations route
2022-06-03 20:14:58 +02:00
Javi Martín
e4d69d12d4 Allow removing investment supports by default
When we added this setting in commit 9979b5399, we disabled it by
default so it would be compatible with existing installations.

Since then, we've released version 1.4, which adds the settings to
existing databases. That means we can now enable it by default and
existing installations won't be affected.
2022-06-03 20:10:33 +02:00
Javi Martín
107c856aea Upgrade Ruby to version 2.7.6
So get the latest fixes in the 2.7.x series.

We're also updating the parser gem so we don't get any warnings.
2022-06-03 20:03:39 +02:00
Javi Martín
7e89ecbb37 Merge pull request #4841 from consul/customize_graphql
Make it possible to customize GraphQL types
2022-06-03 12:28:29 +02:00
Sebastia
77825ed13f Merge pull request #4818 from consul/emails_styles
System emails design
2022-06-03 08:40:54 +02:00
Javi Martín
d91775b4aa Make database queries before starting the browser
When we perform database queries in tests after the process running the
browser has started, we sometimes get failures in our test suite due to
both the tests and the browser accessing the database at the same time.
2022-06-02 19:25:14 +02:00
Javi Martín
0dded3fa22 Remove redundant expectations in polls tests
Furthermore, using `Poll.all` results in a database query, and doing so
after the process running the browser has started might result in
failures when running our test suite.
2022-06-02 19:25:14 +02:00