-
-
Notifications
You must be signed in to change notification settings - Fork 300
feature: add search_result_path and search? authorization method #1634
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
Merged
adrianthedev
merged 5 commits into
avo-hq:main
from
glaucocustodio:feature/search-result-url-and-policy-class
Mar 21, 2023
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0035da0
feature: add search_result_path and search authorization method
glaucocustodio ac05e45
hide the search bow from the inde page if the authorization prevents it
adrianthedev 1cc87ae
wip
adrianthedev a080578
add question mark to each method
adrianthedev 28d85ba
refactor show/hide seaech field
adrianthedev 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.