Skip to content

Commit

Permalink
chore: Cleaned up project samples search
Browse files Browse the repository at this point in the history
  • Loading branch information
joshsadam committed Oct 3, 2024
1 parent e5bdc5f commit 9a7db86
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 25 deletions.
36 changes: 23 additions & 13 deletions app/components/list_filter_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,27 @@
>
<%= viral_dialog(id: 'list-filter-dialog', closable: false) do |dialog| %>
<%= dialog.with_trigger do %>
<%= viral_button(data: { action: "click->viral--dialog#open" }, aria: { label: t(:'components.list_filter.title') }, title: t(:'components.list_filter.title'), classes: "relative") do %>
<%= viral_icon(name: "document_magnifying_glass", classes: "w-5 h-5 inline-block") %>
<div
<button
class="
relative text-slate-900 bg-white border border-slate-300 focus:outline-none
hover:bg-slate-100 focus:ring-4 focus:ring-slate-200 font-medium rounded-lg
text-sm px-5 py-2.5 dark:bg-slate-800 dark:text-white dark:border-slate-600
dark:hover:bg-slate-700 dark:hover:border-slate-600 dark:focus:ring-slate-700
"
data-action="viral--dialog#open"
data-aria-label="<%= t(:'components.list_filter.title') %>"
title="<%= t(:'components.list_filter.title') %>"
>
<span
data-list-filter-target="count"
class="
hidden absolute items-center justify-center h-6 text-xs font-bold text-white
bg-red-800 border-2 border-white rounded-full -top-2 -end-2
dark:border-slate-900 px-2
absolute items-center justify-center hidden h-6 px-2 text-xs font-bold
text-white bg-red-800 border-2 border-white rounded-full -top-2 -end-2
dark:border-slate-900
"
>8</div>
<% end %>
>8</span>
<%= viral_icon(name: "document_magnifying_glass", classes: "size-5") %>
</button>
<% end %>
<%= dialog.with_header(title: t(:"components.list_filter.title")) %>
<%= dialog.with_section do %>
Expand All @@ -26,11 +36,11 @@
multiple: true,
class: "hidden",
data: "turbo-temporary" %>
<span class="label font-mono text-base font-semibold mr-1"></span>
<span class="mr-1 font-mono text-base font-semibold label"></span>
<button
type="button"
class="
inline-flex items-center p-1 text-sm text-slate-400 bg-transparent rounded-full
inline-flex items-center p-1 text-sm bg-transparent rounded-full text-slate-400
hover:bg-blue-200 hover:text-blue-900 dark:hover:bg-blue-600
dark:hover:text-blue-300
"
Expand Down Expand Up @@ -62,7 +72,7 @@
type="text"
name="q[name_or_puid_in][]"
class="
focus:outline-none focus:ring-0 border-none bg-transparent grow
bg-transparent border-none focus:outline-none focus:ring-0 grow
"
autofocus
aria-label="<%= t(:'components.list_filter.description') %>"
Expand All @@ -76,8 +86,8 @@
<button
type="button"
class="
absolute inline-flex items-center justify-center w-6 h-6 text-xs font-bold
text-slate-600 bg-slate-100 border-3 border-slate-10 rounded-full bottom-2 end-2
absolute inline-flex items-center justify-center w-5 h-5 text-xs font-bold
rounded-full text-slate-600 bg-slate-100 border-3 border-slate-10 bottom-2 end-2
dark:text-slate-300 dark:border-slate-900 dark:bg-slate-600
dark:hover:bg-slate-500 hover:bg-slate-300
"
Expand Down
16 changes: 4 additions & 12 deletions app/views/projects/samples/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
},
class:
"flex items-center px-4 py-2 bg-slate-100 text-slate-600 dark:bg-slate-600 dark:text-slate-300
border-slate-100 dark:border-slate-600 pointer-events-none cursor-not-allowed",
border-slate-100 dark:border-slate-600 pointer-events-none cursor-not-allowed",
) %>
<% else %>
<% dropdown.with_item(
Expand Down Expand Up @@ -114,12 +114,8 @@
<% end %>
<% end %>

<div class="flex">
<div
class="
inline-flex flex-grow mb-2 space-x-2 border border-red-200 dark:border-slate-700
"
>
<div class="flex mb-2">
<div class="inline-flex flex-grow space-x-2">
<% if allowed_to?(:submit_workflow?, @project) || allowed_to?(:clone_sample?, @project) || allowed_to?(:transfer_sample?, @project) || allowed_to?(:export_data?, @project) %>
<%= search_form_for(
@q,
Expand All @@ -142,11 +138,7 @@
<% end %>
<% end %>
</div>
<div
class="
flex space-x-2 border grow-0 border-slate-200 dark:border-slate-700
"
>
<div class="flex grow-0">
<%= render SearchComponent.new(
query: @q,
url: search_namespace_project_samples_url,
Expand Down

0 comments on commit 9a7db86

Please sign in to comment.