Commit Graph

17084 Commits

Author SHA1 Message Date
Javi Martín
9514ece2c2 Prioritize English and Spanish in dev seeds
These locales are officially maintained by CONSUL developers, so we're
using them when available.

This way we'll be able to use `random_locales` in places where we're
manually using English and Spanish, giving support to other locales
while maintaining compatibility with the current version.
2021-12-13 15:15:28 +01:00
Javi Martín
dd28ea7713 Don't enforce available locales in dev seeds
We're using Faker during this task, and it depends on English being
available as a fallback for methods like the Lorem ipsum ones.
2021-12-13 15:15:28 +01:00
Javi Martín
980558c9d2 Merge pull request #4752 from consul/remove_incomplete_text
Remove broken technical assistance text in footer
2021-12-13 14:16:45 +01:00
Javi Martín
baedac8839 Remove broken technical assistance text in footer
Originally there was a link pointing to the FAQ page but it was removed
in commit e14b7b67fb because by default the FAQ page in CONSUL only
contains a placeholder text.

We aren't sure where this link should point:

* FAQ page, only if the FAQ page is published
* Help page, only when the help feature is enabled
* CONSUL technical documentation page

So, for now, we're choosing the easiest solution which is removing the
text completely.
2021-12-13 13:30:24 +01:00
Javi Martín
3b12ff0b81 Merge pull request #4750 from consul/legislation_comment_email
Fix comment notifications on legislation proposals
2021-12-13 13:29:40 +01:00
Javi Martín
d2d79b9926 Merge pull request #4645 from consul/remove_newrelic
Remove newrelic and rollbar gem dependencies
2021-12-08 16:15:11 +01:00
Javi Martín
0349f0b1a3 Remove obsolete comments in Gemfile_custom
The CUSTOMIZE files don't exist anymore.
2021-12-08 15:56:17 +01:00
Javi Martín
b544ec8988 Remove rollbar gem dependency
We already support Errbit and Airbrake as error monitoring services.
Since some people might not want to setup Errbit and might prefer
Rollbar over Airbrake, we're referencing it in the custom gemfile.
2021-12-08 15:56:17 +01:00
Javi Martín
dc44dda30c Remove newrelic gem dependency
We haven't updated the gem for years and don't know whether it
still works with our current Ruby and Rails versions.

Besides, dependabot keeps opening pull requests to update it. In theory
we could just ignore the dependabot pull requests for this dependency,
but unfortunately right now we can't add a dependabot config file
because it would open pull requests on forks as well.

Finally, there are other companies offering similar services for Rails
applications, and it's up to each CONSUL installation to decide which
one is better for them. We might add a self-hosted performance
monitoring tool in the future.

Since other CONSUL installations might be using Newrelic, and in general
we recommend adding an application monitoring tool, we're suggesting it
in the custom gemfile. In the name of neutrality, we're also adding
Sentry. We might add other services in the future.
2021-12-08 15:56:09 +01:00
Javi Martín
735f99f877 Fix comment notifications on legislation proposals
The `commentable_url` method wasn't updated when we added legislation
proposals.

Back when we first created this method, we couldn't pass budget
investments or topics directly to `polymorphic_url` because they are
nested resources. That isn't the case since commit ff93f5a59, so now we
can simplify this method.

We're keeping the `commentable_url` method for now in order to keep
compatibility with custom changes that might use it, although this
method isn't consistent with the `commentable_path` method (which
receives a comment, and not a commentable), and so we might have to
revisit this code in the future.
2021-11-29 16:16:15 +01:00
Sebastia
51da643f2a Merge pull request #4749 from consul/release_1.4.1
Release version 1.4.1
2021-11-25 14:25:24 +01:00
Senén Rodero
ca5a718326 Merge pull request #4748 from consul/crowdin_integration
Change the way we handle source strings updates
2021-11-25 13:42:57 +01:00
Senén Rodero
5485aef670 Merge pull request #4747 from consul/i18n_master
New Crowdin updates
2021-11-25 13:41:12 +01:00
taitus
70b19cb290 Release version 1.4.1 2021-11-25 13:13:45 +01:00
Senén Rodero Rodríguez
30a0235ea3 Change the way we handle source strings updates
With the `update_without_changes`, previous translations are kept
even when the source string changed utterly. Using this option caused
some problems when updating source language strings, as the
translators do not get any notification, and the old translation keeps
approved, so translators do not have an easy way to find those strings
in Crowdin.

