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] DF Analytics / Transforms: Fix job row actions menu invalid DOM nesting warning #74499

Merged
merged 45 commits into from
Aug 19, 2020

Conversation

walterra
Copy link
Contributor

@walterra walterra commented Aug 6, 2020

Summary

Fixes #63455.

Refactors the action buttons for transforms and analytics job list to no longer produce nested button elements and throw a React error.

Checklist

For maintainers

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 and confirmed the DOM errors are no longer seen. Just left a couple of minor comments.

expect(typeof actions[2].render).toBe('function');
expect(typeof actions[3].render).toBe('function');
// Using `any` for the callback. Somehow the EUI types don't pass
// on the `data-test-subj` attribute correctly. We're interesting
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo! Should be interested.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 74071d9.

color="text"
size="xs"
onClick={clickHandler}
iconType="tableOfContents"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should switch this icon to be consistent with the one in the main DFA jobs list - tableDensityNormal.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Consolidated button icons in c9fc1b2.

canStartStopDataFrameAnalytics={canStartStopDataFrameAnalytics}
/>
),
available: (i: DataFrameAnalyticsListRow) => !isDataFrameAnalyticsRunning(i.stats.state),
Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 Aug 17, 2020

Choose a reason for hiding this comment

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

I think there needs to be a check here for the job being in a failed state to ensure that we don't lose the fix from (https://github.com/elastic/kibana/pull/74710/files)

E.g. !isDataFrameAnalyticsFailed(i.stats.state).

image

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! I carried over the changes related to the stop action rendering but missed this one. Fixed in c9fc1b2.

const action: DataFrameAnalyticsListAction = useMemo(
() => ({
name: () => <StopActionName isDisabled={!canStartStopDataFrameAnalytics} />,
available: (i: DataFrameAnalyticsListRow) => isDataFrameAnalyticsRunning(i.stats.state),
Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 Aug 17, 2020

Choose a reason for hiding this comment

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

Similarly, there might need to be a check to allow force stop for jobs in a failed state.
image

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! I carried over the changes related to the stop action rendering but missed this one. Fixed in c9fc1b2.

@alvarezmelissa87
Copy link
Contributor

Looks good overall. Gave it a test and looks good aside from the comments I left.

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.

Latest changes LGTM ⚡

@walterra walterra requested a review from peteharverson August 19, 2020 07:48
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.

Latest edits LGTM

Comment on lines 396 to 400
/**
* Temp component to have Clone job button with the same look as the other actions.
* Replace with {@link getCloneAction} as soon as all the actions are refactored
* to support EuiContext with a valid DOM structure without nested buttons.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

we probably don't need this comment anymore

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

@kbn/optimizer bundle module count

id value diff baseline
ml 1357 +2 1355
transform 320 +2 318
total +4

async chunks size

id value diff baseline
ml 8.0MB +4.1KB 8.0MB
transform 704.4KB +3.8KB 700.6KB
total +7.9KB

page load bundle size

id value diff baseline
ml 573.5KB +86.0B 573.4KB

History

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

@walterra walterra merged commit e61a4b6 into elastic:master Aug 19, 2020
@walterra walterra deleted the ml-fix-list-action-buttons-3 branch August 19, 2020 14:26
walterra added a commit to walterra/kibana that referenced this pull request Aug 19, 2020
…nesting warning (elastic#74499)

Refactors the action buttons for transforms and analytics job list to no longer produce nested button elements and throw a React error.
gmmorris added a commit to gmmorris/kibana that referenced this pull request Aug 19, 2020
* master: (30 commits)
  [code coverage] always download node before team assignment (elastic#75424)
  [Form lib] Allow new "defaultValue" to be provided when resetting the… (elastic#75302)
  [Logs UI] Add "View in machine learning" links in the anomaly explorer (elastic#74555)
  skip flaky suite (elastic#75440)
  skip flaky suite (elastic#75386)
  [Saved objects] Add support for version on create & bulkCreate when overwriting a document (elastic#75172)
  [Functional]Table Vis increase sleep time in order filter to be applied (elastic#75138)
  MOAR RAM (elastic#75423)
  [Visualize] Horizontal Bar Percentiles Overlapping (elastic#75315)
  [ML] DF Analytics / Transforms: Fix job row actions menu invalid DOM nesting warning (elastic#74499)
  [ML] Inference models management (elastic#74978)
  [Monitoring] Migrate karma tests (elastic#75301)
  [Index template] Add filters to simulate preview (elastic#74497)
  Bump and consolidate dependencies (elastic#75360)
  [Ingest Manager] Fix agent config rollout rate limit to use constants (elastic#75364)
  Update Node.js to version 10.22.0 (elastic#75254)
  [ML] Anomaly Explorer / Single Metric Viewer: Fix error reporting for annotations. (elastic#74953)
  [Discover] Fix histogram cloud tests (elastic#75268)
  Uiactions to navigate to visualize or maps (elastic#74121)
  Use prefix search invis editor field/agg combo box (elastic#75290)
  ...
walterra added a commit that referenced this pull request Aug 20, 2020
…nesting warning (#74499) (#75436)

Refactors the action buttons for transforms and analytics job list to no longer produce nested button elements and throw a React error.
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 Feature:Transforms ML transforms :ml release_note:fix v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ML] DF Analytics / Transforms: job row actions menu throws invalid DOM nesting warning
7 participants