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

[ML] Data Frame Analytics: Fix confusion matrix data grid width. #65818

Merged
merged 9 commits into from
May 13, 2020

Conversation

walterra
Copy link
Contributor

@walterra walterra commented May 8, 2020

Summary

Part of #64418.

  • Fixes an issue where hiding all columns for the confusion matrix would hide the menu item to enable columns again.
  • Replaces resizeHandler based workaround for EuiDataGrid within flex layouts with a CSS based workaround.
  • Moves inline styles to SCSS file and imports that file directly.

Fixes IE11 layout issues:

Before:

image

After:

image

Checklist

For maintainers

@walterra walterra added bug Fixes for quality problems that affect the customer experience :ml v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Feature:Data Frame Analytics ML data frame analytics features v7.8.0 v7.9.0 labels May 8, 2020
@walterra walterra requested review from a team as code owners May 8, 2020 08:09
@walterra walterra self-assigned this May 8, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

padding-top: $euiSize * 4;
/* Workaround for EuiDataGrid within a Flex Layout */
.mlDataFrameAnalyticsClassification {
width: calc(100% - 0px);
Copy link
Contributor

Choose a reason for hiding this comment

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

why do you need calc here? also, keep in mind it's not supported by IE11 properly https://caniuse.com/#feat=calc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The calc is used to work around an issue with EuiDataGrid and percentage based width of the wrapping container when used in flex layouts. The original issue in the EUI repo is here: elastic/eui#2618

calc in IE has limitations but this one should work hopefully. I cannot test it at the moment because it seems Kibana is broken for IE11 on master. Will try again once I hear back from QA team.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Managed to test in IE. Pushed some fixes in de5e1c0 and updated the PR description with before and after screenshots.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After the refactor to not use flex anymore for the layout, the calc() is no longer necessary. Removed in 7905eec.


.mlDataFrameAnalyticsClassification__actualLabel {
min-width: 70px;
padding-top: $euiSize * 4.2;
Copy link
Contributor

Choose a reason for hiding this comment

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

why 4.2? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's to tweak the vertical alignment of "Actual label" against the first row of the data grid. The version before that PR used EuiFormRow + custom padding. I removed the form row because it was used out of context and adjusted the padding.

image

Copy link
Contributor

Choose a reason for hiding this comment

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

have you tried to make it as :before pseudo-element for the header row to avoid this padding?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm not sure that would be feasible to do: The header row is rendered by EuiDataGrid so that would mean either reusing some EUI classes and using a pseudo element would move the text to the SCSS where we cannot use translation (unless I move the style specification back into JSX?). Note this is just about adjusted an already existing padding value, it's not something this PR introduced; the main goal of this PR is to provide a fix for the broken data grid menu and fix IE. I changed the value to $euiSize * 4 + $euiSizeXS; to avoid having the comma in d67b062.

@walterra walterra requested a review from peteharverson May 8, 2020 13:59
@walterra
Copy link
Contributor Author

@elasticmachine merge upstream

@walterra
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

Tested on Chrome and IE11 and LGTM

Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 left a comment

Choose a reason for hiding this comment

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

Gave this a test and LGTM ⚡

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

Copy link
Contributor

@darnautov darnautov left a comment

Choose a reason for hiding this comment

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

LGTM 👍

color="primary"
href={`${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-dfanalytics-evaluate.html#ml-dfanalytics-classification`}
>
{i18n.translate(
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: could be replaced with FormattedMessage

@walterra walterra merged commit a149915 into elastic:master May 13, 2020
@walterra walterra deleted the ml-analytics-fix-data-grid-width branch May 13, 2020 07:30
walterra added a commit to walterra/kibana that referenced this pull request May 13, 2020
…stic#65818)

- Fixes an issue where hiding all columns for the confusion matrix would hide the menu item to enable columns again.
- Replaces resizeHandler based workaround for EuiDataGrid within flex layouts with a CSS based workaround.
- Moves inline styles to SCSS file and imports that file directly.
- Fixes IE11 layout issues.
walterra added a commit that referenced this pull request May 13, 2020
) (#66355)

- Fixes an issue where hiding all columns for the confusion matrix would hide the menu item to enable columns again.
- Replaces resizeHandler based workaround for EuiDataGrid within flex layouts with a CSS based workaround.
- Moves inline styles to SCSS file and imports that file directly.
- Fixes IE11 layout issues.
walterra added a commit that referenced this pull request May 13, 2020
) (#66354)

- Fixes an issue where hiding all columns for the confusion matrix would hide the menu item to enable columns again.
- Replaces resizeHandler based workaround for EuiDataGrid within flex layouts with a CSS based workaround.
- Moves inline styles to SCSS file and imports that file directly.
- Fixes IE11 layout issues.
v1v added a commit to v1v/kibana that referenced this pull request May 13, 2020
* upstream/master: (223 commits)
  [Ingest] Support root level yaml variables in agent stream template (elastic#66120)
  [Snapshot Restore] Fix error when deleting snapshots behind reverse proxy (elastic#66147)
  [Lens] fix empty state for pie (elastic#66206)
  [APM] Improve e2e tests (elastic#66373)
  [ML] Data Frame Analytics: Fix steps to be named phases. (elastic#65855)
  [Discover] Encode context link filter part (elastic#63831)
  [APM] Scope APM alert creation to environment (elastic#65681)
  Move Kibana Usage collectors outside the telemetry plugin (elastic#65663)
  [ML] Data Frame Analytics: Fix confusion matrix data grid width. (elastic#65818)
  Switch to core application service (elastic#63443)
  Removes use of prefer_v2_templates (elastic#66316)
  [Maps] handle case where fit to bounds does not match any documents (elastic#66307)
  log error instead of throw (elastic#66254)
  [plugin-helpers] remove outdated postinstall task (elastic#66324)
  Spaces - migrate default space and enter space view to KP (elastic#66098)
  [APM] Change plugin id for `apm_oss` to `apmOss` (elastic#66164)
  [Maps] convert map_selectors to TS (elastic#65905)
  [uptime/usage-collector] add missing await (elastic#66079)
  [Ingest] Add additional attributes to the Datasources Saved Object (elastic#66127)
  [Endpoint]EMT-339: add new policy response schema (elastic#66264)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Data Frame Analytics ML data frame analytics features :ml release_note:skip Skip the PR/issue when compiling release notes v7.8.0 v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants