From a98e4417c0519d8596ad0584e2eade2045536dc9 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Mon, 16 Aug 2021 13:19:23 +0100 Subject: [PATCH] Only inject taxons and properties AMS data in pages where it's actually needed --- app/views/enterprises/shop.html.haml | 4 ++++ app/views/groups/show.html.haml | 4 ++++ app/views/layouts/darkswarm.html.haml | 4 ---- app/views/map/index.html.haml | 4 ++++ app/views/producers/index.html.haml | 4 ++++ app/views/shops/index.html.haml | 4 ++++ 6 files changed, 20 insertions(+), 4 deletions(-) diff --git a/app/views/enterprises/shop.html.haml b/app/views/enterprises/shop.html.haml index 3008b50d49..150452a4e9 100644 --- a/app/views/enterprises/shop.html.haml +++ b/app/views/enterprises/shop.html.haml @@ -8,6 +8,10 @@ - content_for :injection_data do - cache(*CacheService::FragmentCaching.ams_shop(@enterprise)) do = inject_enterprise_shopfront(@enterprise) + - cache(*CacheService::FragmentCaching.ams_all_taxons) do + = inject_taxons + - cache(*CacheService::FragmentCaching.ams_all_properties) do + = inject_properties %shop.darkswarm - if @shopfront_layout == 'embedded' diff --git a/app/views/groups/show.html.haml b/app/views/groups/show.html.haml index b5622063a2..df1152bd70 100644 --- a/app/views/groups/show.html.haml +++ b/app/views/groups/show.html.haml @@ -9,6 +9,10 @@ = inject_available_countries = inject_group_enterprises = inject_open_street_map_config + - cache(*CacheService::FragmentCaching.ams_all_taxons) do + = inject_taxons + - cache(*CacheService::FragmentCaching.ams_all_properties) do + = inject_properties #group-page.row.pad-top.footer-pad{"ng-controller" => "GroupPageCtrl"} .small-12.columns.pad-top diff --git a/app/views/layouts/darkswarm.html.haml b/app/views/layouts/darkswarm.html.haml index e745a20b3c..82c36ee492 100644 --- a/app/views/layouts/darkswarm.html.haml +++ b/app/views/layouts/darkswarm.html.haml @@ -54,10 +54,6 @@ = inject_current_hub = inject_current_user = inject_rails_flash - - cache(*CacheService::FragmentCaching.ams_all_taxons) do - = inject_taxons - - cache(*CacheService::FragmentCaching.ams_all_properties) do - = inject_properties = inject_current_order = inject_currency_config = yield :injection_data diff --git a/app/views/map/index.html.haml b/app/views/map/index.html.haml index 42b0000d19..c3cb006057 100644 --- a/app/views/map/index.html.haml +++ b/app/views/map/index.html.haml @@ -5,5 +5,9 @@ = inject_available_countries = inject_enterprise_shopfront_list = inject_open_street_map_config + - cache(*CacheService::FragmentCaching.ams_all_taxons) do + = inject_taxons + - cache(*CacheService::FragmentCaching.ams_all_properties) do + = inject_properties = render partial: "shared/map" diff --git a/app/views/producers/index.html.haml b/app/views/producers/index.html.haml index b00268066b..8a9eec338d 100644 --- a/app/views/producers/index.html.haml +++ b/app/views/producers/index.html.haml @@ -4,6 +4,10 @@ - content_for :injection_data do - cache @enterprises do = inject_enterprises(@enterprises) + - cache(*CacheService::FragmentCaching.ams_all_taxons) do + = inject_taxons + - cache(*CacheService::FragmentCaching.ams_all_properties) do + = inject_properties .producers{"ng-controller" => "EnterprisesCtrl", "ng-cloak" => true} .row diff --git a/app/views/shops/index.html.haml b/app/views/shops/index.html.haml index 032096ebb9..845d0a0853 100644 --- a/app/views/shops/index.html.haml +++ b/app/views/shops/index.html.haml @@ -4,6 +4,10 @@ - content_for :injection_data do - cache(*CacheService::FragmentCaching.ams_shops) do = inject_enterprises(@enterprises) + - cache(*CacheService::FragmentCaching.ams_all_taxons) do + = inject_taxons + - cache(*CacheService::FragmentCaching.ams_all_properties) do + = inject_properties #panes #shops.pane