Commit Graph

18703 Commits

Author SHA1 Message Date
Senén Rodero Rodríguez
0643606dcd Add new setting to enable/disable map marker clustering 2024-01-29 17:56:54 +01:00
Senén Rodero Rodríguez
095ec8f267 Use consistent map default coordinates in dev_seeds
While we were creating development seeds with map
locations in Madrid the default map coordinates were
placed in Greenwich. Now when we run the
`dev_seed` task we'll have the default map coordinates
and the sample data placed in Madrid.
2024-01-29 17:56:54 +01:00
Senén Rodero Rodríguez
326a8a769b Use consistent coordinates in tests
When we create a budget heading through factories it's placed at Puerta del Sol,
Madrid. It seems reasonable that the `map_location` factory places the points near
there.

Before these changes sometimes the map center was placed in Madrid while map
locations were placed in Greenwich, therefore markers were not visible in the
map current pane.
2024-01-25 18:30:28 +01:00
Senén Rodero Rodríguez
47bd201ada Remove duplicated test
The previous commit already covers the same.
2024-01-25 18:30:28 +01:00
Senén Rodero Rodríguez
ea0cedec72 [EXP] Make AJAX settings work when javascript is disabled
Otherwise we get a AuthenticityToken exception.

I was nor able to write a test to verify this change.
2024-01-25 18:29:39 +01:00
Senén Rodero Rodríguez
6c4f917e2a [EXP] Show all admin settings tabs when javascript is disabled
Otherwise administrators cannot access the settings from other tabs.
2024-01-25 18:29:39 +01:00
Senén Rodero Rodríguez
047cb2b76c Extract SDG configuration tab partial to a component 2024-01-25 18:29:39 +01:00
Senén Rodero Rodríguez
f32d7edcf3 Extract proposals dashboard tab partial to a component 2024-01-25 18:29:38 +01:00
Senén Rodero Rodríguez
75180de8e6 Extract images and documents tab partial to a component 2024-01-25 18:29:38 +01:00
Senén Rodero Rodríguez
f56dc654f3 Extract map configuration tab partial to a component 2024-01-25 18:29:38 +01:00
Senén Rodero Rodríguez
6876f080a2 Extract features tab partial to a component 2024-01-25 18:29:38 +01:00
Senén Rodero Rodríguez
726019616f Extract configuration settings tab partial to a component 2024-01-25 18:29:38 +01:00
Senén Rodero Rodríguez
347a9d3d5b Extract remote census configuration tab partial to a component 2024-01-25 18:29:38 +01:00
Senén Rodero Rodríguez
684a830515 Extract participation processes tab partial to a component 2024-01-25 18:29:38 +01:00
Senén Rodero Rodríguez
f8835debae Move logic from key definition to views
Before this change, two important things depend on the format of each key,
where to render it in the administration panel and which kind of interface
to use for each setting. Following this strategy led us to a very complex
code, very difficult to maintain or modify. So, we do not want to depend
on the setting key structure anymore to decide how or where to render each
setting.

With this commit, we get rid of the key format-based rules. Now we render
each setting explicitly passing to it the type and the tab where it belongs.
2024-01-25 18:29:38 +01:00
Senén Rodero Rodríguez
91c3bde36b Fix map settings redirection 2024-01-25 18:29:38 +01:00
Senén Rodero Rodríguez
cb91a7421d Fix upload settings redirection 2024-01-25 18:29:38 +01:00
Senén Rodero Rodríguez
1fb351425f Use a plain tab param
Instead of using a setting nested param `setting[:tab]`. We only need
the tab param when rendering settings in the administration section.

