diff --git a/app/views/overrides/activation_keys/_host_synced_content_select.html.erb b/app/views/overrides/activation_keys/_host_synced_content_select.html.erb index 50ca63e261b..7882ffbd952 100644 --- a/app/views/overrides/activation_keys/_host_synced_content_select.html.erb +++ b/app/views/overrides/activation_keys/_host_synced_content_select.html.erb @@ -23,7 +23,9 @@ :class => 'form-control', :name => ks_repo_select_name, :disabled => kickstart_options.empty? end %> - +<% content_for(:javascripts) do -%> + +<% end -%> \ No newline at end of file diff --git a/engines/bastion/app/assets/javascripts/bastion/bastion-bootstrap.js b/engines/bastion/app/assets/javascripts/bastion/bastion-bootstrap.js deleted file mode 100644 index 7dc4483000d..00000000000 --- a/engines/bastion/app/assets/javascripts/bastion/bastion-bootstrap.js +++ /dev/null @@ -1,17 +0,0 @@ -angular.element(document).ready(function () { - angular.bootstrap(document, BASTION_MODULES); -}); - -BASTION_MODULES = [ - 'angular-blocks', - 'ngAnimate', - 'ngSanitize', - 'templates', - 'ui.bootstrap', - 'ui.bootstrap.tpls', - 'Bastion.auth', - 'Bastion.menu', - 'Bastion.i18n', - 'Bastion.features', - 'Bastion.routing' -]; diff --git a/engines/bastion/app/assets/javascripts/bastion/bastion.js b/engines/bastion/app/assets/javascripts/bastion/bastion.js index 5891871f2b9..99fecf240d3 100644 --- a/engines/bastion/app/assets/javascripts/bastion/bastion.js +++ b/engines/bastion/app/assets/javascripts/bastion/bastion.js @@ -36,5 +36,3 @@ //= require "bastion/features/features.module" //= require_tree "./features" - -//= require "bastion/bastion-bootstrap" diff --git a/engines/bastion/app/views/bastion/layouts/assets.html.erb b/engines/bastion/app/views/bastion/layouts/assets.html.erb index 822828d43d1..cdaa5ddc8b3 100644 --- a/engines/bastion/app/views/bastion/layouts/assets.html.erb +++ b/engines/bastion/app/views/bastion/layouts/assets.html.erb @@ -10,11 +10,13 @@ <% end %> <% content_for(:javascripts) do %> - <%= javascript_include_tag 'bastion/bastion' %> + + <%= javascript_tag("window.tfm.tools.loadPluginModule('/webpack/katello','katello','./common_index');".html_safe) %> + <%= javascript_include_tag('bastion/bastion', {type: 'module'})%> <% if File.exist?("#{Bastion::Engine.root}/vendor/assets/javascripts/#{Bastion.localization_path(I18n.locale)}") %> <%= javascript_include_tag(Bastion.localization_path(I18n.locale)) %> <% end %> - + + <%= javascript_include_tag('bastion_katello/bastion_katello', {type: 'module'}) %> <% Bastion.plugins.each do |name, plugin| %> <%= include_plugin_js(plugin) %> <% end %> diff --git a/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion-katello-bootstrap.js b/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion-katello-bootstrap.js index ba81daddfbc..307f7396cb8 100644 --- a/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion-katello-bootstrap.js +++ b/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion-katello-bootstrap.js @@ -1,29 +1,45 @@ -BASTION_MODULES.push( - 'Bastion.capsule-content', - 'Bastion.pulp-primary', - 'Bastion.activation-keys', - 'Bastion.architectures' , - 'Bastion.common', - 'Bastion.content-views', - 'Bastion.content-views.versions', - 'Bastion.debs', - 'Bastion.docker-tags', - 'Bastion.files', - 'Bastion.ansible-collections', - 'Bastion.hosts', - 'Bastion.module-streams', - 'Bastion.environments', - 'Bastion.content-credentials', - 'Bastion.hosts', - 'Bastion.capsules', - 'Bastion.organizations', - 'Bastion.products', - 'Bastion.repositories', - 'Bastion.subscriptions', - 'Bastion.sync-plans', - 'Bastion.http-proxies', - 'Bastion.host-collections', - 'Bastion.content-hosts', - 'Bastion.tasks', - 'Bastion.settings' -); +var BASTION_MODULES = [ + 'angular-blocks', + 'ngAnimate', + 'ngSanitize', + 'templates', + 'ui.bootstrap', + 'ui.bootstrap.tpls', + 'Bastion.auth', + 'Bastion.menu', + 'Bastion.i18n', + 'Bastion.features', + 'Bastion.routing', + 'Bastion.capsule-content', + 'Bastion.pulp-primary', + 'Bastion.activation-keys', + 'Bastion.architectures', + 'Bastion.common', + 'Bastion.content-views', + 'Bastion.content-views.versions', + 'Bastion.debs', + 'Bastion.docker-tags', + 'Bastion.files', + 'Bastion.ansible-collections', + 'Bastion.hosts', + 'Bastion.module-streams', + 'Bastion.environments', + 'Bastion.content-credentials', + 'Bastion.hosts', + 'Bastion.capsules', + 'Bastion.organizations', + 'Bastion.products', + 'Bastion.repositories', + 'Bastion.subscriptions', + 'Bastion.sync-plans', + 'Bastion.http-proxies', + 'Bastion.host-collections', + 'Bastion.content-hosts', + 'Bastion.tasks', + 'Bastion.settings' +]; + +// Check if the document has already been bootstrapped. +if (!angular.element(document).injector()) { + angular.bootstrap(document, BASTION_MODULES); +} diff --git a/engines/bastion_katello/lib/bastion_katello/engine.rb b/engines/bastion_katello/lib/bastion_katello/engine.rb index 3803aca955c..9472a728980 100644 --- a/engines/bastion_katello/lib/bastion_katello/engine.rb +++ b/engines/bastion_katello/lib/bastion_katello/engine.rb @@ -14,12 +14,6 @@ class Engine < ::Rails::Engine Bastion.register_plugin( :name => 'bastion_katello', - :javascript => proc do - [ - javascript_include_tag(*webpack_asset_paths('katello:common', :extension => 'js'), "data-turbolinks-track" => true), - javascript_include_tag('bastion_katello/bastion_katello') - ] - end, :stylesheet => 'bastion_katello/bastion_katello', :pages => %w( activation_keys