Skip to content
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

Merged

Conversation

bmclaughlin
Copy link
Contributor

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:
1490640-before

After:
1490640-after

@miq-bot add_labels bug, compute/infrastructure

https://bugzilla.redhat.com/show_bug.cgi?id=1490640

@bmclaughlin
Copy link
Contributor Author

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).

@mzazrivec
Copy link
Contributor

@skateman review please?

Copy link
Member

@skateman skateman left a 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'
Copy link
Member

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?

Copy link
Member

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
Copy link
Member

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
Copy link
Member

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 {
Copy link
Member

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]}"
Copy link
Member

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
Copy link
Member

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'
Copy link
Member

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'
Copy link
Member

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'

@@ -18,4 +18,6 @@
spice-html5-bower/spiceHTML5/spicearraybuffer.js
webmks.css
webmks.js
remote_consoles/unified_styles.css
remote_consoles/fullscreen_btn.js
Copy link
Member

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.

@bmclaughlin bmclaughlin force-pushed the ctl-alt-del-button-for-webmks-consoles branch 2 times, most recently from e03ed6b to 8e5662c Compare November 9, 2017 18:23
@@ -78,6 +78,7 @@
//= require miq_explorer
//= require qs
//= require miq_timeline
//= require remote_consoles/remote_console
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, thanks!

@bmclaughlin bmclaughlin force-pushed the ctl-alt-del-button-for-webmks-consoles branch from 8e5662c to cd894e3 Compare November 9, 2017 18:47
@@ -0,0 +1,29 @@
//= require jquery
Copy link
Member

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

@bmclaughlin bmclaughlin force-pushed the ctl-alt-del-button-for-webmks-consoles branch 3 times, most recently from a33e8f6 to 15da5f9 Compare November 9, 2017 19:28
@miq-bot
Copy link
Member

miq-bot commented Nov 10, 2017

This pull request is not mergeable. Please rebase and repush.

@bmclaughlin bmclaughlin force-pushed the ctl-alt-del-button-for-webmks-consoles branch from 15da5f9 to 213fbf2 Compare November 10, 2017 17:57
@@ -0,0 +1,16 @@
#remote-console {
Copy link
Member

@skateman skateman Nov 10, 2017

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

@bmclaughlin bmclaughlin force-pushed the ctl-alt-del-button-for-webmks-consoles branch from 213fbf2 to c4814f6 Compare November 13, 2017 14:58
@miq-bot
Copy link
Member

miq-bot commented Nov 13, 2017

Checked commit bmclaughlin@c4814f6 with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0
1 file checked, 0 offenses detected
Everything looks fine. 🍪

@skateman
Copy link
Member

@bmclaughlin looks good, will test it against all console types

Copy link
Member

@skateman skateman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Seal of Approval

@mzazrivec mzazrivec self-assigned this Nov 20, 2017
@mzazrivec mzazrivec added this to the Sprint 74 Ending Nov 27, 2017 milestone Nov 20, 2017
@mzazrivec mzazrivec merged commit eb1c41a into ManageIQ:master Nov 20, 2017
@bmclaughlin bmclaughlin deleted the ctl-alt-del-button-for-webmks-consoles branch November 20, 2017 16:01
simaishi pushed a commit that referenced this pull request Nov 20, 2017
…ks-consoles

Use the unified console style for WebMKS consoles
(cherry picked from commit eb1c41a)

https://bugzilla.redhat.com/show_bug.cgi?id=1515415
@simaishi
Copy link
Contributor

Gaprindashvili backport details:

$ git log -1
commit 65cedc39a004d8c3cdd92ce42052f39f30589816
Author: Milan Zázrivec <mzazrivec@redhat.com>
Date:   Mon Nov 20 09:32:51 2017 +0100

    Merge pull request #2662 from bmclaughlin/ctl-alt-del-button-for-webmks-consoles
    
    Use the unified console style for WebMKS consoles
    (cherry picked from commit eb1c41aa5c6cc9acd514171bee2db36799ae0fce)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1515415

simaishi pushed a commit that referenced this pull request Nov 28, 2017
…ks-consoles

Use the unified console style for WebMKS consoles
(cherry picked from commit eb1c41a)

https://bugzilla.redhat.com/show_bug.cgi?id=1515416
@simaishi
Copy link
Contributor

Fine backport details:

$ git log -1
commit dfe70c0e7436b6b057bc5d8faea60f8015505ca8
Author: Milan Zázrivec <mzazrivec@redhat.com>
Date:   Mon Nov 20 09:32:51 2017 +0100

    Merge pull request #2662 from bmclaughlin/ctl-alt-del-button-for-webmks-consoles
    
    Use the unified console style for WebMKS consoles
    (cherry picked from commit eb1c41aa5c6cc9acd514171bee2db36799ae0fce)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1515416

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants