-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Search scopes #276
Closed
Closed
Search scopes #276
Changes from 4 commits
Commits
Show all changes
95 commits
Select commit
Hold shift + click to select a range
df6e8cb
colon at last char could mean use a model scope
nando 1747a5a
new feature: admin searches using a model scope
nando c84dd78
gems upgrade to fix nokogiri vulnerability
nando 77dc494
avoid hound violations
nando e2c52a2
hopefully last Houndci fixes...
nando 022590f
spec to ignore malicious scope searches (fix pending)
nando 23104a7
Search::BLACKLISTED_WORDS avoids malicious scopes
nando 948305d
petting HoundCI
nando 6916c97
Search splits the scope and the term in the query (wip)
nando 71796b8
Merge branch 'master' into search_scopes
nando 3d4d80f
Admin searches *into* a model scope
nando 43c79af
Merge branch 'master' into search_scopes
nando 4aee009
Merge branch 'master' into search_scopes
nando 5de68c5
Merge branch 'master' into search_scopes
nando ce096e7
Merge branch 'master' into search_scopes
nando fc749c5
Merge branch 'master' into search_scopes
nando 104b23c
double-quoting a string
nando a37e91b
Merge branch 'master' into search_scopes
nando cb6dc90
much better than send anything is public_send it
nando 8802956
Merge branch 'master' into search_scopes
nando 797d99c
Dashboard's COLLECTION_SCOPES for the index page (WIP)
nando fce4e5b
link_to_unless_current in index scope buttons
nando 92d3855
Merge branch 'master' into collection_scopes
nando 2a375ec
Merge branch 'master' into search_scopes
nando b73de10
Dashboard's COLLECTION_SCOPES for the index page (2/2)
nando 14bcced
Merge branch 'collection_scopes' into search_scopes
nando cc634fc
debug change reverted
nando 86f3e8e
Hound fixes
nando 063b503
search into scope syntax changed
nando d508ad7
refactorization finished
nando cd48500
regexp refactor
nando c71f75a
now i feel bad about this stupid joke
nando 47e6128
scenario "admin clicks a scope button"
nando dcdcbf9
scope button link fixed
nando 7fbf27e
COLLECTION_SCOPES defined for the feature specs
nando fffdd86
Hound fix
nando 42bb6ce
Search#new extracts #scopes&#words from the query
nando a95b716
trailing whitespaces removed
nando 9c3819b
admin searches a word inside two model scopes
nando 5c4966c
Scopes with an argument (feature spec pending)
nando ba68fdf
Scopes with argument feature spec
nando e0d3fb6
*if* indentation like hound says it should be
nando 9e29782
COLLECTION_SCOPES accepts strings with (argument)
nando 9742470
Hound fixes
nando 320d239
COLLECTION_SCOPES as a hash w/ scopes' arrays
nando 2616bbd
scope-buttons class style
nando 8f67444
Merge branch 'master' into search_scopes
nando a48b4e4
avoided needless SQL query for only scope search
nando 318f40f
Hound fixes
nando d57583c
fix in #scope_groups
nando c026d41
Merge branch 'master' into search_scopes
nando 45165b1
Merge branch 'master' into search_scopes
nando 8649b87
buttons-group style&component + use in scope groups
nando 73ab8eb
Merge remote-tracking branch 'upstream/master' into search_scopes
nando 5b94dda
calling #freeze in the BLACKLISTED_WORDS value
nando 413e94e
several Hound tweaks
nando 1466905
raw user's Search#scopes_with_arguments inputs
nando ff776ed
Search#new(resolver, query) cleans the users query
nando 917f256
partial for _scope_buttons_group
nando 2c62488
Collection#scoped_with?(scope) + use in partial
nando d307ebb
Page::Collection's #scope_groups&#scope_names spec
nando 846208a
Page::Collection#scope_group(scope)
nando eedbd9e
Collection#scoped_groups in the current query
nando 6b9478b
Mock dashboards moved to spec_helper to be shared
nando c939b84
Page::Colletion's specs refactorization
nando 61c56d9
Collection#current_scope_of(group)
nando b1cf880
Collection#term_using_scope adds/updates the query term with the give…
nando f126156
Hound tweaks
nando 433409f
Merge branch 'master' into search_scopes
nando 0f6ff85
use of page.term_using_scope in the index view
nando cfa40cc
ApplicationHelper#translated_scope(scope, i18n_scope)
nando be85f0f
"Filter" translations added (only zh-CN&zh-TW missing)
nando 679b358
missing Chinese translations added
nando 2ea34a8
check scope's arity while searching them in the query
nando 5f9cb3b
Hound tweaks
nando 5f448de
hound fix
nando cbffcdb
Scope's arity hack removed
nando 46cfe4a
Bourbon button-group style for scope buttons groups
nando 6e808cd
"wildcarded" scopes to search "<scope>:<argument>"
nando 360ec3f
Hound fixes
nando 5735a19
oops! restoring the missed buttons background
nando c3f7293
ending multiline array with a comma
nando 5ef54fa
use #casecmp instead of (innecesary) #downcase.eq (thanks hound!)
nando 0140edc
double-quoting a string
nando 63a9054
"Disable scopes" feature and used by default (in the generated dashbo…
nando b6dcb80
extra line removed
nando a4264f1
explanations in generated dashboard improved
nando 254140c
Merge branch 'master' into search_scopes
nando cc62974
extra space removed
nando 8c672e3
Merge branch 'master' into search_scopes
nando b99024e
Merge branch 'master' into search_scopes
nando e8fddd0
Button to disable active scope in Dashboard index
nando d877b91
Collection#term_without_scope don't care if defined
nando 368dd2b
Merge branch 'master' into search_scopes
nando e76877a
Merge branch 'master' into search_scopes
nando 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
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 |
---|---|---|
|
@@ -30,4 +30,21 @@ | |
expect(page).to have_content(email_match.email) | ||
expect(page).not_to have_content(mismatch.email) | ||
end | ||
|
||
scenario "admin searches using a model scope", :js do | ||
query = "subscribed:" | ||
subscribed_customer = create(:customer, | ||
name: "Dan Croak", | ||
email_subscriber: true) | ||
other_customer = create(:customer, | ||
name: "Foo Bar", | ||
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. Align the parameters of a method call if they span more than one line. |
||
email_subscriber: false) | ||
|
||
visit admin_customers_path | ||
fill_in :search, with: query | ||
page.execute_script("$('.search').submit()") | ||
|
||
expect(page).to have_content(subscribed_customer.name) | ||
expect(page).not_to have_content(other_customer.name) | ||
end | ||
end |
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.
Align the parameters of a method call if they span more than one line.