Skip to content

Commit

Permalink
Add username, button name and automate entry point to CustomButtonEvent.
Browse files Browse the repository at this point in the history
  • Loading branch information
lfu committed Aug 21, 2018
1 parent c25b386 commit 1dcdeb8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/models/custom_button.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,14 @@ def publish_event(source, target, args)
:message => 'Custom button launched',
:source => source,
:target => target,
:username => args[:username],
:user_id => args[:user_id],
:group_id => args[:miq_group_id],
:tenant_id => args[:tenant_id],
:full_data => {
:args => args,
:automate_entry_point => resource_action.ae_path
:automate_entry_point => resource_action.ae_path,
:button_name => name
}
)
end
Expand Down
10 changes: 10 additions & 0 deletions app/models/custom_button_event.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
class CustomButtonEvent < EventStream
virtual_column :button_name, :type => :string
virtual_column :automate_entry_point, :type => :string

def automate_entry_point
full_data[:automate_entry_point]
end

def button_name
full_data[:button_name]
end
end
1 change: 1 addition & 0 deletions app/models/resource_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def automate_queue_hash(target, override_attrs, user)
args[:user_id] ||= user.id
args[:miq_group_id] ||= user.current_group.id
args[:tenant_id] ||= user.current_tenant.id
args[:username] ||= user.userid
end
end

Expand Down

0 comments on commit 1dcdeb8

Please sign in to comment.