-
Notifications
You must be signed in to change notification settings - Fork 897
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
Generate virtual custom attributes with sections #14837
Generate virtual custom attributes with sections #14837
Conversation
From @simon3z
@gtanzillo I suppose this should go in the release notes and somehow reach the users. cc @Loicavenel |
cc @zeari |
…ibutes Example: before assume that we have custom attribute record with #name column ’test1 so from for this custom attribute is virtual_custom_attribute_test1 after assume that we have custom attribute record with #name column ’test1 and #section ’section1’ so from for this custom attribute there is format virtual_custom_attribute_test1:SECTION:section1 Method custom_keys is returning all virtual attributes from object. This new format is used for distinguish custom attributes with same column #name
SECTION separator is :SECTION: in CustomAttributes
Now the method is parsing from virtual attribute also section and this section is used for query to custom attribute table example: virtual_custom_attribute_ANYNAME:SECTION:ANYSECTION is basically query object.custom_attributes.where(:name => ‘ANYNAME’, :section => ‘ANYSECTION’) and old format (virtual_custom_attribute_ANYNAME) is also working
VCA = virtual custom attribute
0ce565c
to
7e47947
Compare
@miq-bot remove_label wip |
Checked commits lpichler/manageiq@8da0481~...7e47947 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
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.
Very nice! 👍
@simaishi This is second part for https://bugzilla.redhat.com/show_bug.cgi?id=1434077 and #14835 |
Backported to Euwe via #14971 |
…butes_with_sections Generate virtual custom attributes with sections (cherry picked from commit 688310e) https://bugzilla.redhat.com/show_bug.cgi?id=1458341
Fine backport details:
|
pulled out from #14823
VCA = Virtual Custom Attributes
When there are more custom_attributes with same
name
we were not able to distinguish them.In this PR I distinguish them by column CustomAttribute#section
and I am extending format of virtual custom attributes to
virtual_custom_attribute_NAMEOFATTR:SECTION:docker_labels
and thanks to that it has a format in UI
Docker Labels: NAMEOFATTR
andwhen there is no section it looks like:
Custom Attribute: NAMEOFATTR
so itmeans that this also works with origin form. (part :SECTION: is not mandatory)
Images
let's assume that we have 3 different custom attributes with name
com.redhat.component
but with different sections
on the report:
columns in report definition
expression
Links
follow up #14391
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1434077
Depends on
#14835
It is a reason for WIP.
@miq-bot add_label enhancement,core, fine/yes, euwe/yes, wip
@miq-bot assign @gtanzillo
cc @zeari @simon3z