-
Notifications
You must be signed in to change notification settings - Fork 6
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
Feature/go 368 filters #249
Open
alhafoudh
wants to merge
44
commits into
main
Choose a base branch
from
feature/GO-368-filters
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
473af6d
Pass filter via url params and tweak message threads table title base…
alhafoudh 914d2fb
Tweak title text
alhafoudh 0a03182
Implement pinning and unpinning filters in sidebar
alhafoudh a6b44f0
Remove dependency on tailwindcss-scoped-groups since it is a native t…
alhafoudh be94fbe
Implement filter sorting
alhafoudh d8e29ff
Replace bars icon with grip icon
alhafoudh 5b0b7a3
Tweak styles
alhafoudh 2fcbce2
Merge branch 'main' into feature/GO-368-filters
alhafoudh 8d1e4e9
Fix FlashComponent renamed namespace
alhafoudh 8bfd59d
Update schema.rb and tenant.rb annotation
alhafoudh 44d03c7
User visibility settings for Tags, Filters v1
stage-rl f6108e5
Merge branch 'main' into feature/GO-368-filters
alhafoudh 3281e2e
Resolve merge conflict
alhafoudh 34e344b
Merge branch 'feature/tags_user_visibility_settings' into feature/GO-…
alhafoudh a11f431
Fix db schema
alhafoudh 9a6425f
Fix wrong merge
alhafoudh d07a6a0
Merge branch 'refs/heads/main' into feature/GO-368-filters
alhafoudh 8bcf810
Remove pinning from sidebar
alhafoudh adf8361
Tweak sidebar for filter list
alhafoudh ef6105c
Rename visibility model to UserItemVisibility and add reordering
alhafoudh 87c0bd8
Reorganize filtering and enable TagFilter usage
alhafoudh 7cc6801
Make first filter default
alhafoudh 3783ec4
Redirect to default filter and fix active sidebar item tracking
alhafoudh 5935dd4
Add buttons with icons for up down
alhafoudh cf6ebfa
Make Filter author nullable
alhafoudh 6c4313f
Remove binding.pry
alhafoudh 6a69302
Merge branch 'main' into feature/GO-368-filters
41f947a
Update filters and tags views, forms, icons, ..
ab4b919
Refactor routes
6afd341
Update filter editable scope
01240ec
Fix filter fixtures
c845d7b
FGRA-9973: Update tests
715141c
Update filters creation, scope, components
15dfcdd
Update tests
901e018
Try fix random failing notifications_test
25c6d2a
Merge branch 'main' into feature/GO-368-filters
d0bf118
Change default_max_wait_time for Capybara
699fc2f
Update notifications_test
6f5ba24
Fix migration and filtering by tag filters
29cc358
Remove is_pinned from filters
0776ad3
Refactoring after review
84646a6
Refactoring after review
21ef1b7
Merge branch 'main' into feature/GO-368-filters
8824a1f
Basic fix
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="<%= @stroke_width %>" stroke="currentColor" class="shrink-0 <%= @classes.present? ? @classes : "w-6 h-6" %>"> | ||
<path stroke-linecap="round" stroke-linejoin="round" d="<%= @svg %>" /> | ||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="<%= @stroke_width %>" stroke="currentColor" class="shrink-0 <%= @classes.presence || "w-6 h-6" %>"> | ||
<% if @svg.class == Array %> | ||
<% @svg.each do |svg| %> | ||
<path stroke-linecap="round" stroke-linejoin="round" d="<%= svg %>" /> | ||
<% end %> | ||
<% else %> | ||
<path stroke-linecap="round" stroke-linejoin="round" d="<%= @svg %>" /> | ||
<% end %> | ||
</svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 11 additions & 3 deletions
14
app/components/filters/filters_list_row_component.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,30 @@ | ||
<% if @filters.present? %> | ||
<div class="flex flex-col justify-start items-start gap-2" data-test="filters"> | ||
<div class="flex justify-start items-start px-4 py-2"> | ||
<p class="text-sm text-center text-gray-400">Filtre</p> | ||
</div> | ||
<div | ||
<% if @sortable %> | ||
data-controller="sortable" | ||
data-sortable-url-value="<%= sort_filters_path %>" | ||
data-sortable-draggable-class=".item" | ||
data-sortable-handle-class=".handle" | ||
<% end %> | ||
class="w-full flex flex-col justify-start items-start gap-2" | ||
data-test="filters" | ||
> | ||
<% if @sortable %> | ||
<%= link_to 'Sort', '', class: 'hidden', data: { turbo_method: :patch, sortable_target: 'submit', url: sort_filters_path } %> | ||
<% end %> | ||
<% if @label.present? %> | ||
<div class="flex justify-start items-start px-4 py-2"> | ||
<p class="text-sm text-center text-gray-400"><%= @label %></p> | ||
</div> | ||
<% end %> | ||
<% @filters.each do |filter| %> | ||
<% url = message_threads_path(q: filter.query) %> | ||
<%= link_to url, class: "text-gray-700 hover:text-indigo-600 hover:bg-gray-50 group w-72 flex gap-x-3 rounded-md p-2 px-4 text-sm leading-6 font-semibold data-[active=true]:bg-gray-50 data-[active=true]:text-indigo-600", data: { active: current_page?(url) } do %> | ||
<%= render Icons::BookmarkComponent.new %> | ||
<p class="truncate text-base font-medium"><%= filter.name %></p> | ||
<% end %> | ||
<%= render TW::SidebarMenuItemComponent.new( | ||
name: filter.name, | ||
url: filtered_message_threads_path(filter:), | ||
icon: icon_for(filter), | ||
variant: :light, | ||
classes: "item #{!@sortable ? 'pl-4' : ''}", | ||
) %> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,20 @@ | ||
class Layout::FilterListComponent < ViewComponent::Base | ||
def initialize(filters:) | ||
include MessageThreadHelper | ||
|
||
def initialize(label: nil, filters:, sortable: false) | ||
@label = label | ||
@filters = filters | ||
@sortable = sortable | ||
end | ||
|
||
def icon_for(filter) | ||
return Common::IconComponent.new(filter.icon) if filter.icon.present? | ||
|
||
if filter.tag.present? | ||
return Common::IconComponent.new(filter.tag.icon) if filter.tag.icon.present? | ||
return Icons::TagComponent.new | ||
end | ||
|
||
Icons::BookmarkComponent.new | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
class MessageThreadsBulkActionsComponent < ViewComponent::Base | ||
def initialize(ids:, signable:, filter: nil, filter_subscription: nil) | ||
def initialize(ids: nil, signable:, filter: nil, query: nil, filter_subscription: nil) | ||
@ids = ids | ||
@signable = signable | ||
@filter = filter | ||
@query = query | ||
@filter_subscription = filter_subscription | ||
end | ||
|
||
def title | ||
return t(:selected_message, count: @ids.count) if @ids.present? | ||
return @filter.name if @filter.present? && @filter.is_a?(EverythingFilter) | ||
return "Správy z filtra '#{@filter.name}'" if @filter.present? | ||
return "Hľadaný výraz '#{@query}'" if @query.present? | ||
|
||
"Správy v schránke" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
app/components/settings/user_filter_visibilities/list_component.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<div class="w-full p-4 flex-col justify-start items-start gap-4 inline-flex"> | ||
<div class="self-stretch bg-white rounded-md border border-gray-200 flex-col justify-start items-start flex"> | ||
<div class="flex-col self-stretch p-6 border-b border-gray-200 justify-start items-start gap-4 inline-flex"> | ||
<div class="grow shrink basis-0 text-gray-900 text-xl font-semibold leading-[35px]">Filtre</div> | ||
Nastavte si osobnú preferenciu viditeľnosti filtrov v ľavom menu | ||
</div> | ||
<div class="self-stretch flex-col justify-start items-start flex"> | ||
<%= render Settings::UserFilterVisibilities::ListRowComponent.with_collection(@visibilities) %> | ||
</div> | ||
</div> | ||
</div> |
5 changes: 5 additions & 0 deletions
5
app/components/settings/user_filter_visibilities/list_component.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class Settings::UserFilterVisibilities::ListComponent < ViewComponent::Base | ||
def initialize(visibilities) | ||
@visibilities = visibilities | ||
end | ||
end |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Ak su toto nepovinne parametre tak ich tam neposielajme, ale zvlastne ze to nepotrebujeme.
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.
niesu nepovinne, ale ide zase o Shorthand Hash Syntax