From ff56f85f7db280a24b60bc295fda5ff8a7309726 Mon Sep 17 00:00:00 2001 From: stacytalbot Date: Tue, 17 Dec 2019 12:18:07 +0000 Subject: [PATCH] Add map to homepag --- app/assets/stylesheets/components/_map.scss | 12 ++++++ .../components/map/MapInteractive.vue | 30 +++++++++++++ app/javascript/components/map/VMap.vue | 42 +++++++++++++++++++ app/javascript/vue.js | 2 + app/views/home/index.html.erb | 2 +- app/views/layouts/partials/_head.html.erb | 14 +++++-- app/views/partials/maps/_main.html.erb | 1 + package.json | 1 + yarn.lock | 19 +++++++++ 9 files changed, 119 insertions(+), 4 deletions(-) create mode 100644 app/assets/stylesheets/components/_map.scss create mode 100644 app/javascript/components/map/MapInteractive.vue create mode 100644 app/javascript/components/map/VMap.vue create mode 100644 app/views/partials/maps/_main.html.erb diff --git a/app/assets/stylesheets/components/_map.scss b/app/assets/stylesheets/components/_map.scss new file mode 100644 index 000000000..c815a387c --- /dev/null +++ b/app/assets/stylesheets/components/_map.scss @@ -0,0 +1,12 @@ +.map { + &--main { + @include gutters; + + .map { + + &__mapbox { + height: rem-calc(700); + } + } + } +} \ No newline at end of file diff --git a/app/javascript/components/map/MapInteractive.vue b/app/javascript/components/map/MapInteractive.vue new file mode 100644 index 000000000..0e15e7902 --- /dev/null +++ b/app/javascript/components/map/MapInteractive.vue @@ -0,0 +1,30 @@ + + + \ No newline at end of file diff --git a/app/javascript/components/map/VMap.vue b/app/javascript/components/map/VMap.vue new file mode 100644 index 000000000..2c9b4395b --- /dev/null +++ b/app/javascript/components/map/VMap.vue @@ -0,0 +1,42 @@ + + + \ No newline at end of file diff --git a/app/javascript/vue.js b/app/javascript/vue.js index 7c7c7d8c9..bdb9341bf 100644 --- a/app/javascript/vue.js +++ b/app/javascript/vue.js @@ -27,6 +27,7 @@ import ChartTreemapInteractive from './components/charts/chart-treemap/ChartTree import ChartRectangles from './components/charts/chart-rectangles/ChartRectangles' import ChartRowTarget from './components/charts/chart-row-target/ChartRowTarget' import ChartSunburst from './components/charts/chart-sunburst/ChartSunburst' +import MapInteractive from './components/map/MapInteractive' import NavBurger from './components/nav/NavBurger' import SelectWithContent from './components/select/SelectWithContent' import StickyBar from './components/sticky/StickyBar' @@ -66,6 +67,7 @@ document.addEventListener('DOMContentLoaded', () => { ChartRectangles, ChartRowTarget, ChartSunburst, + MapInteractive, NavBurger, SelectWithContent, StickyBar, diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index e93983969..e4902f17f 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -26,7 +26,7 @@
- map main + <%= render partial: "partials/maps/main" %>
diff --git a/app/views/layouts/partials/_head.html.erb b/app/views/layouts/partials/_head.html.erb index a2317a825..1e9338018 100644 --- a/app/views/layouts/partials/_head.html.erb +++ b/app/views/layouts/partials/_head.html.erb @@ -22,22 +22,30 @@ + <%= csrf_meta_tags %> + -<%= stylesheet_link_tag 'application', media: 'all' %> + <% if @for_pdf %> <%= stylesheet_link_tag 'pdf', media: 'all' %> <% end %> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> - <%= stylesheet_pack_tag 'application' %> + + + <%= javascript_pack_tag 'application' %> -<%= render 'partials/google_analytics' %> \ No newline at end of file +<%= render 'partials/google_analytics' %> + + + + \ No newline at end of file diff --git a/app/views/partials/maps/_main.html.erb b/app/views/partials/maps/_main.html.erb new file mode 100644 index 000000000..2e6b48242 --- /dev/null +++ b/app/views/partials/maps/_main.html.erb @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/package.json b/package.json index ad3c118f7..4f2a70369 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "bourbon": "^5.1.0", "bourbon-neat": "^1.9.0", "d3": "^5.9.2", + "dotenv-webpack": "^1.7.0", "es6-object-assign": "^1.1.0", "es6-promise": "^4.2.6", "leaflet": "^1.4.0", diff --git a/yarn.lock b/yarn.lock index 8aeffb8a9..c65822035 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2703,6 +2703,25 @@ dot-prop@^4.1.1: dependencies: is-obj "^1.0.0" +dotenv-defaults@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/dotenv-defaults/-/dotenv-defaults-1.0.2.tgz#441cf5f067653fca4bbdce9dd3b803f6f84c585d" + integrity sha512-iXFvHtXl/hZPiFj++1hBg4lbKwGM+t/GlvELDnRtOFdjXyWP7mubkVr+eZGWG62kdsbulXAef6v/j6kiWc/xGA== + dependencies: + dotenv "^6.2.0" + +dotenv-webpack@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/dotenv-webpack/-/dotenv-webpack-1.7.0.tgz#4384d8c57ee6f405c296278c14a9f9167856d3a1" + integrity sha512-wwNtOBW/6gLQSkb8p43y0Wts970A3xtNiG/mpwj9MLUhtPCQG6i+/DSXXoNN7fbPCU/vQ7JjwGmgOeGZSSZnsw== + dependencies: + dotenv-defaults "^1.0.2" + +dotenv@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-6.2.0.tgz#941c0410535d942c8becf28d3f357dbd9d476064" + integrity sha512-HygQCKUBSFl8wKQZBSemMywRWcEDNidvNbjGVyZu3nbZ8qq9ubiPoGLMdRDpfSrpkkm9BXYFkpKxxFX38o/76w== + duplexify@^3.4.2, duplexify@^3.6.0: version "3.7.1" resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.7.1.tgz#2a4df5317f6ccfd91f86d6fd25d8d8a103b88309"