-
Notifications
You must be signed in to change notification settings - Fork 15
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
[WIP] Add advanced filters to admin budget investments #1956
base: master
Are you sure you want to change the base?
Conversation
|
||
click_link('Next') | ||
|
||
expect(page).to have_link('Previous') |
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.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. (https://github.com/bbatsov/ruby-style-guide#consistent-string-literals)
click_link('Selected') | ||
end | ||
|
||
click_link('Next') |
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.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. (https://github.com/bbatsov/ruby-style-guide#consistent-string-literals)
visit admin_budget_budget_investments_path(budget) | ||
|
||
within("#budget_investment_#{selected_bi.id}") do | ||
click_link('Selected') |
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.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. (https://github.com/bbatsov/ruby-style-guide#consistent-string-literals)
@@ -1357,6 +1555,7 @@ | |||
click_link("Selected") | |||
end | |||
|
|||
click_button('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.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. (https://github.com/bbatsov/ruby-style-guide#consistent-string-literals)
results = results.without_admin if params[:advanced_filters].include?("without_admin") | ||
results = results.without_valuator if params[:advanced_filters].include?("without_valuator") | ||
results = results.under_valuation if params[:advanced_filters].include?("under_valuation") | ||
results = results.valuation_finished if params[:advanced_filters].include?("valuation_finished") |
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.
Metrics/LineLength: Line is too long. [102/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
params[:min_total_supports]) if params[:min_total_supports].present? | ||
params[:min_total_supports]) if params[:min_total_supports].present? | ||
results = results.where("cached_votes_up + physical_votes <= ?", | ||
params[:max_total_supports]) if params[:max_total_supports].present? |
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.
Metrics/LineLength: Line is too long. [114/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
@@ -122,7 +122,9 @@ def self.scoped_filter(params, current_filter) | |||
results = Investment.by_budget(budget) | |||
|
|||
results = results.where("cached_votes_up + physical_votes >= ?", | |||
params[:min_total_supports]) if params[:min_total_supports].present? | |||
params[:min_total_supports]) if params[:min_total_supports].present? |
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.
Metrics/LineLength: Line is too long. [114/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
66e8caf
to
3e8ae68
Compare
params[:min_total_supports]) if params[:min_total_supports].present? | ||
params[:min_total_supports]) if params[:min_total_supports].present? | ||
results = results.where("cached_votes_up + physical_votes <= ?", | ||
params[:max_total_supports]) if params[:max_total_supports].present? |
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.
Metrics/LineLength: Line is too long. [114/110] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
@@ -122,7 +122,9 @@ def self.scoped_filter(params, current_filter) | |||
results = Investment.by_budget(budget) | |||
|
|||
results = results.where("cached_votes_up + physical_votes >= ?", | |||
params[:min_total_supports]) if params[:min_total_supports].present? | |||
params[:min_total_supports]) if params[:min_total_supports].present? |
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.
Metrics/LineLength: Line is too long. [114/110] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
References
This is an upstream of PR consuldemocracy#3351 and PR consuldemocracy#3364
Objectives
Change filters on /admin/budgets/:id/budget_investments . We want to move filters from tabs to checkboxes into advanced filters component to give admin the ability of join some of them as filters
Add a new advanced filter on admin budgets investments for maximum number of supports
Visual Changes
Before:
After: