Commit Graph

18157 Commits

Author SHA1 Message Date
Javi Martín
629756dd15 Change URLs referencing our GitHub repositories 2023-07-12 16:05:26 +02:00
Javi Martín
832a6dd8b9 Fix URL to our kanban project
We were referencing an old URL that has been obsolete for years.
2023-07-10 19:28:11 +02:00
Javi Martín
ce7b37f6f8 Change name in English and Spanish texts 2023-07-07 15:07:46 +02:00
Javi Martín
2766d8f152 Merge pull request #5144 from consul/fix_invert_selection
Fix text selection in budget header
2023-07-03 17:29:08 +02:00
Javi Martín
29a3fe4ad5 Merge pull request #5142 from consul/local_logs
Reduce log size in development/test environments
2023-07-03 17:27:40 +02:00
Javi Martín
e0a94f6a6e Reduce log size in development/test environments
Code based on the logger Rails uses by default; as mentioned in the
Rails configuration guide:

> [the logger] defaults to an instance of ActiveSupport::TaggedLogging
> that wraps an instance of ActiveSupport::Logger which outputs a log to
> the log/ directory. You can supply a custom logger, to get full
> compatibility you must follow these guidelines:
>
> * To support a formatter, you must manually assign a formatter from
>   the config.log_formatter value to the logger.
> * To support tagged logs, the log instance must be wrapped with
>   ActiveSupport::TaggedLogging.
> * To support silencing, the logger must include
>   ActiveSupport::LoggerSilence module. The ActiveSupport::Logger class
>   already includes these modules.

Just like the documentation mentions, we're enabling log rotation using
"1" as the number of old files to keep and then the maximum size of the
log file.
2023-07-03 16:16:10 +02:00
Javi Martín
db4db07853 Merge pull request #5146 from consul/delayed_job_monitor
Restart DelayedJob workers after they crash
2023-06-30 17:23:13 +02:00
Senén Rodero
37417e5829 Merge pull request #5129 from consul/geozones
Do not show geozones when there are no geozones defined
2023-06-30 17:21:20 +02:00
Javi Martín
286a128a71 Merge pull request #5106 from consul/fix_budget_background_image
Render background images with brackets in their names
2023-06-30 17:20:56 +02:00
Javi Martín
865fe706b4 Merge pull request #5145 from consul/map_wheel_on_focus
Enable mousewheel when focusing on the map
2023-06-30 11:52:20 +02:00
Javi Martín
a668ecd1a8 Merge pull request #5136 from Meet-Democracy/Legislation-draft-render-markdown-tables
Render markdown tables in legislation draft
2023-06-30 00:09:33 +02:00
Javi Martín
af618eaa45 Extract markdown helper logic to a class
This way it'll be easier for other Consul installations to overwrite
parts of the code, like the default options.
2023-06-29 20:48:01 +02:00
Javi Martín
79120209da Use the same extensions in all markdown renderers
We were using two different sets of extensions but, since the markdown
code is always written by administrators, IMHO it makes sense to be
consistent and always render markdown code the same way.
2023-06-29 20:48:01 +02:00
Karim Semmoud
3faaa8521d Render markdown tables in legislation draft
* Add Tables option to Redcarpet in Legislation draft

* Allow table tags in Admin Legislation Sanitizer

* Add Test to render markdown tables in Legislation drafts

* Add Test for Admin Legislation Sanitizer

We include test for image, table and h1 to h6 tags and additional tests to strengthen the allowed and disallowed parameters

* Add Table from markdown test in System and Factories

* Add test to render  tables for admin user

* Remove comment line about Redcarpet options

