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

Fix editing of Default Container Image Rate #3673

Merged

Conversation

hstastna
Copy link

@hstastna hstastna commented Mar 22, 2018

Fixing https://bugzilla.redhat.com/show_bug.cgi?id=1552260
Depends on ManageIQ/manageiq#17188


The problem:
There was a bug, in Cloud Intel > Chargeback > Rates > Compute Rates: it was possible to edit Default Container Image Rate, from its details page and also from the page with the list of Compute Rates.

How expected result/solution looks like:
Working with Default Container Image Rate will work (after merging this PR and another PR in main MIQ repo) the same way as working with Default Rate (under Compute/Storage Rates): when displaying its details page, the button for editing of Default Container Image Rate (under Configuration) will be disabled automatically; when displaying list of the rates and checking the checkbox of Default Container Image Rate, and then clicking on Edit the selected Chargeback Rate, error message will occur and it will inform that it's not possible to edit this rate.

What was needed to be done:

  • Refactor disabled? method for chargeback rate remove button, according to the changes in core repo (link above)
  • Remove unnecessary case from cb_rate_edit method related to saving/adding a new rate, because it will be no longer possible to edit Default Container Image Rate (after merging this PR)

Trying to edit Default Container Image Rate, after selecting the rate by checking its checkbox and clicking on Edit the selected Chargeback Rate:
rate_edit

Before fixing:
We were able to access editing screen, no flash message occurred:
default_before2
We were able to click on Edit this Chargeback Rate, for Default Container Image Rate:
default_before

After fixing:
Flash message occurs to inform us:
default_after
The button for editing this rate is not active anymore:
default_after2

@hstastna
Copy link
Author

@miq-bot add_label bug, pending core, gaprindashvili/yes

Remove unnecessary case from cb_rate_edit method in chargeback controller
related to saving/adding a new rate, because it is no longer possible to
edit Default Container Image Rate (after merging PR with this commit).
@miq-bot
Copy link
Member

miq-bot commented Mar 22, 2018

Checked commits hstastna/manageiq-ui-classic@267a363~...4d5fa39 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. ⭐

@hstastna hstastna changed the title [WIP] Fix editing of Default Container Image Rate Fix editing of Default Container Image Rate Mar 22, 2018
@hstastna
Copy link
Author

@miq-bot remove_label wip

@miq-bot miq-bot removed the wip label Mar 22, 2018
Copy link
Contributor

@lpichler lpichler left a comment

Choose a reason for hiding this comment

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

Tested and LGTM 👍

you removed 10 lines and changed one line, very nice ✂️ !

@martinpovolny martinpovolny added this to the Sprint 83 Ending Apr 9, 2018 milestone Apr 6, 2018
@martinpovolny
Copy link
Member

Looks good. Restarting travis.

@mzazrivec mzazrivec merged commit f318ee4 into ManageIQ:master Apr 9, 2018
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.

5 participants