With the `update_as_unapproved` option, translators and Crowdin
managers can find those translations that need to be updated by
searching among not approved translations.

Quoting Crowdin's docs [1]:

> update_without_changes - preserve translations and validations of
   changed strings
> update_as_unapproved - preserve translations of changed strings
   and remove validations of those translations if they exist

[1] https://support.crowdin.com/configuration-file/#changed-strings-update
2021-11-25 12:06:14 +01:00
Consul Bot
aea5cf46a9 New translations admin.yml (Turkish) 2021-11-25 11:23:13 +01:00
Consul Bot
e54cc6206d New translations admin.yml (Swedish) 2021-11-25 11:23:12 +01:00
Consul Bot
c1b85a7704 New translations admin.yml (Italian) 2021-11-25 11:23:09 +01:00
Consul Bot
799eba8733 New translations admin.yml (German) 2021-11-25 11:23:08 +01:00
Consul Bot
e1dab4b016 New translations admin.yml (Romanian) 2021-11-25 11:14:59 +01:00
Javi Martín
b9ccfcf0ae Merge pull request #4720 from consul/release_1.4.0
Release version 1.4.0
2021-11-24 14:47:14 +01:00
Javi Martín
8ccadde131 Release version 1.4.0 2021-11-23 17:57:58 +01:00
Javi Martín
0f136d65f0 Update help wanted links to include pull requests
There are some pull requests where we also want help.
2021-11-23 17:57:58 +01:00
Javi Martín
a1785b0621 Remove note about Semantic Versioning
We don't have a public API, so this system doesn't apply to us.
2021-11-23 17:57:58 +01:00
Senén Rodero
cd376f90fb Merge pull request #4745 from consul/spanish_translation
Fix user edit page title
2021-11-23 17:47:32 +01:00
Senén Rodero
d6673475f3 Merge pull request #4743 from consul/i18n_crowdin
Update translations from Crowdin
2021-11-23 17:47:17 +01:00
Senén Rodero Rodríguez
a52517a9f7 Fix user edit page title
The error is only present at the Spanish language.
2021-11-23 16:55:42 +01:00
Senén Rodero Rodríguez
fff30e0a1c Update translations from Crowdin 2021-11-23 13:56:53 +01:00
Senén Rodero
64fc2a836a Merge pull request #4738 from consul/i18n_crowdin
Update translations from Crowdin
2021-11-19 16:12:39 +01:00
Javi Martín
43994e054c Merge pull request #4741 from consul/track_invalid_id_spec
Query the database before a visit in campaigns test
2021-11-19 13:00:00 +01:00
Javi Martín
e9abb153d6 Merge pull request #4739 from consul/investment_filters_visibility
Make investment filters less prominent
2021-11-19 12:58:24 +01:00
Javi Martín
006128da57 Query the database before a visit in campaigns test
This test was failing sometimes. One possible cause (although it might
not be the only one) is we were querying the database with
`Campaing.last` after starting the process running the browser with a
`visit`. In the past doing so has resulted in database inconsistencies
while running the tests.

Since after running the test more than 1500 times we weren't able to
reproduce the failure, it's possible that this change doesn't fix the
issue which caused the test to fail, but in the worst case scenario we
reduce the number of possible reasons why it fails.
2021-11-18 15:04:22 +01:00
Senén Rodero
f64377ad5a Merge pull request #4740 from consul/flake
Fix flaky spec in campaign-tracking tests
2021-11-18 10:15:07 +01:00
Senén Rodero
a6d61faa3a Merge pull request #4736 from consul/typos
Fix typos in proposals dashboard and budgets admin
2021-11-18 10:13:55 +01:00
Javi Martín
e612705463 Make investment filters easier to understand
So now:

* In the first few phases, no filters are shown (just like before)
* During the valuation phase, we show "Active" and "Unfeasible"
* During the final voting, we show "Active" (which now refers to the
  selected investments), "Not selected for the final voting" and
  "Unfeasible"
* When the budget is finished, we show "Winners", "Not selected for the
  final voting" and "Unfeasible"

Now each investment is shown in one (and only one) of the filters
(except when the budget is finished; in this case we don't show selected
investments which didn't win), and we remove the confusing "Not
unfeasible" filter by only showing it during the valuation phase (before
filters are selected) and renaming it to "Active". We also rearrange the
filters so the default one for each phase is shown first.

