diff --git a/app/javascript/js/controllers/search_controller.js b/app/javascript/js/controllers/search_controller.js index 7a8b1007b..90fe13f07 100644 --- a/app/javascript/js/controllers/search_controller.js +++ b/app/javascript/js/controllers/search_controller.js @@ -24,6 +24,10 @@ export default class extends Controller { 'clearButton', ] + static values = { + extraParams: Object, + } + debouncedFetch = debouncePromise(fetch, this.searchDebounce) destroyMethod @@ -256,6 +260,7 @@ export default class extends Controller { ...Object.fromEntries(new URLSearchParams(window.location.search)), q: query, global: false, + ...this.extraParamsValue, } if (this.isGlobalSearch) { diff --git a/app/views/avo/partials/_navbar.html.erb b/app/views/avo/partials/_navbar.html.erb index e8b18f410..e94860d54 100644 --- a/app/views/avo/partials/_navbar.html.erb +++ b/app/views/avo/partials/_navbar.html.erb @@ -7,7 +7,7 @@ <%= render partial: "avo/partials/logo" %>
- <%= render Avo::Pro::GlobalSearchComponent.new rescue nil %> + <%= render Avo::Pro::GlobalSearchComponent.new(resource:) if defined?(Avo::Pro::GlobalSearchComponent) %>
<%= render partial: "avo/partials/header" %>
diff --git a/app/views/layouts/avo/application.html.erb b/app/views/layouts/avo/application.html.erb index eeac92ceb..0319de8cd 100644 --- a/app/views/layouts/avo/application.html.erb +++ b/app/views/layouts/avo/application.html.erb @@ -29,7 +29,7 @@
- <%= render partial: "avo/partials/navbar" %> + <%= render partial: "avo/partials/navbar", locals: { resource: @resource } %>
">