-
Notifications
You must be signed in to change notification settings - Fork 356
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
Allow to save multiple tag categories in chargeback controller #4310
Allow to save multiple tag categories in chargeback controller #4310
Conversation
205b3ae
to
e80a6a7
Compare
@edit[:cb_assign][:tags] as you can see in code(@edit[:cb_assign][cb_assign_key]) is bringing selected chargeback rates for tags in selected tag category which is stored in @edit[:new][:cbtag_cat] to keep selected chargeback rates for any count of tag categories we need to extend @edit[:cb_assign][:tags] to @edit[:cb_assign][:tags] [category_id] and this hash can keep multiple chargeback rates across any count of tag categories. we need to update code when chargeback rate is selected ( in method cb_assign_params_to_edit called controller action cb_assign_field_changed) and then when we want to save this selection of chargeback rates in cb_assign_update.
e80a6a7
to
5b77319
Compare
Checked commit lpichler@5b77319 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 **
|
@miq-bot add_label gaprindashvili/yes, blocker cc @gtanzillo please review @hstastna @miq-bot assign @mzazrivec |
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.
For me the change is not obvious from the screenshot, and I am missing any steps how to test this properly. I'm not sure how these Assignments work. How can I check if multiple tag categories were properly set? Tried to test it but I still see only the one last selected tag category there. Maybe I am missing something. Thank you.
Ahh, I was missing the next steps how to test it:
@lpichler Please, correct me if I am wrong. Thanks. 🎇 |
The weird thing is that if I try to set the assignment and to save it more times in a row, right after saving it, the previous assignment appears in the screen, not the last one. I mean, different Category and Selections appear in the screen, not the latest saved ones. For me this behavior does not make sense. |
It is possible to assign chargeback rates to more tags from various tag categories (ManageIQ/manageiq-ui-classic#4310).
It is possible to assign chargeback rates to more tags from various tag categories (ManageIQ/manageiq-ui-classic#4310). It will cause costs for each rate will be added up. Example: VM has tag department/it and enviroment/test Rate 1 is assigned to tag department/it Rate 2 is assigned to tag enviroment/test Then if checkbox from (ManageIQ/manageiq-ui-classic#4310) will turn on it will add costs from Rate 1 and Rate 2 together. cost = Rate 1 + Rate 1 But metric value will not be doubled.
@hstastna thanks for the review and comments, yes UX is weird but from functional point of view (saving multiple rates across various category) it is OK. So I am suggesting to do such UX in follow up PR. |
It is possible to assign chargeback rates to more tags from various tag categories (ManageIQ/manageiq-ui-classic#4310). It will cause costs for each rate will be added up. Example: VM has tag department/it and enviroment/test Rate 1 is assigned to tag department/it Rate 2 is assigned to tag enviroment/test Then if checkbox from (ManageIQ/manageiq-ui-classic#4310) will turn on it will add costs from Rate 1 and Rate 2 together. cost = Rate 1 + Rate 1 But metric value will not be doubled.
It is possible to assign chargeback rates to more tags from various tag categories (ManageIQ/manageiq-ui-classic#4310). It will cause costs for each rate will be added up. Example: VM has tag department/it and enviroment/test Rate 1 is assigned to tag department/it Rate 2 is assigned to tag enviroment/test Then if checkbox from (ManageIQ/manageiq-ui-classic#4310) will turn on it will add costs from Rate 1 and Rate 2 together. cost = Rate 1 + Rate 1 But metric value will not be doubled.
It is possible to assign chargeback rates to more tags from various tag categories (ManageIQ/manageiq-ui-classic#4310). It will cause costs for each rate will be added up. Example: VM has tag department/it and enviroment/test Rate 1 is assigned to tag department/it Rate 2 is assigned to tag enviroment/test Then if checkbox from (ManageIQ/manageiq-ui-classic#4310) will turn on it will add costs from Rate 1 and Rate 2 together. cost = Rate 1 + Rate 1 But metric value will not be doubled.
…n_chargeback_assignments Allow to save multiple tag categories in chargeback controller (cherry picked from commit a296004) https://bugzilla.redhat.com/show_bug.cgi?id=1612889
Gaprindashvili backport details:
|
Behaviour:
Before:
It was possible to save just assignment for Tagged VMs and Instances only for ONE Tag Category
After:
It is possible to save it also for multiple categories:
Implementation details
@edit[:cb_assign][:tags]
as you can see incode(
@edit[:cb_assign][cb_assign_key]
) is bringingselected chargeback rates for tags in selected tag category which is
stored in
@edit[:new][:cbtag_cat]
to keep selected chargeback rates for any count of tag categories
we need to extend
@edit[:cb_assign][:tags]
to@edit[:cb_assign][:tags] [category_id]
and this hash cankeep multiple chargeback rates across any count of
tag categories.
we need to update code when chargeback rate is
selected ( in method
cb_assign_params_to_edit
called bycontroller action
cb_assign_field_changed
) and thenwhen we want to save this selection of chargeback rates
in
cb_assign_update
.Note
This PR will need probably also some work to make it better from UX aspects but leave it on other PR.
This PR accomplish it from functional aspects.
Links
https://bugzilla.redhat.com/show_bug.cgi?id=1581349
https://bugzilla.redhat.com/show_bug.cgi?id=1601228