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

Extend the Vmdb::Plugins singleton with UI-specific plugin support #15309

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/vmdb/plugins.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ class Plugins
include Singleton

attr_reader :registered_automate_domains
attr_reader :registered_ui_plugins

def initialize
@registered_automate_domains = []
@registered_provider_plugin_map = {}
@registered_ui_plugins = []
@vmdb_plugins = []
end

Expand All @@ -28,6 +30,7 @@ def register_vmdb_plugin(engine)

register_automate_domains(engine)
register_provider_plugin(engine)
register_ui_plugin(engine)

# make sure STI models are recognized
DescendantLoader.instance.descendants_paths << engine.root.join('app')
Expand Down Expand Up @@ -59,5 +62,9 @@ def register_automate_domains(engine)
@registered_automate_domains << AutomateDomain.new(domain_directory)
end
end

def register_ui_plugin(engine)
@registered_ui_plugins << engine if engine.try(:ui_plugin)
end
end
end