-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Migrate anomaly explorer components from SCSS to Emotion #212793
[ML] Migrate anomaly explorer components from SCSS to Emotion #212793
Conversation
Pinging @elastic/ml-ui (:ml) |
<EuiButtonIcon | ||
size="s" | ||
css={filterButton} | ||
onClick={blurButtonOnClick(() => { | ||
influencerFilter( | ||
influencer.influencerFieldName, | ||
influencer.influencerFieldValue, | ||
'+' | ||
); | ||
})} | ||
iconType="plusInCircle" | ||
aria-label={i18n.translate( | ||
'xpack.ml.anomaliesTable.influencersCell.addFilterAriaLabel', | ||
{ | ||
defaultMessage: 'Add filter', | ||
} | ||
)} | ||
/> |
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.
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.
Done in cafbf1e
const { filterButton } = useEntityCellStyles(); | ||
|
||
const [showAllInfluencers, setShowAllInfluencers] = useState(false); | ||
const toggleAllInfluencers = setShowAllInfluencers.bind(null, (prev) => !prev); |
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.
I'm not sure if bind
is necessary here
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.
Done in cafbf1e
@@ -10,12 +10,12 @@ import React, { useState } from 'react'; | |||
import { i18n } from '@kbn/i18n'; | |||
import type { EuiLinkButtonProps, EuiPopoverProps } from '@elastic/eui'; | |||
import { EuiButtonIcon, EuiPopover, EuiPopoverTitle, EuiText } from '@elastic/eui'; | |||
import './help_popover.scss'; | |||
// import './help_popover.scss'; |
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.
// import './help_popover.scss'; |
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.
Removed in cafbf1e
@@ -2,10 +2,6 @@ | |||
.ml-rule-editor-flyout { | |||
font-size: $euiFontSizeS; | |||
|
|||
.select-rule-action .rule-detector-description-list { |
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 the select-rule-action
is removed, we should also remove it in:
https://github.com/elastic/kibana/blob/main/x-pack/platform/plugins/shared/ml/public/application/components/rule_editor/select_rule_action/select_rule_action.js#L53
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.
Done in cafbf1e
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.
NIT: this is the same as the filterButton
style in x-pack/platform/plugins/shared/ml/public/application/components/entity_cell/entity_cell_styles.ts
. Maybe it could be extracted into something like filter_button_styles
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.
Agree that this would be the ideal approach, with some refactoring to create a separate component for the filter button which is used in several places. But I want to keep the scope of this PR small, and save that refactoring for future work.
@elasticmachine merge upstream |
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.
Left a nitpick, but
@@ -53,10 +55,13 @@ function getAddFilter({ entityName, entityValue, filter }: EntityCellProps) { | |||
/> | |||
</EuiToolTip> | |||
); | |||
} else { |
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.
Nit, we usually return early with null
rather than have it in an else as it is easier to read.
e.g.
if (filter === undefined) {
return null;
}
return (
.....
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.
Done in ac5e22e
@@ -81,8 +86,10 @@ function getRemoveFilter({ entityName, entityValue, filter }: EntityCellProps) { | |||
/> | |||
</EuiToolTip> | |||
); | |||
} else { | |||
return null; |
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 comment as above
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.
Done in ac5e22e
opacity: 0.5, | ||
width: euiTheme.size.base, | ||
height: euiTheme.size.base, | ||
'-webkit-transform': 'translateY(-1px)', |
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.
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.
Removed in ac5e22e
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.
LGTM
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Module Count
Async chunks
History
|
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.
SCSS changes
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.
Latest changes LGTM 👍
Starting backport for target branches: 8.x |
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
Summary
Part of: #140695
Migrates SCSS to emotion for several of the components used across the Anomaly Explorer and Single Metric Viewer.
Removes the following SCSS files:
Components edited: