Skip to content

Commit

Permalink
Merge branch 'feature/multiple_select_field_for_products' of github.c…
Browse files Browse the repository at this point in the history
…om:zhephyn/avo into feature/multiple_select_field_for_products
  • Loading branch information
Paul-Bob committed Feb 6, 2025
2 parents 4609f49 + 28d62a1 commit e56ecb6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
5 changes: 4 additions & 1 deletion app/components/avo/media_library/list_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@
<div class="flex-2 w-full sm:flex sm:items-center sm:justify-between space-y-2 sm:space-y-0 text-center sm:text-left pagy-gem-version-<%= helpers.pagy_major_version %> ">
<div class="text-sm text-slate-600 mr-4"><%== helpers.pagy_info @pagy %></div>
<% if @pagy.pages > 1 %>
<%== helpers.pagy_nav(@pagy, anchor_string: "data-turbo-frame=\"#{@turbo_frame}\"") %>
<%# xanchor_string is not valid key word argument and it breaks when require "pagy/extras/calendar" %>
<%# https://github.com/ddnexus/pagy/blob/d70e443872a5b18da4e482454b3c8b4a1c86cb6b/gem/lib/pagy/extras/calendar.rb#L47 %>
<%#== helpers.pagy_nav(@pagy, xanchor_string: "data-turbo-frame=\"#{@turbo_frame}\"") %>
<%== helpers.pagy_nav(@pagy) %>
<% end %>
</div>
</div>
Expand Down
15 changes: 11 additions & 4 deletions app/controllers/avo/search_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ def search_resource(resource)
return nil unless render_error?

search_query_undefined = error_payload(
_label: "Please configure the search for #{resource}",
header: "⚠️ Warning ⚠️",
help: "",
_label: "Search is disabled for #{resource}.\n To enable it please use this guide...",
_url: "https://docs.avohq.io/3.0/search.html#enable-search-for-a-resource"
)

Expand Down Expand Up @@ -207,10 +209,15 @@ def render_error(...)
}, status: 500
end

def error_payload(_label:, _url: "")
def error_payload(
_label:,
_url: "",
header: "🚨 An error occurred during search 🚨",
help: "Please review and resolve the issue before deployment 🚨"
)
{
header: "🚨 An error occurred during search 🚨",
help: "Please review and resolve the issue before deployment 🚨",
header:,
help:,
results: {
_label:,
_url:,
Expand Down

0 comments on commit e56ecb6

Please sign in to comment.