Skip to content

Commit

Permalink
Fixes #37104 - update katello to support webpack5 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MariaAga authored and jeremylenz committed Jan 26, 2024
1 parent cc1b7cc commit 7091b11
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
:class => 'form-control', :name => ks_repo_select_name, :disabled => kickstart_options.empty?
end %>

<script>
KT.hosts.set_media_selection_bindings();
KT.hosts.update_media_enablement();
</script>
<% content_for(:javascripts) do -%>
<script>
KT.hosts.set_media_selection_bindings();
KT.hosts.update_media_enablement();
</script>
<% end -%>

This file was deleted.

2 changes: 0 additions & 2 deletions engines/bastion/app/assets/javascripts/bastion/bastion.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,3 @@

//= require "bastion/features/features.module"
//= require_tree "./features"

//= require "bastion/bastion-bootstrap"
8 changes: 6 additions & 2 deletions engines/bastion/app/views/bastion/layouts/assets.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
<script type="text/javascript">
<script type="module">
angular.module('Bastion.features').value('FeatureSettings', angular.fromJson(<%= SETTINGS[:features].nil? ? {} : SETTINGS[:features].to_json.html_safe %>));
angular.module('Bastion').value('currentLocale', '<%= I18n.locale %>');
angular.module('Bastion').value('CurrentOrganization', "<%= Organization.current.id if Organization.current %>");
Expand All @@ -34,6 +36,8 @@
angular.module('Bastion').value('newHostDetailsUI', "<%= Setting[:host_details_ui] %>");
angular.module('Bastion').value('experimentalLabsSetting', "<%= Setting[:lab_features] %>");
</script>

<%= javascript_include_tag('bastion_katello/bastion_katello', {type: 'module'}) %>
<% Bastion.plugins.each do |name, plugin| %>
<%= include_plugin_js(plugin) %>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}
6 changes: 0 additions & 6 deletions engines/bastion_katello/lib/bastion_katello/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7091b11

Please sign in to comment.