Fix editing of Default Container Image Rate #3673
Merged
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.
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:
disabled?
method for chargeback rate remove button, according to the changes in core repo (link above)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:
Before fixing:
We were able to access editing screen, no flash message occurred:
We were able to click on Edit this Chargeback Rate, for Default Container Image Rate:
After fixing:
Flash message occurs to inform us:
The button for editing this rate is not active anymore: