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

Changes to CustomButtonEvent. #17885

Merged
merged 3 commits into from
Aug 22, 2018
Merged

Conversation

lfu
Copy link
Member

@lfu lfu commented Aug 21, 2018

Add association of CustomButtonEvent to its supporting classes.
Add button name and automate entry point virtual columns to CustomButtonEvent.

Followup of #17764.

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

@miq-bot assign @gmcculloug
@miq-bot add_label automate, enhancement, events

cc @h-kataria

end

def button_name
full_data[:button_name]
Copy link
Member

Choose a reason for hiding this comment

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

@lfu I would suggest capturing the button ID as well. Then this method should use the current button name, incase it gets renamed, and fall back to the name of the button when it was run if the button get deleted.

@lfu lfu force-pushed the ansible_reporting branch from 1dcdeb8 to 9b02269 Compare August 21, 2018 14:25
full_data[:automate_entry_point]
end

def button_name
Copy link
Member

Choose a reason for hiding this comment

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

@lfu Please add tests for these two new methods.

virtual_column :automate_entry_point, :type => :string

def automate_entry_point
full_data[:automate_entry_point]
Copy link
Member

Choose a reason for hiding this comment

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

Based on the virtual column I would expect this to always return a string, so I would suggest adding a to_s incase it comes up nil. My guess is if the UI allows sorting that would cause it to blow us.

cc @h-kataria

Copy link
Member

Choose a reason for hiding this comment

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

@gmcculloug just tried with userid as nil, seems working

Copy link
Member

Choose a reason for hiding this comment

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

Good to know, but I have run into issues in the past with list-views and breaking with nil objects. Additionally, the virtual column specifies that it returns :type => :string, so I would argue on that point it should always return an actual string.

Copy link
Member

Choose a reason for hiding this comment

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

@lfu Can you let me know what you are thinking here. I'm suggesting that virtual columns should return their defined data type, which means we should ensure these methods backing the virtual columns return strings.

Copy link
Member Author

Choose a reason for hiding this comment

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

@gmcculloug I agree with what you said. 👍

@lfu lfu force-pushed the ansible_reporting branch 2 times, most recently from c6b60f6 to 3145941 Compare August 21, 2018 17:38
@lfu lfu force-pushed the ansible_reporting branch from 3145941 to 4b2afee Compare August 22, 2018 00:29
@miq-bot
Copy link
Member

miq-bot commented Aug 22, 2018

Checked commits lfu/manageiq@c7c0189~...4b2afee with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
6 files checked, 1 offense detected

app/models/mixins/custom_actions_mixin.rb

@gmcculloug gmcculloug merged commit 198f2ad into ManageIQ:master Aug 22, 2018
@gmcculloug gmcculloug added this to the Sprint 93 Ending Aug 27, 2018 milestone Aug 22, 2018
@skateman
Copy link
Member

Perfect, UI PR will be hopefully finished today.

@h-kataria
Copy link
Contributor

WIP UI PR ManageIQ/manageiq-ui-classic#4520

@lfu lfu deleted the ansible_reporting branch September 29, 2018 14:31
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