Skip to content
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

Add checkbox for chargeback without C & U #366

Merged

Conversation

lpichler
Copy link
Contributor

@lpichler lpichler commented Feb 13, 2017

this checkbox is allowing feature in this PR

screen shot 2017-02-16 at 11 24 55

@miq-bot assign @gtanzillo

please review @himdel

cc @isimluk

@miq-bot
Copy link
Member

miq-bot commented Feb 13, 2017

@lpichler @gtanzillo is an invalid assignee, ignoring...

@lpichler lpichler force-pushed the add_checkbox_for_chargeback_without_c_and_u branch from 89f5997 to 670049d Compare February 13, 2017 14:12
@lpichler
Copy link
Contributor Author

@miq-bot add_label ui, chargeback, enhancement

@miq-bot
Copy link
Member

miq-bot commented Feb 13, 2017

@lpichler Cannot apply the following label because they are not recognized: chargeback

@@ -597,6 +597,8 @@ def gfv_chargeback
@edit[:new][:cb_tag_cat] = params[:cb_tag_cat]
@edit[:cb_tags] = entries_hash(params[:cb_tag_cat])
end
elsif params.key?(:cb_without_metric_rollups)
@edit[:new][:cb_without_metric_rollups] = params[:cb_without_metric_rollups] == "true" ? true : false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

params[:cb_without_metric_rollups] == "true" ? true : false is just params[:cb_without_metric_rollups] == "true" ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, sure, thanks :)

@lpichler lpichler force-pushed the add_checkbox_for_chargeback_without_c_and_u branch from 19d5bcd to fdf2176 Compare February 13, 2017 14:24
@himdel
Copy link
Contributor

himdel commented Feb 13, 2017

LGTM 👍 (but pending_core..)

@gtanzillo
Copy link
Member

Maybe it would be better to go the other way with the checkbox text. Something like "Include Capacity & Utilization Metrics" with a default of "Yes". This way, the option on the backend can be named in the positive way like :include_metrics or `:with_metrics'. Would be easier to follow that way for both the UI and the backend code.

@lpichler lpichler force-pushed the add_checkbox_for_chargeback_without_c_and_u branch 2 times, most recently from fafd240 to 2c2e708 Compare February 14, 2017 17:13
@lpichler
Copy link
Contributor Author

@himdel Can I ask for other review ? - as we discussed with @gtanzillo we changed semantic of checkbox so we have now:

  • [:cb_]include_metrics is now name of the parameter
  • :include_metrics is nil - default value - it means YES
  • :include_metrics is true- it means YES
  • :include_metrics is false- it means NO

thanks !

@lpichler lpichler closed this Feb 15, 2017
@lpichler lpichler reopened this Feb 15, 2017
%label.control-label.col-md-2
= _('Include Capacity & Utilization Metrics')
.col-md-8
= check_box_tag("cb_include_metrics", true, @edit[:new][:cb_include_metrics].nil? || @edit[:new][:cb_include_metrics],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you have the same condition when setting @edit[:new][:cb_include_metrics], here you can just use that, right? (As in, it will never be nil here.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aah.. no, sorry, the condition is in the wrong place for that..

But maybe you can just move the condition to the place where you copy options[:include_metrics] to @edit?

Copy link
Contributor Author

@lpichler lpichler Feb 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@himdel 👍 now we have the condition on the one place as we discussed
(I needed to add also init value for new report https://github.com/ManageIQ/manageiq-ui-classic/pull/366/files#diff-a1e3f16734c9d90e5b6e866305eab359R509 )

@lpichler lpichler force-pushed the add_checkbox_for_chargeback_without_c_and_u branch from 2c2e708 to f45b8b7 Compare February 16, 2017 10:23
@miq-bot
Copy link
Member

miq-bot commented Feb 16, 2017

Checked commit lpichler@f45b8b7 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
2 files checked, 0 offenses detected
Everything looks good. ⭐

@lpichler
Copy link
Contributor Author

@gtanzillo updated and screenshot changed, thanks 👍

@himdel himdel added this to the Sprint 55 Ending Feb 27, 2017 milestone Feb 16, 2017
@himdel himdel self-assigned this Feb 16, 2017
@himdel himdel removed this from the Sprint 55 Ending Feb 27, 2017 milestone Feb 16, 2017
@himdel
Copy link
Contributor

himdel commented Feb 16, 2017

LGTM 👍 waiting for ManageIQ/manageiq#13884

@gtanzillo
Copy link
Member

@himdel, ManageIQ/manageiq#13884 is now merged so you should be good to go to merge this one.

@himdel himdel added this to the Sprint 55 Ending Feb 27, 2017 milestone Feb 21, 2017
@himdel himdel merged commit 772caa6 into ManageIQ:master Feb 21, 2017
@lpichler lpichler deleted the add_checkbox_for_chargeback_without_c_and_u branch February 21, 2017 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants