-
Notifications
You must be signed in to change notification settings - Fork 357
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
Use the unified console style for WebMKS consoles #2662
Use the unified console style for WebMKS consoles #2662
Conversation
The failing codeclimate checks are in code extracted to an included file and the failed checks are intended (browser specific function calls with similar names, the default switch statement is first followed by browser specific cases). |
@skateman review please? |
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.
The remote consoles in general are using a fully custom view, i.e. without the application.html.haml
on purpose. We don't want to load all the unnecessary JS that powers our angular-based stuff in a popup that's totally isolated.
= stylesheet_link_tag 'webmks' | ||
= javascript_include_tag 'jquery/dist/jquery.js', 'jquery-ui/jquery-ui.js', 'webmks' | ||
= stylesheet_link_tag 'application', 'webmks' | ||
= javascript_include_tag 'application', 'webmks' |
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.
Why would you want to include our whole JS codebase for remote consoles?
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.
Same as above:
= javascript_include_tag 'jquery/dist/jquery.js', 'jquery-ui/jquery-ui.js', 'webmks', 'remote_console'
@@ -78,6 +78,7 @@ | |||
//= require miq_explorer | |||
//= require qs | |||
//= require miq_timeline | |||
//= require remote_consoles/fullscreen_btn |
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.
Remove this line please, we don't want this in the global JS
@@ -0,0 +1,29 @@ | |||
//= require jquery |
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.
You don't need the jquery here, we're including it explicitly later. Also rename this file to something more "generic", like remote_console.js
and move it one folder up.
@@ -0,0 +1,16 @@ | |||
#remote-console { |
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.
As with the JS, rename this file and move it up...
}); | ||
|
||
}); | ||
= javascript_include_tag 'application', "remote_consoles/#{@console[:type]}" |
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.
= javascript_include_tag 'jquery/dist/jquery.js', "remote_consoles/#{@console[:type]}", "remote_console"
@@ -0,0 +1,9 @@ | |||
%footer |
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.
Can this be also something more "generic"? Like remote_console_footer
?
@@ -4,16 +4,23 @@ | |||
%title | |||
= _('%{product_name} WebMKS Remote Console') % {:product_name => I18n.t('product.name')} | |||
= favicon_link_tag | |||
= stylesheet_link_tag 'webmks' | |||
= javascript_include_tag 'jquery/dist/jquery.js', 'jquery-ui/jquery-ui.js', 'webmks' | |||
= stylesheet_link_tag 'application', 'webmks' |
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's fine, CSS is OK to be global.
= stylesheet_link_tag 'webmks' | ||
= javascript_include_tag 'jquery/dist/jquery.js', 'jquery-ui/jquery-ui.js', 'webmks' | ||
= stylesheet_link_tag 'application', 'webmks' | ||
= javascript_include_tag 'application', 'webmks' |
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.
Same as above:
= javascript_include_tag 'jquery/dist/jquery.js', 'jquery-ui/jquery-ui.js', 'webmks', 'remote_console'
config/initializers/assets.rb
Outdated
@@ -18,4 +18,6 @@ | |||
spice-html5-bower/spiceHTML5/spicearraybuffer.js | |||
webmks.css | |||
webmks.js | |||
remote_consoles/unified_styles.css | |||
remote_consoles/fullscreen_btn.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.
These lines make sure that the assets are reachable from javascript_include_tag
and stylesheet_link_tag
. You don't need the CSS as we're having this through application.css
.
e03ed6b
to
8e5662c
Compare
@@ -78,6 +78,7 @@ | |||
//= require miq_explorer | |||
//= require qs | |||
//= require miq_timeline | |||
//= require remote_consoles/remote_console |
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.
you don't need this if you don't include the application
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.
good catch, thanks!
8e5662c
to
cd894e3
Compare
@@ -0,0 +1,29 @@ | |||
//= require jquery |
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.
you don't need this, and move the file up by one folder, I won't expect any other JS code here
a33e8f6
to
15da5f9
Compare
This pull request is not mergeable. Please rebase and repush. |
15da5f9
to
213fbf2
Compare
@@ -0,0 +1,16 @@ | |||
#remote-console { |
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.
the name of this file 😉 please 🐶 a folder up
213fbf2
to
c4814f6
Compare
Checked commit bmclaughlin@c4814f6 with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0 |
@bmclaughlin looks good, will test it against all console types |
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.
…ks-consoles Use the unified console style for WebMKS consoles (cherry picked from commit eb1c41a) https://bugzilla.redhat.com/show_bug.cgi?id=1515415
Gaprindashvili backport details:
|
…ks-consoles Use the unified console style for WebMKS consoles (cherry picked from commit eb1c41a) https://bugzilla.redhat.com/show_bug.cgi?id=1515416
Fine backport details:
|
Makes the appearance of the WebMKS console consistent with our other consoles as well as simplifying access to full screen and ctl-alt-del button sequence for the user.
Before:
After:
@miq-bot add_labels bug, compute/infrastructure
https://bugzilla.redhat.com/show_bug.cgi?id=1490640