Commit Graph

8970 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
Senén Rodero Rodríguez
0ccfac76ad Remove Processes link on help page when legislation is disabled 2022-07-20 20:44:25 +02:00
taitus
5a2c875115 Release version 1.5.0 2022-07-11 14:43:28 +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
Javi Martín
6c852e3ea0 Merge pull request #4858 from consul/spacing_fixes
Fix Rubocop convention offenses
2022-06-13 19:07:39 +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
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
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
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
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
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
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
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
d4c62e2fc6 Add notice after destroying a banner
We were missing a notice in this case. Not only this caused
inconsistencies in the user experience, but it also made it hard to add
an expectation in the test checking the request had finished before
making a new one. Simultaneous requests sometimes cause failures in our
test suite.
2022-06-02 19:05:02 +02:00
taitus
73f710e737 Unify format and indentation for sanitize, i18n and links on emails
In the mail section we have very different indentations and formatting in
 texts with sanitize, links and texts with interpolations. In my opinion it
helps a lot to have clearer indentations in these cases.

This may not be the best way to indent them, but at least I think it is
clearer than it was and at least relatively unified.
2022-06-02 17:56:18 +02:00
decabeza
8c078ae0a9 Add missing heading title on mailers 2022-06-02 17:56:18 +02:00
decabeza
bec59f1f9f Remove icon images on mailers 2022-06-02 17:56:18 +02:00
decabeza
7f0f35a5c0 Add mailer helpers to simplify customization 2022-06-02 17:56:15 +02:00
Javi Martín
201e23da3d Describe enabled processes in the consul.json URL
The idea to show the status of the existing features was done in commit
7339a98b74. Back then, we didn't have the separate `process.` prefix,
and so processes were enabled/disabled using settings like
`feature.debates` instead of `process.debates`.

IMHO making the information about the enabled features public could
potentially be a bit risky since it gives too much information about the
current status of the application.

Showing which processes are enabled, on the other hand, is pretty
harmless, and it's the reason why this feature was added in the first
place.
2022-06-02 17:10:38 +02:00
Javi Martín
4eea69faee Make it possible to customize GraphQL types 2022-06-02 16:22:25 +02:00
Javi Martín
954bc61014 Merge pull request #4815 from iraline/fix_confirmation_token_2746
Fix Confirmation Token to only work once
2022-06-02 15:23:47 +02:00
Javi Martín
4ff2e4573e Remove explicit inclusions of now-default modules
These modules are used by default in version 1.12.14 and so we were
getting deprecation warnings:

```
DEPRECATION WARNING: GraphQL::Execution::Interpreter is now the
default; remove `use GraphQL::Execution::Interpreter` from the schema
definition (app/graphql/consul_schema.rb:6)
DEPRECATION WARNING: GraphQL::Analysis::AST is now the default; remove
`use GraphQL::Analysis::AST` from the schema definition
(app/graphql/consul_schema.rb:7)
DEPRECATION WARNING: GraphQL::Pagination::Connections is now the
default, remove `use GraphQL::Pagination::Connections` from
app/graphql/consul_schema.rb:10
```
2022-06-02 13:23:56 +02:00
taitus
d871bb9eae Unify render "quotes" on emails
This section was being displayed differently in each mailing. We are trying
to unify it so that they are displayed the same.
2022-06-02 11:24:19 +02:00
taitus
d0224d1903 Add attributes for sanitize on unsubscribe link section
In the comments and direct message emails, the "attributes" was
missing and in the reply email it was not in the right place.
2022-06-02 11:24:19 +02:00
taitus
41b9705563 Unify unsubscribe section styles with others emails 2022-06-02 11:24:19 +02:00
taitus
7ff62532df Unifiy proposal notification digest with others emails
The notification digest title did not look the same as other mail.  We
removed the table for the title to make it more consistent with the rest of
the emails.
2022-06-02 11:24:19 +02:00
taitus
12ea724474 Fix evaluation comment email on system emails
Currently with both seeds and dev_seeds, not only was this email not
displayed from the system emails section, but it also caused an error in
the application.