* Edit custom css for legislation draft table to make it responsive
2023-06-29 20:48:01 +02:00
Senén Rodero
b4f2e66c78 Merge pull request #5147 from consul/bump_capybara-webmock
Bump selenium-webdriver from 3.142 to 4.0.0
2023-06-29 18:37:57 +02:00
Senén Rodero Rodríguez
41a84d6625 Bump selenium-webdriver from 3.142 to 4.0.0
And also `capybara-webmock' to the latest as the previous
one is not supported by selenium-webdriver.

The change in the rails_helper.rb file fixes a deprecation warning
related to desired capabilities after this upgrade.
2023-06-29 17:29:21 +02:00
Javi Martín
68927409b6 Fix text selection in budget heading
The `inverted-selection` rules defined in the `%brand-background`
selector weren't being applied because we were using this selector in
`::before` and `::after` pseudoelements. Not sure about the reason, but
it looks like the saturation of `::after::selection` pseudoelements
resulted in invalid selectors and so the inverted selection rules were
ignored for every selection using `%brand-background`, like
`%budget-header`.

Using `@include brand-background` instead of `@extend %brand-background`
in pseudoelements solves the issue. The inverted selection might not
work in these pseudoelements, but we don't need it there since these
pseudoelements don't have content.
2023-06-29 15:54:29 +02:00
Javi Martín
970a64e276 Enable mousewheel when focusing on the map
Zooming with the mousewheel is useful when you want to use it, but
annoying when you don't want to.

Here we're taking an intermediary approach: by default, the mousewheel
isn't active, but it will be active after focusing on the map, so it can
be used both to scroll and to zoom.

This behavior presents usability issues, though, since we aren't making
users aware of the way the mousewheel works, and even if they were
aware, it could be confusing anyway. However, I currently think it's
better than always enabling or always disabling the mousewheel (might
change my mind, though).

Note that the "focus" event is only used on the map, so if we click on a
marker or navigate to a marker with the keyboard without focusing on the
map first, the mousewheel isn't enabled. The same would happen if we
used the "click" event.

We might use the Leaflet.GestureHandling plugin in the future to deal
with this issue and the scroll on touch screens.
2023-06-29 15:54:07 +02:00
Javi Martín
ee9cd881e0 Restart DelayedJob workers after they crash
DelayedJob offers the `--monitor` (aliased as `-m`) option to create a
process that monitors the workers and restarts them when they crash.

This change implies that, in order to stop the delayed job workers, we
now need to pass the `-n` option when running `bin/delayed_job stop`:
`RAILS_ENV=production bin/delayed_job -n 2 stop`.
2023-06-29 15:50:19 +02:00
Senén Rodero
59d260c891 Merge pull request #5143 from consul/bump_parser
Bump parser from 3.1.0.3 to 3.2.2.3
2023-06-29 13:37:36 +02:00
Senén Rodero Rodríguez
15e9c593a8 Bump parser from 3.1.0.3 to 3.2.2.3 2023-06-29 13:03:54 +02:00
Senén Rodero
93d33b6d83 Merge pull request #5141 from consul/search_dictionary_selector
Fix Serbian locale code
2023-06-28 13:02:26 +02:00
Senén Rodero Rodríguez
83b5965821 Fix Serbian locale code
I accidentally duplicated the locale code within
commit 3c3ff65.
2023-06-27 18:06:19 +02:00
Sebastia
f001f07210 Merge pull request #5140 from consul/legislation-proposals
Remove unused code from Legislation proposals
2023-06-27 16:48:20 +02:00
taitus
d2b181777d Call Legislation::Proposals::VotesComponent directly 2023-06-27 15:57:03 +02:00
Senén Rodero
ab698a79a8 Merge pull request #5098 from consul/map_open_popups_with_keyboard
Open marker popups when navigating with the keyboard
2023-06-27 15:33:45 +02:00
Javi Martín
ad26c5cf9f Fix background images with special characters
Just like we did for budgets, we're doing the same thing in all the
places where we render background images attached by either regular
users or administrators.

This way we correctly render background images with characters like
brackets or quotes.
2023-06-27 15:06:30 +02:00
taitus
ab2c548964 Remove unused code for legislation proposals votes
In these commits 38ba5e159b and 8805037e2f we added the parameter
"vote_url" in the call to the partial "votes" in collaborative legislation
proposals.

It seems that this parameter is only used in the proposals module and not in
collaborative legislation proposals.

While it is true that in the partial "votes" in these commits this parameter
"vote_url" is referred to, in commit 276baedcf it seems to be removed.

For this reason, we remove the parameter.
2023-06-27 14:44:54 +02:00
karim-semmoud
3a623c070f Add tests for budget images with brackets / quotes 2023-06-27 13:57:51 +02:00
Senén Rodero
90ddd99751 Merge pull request #5134 from consul/pg_search_dictionaries
Update search dictionaries
2023-06-26 20:54:51 +02:00
Senén Rodero Rodríguez
3fa3c90db6 Fix map markers navigation for keyboard users
By using the bindPopup function instead of the click event
popups work when using the keyboard.

Note that now we are loading all the map markers in the first
request in a single query to the database (needed when there
is a lot or markers to show). Because of that we removed the
AJAX endpoint.
2023-06-26 20:33:35 +02:00
Senén Rodero Rodríguez
2b0a812543 Add method to retrieve translations in one database query
This methods performs much better when we need to load a lot of
globalized models translations and returns the best fallback translation
for the current language.
2023-06-26 20:33:35 +02:00
Javi Martín
5630a24d7a Render budget images with special chars their names
Images with brackets weren't being rendered properly, so we're now
enclosing the URL in single quotes. In order to render images with
single quotes, we're also using the `j` method.

Since the tests were written by a different developer, we're adding them
in the next commit.
2023-06-26 20:06:39 +02:00
karim-semmoud
f4973498be Add budget image to Budget and image factories and model 2023-06-26 19:40:42 +02:00
Sebastia
bb8759d8fd Merge pull request #5122 from consul/strip-metadata
Remove metadata from images
2023-06-26 15:56:33 +02:00
Javi Martín
ec1fe1fbb1 Merge pull request #5104 from markusgeert/feature/disable-create-booths-button
Disable the create booths button when the polls function is disabled
2023-06-23 15:45:50 +02:00
Max Stevens
13bf866c95 Disable the create booths button when the polls function is disabled 2023-06-23 14:33:19 +02:00
Javi Martín
8ed898a13c Merge pull request #5110 from consul/dependabot/bundler/audited-5.3.3
Bump audited from 5.0.2 to 5.3.3
2023-06-23 14:09:46 +02:00
Senén Rodero Rodríguez
3c3ff65be1 Update search dictionaries
Since the creation of this list 3 years ago we added more languages to the
application and PostgreSQL added more dictionaries too.
2023-06-23 12:53:43 +02:00
Senén Rodero Rodríguez
1d7c821935 Sort languages alphabetically
So it's easier to know where to add new ones when needed.
2023-06-23 12:53:41 +02:00
Senén Rodero
443c5e0a53 Merge pull request #5137 from consul/legislation_translations
Allow administrators to override legislation and budget translations
2023-06-23 11:51:32 +02:00
Senén Rodero Rodríguez
27249f6e69 Allow administrators to override budgets translations 2023-06-23 11:15:54 +02:00
Senén Rodero Rodríguez
dc9a30adda Allow administrators to override legislation translations
Now administrators can override default legislation translations through
the administration panel.
2023-06-23 11:15:54 +02:00
Senén Rodero Rodríguez
ca12388005 Do not render proposals geozones when empty 2023-06-19 14:37:01 +02:00
Senén Rodero Rodríguez
e4cd02c6a9 Extract proposals geozones to a component 2023-06-19 11:15:37 +02:00
Senén Rodero Rodríguez
37695cd262 Add the geozone name to the proposal partial when there are geozones defined
As we have links pointing to a search by geozone name I
think we should show somewhere the geozone where the
proposal belongs.
2023-06-14 19:07:05 +02:00
Senén Rodero Rodríguez
1bc2a68856 Do not show the geozone selector where there are no geozones defined 2023-06-14 14:32:08 +02:00
Senén Rodero Rodríguez
9003c460d5 Do not render the geozone link where there are no geozones defined 2023-06-14 14:32:07 +02:00
Senén Rodero Rodríguez
a6b1866908 Allow to pass the destination link for the geozone link
Previous to this commit the geozone link shown in the
legislation proposal page was pointing to the proposals
process feature instead to the legislation proposals.
2023-06-14 14:31:44 +02:00
Senén Rodero
cf8a98f06b Merge pull request #5121 from consul/application_name_for_deployments
Allow to change the application name for deployments
2023-06-12 16:38:04 +02:00