This change will make it easier rendering the correct tab after
updating settings.
2024-01-25 18:29:38 +01:00
Senén Rodero Rodríguez
6a64f38d17 Use admin table settings component to render featured settings
Now, with the same template we can render all kind of settings.
2024-01-25 18:29:38 +01:00
Senén Rodero Rodríguez
e7223ba865 Extract interactive map form to a component 2024-01-25 18:29:38 +01:00
Senén Rodero Rodríguez
65c6189183 Extract setting text form to a component 2024-01-25 18:29:38 +01:00
Senén Rodero Rodríguez
c9e3b8903d Extract setting content types form to a component 2024-01-25 18:29:38 +01:00
Senén Rodero Rodríguez
57c257e91c Extract settings table partial to a component 2024-01-25 18:29:38 +01:00
Javi Martín
8a3bd04a9a Merge pull request #5368 from consuldemocracy/content_blocks_description_typo
Update content block field info in heading form
2024-01-25 18:18:18 +01:00
Sebastia
be8f8e3bd8 Merge pull request #5148 from consuldemocracy/polls_order
Order expired polls by ends date
2024-01-25 15:34:29 +01:00
Javi Martín
bfd7fd9735 Update content block field info in heading form
We moved the "Custom content blocks" menu entry from "Settings" to "Site
content" in commit a902f9e11, but we forgot to update a description
referencing the old location..
2024-01-25 14:00:07 +01:00
Senén Rodero
fe6ae18a09 Merge pull request #5348 from consuldemocracy/rename_storage_folder
Rename tenant's storage folder when modifying the schema
2024-01-19 17:16:43 +01:00
Senén Rodero
d7a48280a9 Merge pull request #5318 from consuldemocracy/application_timezone
Allow to set the application timezone via secrets
2024-01-19 16:16:47 +01:00
Senén Rodero Rodríguez
b3012caac7 Rename tenant's storage folder when modifying the schema 2024-01-19 13:39:56 +01:00
decabeza
bfb02093a6 Order expired polls by ends date 2023-12-11 15:38:55 +01:00
Javi Martín
614945a607 Merge pull request #5347 from consuldemocracy/dependabot/bundler/selenium-webdriver-4.16.0
Bump selenium-webdriver from 4.13.1 to 4.16.0
2023-12-08 17:34:06 +01:00
dependabot[bot]
1bd73b25d7 Bump selenium-webdriver from 4.13.1 to 4.16.0
Bumps [selenium-webdriver](https://github.com/SeleniumHQ/selenium) from 4.13.1 to 4.16.0.
- [Release notes](https://github.com/SeleniumHQ/selenium/releases)
- [Changelog](https://github.com/SeleniumHQ/selenium/blob/trunk/rb/CHANGES)
- [Commits](https://github.com/SeleniumHQ/selenium/commits/selenium-4.16.0)

---
updated-dependencies:
- dependency-name: selenium-webdriver
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-08 16:14:22 +00:00
Javi Martín
906f5c4066 Merge pull request #5327 from consuldemocracy/users_url
Add a username slug to the user URL
2023-12-07 18:55:43 +01:00
Javi Martín
77c043b68a Add a username slug to the user URL
This way it won't be possible to browse all user URLs by just going to
/users/1, /users/2, /users/3, ... and collect usernames, which might not
be desirable in some cases.

Note we could use the username as a URL parameter and just find the user
with `@user = User.find_by!(id: id, username: username)`, but since
usernames might contain strange characters, this might lead to
strange/ugly URLs.

Finally, note we're using `username.to_s` in order to cover the case
where the username is `nil` (as is the case with erased users).
2023-12-07 15:51:56 +01:00
Javi Martín
2db807baa7 Restrict access to the "new" direct message action
This way only verified users will be able to access this page, which
shows the username of the receiver of the direct message. With this,
it's no longer possible for unverified users to browse direct message
URLs in order to collect usernames from every user.
2023-12-01 13:02:33 +01:00
Javi Martín
80f0d710fd Simplify direct messages resource loading 2023-12-01 13:02:33 +01:00
Javi Martín
54b6e1ea24 Use explicit paths in direct messages URLs
This way it's easier to search the code for places using them.
2023-12-01 13:02:33 +01:00
Senén Rodero
49b3029865 Merge pull request #5329 from consuldemocracy/turbolinks_authenticity_token
Refresh CSRF Token when using Turbolinks
2023-12-01 13:00:31 +01:00
Julian Herrero
60a0fcfea5 Refresh CSRF Token when using Turbolinks 2023-11-30 18:57:29 +01:00
Senén Rodero Rodríguez
9646991846 Allow to set the application timezone via secrets
This will allow us to keep using the timezone used when running
the installer.

We keep using Madrid as default timezone in the installer and in
the application.
2023-11-27 16:31:32 +01:00
Senén Rodero
b8156040a5 Merge pull request #5320 from consuldemocracy/aibrake_filter
Filter sensitive information from airbrake parameters
2023-11-24 12:23:54 +01:00
Sebastia
9241faf6d9 Merge pull request #5324 from consuldemocracy/authentication-logs
Clarify authentication_logs secret
2023-11-24 08:03:58 +01:00
Senén Rodero Rodríguez
1e46746d6a Filter airbrake parameters
As Rails does with the application log and other tools. We
are going to use the same filtering rules we use in Consul Democracy.

We are renaming the initializer file name `filter_parameter_logging.rb` so
it's loaded before the errbit initializer.
2023-11-23 18:21:29 +01:00
taitus
76128494aa Move authentication_logs secret out of security section
As this secret is currently not programmed to be customisable for each Tenant,
we take it out of the security section. The reason is that so far everything inside this security section can be overwritten per tenant. With this change we are trying
to prevent anyone from trying to overwrite it on a per Tenant basis, as it would have
no effect.
2023-11-22 16:36:27 +01:00
Sebastia
a9fa73be83 Merge pull request #5256 from consuldemocracy/remove-pdf-metadata
ENS: Strip metadata from attachments
2023-11-22 15:11:33 +01:00
taitus
84b88c0ec3 Allow testing remove metadata from PDF
In order to test that we remove metadata from PDF we need add
"pdf-reader" gem.

With this gem we can check the info from the PDF and ensure that
this info is removed.
2023-11-22 14:46:11 +01:00
taitus
622f351dbf Remove pdf metadata
In order to remove metadata from PDF documents we will use the
exiftool_vendored gem.

The following line:
  Exiftool.new(attachment_path, "-overwrite_original -all:all=")
Overwrites the original file with another file without metadata.

So far this is the best solution we have found to perform this
metadata deletion.

When using Exiftool an exception is thrown, so we added a rescue
to handle it. Here is a task created where this problem is discussed
in issue 28 in the https://github.com/exiftool-rb/exiftool.rb/ repository.
We'll wait to see if this will be fixed in future versions.
2023-11-22 14:44:24 +01:00
Sebastia
4faa52b29d Merge pull request #5319 from consuldemocracy/update-rails
Bump rails from 6.1.7.4 to 6.1.7.6
2023-11-21 06:30:27 +01:00
Javi Martín
9972066b0a Merge pull request #5271 from consuldemocracy/dependabot/bundler/rubocop-rails-2.21.2
Bump rubocop-rails from 2.20.2 to 2.21.2
2023-11-20 17:54:30 +01:00
taitus
76837919b8 Remove redundant .all in .all.sample calls
Rubocop doesn't detect this method because we've added it in the
ApplicationRecord class, but we're removing the `.all` calls for
consistency.
2023-11-20 14:23:41 +01:00