From b46c473807ebbf93fcb05779de73f527697b2abd Mon Sep 17 00:00:00 2001 From: Dominik Piatek Date: Fri, 5 Aug 2022 11:30:32 +0100 Subject: [PATCH 1/4] Pass AddSearch apiKey directly to suggestions method --- preview/app/controllers/components_controller.rb | 3 ++- preview/app/views/components/meganav_vw.html.erb | 2 +- preview/app/views/layouts/application.html.erb | 2 +- src/core/Meganav/component.js | 6 ++++-- src/core/Meganav/component.jsx | 5 +++-- src/core/MeganavSearchAutocomplete/component.js | 13 ++++++++++--- 6 files changed, 21 insertions(+), 10 deletions(-) diff --git a/preview/app/controllers/components_controller.rb b/preview/app/controllers/components_controller.rb index 06ec110ad..20572ad38 100644 --- a/preview/app/controllers/components_controller.rb +++ b/preview/app/controllers/components_controller.rb @@ -170,7 +170,8 @@ def meganav_react_props notice: { props: notice_props, config: notice_config - } + }, + addSearchApiKey: Rails.application.config.add_search_api_key } props[:login_link] = '/custom-login-link' if custom_login_link? diff --git a/preview/app/views/components/meganav_vw.html.erb b/preview/app/views/components/meganav_vw.html.erb index 4ce3aa4e9..eeaac939a 100644 --- a/preview/app/views/components/meganav_vw.html.erb +++ b/preview/app/views/components/meganav_vw.html.erb @@ -9,7 +9,7 @@