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.
This commit is contained in:
Javi Martín
2023-03-07 18:10:33 +01:00
parent aa5f5235de
commit e00aa807b9
6 changed files with 6 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
<div class="map inline"> <div class="map inline">
<h2><%= t("budgets.index.map") %></h2> <h2><%= t("budgets.index.map") %></h2>
<%= render_map(nil, "budgets", nil, coordinates) %> <%= render_map(nil, "budgets", investments_coordinates: coordinates) %>
</div> </div>

View File

@@ -2,7 +2,7 @@ class Shared::MapLocationComponent < ApplicationComponent
attr_reader :parent_class, :remove_marker_label, :investments_coordinates attr_reader :parent_class, :remove_marker_label, :investments_coordinates
delegate :map_location_input_id, to: :helpers delegate :map_location_input_id, to: :helpers
def initialize(map_location, parent_class, remove_marker_label, investments_coordinates = nil) def initialize(map_location, parent_class, remove_marker_label: nil, investments_coordinates: nil)
@map_location = map_location @map_location = map_location
@parent_class = parent_class @parent_class = parent_class
@remove_marker_label = remove_marker_label @remove_marker_label = remove_marker_label

View File

@@ -28,7 +28,7 @@
<% if feature?(:map) && map_location_available?(@investment.map_location) %> <% if feature?(:map) && map_location_available?(@investment.map_location) %>
<div class="margin"> <div class="margin">
<%= render_map(investment.map_location, "budget_investment", nil) %> <%= render_map(investment.map_location, "budget_investment") %>
</div> </div>
<% end %> <% end %>

View File

@@ -1,3 +1,3 @@
<div class="map"> <div class="map">
<%= render_map(@map_location, "budgets", nil, @investments_map_coordinates) %> <%= render_map(@map_location, "budgets", investments_coordinates: @investments_map_coordinates) %>
</div> </div>

View File

@@ -1,7 +1,7 @@
<%= form.label :map_location, label %> <%= form.label :map_location, label %>
<p class="help-text" id="tag-list-help-text"><%= help %></p> <p class="help-text" id="tag-list-help-text"><%= help %></p>
<%= render_map(map_location, parent_class, remove_marker_label) %> <%= render_map(map_location, parent_class, remove_marker_label: remove_marker_label) %>
<%= form.fields_for :map_location, map_location do |m_l_fields| %> <%= form.fields_for :map_location, map_location do |m_l_fields| %>
<%= m_l_fields.hidden_field :latitude, <%= m_l_fields.hidden_field :latitude,

View File

@@ -42,7 +42,7 @@
<% if feature?(:map) && map_location_available?(@proposal.map_location) %> <% if feature?(:map) && map_location_available?(@proposal.map_location) %>
<div class="margin"> <div class="margin">
<%= render_map(@proposal.map_location, "proposal", nil) %> <%= render_map(@proposal.map_location, "proposal") %>
</div> </div>
<% end %> <% end %>