-
-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: add search_result_url and search_policy_class (#1634)
Co-authored-by: Adrian <[email protected]>
- Loading branch information
1 parent
49a6558
commit c04ed9b
Showing
19 changed files
with
119 additions
and
11 deletions.
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
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
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
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 |
---|---|---|
|
@@ -26,6 +26,10 @@ def update? | |
false | ||
end | ||
|
||
def avo_search? | ||
false | ||
end | ||
|
||
def edit? | ||
update? | ||
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 |
---|---|---|
|
@@ -35,6 +35,10 @@ def act_on? | |
true | ||
end | ||
|
||
def avo_search? | ||
true | ||
end | ||
|
||
def upload_attachments? | ||
true | ||
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 |
---|---|---|
|
@@ -59,6 +59,10 @@ def reorder_links? | |
false | ||
end | ||
|
||
def avo_search? | ||
true | ||
end | ||
|
||
class Scope < Scope | ||
def resolve | ||
scope.all | ||
|
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 |
---|---|---|
|
@@ -31,6 +31,10 @@ def act_on? | |
true | ||
end | ||
|
||
def avo_search? | ||
true | ||
end | ||
|
||
def upload_attachments? | ||
true | ||
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 |
---|---|---|
|
@@ -27,6 +27,10 @@ def destroy? | |
true | ||
end | ||
|
||
def avo_search? | ||
true | ||
end | ||
|
||
# Attachments | ||
def upload_attachments? | ||
true | ||
|
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 |
---|---|---|
|
@@ -35,6 +35,10 @@ def act_on? | |
true | ||
end | ||
|
||
def avo_search? | ||
true | ||
end | ||
|
||
def attach_post? | ||
true | ||
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
require "rails_helper" | ||
|
||
RSpec.feature "Search with custom path", type: :system do | ||
let(:url) { "/admin/resources/cities" } | ||
|
||
subject do | ||
visit url | ||
page | ||
end | ||
|
||
describe "global search" do | ||
let!(:city) { create :city, name: "São Paulo" } | ||
|
||
context "when search result path has been changed" do | ||
it "can find the city" do | ||
visit url | ||
open_global_search_box | ||
expect_search_panel_open | ||
|
||
write_in_search "São Paulo" | ||
expect(page).to have_content "São Paulo" | ||
find(".aa-Panel").find(".aa-Item div", text: "São Paulo", match: :first).click | ||
sleep 0.8 | ||
|
||
expect(page.current_url).to include("custom=yup") | ||
end | ||
end | ||
end | ||
end | ||
|
||
def open_global_search_box | ||
find(".global-search").click | ||
end | ||
|
||
def expect_search_panel_open | ||
expect(page).to have_css ".aa-InputWrapper .aa-Input" | ||
expect(page).to have_selector(".aa-Input:focus") | ||
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