Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dm 3508 map component #541

Merged
merged 103 commits into from
Oct 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
81bbc5a
dm-3508
bradjohnson92008 Aug 24, 2022
379497b
dm-3508
bradjohnson92008 Aug 25, 2022
789e7d5
dm-3508
bradjohnson92008 Aug 25, 2022
f3c71d5
dm-3508
bradjohnson92008 Aug 25, 2022
59c35ae
dm-3508
bradjohnson92008 Aug 31, 2022
93c0ea9
dm-3508
bradjohnson92008 Aug 31, 2022
676ce53
dm-3508
bradjohnson92008 Sep 1, 2022
f897e86
dm-3508
bradjohnson92008 Sep 1, 2022
cbc8d0e
dm-3508
bradjohnson92008 Sep 1, 2022
01075e5
dm-3508
bradjohnson92008 Sep 1, 2022
27170ca
dm-3508
bradjohnson92008 Sep 1, 2022
d2d8c52
dm-3508
bradjohnson92008 Sep 1, 2022
90e4386
dm-3508
bradjohnson92008 Sep 1, 2022
e55db8c
dm-3508
bradjohnson92008 Sep 1, 2022
4b3ed39
dm-3508
bradjohnson92008 Sep 2, 2022
4b616b1
dm-3508
bradjohnson92008 Sep 6, 2022
55f9dac
dm-3508
bradjohnson92008 Sep 6, 2022
200b5e3
dm-3508
bradjohnson92008 Sep 7, 2022
19e6bbf
dm-3508
bradjohnson92008 Sep 7, 2022
aa974ed
dm-3508
bradjohnson92008 Sep 7, 2022
f08f43d
dm-3508
bradjohnson92008 Sep 7, 2022
146efe0
dm-3508
bradjohnson92008 Sep 7, 2022
ba851a1
dm-3508
bradjohnson92008 Sep 7, 2022
b4c0f74
dm-3508
bradjohnson92008 Sep 7, 2022
49db804
dm-3508
bradjohnson92008 Sep 7, 2022
81e0043
dm-3508
bradjohnson92008 Sep 8, 2022
77edd43
dm-3508
bradjohnson92008 Sep 8, 2022
0614009
dm-3508
bradjohnson92008 Sep 8, 2022
a168783
dm-3508
bradjohnson92008 Sep 13, 2022
fa3b669
dm-3508
bradjohnson92008 Sep 14, 2022
26fedd9
dm-3508
bradjohnson92008 Sep 14, 2022
eb1c3e0
dm-3508
bradjohnson92008 Sep 14, 2022
1f97b99
dm-3508
bradjohnson92008 Sep 14, 2022
4a1c91b
dm-3508
bradjohnson92008 Sep 14, 2022
32f5dc2
dm-3508
bradjohnson92008 Sep 15, 2022
fae4ff4
dm-3508
bradjohnson92008 Sep 15, 2022
b35be68
dm-3508
bradjohnson92008 Sep 19, 2022
eb7aad5
dm-3508
bradjohnson92008 Sep 22, 2022
9beed30
dm-3508
bradjohnson92008 Sep 22, 2022
b21b74b
dm-3508
bradjohnson92008 Sep 22, 2022
d83a80b
dm-3508
bradjohnson92008 Sep 23, 2022
ec00f49
dm-3508
bradjohnson92008 Sep 23, 2022
ddab3df
dm-3508
bradjohnson92008 Sep 26, 2022
939abf1
dm-3508
bradjohnson92008 Sep 26, 2022
3e87346
dm-3508
bradjohnson92008 Sep 27, 2022
ca97234
dm-3508
bradjohnson92008 Sep 27, 2022
4e6b13a
dm-3508
bradjohnson92008 Sep 27, 2022
8a9b2b3
dm-3508
bradjohnson92008 Sep 28, 2022
f9b96e0
dm-3508
bradjohnson92008 Sep 28, 2022
c5650bf
dm-3508
bradjohnson92008 Sep 28, 2022
0ad892e
dm-3508
bradjohnson92008 Sep 28, 2022
52fd160
dm-3508
bradjohnson92008 Sep 28, 2022
fdcdbe2
dm-3508
bradjohnson92008 Sep 28, 2022
801eb9f
dm-3508
bradjohnson92008 Sep 28, 2022
d3847e3
m-3508
bradjohnson92008 Sep 28, 2022
b5fa7f2
dm-3508
bradjohnson92008 Sep 28, 2022
ea5ed0a
dm-3508
bradjohnson92008 Sep 28, 2022
41439a8
dm-3508
bradjohnson92008 Sep 28, 2022
ef5984c
dm-3508
bradjohnson92008 Sep 28, 2022
a430eb7
Merge branch 'feature/communities' into dm-3508-map-component
bradjohnson92008 Sep 29, 2022
8926368
dm-3508
bradjohnson92008 Sep 30, 2022
3986563
dm-3508
bradjohnson92008 Sep 30, 2022
eb41e02
dm-3508
bradjohnson92008 Sep 30, 2022
c4d782b
dm-3508
bradjohnson92008 Sep 30, 2022
16b4de0
dm-3508
bradjohnson92008 Sep 30, 2022
36acdb5
dm-3508
bradjohnson92008 Oct 3, 2022
a7e5c1c
dm-3508
bradjohnson92008 Oct 3, 2022
b0cb7c6
dm-3508
bradjohnson92008 Oct 3, 2022
908dee0
dm-3508
bradjohnson92008 Oct 4, 2022
c8ca53c
dm-3508
bradjohnson92008 Oct 4, 2022
25a1a73
dm-3508
bradjohnson92008 Oct 4, 2022
8e352bd
dm-3508
bradjohnson92008 Oct 4, 2022
b2603d0
Revert "dm-3508"
bradjohnson92008 Oct 4, 2022
9cbe93c
dm-3508
bradjohnson92008 Oct 4, 2022
b5367c9
dm-3508
bradjohnson92008 Oct 4, 2022
24b5f43
dm-3508
bradjohnson92008 Oct 4, 2022
8003a66
dm-3508
bradjohnson92008 Oct 5, 2022
85b59c1
dm-3508
bradjohnson92008 Oct 5, 2022
c1b3cd3
dm-3508
bradjohnson92008 Oct 5, 2022
fb1ec6e
dm-3508
bradjohnson92008 Oct 5, 2022
fce7d38
dm-3508
bradjohnson92008 Oct 5, 2022
6290999
dm-3508
bradjohnson92008 Oct 5, 2022
495dd15
dm-3508
bradjohnson92008 Oct 6, 2022
f8e13ff
dm-3508
bradjohnson92008 Oct 6, 2022
1c16b7a
dm-3508
bradjohnson92008 Oct 6, 2022
4297405
Merge branch 'feature/communities' into dm-3508-map-component
bradjohnson92008 Oct 7, 2022
a618166
dm-3508
bradjohnson92008 Oct 7, 2022
6ed6926
dm-3508
bradjohnson92008 Oct 7, 2022
f6eceb8
dm-3508
bradjohnson92008 Oct 7, 2022
6a9aaad
dm-3508
bradjohnson92008 Oct 11, 2022
18a2448
dm-3508
bradjohnson92008 Oct 11, 2022
4eeff5e
dm-3508
bradjohnson92008 Oct 11, 2022
428d5a8
dm-3508
bradjohnson92008 Oct 11, 2022
8866d54
Merge branch 'feature/communities' into dm-3508-map-component
bradjohnson92008 Oct 11, 2022
6eda011
Merge branch 'feature/communities' into dm-3508-map-component
bradjohnson92008 Oct 11, 2022
c73faf1
dm-3508
bradjohnson92008 Oct 11, 2022
2009130
dm-3508
bradjohnson92008 Oct 12, 2022
f283ddd
dm-3508
bradjohnson92008 Oct 12, 2022
377a4ca
dm-3508
bradjohnson92008 Oct 12, 2022
b3bdd97
dm-3508
bradjohnson92008 Oct 12, 2022
886f7fb
dm-3508
bradjohnson92008 Oct 12, 2022
cb39024
dm-3508
bradjohnson92008 Oct 12, 2022
7c9a781
Removed duplicate code in admin/pages.rb
JoshingYou1 Oct 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion app/admin/pages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
:cta_text,
:button_text,
:card,
:display_successful_adoptions,
:display_in_progress_adoptions,
:display_unsuccessful_adoptions,
:map_info_window_text,
:body,
:title_header,
:text_alignment,
Expand Down Expand Up @@ -119,14 +123,17 @@
if (pc.component_type == 'PageHeader3Component' ||
pc.component_type == 'PageSubpageHyperlinkComponent' ||
pc.component_type == 'PageAccordionComponent' ||
pc.component_type == 'PageMapComponent' ||
pc.component_type == 'PageCompoundBodyComponent') && component&.title.present?
para "Title: #{component.title}"
end
# Large title
para "Large title: #{component.large_title}" if pc.component_type == 'PageCompoundBodyComponent' && component&.large_title
# Description
if (pc.component_type == 'PageHeader3Component' ||
pc.component_type == 'PageDownloadableFileComponent') && component&.description.present?
pc.component_type == 'PageDownloadableFileComponent' ||
pc.component_type == 'PageMapComponent') &&
component&.description.present?
para component.description
end
# Text
Expand Down Expand Up @@ -155,6 +162,9 @@
para component&.alt_text if pc.component_type == 'PageImageComponent'
# Attachment file name
para component&.attachment_file_name if pc.component_type == 'PageDownloadableFileComponent'
# Map Info Window Text
para component&.map_info_window_text if pc.component_type == 'PageMapComponent' && component&.map_info_window_text != ''

