Commit Graph

18194 Commits

Author SHA1 Message Date
Javi Martín
60d52686b9 Remove text-center class in heading price header
Not sure why it was added in commit 9fb5019f0, but it made the table
look funny on some screens, particularly after adding the extra field
we're about to add.
2023-05-29 17:46:04 +02:00
Javi Martín
882cc85532 Move geozones index view to a component
This way we simplify the header and it will be easier to add more code
and tests.
2023-05-29 17:46:04 +02:00
Javi Martín
ca013cf9f1 Move budget headings form partial to a component
This way it'll be easier to test it.
2023-05-29 17:46:04 +02:00
Javi Martín
c6c09074df Move geozone form partial to a component
That way it'll be easier to refactor it.
2023-05-29 17:46:04 +02:00
Sebastia
1462ae72a8 Merge pull request #4854 from iraline/activation_status
Show account activation status for each user in the admin section
2023-05-29 16:50:40 +02:00
Iraline
2dc32c6bc1 Add new column to show activation status 2023-05-29 16:06:51 +02:00
Sebastia
0c1e860760 Merge pull request #5115 from consul/remove-unused-field
Remove unused field and related code
2023-05-29 16:00:09 +02:00
taitus
0d937647af Remove the unused field from the database.
In the PR #1140 this field was added in commit ad697cd2c1, but in this same
PR in commit 28d12fe55 all the related functionality that had been added was
removed but the field was not removed.
2023-05-29 15:12:40 +02:00
taitus
2425d0ecfc Remove unused code
In the commit: 315c57929a this code was added, but at that time this field
was no longer in use, even though it existed in the database.

I don't know why this line was added, but there seems to be no point in
keeping it.
2023-05-29 15:11:38 +02:00
Senén Rodero Rodríguez
b85df50a28 Configure airbrake as Errbit documentation says
Quoting `errbit/errbit/blob/main/app/views/apps/_configuration_instructions.html.erb`

