-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blank results visualization #311
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<div class="flex flex-col justify-start items-start self-stretch flex-grow-0 flex-shrink-0"> | ||
<div class="flex flex-col justify-center items-center self-stretch flex-grow-0 flex-shrink-0 relative gap-6 px-6 py-12 bg-white"> | ||
<%= render Common::IconComponent.new(@icon, classes: "size-32 text-gray-500") %> | ||
<div class="flex flex-col justify-center items-center flex-grow-0 flex-shrink-0 relative gap-1"> | ||
<p class="flex-grow-0 flex-shrink-0 text-base font-semibold text-center text-gray-500"><%= @text1 %></p> | ||
<p class="flex-grow-0 flex-shrink-0 text-base text-center text-gray-500"><%= @text2 %></p> | ||
</div> | ||
</div> | ||
</div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module Common | ||
class BlankResultsComponent < ViewComponent::Base | ||
def initialize(reason = :not_found) | ||
case reason | ||
when :empty | ||
@text1 = "Žiadne záznamy" | ||
@text2 = "Zatiaľ nie sú vytvorené žiadne záznamy" | ||
@icon = "hand-thumb-up" | ||
when :not_found | ||
@text1 = "Žiadne výsledky" | ||
@text2 = "Skúste zmeniť filter alebo vyhľadávané slová" | ||
@icon = "magnifying-glass" | ||
when :all_done | ||
@text1 = "Všetko je hotové" | ||
@text2 = "Nemáte žiadnu novú správu" | ||
@icon = "hand-thumb-up" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Toto presunme do translations file |
||
end | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
<div class="flex flex-col justify-stretch items-stretch gap-4 sm:p-4"> | ||
<div class="flex flex-col justify-stretch items-stretch sm:rounded-md bg-white sm:border sm:border-gray-200" data-controller="form all-checkboxes"> | ||
<%= render MessageThreadsBulkActionsComponent.new(ids: [], filter: @filter, filter_subscription: @filter_subscription, signable: Current.user.signer?) %> | ||
<%= form_with url: bulk_actions_message_threads_path, data: { "form-target": "form", "all-checkboxes-target": "form" } do %> | ||
<%= form_with url: bulk_actions_message_threads_path, data: { 'form-target': "form", 'all-checkboxes-target': "form" } do %> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tie dvojite " nedavame vsade? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Davame, ale neprepisujeme stary kod. A vypli sme si enforcement tohto pravidla v nasom krasnom lintri, lebo to iritovalo head architekta ;-) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ja tu vidím diff kde sa zmenili There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prauda, moja chyba. Tam je zjavne este dalsie pravidlo, ine ako pouzivanie jednoritych vs dvojitych. Vypinam aj toto https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/QuotedSymbols |
||
<ul role="list" id="message_threads" class="divide-y divide-gray-100"> | ||
<% message_threads.each do |message_thread| %> | ||
<%= message_thread %> | ||
<% end %> | ||
</ul> | ||
<%= next_page_area %> | ||
<% end %> | ||
<%= blank_results_area %> | ||
</div> | ||
</div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
class Settings::Rules::AutomationRulesListComponent < ViewComponent::Base | ||
renders_many :automation_rules | ||
renders_one :blank_results_area | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
<%= render Admin::Tags::TagsListComponent.new(simple_tags: @simple_tags) %> | ||
<%= render Admin::Tags::TagsListComponent.new(simple_tags: @simple_tags) do |component| %> | ||
<% if @simple_tags.empty? %> | ||
<% component.with_blank_results_area do %> | ||
<%= render Common::BlankResultsComponent.new(:empty) %> | ||
<% end %> | ||
<% end %> | ||
<% end %> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
<%= render Filters::FiltersListComponent.new(@filters) %> | ||
<% if @filters.any? %> | ||
<%= render Filters::FiltersListComponent.new(@filters) %> | ||
<% else %> | ||
<%= render Common::BlankResultsComponent.new(:empty) %> | ||
<% end %> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,14 +3,23 @@ | |
<meta name="turbo-visit-control" content="reload"> | ||
<% end %> | ||
<% end %> | ||
|
||
<%= render MessageThreadsTableComponent.new(filter: @filter, filter_subscription: @filter_subscription) do |component| %> | ||
<% component.with_message_thread do %> | ||
<%= render MessageThreadsTableRowComponent.with_collection(@message_threads) %> | ||
<% end %> | ||
<% if @next_cursor %> | ||
<% component.with_next_page_area do %> | ||
<%= render Turbo::NextPageAreaComponent.new(id: @next_cursor, url: scroll_message_threads_url(@next_page_params)) %> | ||
<% if @message_threads.any? %> | ||
<% component.with_message_thread do %> | ||
<%= render MessageThreadsTableRowComponent.with_collection(@message_threads) %> | ||
<% end %> | ||
<% if @next_cursor %> | ||
<% component.with_next_page_area do %> | ||
<%= render Turbo::NextPageAreaComponent.new(id: @next_cursor, url: scroll_message_threads_url(@next_page_params)) %> | ||
<% end %> | ||
<% end %> | ||
<% else %> | ||
<% component.with_blank_results_area do %> | ||
<% if params[:referrer] == "menu" %> | ||
<%= render Common::BlankResultsComponent.new(:all_done) %> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Toto neviem ci je uplne spravna logika, ak "idem z menu", tak mozem mat aj filter "Vybavene" a ked je prazdny tak nie je prave naopak NIC vybavene. Zaroven to posuvanie referera sa mi nepaci. Spravme teda len tu verziu, ze ziadne spravy. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No moja logika bola taka, ze ked idem z menu, tak je to nieco ako "TODO list", t.j. prazdny zoznam je dobry zoznam, a preto palec hore. A naopak, ked si robim custom query, tak asi nieco chcem najst, a ked nenajdem, tak je to v podstate chyba. Tomu som sa snazil aj ikony prisposobovat po inspiracii Figmou |
||
<% else %> | ||
<%= render Common::BlankResultsComponent.new(:not_found) %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
<% end %> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
<%= render Settings::Rules::AutomationRulesListComponent.new do |component| %> | ||
<% @automation_rules.each do |automation_rule| %> | ||
<% component.with_automation_rule do %> | ||
<%= render Settings::Rules::AutomationRulesTableRowComponent.new(automation_rule) %> | ||
<% if @automation_rules.any? %> | ||
<% @automation_rules.each do |automation_rule| %> | ||
<% component.with_automation_rule do %> | ||
<%= render Settings::Rules::AutomationRulesTableRowComponent.new(automation_rule) %> | ||
<% end %> | ||
<% end %> | ||
<% else %> | ||
<% component.with_blank_results_area do %> | ||
<%= render Common::BlankResultsComponent.new(:empty) %> | ||
<% end %> | ||
<% end %> | ||
<% end %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Toto je strasne genericke, blank stav by ti mal aj trochu poradit, ze naco to sluzi (napr. filtre) a ponuknut akciu (napr. vytvorit filter)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je to teda v prekladoch. Ak vies ako, kludne pomen