# Display name
para component&.display_name if pc.component_type == 'PageDownloadableFileComponent' && component&.display_name.present?
# Margin bottom
Expand Down
3 changes: 2 additions & 1 deletion app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,5 @@
//= require visns/visn_va_facility_infowindow
//= require jquery.collapser.js
//= require category_usage.js
//= require tinymce
//= require tinymce
//= require page/page_infowindow
22 changes: 22 additions & 0 deletions app/assets/javascripts/page/page_infowindow.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
class @PageInfoBoxBuilder extends Gmaps.Google.Builders.Marker # inherit from base builder
# override method
create_infowindow: ->
return null unless _.isString @args.infowindow
boxText = document.createElement("div")
boxText.setAttribute('class', 'page-marker-container') #to customize
boxText.innerHTML = @args.infowindow
@infowindow = new InfoBox(@infobox(boxText))

# add @bind_infowindow() for < 2.1

infobox: (boxText)->
content: boxText
pixelOffset: new google.maps.Size(-200, 137)
boxStyle: {
maxWidth: "400px",
maxHeight: "275px",
overflow: "auto",
backgroundColor: "white",
paddingBottom: "52px"
}
alignBottom: true
51 changes: 51 additions & 0 deletions app/assets/javascripts/page/page_map.es6
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
function initialize() {
const handler = Gmaps.build('Google', {
markers: {
clusterer: null
},
builders: {
Marker: PageInfoBoxBuilder
}
});
let markers;
let dataMarkers;

function buildMapMarkers(data) {
dataMarkers = _.map(data, function (json, index) {
json.marker = markers[index];
return json;
});
}

handler.buildMap({
provider: {
center: {lat: 39.8097343, lng: -98.5556199},
zoom: 4.2,
zoomControlOptions: {
position: google.maps.ControlPosition.TOP_RIGHT
},
fullscreenControl: false,
mapTypeControl: false,
streetViewControl: false
},
internal: {id: 'page_builder_map'},
markers: {
options: {
rich_marker: true
}
}
},
function () {
markers = handler.addMarkers(mapData);
buildMapMarkers(mapData);
});

google.maps.event.addListener(handler.getMap(), "idle", function () {
$("#page_builder_map").removeClass("display-none");
$(".dm-facilities-show-map-loading-spinner").addClass("display-none");
});
}

