Commit Graph

17475 Commits

Author SHA1 Message Date
decabeza
10cd182774 Add more images to admin site customization 2022-08-17 13:51:13 +02:00
Javi Martín
11bed74678 Extract constant to configure valid mime types
This way it'll be possible to overwrite the valid mime types in a custom
model.
2022-08-17 12:56:55 +02:00
Javi Martín
00ea1bf719 Fix customization of budget_execution_no_image
We forgot to change the line rendering the image in commits 3574bf867c
and 810bdae37a, and so the custom image was being ignored.

Note that, in the test, we're stubbing a constant instead of adding a
new image. The main reason is that, if we add a new image, forks would
have to change the image when they change the `VALID_IMAGES` constant;
otherwise the tests would fail.
2022-08-17 12:53:00 +02:00
Javi Martín
f0ab7bcfcc Move executions image partial to a component
This way it'll be easier to write tests for it. We also get rid of
another helper file :).
2022-08-03 17:01:57 +02:00
Javi Martín
4d674bf643 Remove duplication in dashboard layout head
Apparently the dashboard branch wasn't updated after we extracted a
common head for all layouts in commit 6e4f697ce, so when said branch was
merged we reintroduced the duplication. Furthermore, we forgot to add to
the dashboard layout the changes we were applying to the common head
partial.
2022-08-03 17:01:21 +02:00
Javi Martín
eb39e8e365 Merge pull request #4883 from consul/bump_rails_to_5.2.8.1
Bump rails from 5.2.7.1 to 5.2.8.1
2022-08-01 15:35:44 +02:00
Javi Martín
241dd53411 Bump rails from 5.2.7.1 to 5.2.8.1
This release introduces an incompatibility in order to fix a security
issue when using YAML for serialization. We use YAML to serialize the
`ranges` column in the `legislation_annotations` table, so we have to
allow the `ActiveSupport::HashWithIndifferentAccess` class in order to
properly read this column.

Ideally we'd use a JSONB column for the ranges (like we do in other
places), but that would require migrating existing data.

Bumps [rails](https://github.com/rails/rails) from 5.2.7.1 to 5.2.8.1.
- [Release notes](https://github.com/rails/rails/releases)
- [Commits](https://github.com/rails/rails/compare/v5.2.7.1...v5.2.8.1)

---
updated-dependencies:
- dependency-name: rails
...
2022-07-26 22:58:43 +02:00
Javi Martín
cbafb97fd7 Merge pull request #4879 from consul/dependabot/bundler/tzinfo-1.2.10
Bump tzinfo from 1.2.9 to 1.2.10
2022-07-26 22:21:39 +02:00
dependabot[bot]
706beb05fa Bump tzinfo from 1.2.9 to 1.2.10
Bumps [tzinfo](https://github.com/tzinfo/tzinfo) from 1.2.9 to 1.2.10.
- [Release notes](https://github.com/tzinfo/tzinfo/releases)
- [Changelog](https://github.com/tzinfo/tzinfo/blob/master/CHANGES.md)
- [Commits](https://github.com/tzinfo/tzinfo/compare/v1.2.9...v1.2.10)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-26 21:48:56 +02:00
Senén Rodero
36404e1686 Merge pull request #4873 from consul/help_page_bug
Remove Processes link on help page when legislation is disabled
2022-07-21 07:26:10 +02:00
Senén Rodero Rodríguez
0ccfac76ad Remove Processes link on help page when legislation is disabled 2022-07-20 20:44:25 +02:00
Javi Martín
8a1b5d5a62 Merge pull request #4875 from consul/unify_environments
Simplify staging/preproduction environment files
2022-07-20 13:31:41 +02:00
Javi Martín
dbc988f3e4 Unify production and staging environment files
We changed the structure of the production environment file in commit
eb36b7e2e, but forgot to do so for staging and preproduction.

We're also changing the comments in the production environment file so
they use double quotes, like we do everywhere else.

After these changes, the staging and production environments are mostly
identical, and we could simply require the production environment
configuration in the `staging.rb` file. We aren't doing so because we've
just done changes affecting the preproduction environment and, since
Consul installations might have customized these files, it might be hard
for them to deal with all these changes at once.
2022-07-19 23:13:42 +02:00
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