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

Order Sub Metrics of Storage types in Rate editor #2812

Merged

Conversation

hstastna
Copy link
Contributor

@hstastna hstastna commented Nov 23, 2017

fixing
Issue with more info: #2799
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1517802

Order Sub Metrics of Storage types (under Rate Details) in Rate editor
correctly when editing newly created Chargeback Rate in Cloud Intel ->
Chargeback -> Rates
.

Details:
The problem was that Rate Details were not sorted when editing the details after choosing
Edit this Chargeback Rate under Configuration comparing to showing the details where the
details are sorted by group, description and sub metric.

Solution:
Adding just sorting the details by group, description and sub metric was not enough. It solved
ordering but then there the problem occurred that after editing the rate and saving the changes,
the changes did not correspond to the right row under Rate Details.

Getting the right detail_indexsolved this. We cannot rely just on order of the details, so
detail_index is set according to the id of rate detail, so we can now get proper array from
@edit[:new][:tiers] and edit appropriate values correctly.

Before:
Video:
https://user-images.githubusercontent.com/14937244/33130609-35639070-cf94-11e7-9826-86bb8a18cb61.gif
Example:
sub4

After:
sub2
sub3

@hstastna
Copy link
Contributor Author

@miq-bot add_label chargeback, gaprindashvili/yes

@miq-bot
Copy link
Member

miq-bot commented Nov 23, 2017

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

@hstastna hstastna force-pushed the Sub_metrics_storage_Chargeback_rate_edit branch 2 times, most recently from f0cfd69 to 2b8ae25 Compare November 23, 2017 17:11
fixing ManageIQ#2799

Order Sub Metrics of Storage types in Rate editor correctly when
editing newly created Chargeback Rate in Cloud Intel -> Chargeback
-> Rates.
@hstastna hstastna force-pushed the Sub_metrics_storage_Chargeback_rate_edit branch from 2b8ae25 to b1c6bc7 Compare November 24, 2017 16:54
@miq-bot
Copy link
Member

miq-bot commented Nov 24, 2017

Checked commit hstastna@b1c6bc7 with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 1 offense detected

app/views/chargeback/_cb_rate_edit_table.html.haml

  • ⚠️ - Line 21 - Block has too many lines. [61/25]

@hstastna
Copy link
Contributor Author

@miq-bot add_label bug

@miq-bot miq-bot added the bug label Nov 27, 2017
@lpichler
Copy link
Contributor

lpichler commented Dec 6, 2017

@miq-bot assign @mzazrivec

@miq-bot
Copy link
Member

miq-bot commented Dec 6, 2017

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

@lpichler
Copy link
Contributor

lpichler commented Dec 6, 2017

@miq-bot assign @mzazrivec

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 👍 working as expected

@mzazrivec mzazrivec added this to the Sprint 76 Ending Jan 1, 2018 milestone Dec 12, 2017
@mzazrivec mzazrivec merged commit 42bc7e3 into ManageIQ:master Dec 12, 2017
simaishi pushed a commit that referenced this pull request Dec 14, 2017
…_rate_edit

Order Sub Metrics of Storage types in Rate editor
(cherry picked from commit 42bc7e3)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1526068
@simaishi
Copy link
Contributor

Gaprindashvili backport details:

$ git log -1
commit 4b33f619e88c1de27ff89b93eef3641bfb098910
Author: Milan Zázrivec <mzazrivec@redhat.com>
Date:   Tue Dec 12 17:44:40 2017 +0100

    Merge pull request #2812 from hstastna/Sub_metrics_storage_Chargeback_rate_edit
    
    Order Sub Metrics of Storage types in Rate editor
    (cherry picked from commit 42bc7e3edc4e4f605f2a4e2452bb8c3987673a99)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1526068

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

5 participants