$(document).on("turbolinks:load", function () {
google.maps.event.addDomListener(window, "load", initialize);
});
21 changes: 20 additions & 1 deletion app/assets/stylesheets/dm/components/page_component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,30 @@
}
}

.page-map-component {
.page-marker-container {
padding: 52px 8px 0 8px;
}

.infoBox {
img {
@include u-position('absolute');
@include u-right('105');
@include u-top('105');
}
}
}

.page_builder_map {
height: 440px;
}
}

.page-event-component {
border-top: 1px solid black;
}

.page-news-component {
@include u-margin-bottom(2);
}
}

39 changes: 39 additions & 0 deletions app/controllers/page_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ def show
page_slug = params[:page_slug] ? params[:page_slug] : 'home'
@page = Page.includes(:page_group).find_by(slug: page_slug.downcase, page_groups: {slug: params[:page_group_friendly_id].downcase})
@page_components = @page.page_components
get_map_components(@page_components)
@path_parts = request.path.split('/')
@facilities_data = VaFacility.cached_va_facilities.order_by_station_name
@practice_list_components = []
Expand All @@ -22,8 +23,46 @@ def show
end
end


private

def get_map_components(page_components)
page_components.each do |pc|
if pc.component_type == "PageMapComponent"
@map_component = PageMapComponent.find_by_id(pc.component_id)
build_map_component(@map_component.get_adopting_facility_ids)
end
end
end

