lib/katello/plugin.rb in katello-3.8.1 vs lib/katello/plugin.rb in katello-3.9.0.rc1

- old
+ new

@@ -9,11 +9,11 @@ :icon => 'fa fa-book', :after => :monitor_menu do menu :top_menu, :red_hat_subscriptions, :caption => N_('Subscriptions'), :url => '/subscriptions', - :url_hash => {:controller => 'katello/react', + :url_hash => {:controller => 'katello/api/v2/subscriptions', :action => 'index'}, :engine => Katello::Engine, :turbolinks => false menu :top_menu, @@ -111,21 +111,10 @@ :action => 'index'}, :engine => Katello::Engine, :turbolinks => false end - if ::Katello::RepositoryTypeManager.enabled?(::Katello::Repository::YUM_TYPE) - menu :top_menu, - :errata, - :caption => N_('Errata'), - :url => '/errata', - :url_hash => {:controller => 'katello/api/v2/errata', - :action => 'index'}, - :engine => Katello::Engine, - :turbolinks => false - end - if ::Katello::RepositoryTypeManager.enabled?(::Katello::Repository::FILE_TYPE) menu :top_menu, :files, :caption => N_('Files'), :url => '/files', @@ -153,10 +142,28 @@ :url => '/packages', :url_hash => {:controller => 'katello/api/v2/packages', :action => 'index'}, :engine => Katello::Engine, :turbolinks => false + + menu :top_menu, + :errata, + :caption => N_('Errata'), + :url => '/errata', + :url_hash => {:controller => 'katello/api/v2/errata', + :action => 'index'}, + :engine => Katello::Engine, + :turbolinks => false + + menu :top_menu, + :module_streams, + :caption => N_('Module Streams'), + :url => '/module_streams', + :url_hash => {:controller => 'katello/api/v2/module_streams', + :action => 'index'}, + :engine => Katello::Engine, + :turbolinks => false end if ::Katello::RepositoryTypeManager.enabled?(::Katello::Repository::PUPPET_TYPE) menu :top_menu, :puppet_modules, @@ -190,21 +197,23 @@ :parent => :hosts_menu, :after => :content_hosts, :turbolinks => false allowed_template_helpers :subscription_manager_configuration_url, :repository_url + extend_template_helpers Katello::KatelloUrlsHelper + search_path_override("Katello") do |resource| "/#{Katello::Util::Model.model_to_controller_path(resource)}/auto_complete_search" end apipie_documented_controllers ["#{Katello::Engine.root}/app/controllers/katello/api/v2/*.rb"] apipie_ignored_controllers %w(::Api::V2::OrganizationsController) parameter_filter ::Host::Managed, :host_collection_ids => [], :content_facet_attributes => [:content_view_id, :lifecycle_environment_id, :content_source_id, :host, :kickstart_repository_id], - :subscription_facet_attributes => [:release_version, :autoheal, :service_level, :host, - {:installed_products => [:product_id, :product_name, :arch, :version]}, :facts, :hypervisor_guest_uuids => []] + :subscription_facet_attributes => [:release_version, :autoheal, :purpose_usage, :purpose_role, :service_level, :host, + {:installed_products => [:product_id, :product_name, :arch, :version]}, :facts, :hypervisor_guest_uuids => [], :purpose_addons => []] parameter_filter Hostgroup, :content_view_id, :lifecycle_environment_id, :content_source_id, :kickstart_repository_id parameter_filter Organization, :label, :service_level parameter_filter SmartProxy, :download_policy, :lifecycle_environment_ids => [] @@ -234,12 +243,20 @@ :onlyif => proc { |proxy| proxy.has_feature?(SmartProxy::PULP_NODE_FEATURE) } end register_custom_status(Katello::ErrataStatus) register_custom_status(Katello::SubscriptionStatus) + register_custom_status(Katello::PurposeSlaStatus) + register_custom_status(Katello::PurposeRoleStatus) + register_custom_status(Katello::PurposeUsageStatus) + register_custom_status(Katello::PurposeAddonsStatus) + register_custom_status(Katello::PurposeStatus) register_custom_status(Katello::TraceStatus) + extend_rabl_template 'api/v2/smart_proxies/main', 'katello/api/v2/smart_proxies/download_policy' + extend_rabl_template 'api/v2/hosts/show', 'katello/api/v2/hosts/host_collections' + extend_page "smart_proxies/show" do |cx| cx.add_pagelet :details_content, :name => _('Storage'), :partial => 'smart_proxies/show/storage', :onlyif => proc { |proxy| proxy.has_feature?(SmartProxy::PULP_FEATURE) || proxy.has_feature?(SmartProxy::PULP_NODE_FEATURE) } @@ -247,15 +264,17 @@ register_facet Katello::Host::ContentFacet, :content_facet do api_view :list => 'katello/api/v2/content_facet/base_with_root', :single => 'katello/api/v2/content_facet/show' api_docs :content_facet_attributes, ::Katello::Api::V2::HostContentsController template_compatibility_properties :content_source_id, :content_source + extend_model ::Katello::Concerns::ContentFacetHostExtensions end register_facet Katello::Host::SubscriptionFacet, :subscription_facet do api_view :list => 'katello/api/v2/subscription_facet/base_with_root', :single => 'katello/api/v2/subscription_facet/show' api_docs :subscription_facet_attributes, ::Katello::Api::V2::HostSubscriptionsController + extend_model ::Katello::Concerns::SubscriptionFacetHostExtensions end if Katello.with_remote_execution? RemoteExecutionFeature.register(:katello_package_install, N_("Katello: Install Package"), :description => N_("Install package via Katello interface"), :provided_inputs => ['package']) RemoteExecutionFeature.register(:katello_package_update, N_("Katello: Update Package"), :description => N_("Update package via Katello interface"), :provided_inputs => ['package']) @@ -263,10 +282,13 @@ RemoteExecutionFeature.register(:katello_group_install, N_("Katello: Install Package Group"), :description => N_("Install package group via Katello interface"), :provided_inputs => ['package']) RemoteExecutionFeature.register(:katello_group_update, N_("Katello: Update Package Group"), :description => N_("Update package group via Katello interface"), :provided_inputs => ['package']) RemoteExecutionFeature.register(:katello_group_remove, N_("Katello: Remove Package Group"), :description => N_("Remove package group via Katello interface"), :provided_inputs => ['package']) RemoteExecutionFeature.register(:katello_errata_install, N_("Katello: Install Errata"), :description => N_("Install errata via Katello interface"), :provided_inputs => ['errata']) RemoteExecutionFeature.register(:katello_service_restart, N_("Katello: Service Restart"), :description => N_("Restart Services via Katello interface"), :provided_inputs => ['helpers']) + RemoteExecutionFeature.register(:katello_module_stream_action, N_("Katello: Module Stream Actions"), + :description => N_("Perform a module stream action via Katello interface"), + :provided_inputs => ['action', 'module_spec', 'options']) allowed_template_helpers :errata end tests_to_skip("AccessPermissionsTest" => [ 'foreman_tasks/api/tasks/callback should have a permission that grants access', @@ -285,9 +307,11 @@ .preload(:content_view, :lifecycle_environment, :subscription_facet) .preload(content_facet: [:bound_repositories, :content_view, :lifecycle_environment]) end register_info_provider Katello::Host::InfoProvider + + medium_providers.register(Katello::ManagedContentMediumProvider) Katello::PermissionCreator.new(self).define add_all_permissions_to_default_roles role 'Register hosts', [