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

Display info about unavailable fields while adding/editing report #5418

Conversation

hstastna
Copy link

@hstastna hstastna commented Apr 2, 2019

Fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=1581817

What:
When choosing Chargeback for Images/Projects/Vms under Configure Report Columns section while adding a new/editing an existing Report under Cloud Intel > Reports > Reports, some of the fields are not available. This is ok but there was a misunderstanding that those fields were missing there. This is why I am adding note about which fields are not supported to the Report editing screen.

Steps to reproduce:

  1. Go to Cloud Intel > Reports > Reports accordion
  2. In toolbar, choose Configuration > Add a new Report (or you can also edit an existing report)
  3. Under Configure Report Columns, for Base the report on choose one of Chargeback for Images/Projects/Vms
    => some of the fields are not available, for example Cpu Cores Allocated Metric for Chargeback for Fms (Carefully! They are not missing!)

Before:
Choosing Chargeback for Images while adding/editing report:
b1
Choosing Chargeback for Projects:
b2
Choosing Chargeback for Vms:
b3

After:
Choosing Chargeback for Images while adding/editing report:
images
Choosing Chargeback for Projects:
projects
Choosing Chargeback for Vms:
vms

@miq-bot miq-bot added the wip label Apr 2, 2019
@hstastna hstastna force-pushed the Cannot_Create_VM_Chargeback_Reports_with_CPU_Cores2 branch from d779d54 to 91d3037 Compare April 2, 2019 12:44
@hstastna
Copy link
Author

hstastna commented Apr 2, 2019

@miq-bot add_label bug, hammer/yes

@hstastna hstastna force-pushed the Cannot_Create_VM_Chargeback_Reports_with_CPU_Cores2 branch 2 times, most recently from 2ef38df to 18d22e0 Compare April 2, 2019 15:52
@hstastna hstastna changed the title [WIP] Display info about unavailable fields while adding/editing report Display info about unavailable fields while adding/editing report Apr 2, 2019
@miq-bot miq-bot removed the wip label Apr 2, 2019
@lpichler
Copy link
Contributor

lpichler commented Apr 3, 2019

Overall looks good 👍 thanks @hstastna

@hstastna hstastna force-pushed the Cannot_Create_VM_Chargeback_Reports_with_CPU_Cores2 branch 2 times, most recently from 55d06fa to f9afa3e Compare April 3, 2019 11:27
%br
%p{:style => "max-width: 850px;"}
%strong
= _("* Caution: %{unav_fields} are not supported for %{rep_base}.") % {:unav_fields => @unavailable_fields, :rep_base => Dictionary.gettext(@edit[:new][:model], :type => :model, :notfound => :titleize, :plural => true)}
Copy link
Contributor

Choose a reason for hiding this comment

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

Using string arithmetics for gettext strings is generally a bad idea. It makes the work of translators more difficult, plus the resulting translated string will not always make sense.

Copy link
Author

Choose a reason for hiding this comment

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

Hmm, that is interesting because I was told to do so in some other PR. So what is your suggestion instead of this? What is the best? Thank you.

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, you need to put the static parts of the string together in one place (in this case, probably the controller) and substitute %{rep_base} here (that's the only dynamic part, correct?)

@hstastna hstastna force-pushed the Cannot_Create_VM_Chargeback_Reports_with_CPU_Cores2 branch from f9afa3e to 417d035 Compare April 9, 2019 11:53
@hstastna hstastna force-pushed the Cannot_Create_VM_Chargeback_Reports_with_CPU_Cores2 branch from 417d035 to bc17b0f Compare April 9, 2019 11:56
@miq-bot
Copy link
Member

miq-bot commented Apr 9, 2019

Checked commits hstastna/manageiq-ui-classic@01d2a9a~...bc17b0f with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
4 files checked, 1 offense detected

**

  • 💣 💥 🔥 🚒 - Linter/Haml - Linter::Haml STDERR:
warning: parser/current is loading parser/ruby23, which recognizes
warning: 2.3.6-compliant syntax, but you are running 2.3.3.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.

@mzazrivec mzazrivec added this to the Sprint 109 Ending Apr 15, 2019 milestone Apr 10, 2019
@mzazrivec mzazrivec self-assigned this Apr 10, 2019
@mzazrivec mzazrivec merged commit 8643aa8 into ManageIQ:master Apr 10, 2019
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