def build_map_component(adopting_facility_ids)
va_facilities = VaFacility.where(id: adopting_facility_ids)
@va_facility_marker = Gmaps4rails.build_markers(va_facilities) do |facility, marker|
marker.lat facility.latitude
marker.lng facility.longitude
marker.picture({
url: view_context.image_path('map-marker-default.svg'),
width: 34,
height: 46,
scaledWidth: 34,
scaledHeight: 46
})
marker.shadow nil
marker.json({ id: facility.id })
adoption_count = DiffusionHistory.where(va_facility_id: facility.id).count
practice_data = @map_component.get_practice_data_by_diffusion_histories(facility.id)
marker.infowindow render_to_string(
partial: 'maps/page_map_infowindow',
locals: {
facility: facility,
map_component: @map_component,
practice_data: practice_data,
adoption_count: adoption_count
}
)
end
end

def collect_paginated_components(page_components)
practice_lists = []
events = []
Expand Down
1 change: 1 addition & 0 deletions app/models/page_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def destroy_component
'Subpage Hyperlink': 'PageSubpageHyperlinkComponent',
'YouTube Player': 'PageYouTubePlayerComponent',
'Horizontal Separator': 'PageHrComponent',
'Google Map': 'PageMapComponent',
'Text and Images': 'PageCompoundBodyComponent'
}

Expand Down
35 changes: 35 additions & 0 deletions app/models/page_map_component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
class PageMapComponent < ApplicationRecord
has_one :page_component, as: :component, autosave: true

def get_practice_data_by_diffusion_histories(facility_id)
adoptions = DiffusionHistory.where(va_facility_id: facility_id)
info_window_practice_data = []
adoptions.each do |adoption|
adoption_practice = DiffusionHistory.get_with_practice(adoption.practice).first.practice
if practices.include?(adoption_practice.id.to_s)
info_window_practice_data << adoption_practice.slice(:name, :short_name, :tagline, :slug)
end
end
info_window_practice_data
end

