From a09917bb2d420a80d6f9d88f5671442dafc613d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Rueda=20L=C3=B3pez?= Date: Sun, 1 Dec 2024 13:55:56 +0100 Subject: [PATCH] Fix meeting view when maps are disabled (#13666) --- .../app/cells/decidim/meetings/dates_and_map/show.erb | 8 +++++--- .../app/cells/decidim/meetings/dates_and_map_cell.rb | 2 +- decidim-meetings/spec/system/meeting_spec.rb | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/decidim-meetings/app/cells/decidim/meetings/dates_and_map/show.erb b/decidim-meetings/app/cells/decidim/meetings/dates_and_map/show.erb index 4262f9a2db990..a4a7cd78f71e1 100644 --- a/decidim-meetings/app/cells/decidim/meetings/dates_and_map/show.erb +++ b/decidim-meetings/app/cells/decidim/meetings/dates_and_map/show.erb @@ -15,9 +15,11 @@ - <%= static_map %> - - <% if online? %> + <% if display_map? %> + <%= static_map %> + <% elsif online? %> <%= cell("decidim/address", meeting, online: true) %> + <% else %> + <%= cell("decidim/address", meeting) %> <% end %> diff --git a/decidim-meetings/app/cells/decidim/meetings/dates_and_map_cell.rb b/decidim-meetings/app/cells/decidim/meetings/dates_and_map_cell.rb index 245f8a9196157..65e96c342aa80 100644 --- a/decidim-meetings/app/cells/decidim/meetings/dates_and_map_cell.rb +++ b/decidim-meetings/app/cells/decidim/meetings/dates_and_map_cell.rb @@ -14,7 +14,7 @@ class DatesAndMapCell < Decidim::ViewModel delegate :snippets, to: :controller def static_map - return render :static_map if display_map? + return render :static_map end def year diff --git a/decidim-meetings/spec/system/meeting_spec.rb b/decidim-meetings/spec/system/meeting_spec.rb index bd289b978d38b..1171522c2869b 100644 --- a/decidim-meetings/spec/system/meeting_spec.rb +++ b/decidim-meetings/spec/system/meeting_spec.rb @@ -107,10 +107,11 @@ def visit_meeting context "and meeting is in_person" do let(:meeting) { create(:meeting, :published, :with_services, component:) } - it "hides the map section" do + it "hides the map section but displays address" do visit_meeting expect(page).to have_no_css("div.meeting__calendar-container .static-map") + expect(page).to have_css("div.meeting__calendar-container .address__container") end end