-
Notifications
You must be signed in to change notification settings - Fork 900
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
Descriptive custom attribute columns #14391
Descriptive custom attribute columns #14391
Conversation
4bf9c25
to
fe65569
Compare
@zeari I added some comments on ManageIQ/manageiq-ui-classic#733 that are relevant here as well (adding the |
ee60b15
to
bfa3077
Compare
@@ -25,7 +25,7 @@ module CustomAttributeMixin | |||
end | |||
|
|||
def self.custom_keys | |||
CustomAttribute.where(:resource_type => base_class).distinct.pluck(:name).compact | |||
CustomAttribute.where(:resource_type => base_class).distinct.pluck(:section, :name).compact | |||
end |
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.
@lpichler I couldnt find any other place in the code that uses this particular method:custom_keys
other than _custom_details_for
in miq_expression.rb
changed below.
So i hope this is reasonable.
I didnt go into it too far but i think reporting doesnt take into account that there could be two custom attributes with the same name
but with different section
belonging to the same record.
|
bfa3077
to
0b1c0a3
Compare
I don't think a
Yes, I don't think it we should expose "Custom Attribute". LGTM 👍 |
@lpichler can you review this? |
9e82858
to
db66eba
Compare
lib/miq_expression.rb
Outdated
@@ -1172,11 +1172,11 @@ def self._custom_details_for(model, options) | |||
custom_attributes_details = [] | |||
|
|||
klass.custom_keys.each do |custom_key| | |||
custom_detail_column = [model, CustomAttributeMixin::CUSTOM_ATTRIBUTES_PREFIX + custom_key].join("-") | |||
custom_detail_name = custom_key | |||
custom_detail_column = [model, CustomAttributeMixin::CUSTOM_ATTRIBUTES_PREFIX + custom_key[1]].join("-") |
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.
Instead of array indexing, it might be more readable to do
klass.custom_keys.each do |custom_section, custom_key|
and then use the named variables.
@lpichler Please also review with respect to reporting and how custom attributes can be filtered against.
@zeari Yes, it can be nil. The key/value part (and maybe source) are the only columns that matter. Section is extra, but is not necessarily needed. In my mind I think of this table like an ini file, where the section is optional, and the source would be like the ini file name. |
26a8a53
to
a26fa1e
Compare
Checked commit zeari@a26fa1e 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.
👍 finalized with @zeari
tested:
-reporting & UI reporting definition
-reporting with filtering (expression editor)
- reporting with filtering with field which are not listed in selected field.
@Fryguy We are letting go of |
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.
LGTM 👍
Ready for merge
@Fryguy @blomquisg @chessbyte @gtanzillo anyone around to merge this?
cc @chrispy1
…umns2 Descriptive custom attribute columns (cherry picked from commit ab3ce4a) https://bugzilla.redhat.com/show_bug.cgi?id=1434160
Euwe backport details:
|
update of #11916
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1416220
Completed on the UI side by ManageIQ/manageiq-ui-classic#733
does
version
->Labels: version
in report columns.@lpichler Please review
cc @simon3z
@miq-bot add_label euwe/yes, chargeback, providers/containers