def get_adopting_facility_ids
va_facility_ids = []
practices.each do |pr|
diffusion_histories = DiffusionHistory.where(practice_id: pr)
diffusion_histories.each do |dh|
dhs = DiffusionHistoryStatus.where(diffusion_history_id: dh[:id]).first.status
unless dh.va_facility_id.nil?
if (dhs == 'Completed' || dhs == 'Implemented' || dhs == 'Complete') && display_successful_adoptions
va_facility_ids.push dh.va_facility_id
elsif (dhs == 'In progress' || dhs == 'Planning' || dhs == 'Implementing') && display_in_progress_adoptions
va_facility_ids.push dh.va_facility_id
elsif dhs == "Unsuccessful" && display_unsuccessful_adoptions
va_facility_ids.push dh.va_facility_id
end
end
end
end
va_facility_ids
end
end
bradjohnson92008 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ f.has_many page_components, heading: nil, sortable: :position, sortable_start: 1
pc.template.concat(render partial: 'page_hr_component_form', locals: {component: component.class == PageHrComponent ? component : nil, placeholder: placeholder})
pc.template.concat(render partial: 'page_downloadable_file_component_form', locals: {component: component.class == PageDownloadableFileComponent ? component : nil, placeholder: placeholder})
pc.template.concat(render partial: 'page_cta_component_form', locals: {component: component.class == PageCtaComponent ? component : nil, placeholder: placeholder})
pc.template.concat(render partial: 'page_map_component_form', locals: {component: component.class == PageMapComponent ? component : nil, placeholder: placeholder})
pc.template.concat(
render partial: 'page_compound_body_component_form',
locals: {
Expand Down
84 changes: 84 additions & 0 deletions app/views/active_admin/resource/_page_map_component_form.html.arb
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# TODO: get the placeholder how active admin does "NEW_#{association_human_name.upcase.split(' ').join('_')}_RECORD"
placeholder ||= 'NEW_PAGE_COMPONENT_RECORD' # = "NEW_#{association_human_name.upcase.split(' ').join('_')}_RECORD"
component ||= nil
html = Arbre::Context.new do
li "", id: "PageMapComponent_poly_#{placeholder}", class: "input polyform component-#{placeholder}" do
fieldset class: "inputs" do
legend do
span 'Map'
end
ol do
if component
input type: 'hidden', value: component.id, name: "page[page_components_attributes][#{placeholder}][component_attributes][id]"
end

li class: 'url input required stringish', id: "page_page_components_attributes_#{placeholder}_component_attributes_title_input" do
label 'Title', for: "page_page_components_attributes_#{placeholder}_component_attributes_title", class: 'label'
input value: component&.title || nil, type: 'text', required: 'required',
id: "page_page_components_attributes_#{placeholder}_component_attributes_title",
name: "page[page_components_attributes][#{placeholder}][component_attributes][title]"
para 'Enter a title for the map.', class: 'inline-hints'
end

li class: 'url input required stringish', id: "page_page_components_attributes_#{placeholder}_component_attributes_map_info_window_text_input" do
label 'Map Info Window Text', for: "page_page_components_attributes_#{placeholder}_component_attributes_map_info_window_text", class: 'label'
input value: component&.map_info_window_text || nil, type: 'text', required: 'required',
id: "page_page_components_attributes_#{placeholder}_component_attributes_map_info_window_text",
name: "page[page_components_attributes][#{placeholder}][component_attributes][map_info_window_text]"
para 'Enter text or acronym to display in the maps info window.', class: 'inline-hints'
end

li class: 'url input required stringish', id: "page_page_components_attributes_#{placeholder}_component_attributes_description_input" do
label 'Description', for: "page_page_components_attributes_#{placeholder}_component_attributes_description", class: 'label'
input value: component&.description || nil, type: 'text', required: 'required',
id: "page_page_components_attributes_#{placeholder}_component_attributes_description",
name: "page[page_components_attributes][#{placeholder}][component_attributes][description]"
para 'Enter a brief description of the map.', class: 'inline-hints'
end

li class: 'select input optional', id: "page_page_components_attributes_#{placeholder}_practices_attributes_input" do
label 'Innovation List', for: "page_page_components_attributes_#{placeholder}_component_attributes_map", class: 'label'
select required: 'required', multiple: 'multiple', size: '20',
id: "page_page_components_attributes_#{placeholder}_component_attributes_map",
name: "page[page_components_attributes][#{placeholder}][component_attributes][practices][]" do
Practice.order(name: :asc).each do |p|
option p.name, value: p.id, selected: component&.practices&.include?(p.id.to_s) ? 'selected' : nil
end
end
para 'Select which Innovations adoptions are displayed on the map. Hold down the CTRL key and click on Innovation names to add to the list.', class: 'inline-hints'
end

li class: 'checkbox input optional', id: "page_page_components_attributes_#{placeholder}_component_attributes_display_successful_adoptions_input" do
if component
input type: 'hidden', value: '0', name: "page[page_components_attributes][#{placeholder}][component_attributes][display_successful_adoptions]"
end
label 'Successful', for: "page_page_components_attributes_#{placeholder}_component_attributes_display_successful_adoptions", class: 'label'
input value: component&.display_successful_adoptions || nil, type: 'checkbox', checked: component&.display_successful_adoptions?,
id: "page_page_components_attributes_#{placeholder}_component_attributes_display_successful_adoptions",
name: "page[page_components_attributes][#{placeholder}][component_attributes][display_successful_adoptions]"
end
li class: 'checkbox input optional', id: "page_page_components_attributes_#{placeholder}_component_attributes_display_in_progress_adoptions_input" do
if component
input type: 'hidden', value: '0', name: "page[page_components_attributes][#{placeholder}][component_attributes][display_in_progress_adoptions]"
end
label 'In Progress', for: "page_page_components_attributes_#{placeholder}_component_attributes_display_in_progress_adoptions", class: 'label'
input value: '1', type: 'checkbox', checked: component&.display_in_progress_adoptions?,
id: "page_page_components_attributes_#{placeholder}_component_attributes_display_in_progress_adoptions",
name: "page[page_components_attributes][#{placeholder}][component_attributes][display_in_progress_adoptions]"
end
li class: 'checkbox input optional', id: "page_page_components_attributes_#{placeholder}_component_attributes_display_unsuccessful_adoptions_input" do
if component
input type: 'hidden', value: '0', name: "page[page_components_attributes][#{placeholder}][component_attributes][display_unsuccessful_adoptions]"
end
label 'Unsuccessful', for: "page_page_components_attributes_#{placeholder}_component_attributes_display_unsuccessful_adoptions", class: 'label'
input value: '1', type: 'checkbox', checked: component&.display_unsuccessful_adoptions?,
id: "page_page_components_attributes_#{placeholder}_component_attributes_display_unsuccessful_adoptions",
name: "page[page_components_attributes][#{placeholder}][component_attributes][display_unsuccessful_adoptions]"
end
para 'Select which adoptions statuses should display on the map.', class: 'inline-hints'
end
end
end
end

return html.to_s
30 changes: 30 additions & 0 deletions app/views/maps/_page_map_infowindow.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<div class="line-height-sans-1">
<div class="margin-top-1">
<%
station_name = facility.official_station_name
map_info_window_text = map_component.map_info_window_text
%>
<p class="margin-0 padding-x-4">
<%= link_to "#{station_name} #{ show_common_name(station_name, facility.common_name)}", va_facility_path(facility), class: 'usa-link font-sans-md text-bold' %>
</p>
<div class="margin-top-0 text-normal theme-type-scale-sm padding-x-4">
<%= adoption_count %> <%= map_info_window_text.present? ? "#{map_info_window_text}" : 'Total' %> Innovation<%= 's' if adoption_count != 1 %>
</div>
<div class="text-bold font-sans-3xs">
<% practice_data.each do |pd| %>
<%
info_window_text = pd[:map_info_window_text]
name = pd[:name]
%>
<div class="radius-lg border border-solid padding-x-4 padding-y-105 border-base-lightest margin-bottom-2">
<a class="usa-link" href="/innovations/<%= pd[:slug] %>">
<%= info_window_text.present? ? "#{name} (#{info_window_text})" : "#{name}" %>
</a>
<div class="text-normal font-sans-3xs margin-top-3">
<%= pd[:tagline] %>
</div>
</div>
<% end %>
</div>
</div>
</div>
10 changes: 10 additions & 0 deletions app/views/page/_page_map.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<% if ENV['GOOGLE_API_KEY'].present? %>
<% provide :head_tags do %>
<%= javascript_tag 'data-turbolinks-track': 'reload' do %>
var mapData = <%= raw @va_facility_marker.to_json %>
<% end %>
<%= javascript_include_tag 'page/page_map', 'data-turbolinks-track': 'reload' %>
<% end %>
<div id="page_builder_map" class="display-none grid-col-12 desktop:grid-col-9 page_builder_map"></div>
<%= render partial: 'shared/loading_spinner', locals: { display: true, classes: 'flex-justify-center flex-align-self-center margin-y-8 desktop:margin-y-10 dm-facilities-show-map-loading-spinner text-center' } %>
<% end %>
1 change: 1 addition & 0 deletions app/views/page/_page_map_data.js.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var mapData = <%= raw @va_facility_marker.to_json %>;
Loading