Skip to content

Commit

Permalink
[8.x] [ML] Remove data frame analytics scss files (#199572) (#200639)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `8.x`:
- [[ML] Remove data frame analytics scss files
(#199572)](#199572)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Melissa
Alvarez","email":"melissa.alvarez@elastic.co"},"sourceCommit":{"committedDate":"2024-11-18T19:09:31Z","message":"[ML]
Remove data frame analytics scss files (#199572)\n\n##
Summary\r\n\r\nRelated meta issue:
https://github.com/elastic/kibana/issues/140695\r\n\r\nDFA map legend
changes:\r\n\r\n<img width=\"1160\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/9858e83f-8cf5-4b1c-97d3-2726808eaedc\">\r\n\r\nJob
messages changes:\r\n\r\n<img width=\"1033\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/fff3cdb0-efad-4cfd-bc18-bf60deffad26\">\r\n\r\njob
messages in AD:\r\n\r\n<img width=\"1231\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/4f880be2-1be6-4315-a086-45920c3cb35e\">\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [ ] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [ ] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [ ] Any UI touched in this PR is
usable by keyboard only (learn more\r\nabout [keyboard
accessibility](https://webaim.org/techniques/keyboard/))\r\n- [ ] Any UI
touched in this PR does not create any new axe failures\r\n(run axe in
browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n-
[ ] If a plugin configuration key changed, check if it needs to
be\r\nallowlisted in the cloud and added to the
[docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n-
[ ] This renders correctly on smaller devices using a
responsive\r\nlayout. (You can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n-
[ ] This was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"2c0825f6b13d761b25c2c2978f9f7964d1b95a6b","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":[":ml","release_note:skip","Feature:Data
Frame Analytics","v9.0.0","backport:version","v8.17.0"],"title":"[ML]
Remove data frame analytics scss
files","number":199572,"url":"https://github.com/elastic/kibana/pull/199572","mergeCommit":{"message":"[ML]
Remove data frame analytics scss files (#199572)\n\n##
Summary\r\n\r\nRelated meta issue:
https://github.com/elastic/kibana/issues/140695\r\n\r\nDFA map legend
changes:\r\n\r\n<img width=\"1160\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/9858e83f-8cf5-4b1c-97d3-2726808eaedc\">\r\n\r\nJob
messages changes:\r\n\r\n<img width=\"1033\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/fff3cdb0-efad-4cfd-bc18-bf60deffad26\">\r\n\r\njob
messages in AD:\r\n\r\n<img width=\"1231\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/4f880be2-1be6-4315-a086-45920c3cb35e\">\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [ ] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [ ] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [ ] Any UI touched in this PR is
usable by keyboard only (learn more\r\nabout [keyboard
accessibility](https://webaim.org/techniques/keyboard/))\r\n- [ ] Any UI
touched in this PR does not create any new axe failures\r\n(run axe in
browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n-
[ ] If a plugin configuration key changed, check if it needs to
be\r\nallowlisted in the cloud and added to the
[docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n-
[ ] This renders correctly on smaller devices using a
responsive\r\nlayout. (You can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n-
[ ] This was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"2c0825f6b13d761b25c2c2978f9f7964d1b95a6b"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199572","number":199572,"mergeCommit":{"message":"[ML]
Remove data frame analytics scss files (#199572)\n\n##
Summary\r\n\r\nRelated meta issue:
https://github.com/elastic/kibana/issues/140695\r\n\r\nDFA map legend
changes:\r\n\r\n<img width=\"1160\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/9858e83f-8cf5-4b1c-97d3-2726808eaedc\">\r\n\r\nJob
messages changes:\r\n\r\n<img width=\"1033\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/fff3cdb0-efad-4cfd-bc18-bf60deffad26\">\r\n\r\njob
messages in AD:\r\n\r\n<img width=\"1231\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/4f880be2-1be6-4315-a086-45920c3cb35e\">\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [ ] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [ ] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [ ] Any UI touched in this PR is
usable by keyboard only (learn more\r\nabout [keyboard
accessibility](https://webaim.org/techniques/keyboard/))\r\n- [ ] Any UI
touched in this PR does not create any new axe failures\r\n(run axe in
browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n-
[ ] If a plugin configuration key changed, check if it needs to
be\r\nallowlisted in the cloud and added to the
[docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n-
[ ] This renders correctly on smaller devices using a
responsive\r\nlayout. (You can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n-
[ ] This was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"2c0825f6b13d761b25c2c2978f9f7964d1b95a6b"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Melissa Alvarez <melissa.alvarez@elastic.co>
  • Loading branch information
kibanamachine and alvarezmelissa87 authored Nov 18, 2024
1 parent 852d6d9 commit 31144f5
Show file tree
Hide file tree
Showing 15 changed files with 113 additions and 128 deletions.
3 changes: 1 addition & 2 deletions x-pack/plugins/ml/public/application/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// SASSTODO: Prefix ml selectors instead
.ml-app {
// Sub applications
@import 'data_frame_analytics/index';
@import 'explorer/index'; // SASSTODO: This file needs to be rewritten

// Components
Expand All @@ -16,4 +15,4 @@
@import 'components/job_selector/index';
@import 'components/rule_editor/index'; // SASSTODO: This file overwrites EUI directly

}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const BackToListPanel: FC = () => {
return (
<Fragment>
<EuiCard
className="dfAnalyticsCreationWizard__card"
css={{ width: '300px' }}
icon={<EuiIcon size="xxl" type="list" />}
title={i18n.translate('xpack.ml.dataframe.analytics.create.analyticsListCardTitle', {
defaultMessage: 'Data Frame Analytics',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import type { FC } from 'react';
import React, { Fragment } from 'react';
import { EuiCard, EuiIcon } from '@elastic/eui';
import { EuiCard, EuiIcon, useEuiTheme } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import type { DataFrameAnalysisConfigType } from '@kbn/ml-data-frame-analytics-utils';
import { useMlLink } from '../../../../../contexts/kibana';
Expand All @@ -26,10 +26,14 @@ export const ViewResultsPanel: FC<Props> = ({ jobId, analysisType }) => {
},
});

const {
euiTheme: { size },
} = useEuiTheme();

return (
<Fragment>
<EuiCard
className="dfAnalyticsCreationWizard__card"
css={{ width: `calc(${size.xxl} * 7.5)` }}
icon={<EuiIcon size="xxl" type="visTable" />}
title={i18n.translate('xpack.ml.dataframe.analytics.create.viewResultsCardTitle', {
defaultMessage: 'View Results',
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,17 @@ export const OverallDetails: FC<{
}> = ({ overallDetails }) => (
<EuiFlexGroup alignItems="center" wrap data-test-subj={overallDetails.dataTestSubj}>
{overallDetails.items.map((item) => {
const key = item.title;
if (item.title === 'badge') {
return (
<EuiFlexItem grow={false}>
<EuiFlexItem grow={false} key={key}>
<EuiBetaBadge label={item.description} color="subdued" title={item.title} />
</EuiFlexItem>
);
}

return (
<EuiFlexItem grow={false}>
<EuiFlexItem grow={false} key={key}>
<EuiFlexGroup gutterSize="xs">
<EuiFlexItem grow={false}>
<EuiDescriptionListDescription className="descriptionListTitle">
Expand Down Expand Up @@ -82,7 +83,7 @@ export const Stats = ({ section }: { section: SectionConfig }) => (
<EuiFlexItem grow={false}>
<EuiFlexGroup>
{section.items.map((item) => (
<EuiFlexItem grow={false}>
<EuiFlexItem grow={false} key={item.title}>
<EuiDescriptionListDescription className="descriptionListTitle">
<EuiText size="xs">{item.title}</EuiText>
</EuiDescriptionListDescription>
Expand Down Expand Up @@ -200,10 +201,10 @@ export const ExpandedRowDetailsPane: FC<ExpandedRowDetailsPaneProps> = ({
</EuiTitle>
<EuiSpacer size="xs" />
{progress.items.map((item) => (
<>
<span key={item.title}>
{item.description}
<EuiSpacer size="s" />
</>
</span>
))}
</EuiFlexItem>
<EuiFlexItem grow={3}>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
* 2.0.
*/

import './expanded_row_messages_pane.scss';

import type { FC } from 'react';
import React, { useState, useEffect, useCallback } from 'react';
import React, { useState, useEffect, useCallback, useMemo } from 'react';
import { useEuiTheme } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { css } from '@emotion/react';
import { useMlApi } from '../../../../../contexts/kibana';
import { useRefreshAnalyticsList } from '../../../../common';
import { JobMessages } from '../../../../../components/job_messages';
Expand All @@ -23,6 +23,21 @@ interface Props {

export const ExpandedRowMessagesPane: FC<Props> = ({ analyticsId, dataTestSubj }) => {
const mlApi = useMlApi();
const {
euiTheme: { size },
} = useEuiTheme();

const cssOverride = useMemo(
() =>
css({
padding: `0 ${size.s} ${size.s} ${size.s}`,
'.euiTable': {
backgroundColor: 'transparent',
},
}),
[size.s]
);

const [messages, setMessages] = useState<JobMessage[]>([]);
const [isLoading, setIsLoading] = useState(false);
const [errorMessage, setErrorMessage] = useState('');
Expand Down Expand Up @@ -63,7 +78,7 @@ export const ExpandedRowMessagesPane: FC<Props> = ({ analyticsId, dataTestSubj }
useRefreshAnalyticsList({ onRefresh: getMessages });

return (
<div className="mlExpandedRowJobMessages" data-test-subj={dataTestSubj}>
<div data-test-subj={dataTestSubj} css={cssOverride}>
<JobMessages
messages={messages}
loading={isLoading}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ enum TASK_STATE_COLOR {
stopping = 'hollow',
}

const badgeStyle = {
maxWidth: '100px',
};

export const getTaskStateBadge = (
state: DataFrameAnalyticsStats['state'],
failureReason?: DataFrameAnalyticsStats['failure_reason']
Expand All @@ -58,22 +62,22 @@ export const getTaskStateBadge = (
if (isDataFrameAnalyticsFailed(state) && failureReason !== undefined) {
return (
<EuiToolTip content={failureReason}>
<EuiBadge className="mlTaskStateBadge" color={color}>
<EuiBadge css={badgeStyle} color={color}>
{state}
</EuiBadge>
</EuiToolTip>
);
}

return (
<EuiBadge className="mlTaskStateBadge" color={color}>
<EuiBadge css={badgeStyle} color={color}>
{state}
</EuiBadge>
);
};

export const getJobTypeBadge = (jobType: string) => (
<EuiBadge className="mlTaskStateBadge" color="hollow">
<EuiBadge css={badgeStyle} color="hollow">
{jobType}
</EuiBadge>
);
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 31144f5

Please sign in to comment.