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

Fix chromeless NP apps not using full page width #54550

Merged
merged 6 commits into from
Jan 14, 2020

Conversation

pgayvallet
Copy link
Contributor

Summary

Fix #54472

  • add hidden-chrome class on app-wrapper when displaying a chromeless NP app
  • (unrelated to fix) also wire the chrome.getApplicationClasses$() to the application container as this was also missing from NP app rendering

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

- [ ] This was checked for breaking API changes and was labeled appropriately
- [ ] This includes a feature addition or change that requires a release note and was labeled appropriately

@pgayvallet pgayvallet added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:New Platform v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.6.0 labels Jan 13, 2020
@pgayvallet pgayvallet requested a review from a team as a code owner January 13, 2020 09:05
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

Comment on lines -71 to +72
<div className="application">{appUi}</div>
<AppContainer classes$={chrome.getApplicationClasses$()}>{appUi}</AppContainer>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I fixed this in the same PR as we missed it ( the chrome applicationClasses were only properly used when rendering legacy apps), however I did not add functional tests for this, as I'm not sure what the actual usage should be. Tell me if unit test are not enough.

@@ -127,7 +127,7 @@ export class ChromeService {
)
)
);
this.isVisible$ = combineLatest(this.appHidden$, this.toggleHidden$).pipe(
this.isVisible$ = combineLatest([this.appHidden$, this.toggleHidden$]).pipe(
Copy link
Contributor

Choose a reason for hiding this comment

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

Did it change any logic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, changed it because the previous signature is deprecated.

import React from 'react';
import { Observable } from 'rxjs';
import useObservable from 'react-use/lib/useObservable';
import cn from 'classnames';
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: other code in the repo uses import classnames/classNames from 'classnames';


const wrapperWidth = await getAppWrapperWidth();
const windowWidth = (await browser.getWindowSize()).width;
expect(wrapperWidth).to.eql(windowWidth);
Copy link
Contributor

Choose a reason for hiding this comment

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

I haven't tried yet, but probably it's safer to test with Percy in visual_regression setup.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just tried it, however it seems it needs a specific configuration and/or can't be properly used from the plugin_functional test suite, or at least I did not achieve to (the snapshot fails). As the test is pretty simple and only checks a dom element's width, I think it's acceptable for now.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@pgayvallet pgayvallet merged commit f71142d into elastic:master Jan 14, 2020
pgayvallet added a commit to pgayvallet/kibana that referenced this pull request Jan 14, 2020
* add missing conditional classes on app-wrapper and application containers

* update snapshot

* refactor and add unit tests for service

* typo

* use consistent classNames naming
pgayvallet added a commit that referenced this pull request Jan 14, 2020
* add missing conditional classes on app-wrapper and application containers

* update snapshot

* refactor and add unit tests for service

* typo

* use consistent classNames naming
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jan 14, 2020
* upstream/master: (26 commits)
  Take page offset into account too (elastic#54567)
  [APM] Support error.{log,exception}.stacktrace.classname (elastic#54577)
  Np migration tsvb route validation (elastic#51850)
  [ML] MML calculator enhancements for multi-metric job wizard  (elastic#54573)
  [SIEM] Fix Inspect query 'request timestamp' value changes when curso… (elastic#54223)
  Fix chromeless NP apps not using full page width (elastic#54550)
  Remove extraneous public import to prevent failing Kibana startup (elastic#54676)
  [Uptime] Temporarily skip flakey tests (elastic#54675)
  Skip failing uptime tests
  Create UI for alerting and actions plugin (elastic#48959)
  [dev/build/sass] build stylesheets for disabled plugins too (elastic#54654)
  [SIEM] Use bulk actions API when updating or deleting rules (elastic#54521)
  Support "Deprecated" label in advanced settings (elastic#54539)
  [Maps] add text halo color and width style properties (elastic#53827)
  Service Map Data API at Runtime (elastic#54027)
  [SIEM] Detection Engine Create Rule Design Review #1 (elastic#54442)
  Skip flaky test
  [Canvas] Enable Embeddable maps (elastic#53971)
  [SIEM][Detection Engine] Increases the number or rules you can view on a single page (elastic#54628)
  uiSettings - use validation field for image field maxSize (elastic#54522)
  ...
jkelastic pushed a commit to jkelastic/kibana that referenced this pull request Jan 17, 2020
* add missing conditional classes on app-wrapper and application containers

* update snapshot

* refactor and add unit tests for service

* typo

* use consistent classNames naming
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:New Platform release_note:skip Skip the PR/issue when compiling release notes Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.6.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chromeless app container should occupy entire screen
4 participants