@email_to had an empty value and in the view we tried to access
@email_to.name which caused the error. We kept the same logic but
added the current_user to make sure it always has a valid value. We add
the current_user because the current_user is always present in this controller..
2022-06-02 11:24:19 +02:00
Javi Martín
5c317927c0 Merge pull request #4802 from consul/typos
Fix typos in the English version
2022-06-01 14:45:50 +02:00
Javi Martín
92b1e53fc3 Unify user permission texts
We had the same texts four times, with slight variations in the case of
the management section.

We're unifying them under the "verification" i18n namespace, since the
texts are about actions which can be done depending on whether users are
verified or not.

Note the names of the i18n keys aren't very consistent, since we use
"debates" in plural but "proposal" in singular. We're leaving it like
this so existing translations aren't affected.
2022-06-01 14:27:33 +02:00
Javi Martín
67e9c68662 Remove confusing permission info in "my account"
We were saying that actions marked with an asterisk were only possible
when users were verified. However, there were no actions marked with an
asterisk; instead, we didn't show these actions to non-verified users.

Besides, the concept of Census doesn't exist in many CONSUL
installations, where verification is done through other means, so the
text saying that only users on Census could do certain things wasn't
correct in these cases.

Due to that, we're removing the asterisk in the Spanish version as well.
We're also removing the asterisk in the default welcome pages, since
we're already saying which action can't be done until the account is
verified.

In the case of the residence verification page, we had asterisks but we
didn't explain what the asterisk stood for, so we're also removing it.
2022-06-01 14:27:33 +02:00
Javi Martín
0141c51f5f Merge pull request #4826 from consul/global_foundation_sass
Fix warnings when compiling SCSS
2022-06-01 12:28:19 +02:00
Javi Martín
1e1edc02e9 Fix warnings when compiling SCSS
Foundation was using `!global` for non-existing variables, which
generated a warning on our current version of Sass.

This is (mostly) fixed on the latest version of Foundation. However,
this latest version isn't included in the `foundation-rails` gem, so we
can't upgrade yet.

So we're defining these variables before Foundation does so.

See issue 12080 in the foundation/foundation-sites repository for more
information.
2022-06-01 12:04:17 +02:00
Finn Heemeyer
c984e666ff Add new GraphQL types, schema (with fields) & base mutation
The current consul GraphQL API has two problems.

1) It uses some unnecessary complicated magic to automatically create
   the GraphQL types and querys using an `api.yml` file. This approach
   is over-engineered, complex and has no benefits. It's just harder to
   understand the code for people which are not familiar with the
   project (like me, lol).

2) It uses a deprecated DSL [1] that is soon going to be removed from
   `graphql-ruby` completely. We are already seeing deprecation warning
   because of this (see References).

There was one problem. I wanted to create the API so that it is fully
backwards compatible with the old one, BUT the old one uses field names
which are directly derived from the ruby code, which results in
snake_case field names - not the GraphQL way. When I'm using the
graphql-ruby Class-based syntax, it automatically creates the fields in
camelCase, which breaks backwards-compatibility.

So I've added deprecated snake_case field names to keep it
backwards-compatible.

[1] https://graphql-ruby.org/schema/class_based_api.html
2022-06-01 11:41:09 +02:00
Sebastia
5c6ab81c38 Merge pull request #4820 from consul/legislation_processes_alert
Remove unnecessary alert on legislation processes
2022-06-01 11:03:02 +02:00
Sebastia
a1186ffe56 Merge pull request #4827 from consul/machine_learning_settings
Include machine learning settings type
2022-06-01 11:02:24 +02:00
Senén Rodero
99762c57b6 Merge pull request #4821 from consul/census_terms_page
Add census terms page by default
2022-06-01 10:45:07 +02:00
Iraline
0195eac3fa change the code to use what Devise does by default and update the tests 2022-05-09 18:14:12 -03:00
Iraline
4fd6253a00 Permit use confirmation token only when user create a new account or change the email 2022-05-05 16:54:56 -03:00