-
Notifications
You must be signed in to change notification settings - Fork 898
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
Make MIQ widgets pluggable #22087
Make MIQ widgets pluggable #22087
Conversation
lib/vmdb/plugins.rb
Outdated
@miq_widgets_content ||= begin | ||
Dir.glob(Rails.root.join("product/dashboard/widgets", "*")) + flat_map { |engine| content_directories(engine, "dashboard/widgets") } | ||
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.
begin/end isn't needed here since the contents are a single line.
Technically, after this PR, we can now probably move all of the dashboard widgets out of core and into either manageiq-ui-classic or manageiq-content. Then we don't need to have the |
❤️ Love this change! We probably should add this to the checklist in #19440 also |
9be5b46
to
069121d
Compare
let(:core_widget_dir) { File.expand_path(File.join(Rails.root, "product/dashboard/widgets")) } | ||
|
||
before do | ||
EvmSpecHelper.local_miq_server | ||
|
||
MiqReport.seed_report("Vendor and Guest OS") | ||
MiqWidget.seed_widget("chart_vendor_and_guest_os") | ||
MiqWidget.sync_from_file(Dir.glob(File.join(core_widget_dir, "*chart_vendor_and_guest_os*")).first) |
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.
Since this is a single widget and we know the name I think you can just use the full path and drop the glob
let(:widget_path) { Rails.root.join("product/dashboard/widgets/chart_vendor_and_guest_os.yaml") }
MiqWidget.sync_from_file(widget_path)
069121d
to
2c8a973
Compare
<manageiq-provider>/content/dashboard/widgets
@miq-bot assign @agrare
@miq-bot add_label enhancement