-
Notifications
You must be signed in to change notification settings - Fork 296
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
webpack5 #10735
webpack5 #10735
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What defines this type? Is it webpack itself or something else? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it looked more correct to use |
||
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 %>"); | ||
|
@@ -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 %> | ||
|
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); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This broke the "Sync Status" (
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking into that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's an ERB page, I wonder why we're even loading Katello JS here 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. created #10873 |
||
javascript_include_tag('bastion_katello/bastion_katello') | ||
] | ||
end, | ||
:stylesheet => 'bastion_katello/bastion_katello', | ||
:pages => %w( | ||
activation_keys | ||
|
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.
This looks very similar to what
js_tags_for(requested_plugins)
already does forkatello
, except that this calls it forcommon_index
and the other does it forindex
.I'm trying to understand what
common_index.js
even does. I don't see anything that includes it and it only requiresngreact
. If you don't have this, what happens? If it's needed, can it just be moved into katello'sindex.js
?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.
It loads angular, and since angular is not needed in all of Katello I think we shouldn't move it to index.
Without angular pages are just empty.
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.
That makes sense. Thanks for explaining.