The idea of using the "Active" text for investments which can be
selected during the selection phase and voted during the final voting is
experimental. Right now, for simplicity, since we assume filters will
always use the same text, we're removing the "Active" filter when the
budget is finished, since having both "Winners" and "Active" filters
would be confusing.
2021-11-16 19:18:25 +01:00
Senén Rodero Rodríguez
652f85cba3 Update spec expectations to avoid flake specs
The last expectation we were using in this test is satisfied before
going back to the admin stats page, as the campaing2 name is not
present before clicking the `Go back` link. Because of this, the
test could end while the request thrown by the `Go back` link is
not completed yet, which can collide with the following test and
cause a flake spec.
2021-11-16 16:12:05 +01:00
Javi Martín
64892cf3ea Make investment filters less prominent
As mentioned in commit 36d795f69, investment filters aren't that
important; actually, most citizens won't use them at all, and are there
mainly for transparency purposes.

So we're moving them to the bottom of the sidebar, just like the links
for selected/archived/retired proposals in the proposals section.
2021-11-16 14:50:08 +01:00
Javi Martín
6eddf5d395 Merge pull request #3855 from consul/rubocop_open
Add Security/Open rubocop rule
2021-11-16 12:55:43 +01:00
Javi Martín
dc87f9d69a Add Security/Open rubocop rule
The `open` method can be used to open files or URLs and it's deprecated
in Ruby 2.7. In this case, it's clear we're dealing with a URL, so we
can use `URI.parse`.

The code was a bit strange, since it returned a value and had a side
effect: opening the URL. I'm not sure about the intention of the code;
my best guess is we wanted to test the URL exists and was accessible
before returning it (and, if that's the case, IMHO the code should be a
bit more explicit in order to show the intention behind it), but it
could also be an unintended side effect which was there by accident.

Now the URL is no longer opened; if the URL isn't accessible, we'll find
out when trying to connect to it with the Savon client.
2021-11-16 12:37:32 +01:00
Javi Martín
5519518cfb Parse cached attachment URLs with remote storages
In commit 5a4921a1a we replaced `URI.parse` with `URI.open` due to some
issues during our tests with S3.

However, there are some security issues with `URI.open` [1], since it
might allow some users to execute code on the server.

So we're using `URI.parse#open` instead.

[1] https://docs.rubocop.org/rubocop/cops_security.html#securityopen
2021-11-16 12:37:32 +01:00
Javi Martín
e5fbd34eac Extract method to check for a filesystem storage
We'll use this method to write a test dealing with remote storages.
2021-11-16 12:37:14 +01:00
Javi Martín
b548e16ba0 Merge pull request #4735 from consul/rubocop_offenses_1.4
Fix Rubocop convention offenses
2021-11-16 12:36:47 +01:00
Senén Rodero Rodríguez
d9e3ff42ac Update translations from Crowdin 2021-11-15 11:54:26 +01:00
Senén Rodero Rodríguez
e119870e9d Fix typo at source string
Thanks to chkoun.
2021-11-12 13:05:38 +01:00
Senén Rodero Rodríguez
2ccc3d1cac Replace wrong word with the correct one
When referring to budget we use the word headings instead of headers.
2021-11-11 10:45:26 +01:00
Javi Martín
c2410cb461 Fix RSpec/LetSetup Rubocop offense
It was accidentally introduced in commit 756a16f67. Pronto didn't warn
us because in that commit we deleted the code where the `group` method
was used.
2021-11-10 19:50:43 +01:00
Javi Martín
28ee026951 Fix Layout/EmptyLines Rubocop offense
It was accidentally introduced in commit 2b709f1a3. Pronto didn't warn
us because the blank lines were together after removing the blank lines
between them.
2021-11-10 19:50:06 +01:00
Senén Rodero
b0af76efdb Merge pull request #4711 from consul/typos
Fix typos in budget administration texts
2021-11-10 18:39:30 +01:00
Javi Martín
5a9d4aa2f7 Merge pull request #4732 from consul/fix_mobile_investment_layout
Fix investment list layout on small/medium screens
2021-11-09 14:14:14 +01:00
Javi Martín
a8ff04d9b7 Fix investments list layout on small screens
The flex layout didn't work well on small screens, since there was
barely any space for the elements.
2021-11-09 12:27:11 +01:00