> airbrake.io supports various features that are out of scope for Errbit.
2023-05-29 13:50:33 +02:00
Sebastia
0b7dfb2172 Merge pull request #5114 from consul/bump-wkhtmltopdf-binary
Bump wkhtmltopdf-binary from 0.12.6.5 to 0.12.6.6
2023-05-29 09:29:35 +02:00
Sebastia
d655acc2b6 Merge pull request #5117 from consul/update-spec
Update spec
2023-05-24 11:19:17 +02:00
taitus
81b7f30c8a Update spec
Configure the database before starting the browser with a call to `visit`
2023-05-24 10:25:59 +02:00
Senén Rodero
c52d28788a Merge pull request #5113 from consul/proposals_notifications
Show email digest only if proposals are enabled
2023-05-23 11:35:31 +02:00
dependabot[bot]
14d4abe99a Bump audited from 5.0.2 to 5.3.3
Bumps [audited](https://github.com/collectiveidea/audited) from 5.0.2 to 5.3.3.
- [Release notes](https://github.com/collectiveidea/audited/releases)
- [Changelog](https://github.com/collectiveidea/audited/blob/main/CHANGELOG.md)
- [Commits](https://github.com/collectiveidea/audited/compare/v5.0.2...v5.3.3)

---
updated-dependencies:
- dependency-name: audited
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-22 12:18:30 +02:00
taitus
26a158f3ba Update wkhtmltopdf-binary gem
In order to add compatibility to ubuntu 22.04 we update the
wkhtmltopdf-binary gem.  The gem version 0.12.6.5 only
supports up to ubuntu 20.04.
2023-05-22 10:51:25 +02:00
decabeza
e51f240736 Show email digest only if proposals are enabled 2023-05-19 12:41:56 +02:00
Javi Martín
287f483f4e Merge pull request #5111 from consul/remove_marker_accessibility
Use a button instead of a link to remove a marker
2023-05-05 15:23:36 +02:00
Javi Martín
0ef1882a9d Merge pull request #5108 from consul/map_refactoring
Simplify the code rendering the map
2023-05-05 15:21:49 +02:00
Javi Martín
8b14522bf5 Use a button instead of a link to remove a marker
Using a button for interactive elements is better, as explained in
commit 5311daadf.

Since buttons with "type=button" do nothing by default, we no longer
need to call `preventDefault()` when clicking it.
2023-05-04 15:32:33 +02:00
Javi Martín
59ed975f81 Set remove marker link margin-bottom in CSS
We were setting the margin-top property in CSS but the margin-bottom
property by adding a div with a `.margin-bottom` HTML class.
2023-05-04 15:32:33 +02:00
Javi Martín
a145fdb8a8 Make map location HTML class names consistent
We were using `map_location` in one place and
`location-map-remove-marker` in another one. We usually use dashes in
HTML class names, we don't say "location map" anywhere else.
2023-05-04 15:32:33 +02:00
Javi Martín
f4ef6412b6 Remove unused HTML class in link to remove marker
It isn't used since commit c34aa5412.
2023-05-04 15:32:33 +02:00
Javi Martín
b0680628ba Extract function to add investment markers 2023-05-04 15:27:15 +02:00
Javi Martín
21ce7689c2 Don't overwrite marker when creating investment markers
The `marker` variable is like a global variable inside the
`initializeMap` function, so assigning it inside the `createMarker`
function was changing its value in other places.

So we're using different variable names like `newMarker` in order to
make the code easier to follow. Now we "only" change the `marker`
variable in functions that modify the marker.
2023-05-04 15:27:15 +02:00
Javi Martín
74d165ae7a Extract function to create a map 2023-05-04 15:27:15 +02:00
Javi Martín
2e8bc11c2a Extract functions to update map form fields 2023-05-04 15:27:15 +02:00
Javi Martín
f8053c9532 Extract function to get popup in map JavaScript 2023-05-04 15:27:15 +02:00
Javi Martín
4087066c59 Extract function to add map attribution 2023-05-04 15:27:15 +02:00
Javi Martín
00cd91c6b2 Extract functions to get coordinates in map JS
We had 130 lines long function, and we're trying to reduce its size so
it's easier to follow the code.
2023-05-04 15:27:15 +02:00
Javi Martín
e75211125a Remove duplicate i18n text to remove marker
We had two different keys with the same text and were passing it as a
parameter. Since the text is the same in any case, we don't need a
parameter for it.

Note we are using the `proposals` i18n key instead of creating a new one
in a `shared` namespace one because creating a new key would mean that
we'd lose the already existing translations in Crowdin.
2023-05-04 15:27:15 +02:00
Javi Martín
c667582c98 Remove redundant value assignments in map fields
Rails forms automatically take the value from the object related to the
form.
2023-05-04 15:27:15 +02:00
Javi Martín
b9518d64e1 Use Rails methods to get map location input IDs
We were manually generating the IDs in order to pass them as data
attributes in the HTML in a component where we don't have access to the
form which has the inputs.

However, these data attributes only make sense when there's a form
present, so we can pass the form as a parameter and use it to get the
IDs.

We can now define a map as editable when there's an associated form,
which makes sense IMHO.
2023-05-04 15:27:15 +02:00
Javi Martín
84fff2e9fb Simplify code setting marker data in maps
We were probably setting them separately to avoid having blank data
attributes in the HTML. However, when a data attribute is `nil`, Rails
doesn't write it in the HTML in the first place.
2023-05-04 15:27:15 +02:00
Javi Martín
e00aa807b9 Make remove marker label parameter optional
We were passing `nil` in some calls, which was confusing.

Since now we've got two optional parameters, we're using named
parameters.
2023-05-04 15:27:15 +02:00
Javi Martín
aa5f5235de Simplify creating a map location from a heading 2023-05-04 15:27:15 +02:00
Javi Martín
deb965bcce Remove editable parameter in render_map
The calls to `render_map` are confusing since there are so many
parameters. We can assume that the map is editable if we pass the remove
marker label.
2023-05-04 15:27:15 +02:00
Javi Martín
19adae993e Simplify method names in map component
Since we aren't using helpers anymore, we don't need the `map_location`
prefix.
2023-05-04 15:27:15 +02:00
Javi Martín
9cc3c553ff Extract component to render a map
This way it'll be easier to refactor it.
2023-05-04 15:27:15 +02:00
Javi Martín
c7de42ab96 Simplify map location coordinates helpers
We're calling this method after setting the map location with
`map_location = MapLocation.new if map_location.nil?`, so the condition
`map_location.present?` is always going to be true.
2023-05-04 15:27:15 +02:00
Javi Martín
b0b7d0f25b Remove unused legislation proposals map action
The only view that linked to this action was never used and so it was
deleted in commit 0bacd5baf.

Since now the proposals controller is the only one place rendering the
`shared/map` partial, we're moving it to the proposals views.
2023-05-04 15:27:10 +02:00
Javi Martín
2f8717aa52 Merge pull request #5109 from consul/fix_removing_different_map_location
Avoid removing other proposals map locations
2023-04-28 17:43:03 +02:00
Javi Martín
6105de307b Rename map_location variable containing parameters
When it was named `map_location`, I constantly thought it was an object
instead of a hash.
2023-04-28 17:16:07 +02:00
Javi Martín
65ed778226 Avoid removing other proposals map locations
It was possible to remove a map location from a different proposal (even
one created by a different author) by modifying the hidden `id`
parameter in the form.

So we're making sure the map location we destroy is the one associated
to the proposal we're updating.

Since we're now using the `@proposal` instance variable in the
`destroy_map_location_association` method, we're calling that method
after loading the resource with cancancan.
2023-04-28 17:11:59 +02:00
Javi Martín
eaf28ef6fb Merge pull request #5107 from consul/fix_map_investments_after_voting
Fix wrong investments on the map after voting
2023-04-28 15:44:26 +02:00
Javi Martín
4954038076 Only re-render my ballot after voting
We were rendering the whole sidebar again, which wasn't necessary since
most of it remains unchanged. This resulted in complicated code to pass
the necessary information to render the same map that was already
rendered. Furthermore, when users had been moving the map around or
zooming out, we were resetting the map to its default settings after
voting, which was potentially annoying.

This also fixes the wrong investments being displayed in the map after
voting; only the investments on the current page were displayed in this
case while the index displayed all of them.
2023-04-27 17:39:56 +02:00
Javi Martín
d0be5c4850 Extract component to render my ballot
This is the only part of the sidebar that needs to be re-rendered after
an AJAX request adding or removing investments to a ballot, so having a
separate view just for it will make it easier to simplify the code.
2023-04-21 17:39:55 +02:00
Sebastia
17d7451816 Merge pull request #4931 from consul/dependabot/bundler/master/devise-security-0.17.0
Bump devise-security from 0.16.0 to 0.17.0
2023-04-21 12:09:59 +02:00
Javi Martín
e421484c38 Merge pull request #5102 from consul/dependabot/bundler/nokogiri-1.14.3
Bump nokogiri from 1.13.10 to 1.14.3
2023-04-20 19:52:11 +02:00
dependabot[bot]
a93b768e0d Bump nokogiri from 1.13.10 to 1.14.3
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.10 to 1.14.3.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.13.10...v1.14.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-20 19:34:06 +02:00