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] [File data visualizer] Removing scss files #178314

Conversation

jgowdyelastic
Copy link
Member

@jgowdyelastic jgowdyelastic commented Mar 8, 2024

Removes all scss files in favour of inline css.
Fixes misalignment of icons on the landing page.

Before:

image

After:
image

Note, it does leave in the scss file in the a root of the app which is used to import styles from common data visualizer components which are used in the file data visualizer for displaying stats.

@jgowdyelastic jgowdyelastic self-assigned this Mar 8, 2024
@jgowdyelastic jgowdyelastic marked this pull request as ready for review March 8, 2024 13:32
@jgowdyelastic jgowdyelastic requested review from a team as code owners March 8, 2024 13:32
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

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 LGTM

Copy link
Contributor

@MichaelMarcialis MichaelMarcialis left a comment

Choose a reason for hiding this comment

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

Left a few comments, but nothing worth blocking you over. Assuming you're able to address them, I'm approving now.

@@ -84,7 +84,7 @@ export const ResultsView: FC<Props> = ({
</EuiFlexGroup>

<EuiSpacer size="m" />
<div className="results">
<div>
Copy link
Contributor

@MichaelMarcialis MichaelMarcialis Mar 11, 2024

Choose a reason for hiding this comment

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

With the removal of this divs class, I imagine you can also remove the div itself, as it appears to be extraneous at the moment.

Comment on lines 41 to 46
css={{
width: '96px',
height: '96px',
marginLeft: euiThemeVars.euiSizeXL,
marginRight: euiThemeVars.euiSizeL,
}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be reformatted for Emotion? Something like:

Suggested change
css={{
width: '96px',
height: '96px',
marginLeft: euiThemeVars.euiSizeXL,
marginRight: euiThemeVars.euiSizeL,
}}
css={css`
width: 96px;
height: 96px;
${logicalCSS('margin-left', euiThemeVars.euiSizeXL)}
${logicalCSS('margin-right', euiThemeVars.euiSizeL)}
`}

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the review. I'm not sure I understand the advantage of using a template literal over an object for these styles?
Looking at the generated css, it's basically the same.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, technically it'll result in the same outcome. I was just thinking in terms of consistency in the writing of styles. That said, it's not a deal-breaker by any means. If ya'll prefer to write your styles in a mix of formats, I'll defer to you.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree consistency is better. I've switched away from using template literals in this whole PR in favour of plain objects, which read better to me.
Updated in 584db08

@@ -56,11 +57,11 @@ export class Failures extends Component<Props, State> {
}
paddingSize="m"
>
<div className="failure-list">
<div css={{ maxHeight: '200px', overflowY: 'auto' }}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question as above. Reformat for Emotion?

Suggested change
<div css={{ maxHeight: '200px', overflowY: 'auto' }}>
<div css={css`
${logicalCSS('max-height', '200px')}
overflow-y: auto;
`}>

{this._renderPaginationControl()}
{this.props.failedDocs.slice(startIndex, endIndex).map(({ item, reason, doc }) => (
<div key={item}>
<div className="error-message">
<div css={{ color: euiThemeVars.euiColorDanger }}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question as above. Reformat for Emotion?

Suggested change
<div css={{ color: euiThemeVars.euiColorDanger }}>
<div css={css`
color: ${euiThemeVars.euiColorDanger};
`}>

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
dataVisualizer 654.7KB 653.4KB -1.3KB

History

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

cc @jgowdyelastic

@jgowdyelastic jgowdyelastic merged commit d5b4f9b into elastic:main Mar 12, 2024
18 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:File and Index Data Viz ML file and index data visualizer :ml release_note:fix v8.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants