Skip to content

Commit

Permalink
Upgrade EUI to v41.0.0 (#117242)
Browse files Browse the repository at this point in the history
* eui to v41.0.0

* update eui i18n tokens

* sass tokens

* EuiLoadingKibana

* EuiCodeEditor

* subdued

* betaBadgeProps

* EuiCodeEditor null-loader

* src secondary -> success

* [enterprise_search] Deprecate 'secondary' color prop

* [apm] Deprecate 'secondary' color prop

* [canvas] Deprecate 'secondary' color prop

* [cases] Deprecate 'secondary' color prop

* [cross_cluster_replication] Deprecate 'secondary' color prop

* [data_enhanced] Deprecate 'secondary' color prop

* [data_visualizer] Deprecate 'secondary' color prop

* [fleet] Deprecate 'secondary' color prop

* [index_management] Deprecate 'secondary' color prop

* [infra] Deprecate 'secondary' color prop

* [ingest_pipelines] Deprecate 'secondary' color prop

* [maps] Deprecate 'secondary' color prop

* [ml] Deprecate 'secondary' color prop

* [monitoring] Deprecate 'secondary' color prop

* [observability] Deprecate 'secondary' color prop

NB: conditional became `type === 'success' ? 'success' : type` after find&replace, which felt fairly redundant, so I simplified it

* [osquery] Deprecate 'secondary' color prop

* [painless_lab] Deprecate 'secondary' color prop

* [remote_clusters] Deprecate 'secondary' color prop

* [rollup] Deprecate 'secondary' color prop

* [security] Deprecate 'secondary' color prop

* [security_solution] Deprecate 'secondary' color prop

NB: several conditional became `type === 'success' ? 'success' : type` after find&replace, which felt fairly redundant, so I simplified them

* [snapshot_restore] Deprecate 'secondary' color prop

* [spaces] Deprecate 'secondary' color prop

* [transform] Deprecate 'secondary' color prop

* [triggers_actions_ui] Deprecate 'secondary' color prop

* [uptime] Deprecate 'secondary' color prop

* [watcher] Deprecate 'secondary' color prop

* [infra] replace ambiguous 'secondary' color

- GaugesSectionVis doesn't appear to use the color property but it's required by the SeriesOverrides types, so changing it just in case

* [examples] Deprecate 'secondary' color prop

* [uptime] deprecate 'subdued' prop on EuiButtonIcon

* revert EuiKeyPadMenuItem betaBadge props

* mobileOptions

* examples/ updates

* fix brace import

* fix type exports

* update expressions_explorer requiredBundles

* remove make_id mocks

* snapshot updates

* fix import 🤦

* Fix `ReferenceError: ace is not defined` Jest failures

* Remove unused brace import (?)

- Assuming here, as no code editor is actually being used in this file

* Fix failing Jest test due to EuiCodeEditor moving to es_ui_shared plugin

+ minor cleanup of `jest.mock()`s

* Fix failing Jest test due to snapshot update

* Fix failing `TypeError: Cannot read properties of undefined (reading 'euiBorderRadius')` Jest test

- since this is being mount()'d, EuiThemeProvider as a wrapper is needed to prevent the failure

* access uiSettings

* Move react-ace dependency into kbn-ui-shared-deps-npm

* Revert App Search shenanigans

- caused local unsaved changes shenanigans, somehow

* secondary -> success

Co-authored-by: Constance Chen <constance.chen.3@gmail.com>
Co-authored-by: Chandler Prall <chandler.prall@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Constance Chen <constance.chen@elastic.co>
  • Loading branch information
5 people authored and dmlemeshko committed Nov 29, 2021
1 parent 864fa56 commit 341ad3a
Show file tree
Hide file tree
Showing 246 changed files with 524 additions and 474 deletions.
2 changes: 1 addition & 1 deletion examples/expressions_explorer/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
},
"requiredPlugins": ["expressions", "inspector", "uiActions", "developerExamples"],
"optionalPlugins": [],
"requiredBundles": []
"requiredBundles": ["kibanaReact"]
}
69 changes: 37 additions & 32 deletions examples/expressions_explorer/public/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,61 +18,66 @@ import {
EuiText,
EuiLink,
} from '@elastic/eui';
import { AppMountParameters } from '../../../src/core/public';
import { AppMountParameters, IUiSettingsClient } from '../../../src/core/public';
import { ExpressionsStart } from '../../../src/plugins/expressions/public';
import { Start as InspectorStart } from '../../../src/plugins/inspector/public';
import { RunExpressionsExample } from './run_expressions';
import { RenderExpressionsExample } from './render_expressions';
import { ActionsExpressionsExample } from './actions_and_expressions';
import { UiActionsStart } from '../../../src/plugins/ui_actions/public';
import { ActionsExpressionsExample2 } from './actions_and_expressions2';
import { createKibanaReactContext } from '../../../src/plugins/kibana_react/public';

interface Props {
expressions: ExpressionsStart;
inspector: InspectorStart;
actions: UiActionsStart;
uiSettings: IUiSettingsClient;
}

const ExpressionsExplorer = ({ expressions, inspector, actions }: Props) => {
const ExpressionsExplorer = ({ expressions, inspector, actions, uiSettings }: Props) => {
const { Provider: KibanaReactContextProvider } = createKibanaReactContext({ uiSettings });
return (
<EuiPage>
<EuiPageBody>
<EuiPageHeader>Expressions Explorer</EuiPageHeader>
<EuiPageContent>
<EuiPageContentBody>
<EuiText>
<p>
There are a couple of ways to run the expressions. Below some of the options are
demonstrated. You can read more about it{' '}
<EuiLink
href={
'https://github.com/elastic/kibana/blob/main/src/plugins/expressions/README.asciidoc'
}
>
here
</EuiLink>
</p>
</EuiText>
<KibanaReactContextProvider>
<EuiPage>
<EuiPageBody>
<EuiPageHeader>Expressions Explorer</EuiPageHeader>
<EuiPageContent>
<EuiPageContentBody>
<EuiText>
<p>
There are a couple of ways to run the expressions. Below some of the options are
demonstrated. You can read more about it{' '}
<EuiLink
href={
'https://github.com/elastic/kibana/blob/main/src/plugins/expressions/README.asciidoc'
}
>
here
</EuiLink>
</p>
</EuiText>

<EuiSpacer />
<EuiSpacer />

<RunExpressionsExample expressions={expressions} inspector={inspector} />
<RunExpressionsExample expressions={expressions} inspector={inspector} />

<EuiSpacer />
<EuiSpacer />

<RenderExpressionsExample expressions={expressions} inspector={inspector} />
<RenderExpressionsExample expressions={expressions} inspector={inspector} />

<EuiSpacer />
<EuiSpacer />

<ActionsExpressionsExample expressions={expressions} actions={actions} />
<ActionsExpressionsExample expressions={expressions} actions={actions} />

<EuiSpacer />
<EuiSpacer />

<ActionsExpressionsExample2 expressions={expressions} actions={actions} />
</EuiPageContentBody>
</EuiPageContent>
</EuiPageBody>
</EuiPage>
<ActionsExpressionsExample2 expressions={expressions} actions={actions} />
</EuiPageContentBody>
</EuiPageContent>
</EuiPageBody>
</EuiPage>
</KibanaReactContextProvider>
);
};

Expand Down
18 changes: 8 additions & 10 deletions examples/expressions_explorer/public/editor/expression_editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import React from 'react';
import { EuiCodeEditor } from '@elastic/eui';
import { CodeEditor } from '../../../../src/plugins/kibana_react/public';

interface Props {
value: string;
Expand All @@ -16,19 +16,17 @@ interface Props {

export function ExpressionEditor({ value, onChange }: Props) {
return (
<EuiCodeEditor
mode="javascript"
theme="github"
<CodeEditor
languageId="javascript"
width="100%"
height="250px"
value={value}
onChange={onChange}
setOptions={{
fontSize: '14px',
enableBasicAutocompletion: true,
enableSnippets: true,
enableLiveAutocompletion: true,
options={{
fontSize: 14,
fontFamily: 'monospace',
quickSuggestions: true,
}}
onBlur={() => {}}
aria-label="Code Editor"
/>
);
Expand Down
1 change: 1 addition & 0 deletions examples/expressions_explorer/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export class ExpressionsExplorerPlugin implements Plugin<void, void, SetupDeps,
expressions: depsStart.expressions,
inspector: depsStart.inspector,
actions: depsStart.uiActions,
uiSettings: core.uiSettings,
},
params
);
Expand Down
6 changes: 3 additions & 3 deletions examples/state_containers_examples/public/todo/todo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,20 @@ const TodoApp: React.FC<TodoAppProps> = ({ filter, stateContainer }) => {
<>
<div>
<Link to={{ ...location, pathname: '/' }} data-test-subj={'filterLinkAll'}>
<EuiButton size={'s'} color={!filter ? 'primary' : 'secondary'}>
<EuiButton size={'s'} color={!filter ? 'primary' : 'success'}>
All
</EuiButton>
</Link>
<Link to={{ ...location, pathname: '/completed' }} data-test-subj={'filterLinkCompleted'}>
<EuiButton size={'s'} color={filter === 'completed' ? 'primary' : 'secondary'}>
<EuiButton size={'s'} color={filter === 'completed' ? 'primary' : 'success'}>
Completed
</EuiButton>
</Link>
<Link
to={{ ...location, pathname: '/not-completed' }}
data-test-subj={'filterLinkNotCompleted'}
>
<EuiButton size={'s'} color={filter === 'not-completed' ? 'primary' : 'secondary'}>
<EuiButton size={'s'} color={filter === 'not-completed' ? 'primary' : 'success'}>
Not Completed
</EuiButton>
</Link>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"@elastic/datemath": "link:bazel-bin/packages/elastic-datemath",
"@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.35",
"@elastic/ems-client": "8.0.0",
"@elastic/eui": "40.1.0",
"@elastic/eui": "41.0.0",
"@elastic/filesaver": "1.1.2",
"@elastic/maki": "6.3.0",
"@elastic/node-crypto": "1.2.1",
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-ui-shared-deps-npm/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ RUNTIME_DEPS = [
"@npm//moment-timezone",
"@npm//moment",
"@npm//raw-loader",
"@npm//react-ace",
"@npm//react-dom",
"@npm//react-intl",
"@npm//react-is",
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-ui-shared-deps-npm/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ module.exports = (_, argv) => {
'moment-timezone/moment-timezone',
'moment-timezone/data/packed/latest.json',
'moment',
'react-ace',
'react-beautiful-dnd',
'react-dom',
'react-dom/server',
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { FormattedStatus } from '../lib';
const getStatus = (parts: Partial<FormattedStatus['state']> = {}): FormattedStatus['state'] => ({
id: 'available',
title: 'Green',
uiColor: 'secondary',
uiColor: 'success',
message: '',
...parts,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { StatusTable } from './status_table';

const state = {
id: 'available' as const,
uiColor: 'secondary',
uiColor: 'success',
message: 'Ready',
title: 'green',
};
Expand Down
6 changes: 3 additions & 3 deletions src/core/public/core_app/status/lib/load_status.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ describe('response processing', () => {
id: 'available',
title: 'Green',
message: 'Elasticsearch is available',
uiColor: 'secondary',
uiColor: 'success',
},
},
{
Expand All @@ -183,12 +183,12 @@ describe('response processing', () => {
id: 'available',
title: 'Green',
message: 'SavedObjects service has completed migrations and is available',
uiColor: 'secondary',
uiColor: 'success',
},
},
{
id: 'plugin:1',
state: { id: 'available', title: 'Green', message: 'Ready', uiColor: 'secondary' },
state: { id: 'available', title: 'Green', message: 'Ready', uiColor: 'success' },
},
{
id: 'plugin:2',
Expand Down
2 changes: 1 addition & 1 deletion src/core/public/core_app/status/lib/load_status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ const STATUS_LEVEL_UI_ATTRS: Record<ServiceStatusLevel, StatusUIAttributes> = {
title: i18n.translate('core.status.greenTitle', {
defaultMessage: 'Green',
}),
uiColor: 'secondary',
uiColor: 'success',
},
};

Expand Down
4 changes: 0 additions & 4 deletions src/core/public/i18n/__snapshots__/i18n_service.test.tsx.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 0 additions & 16 deletions src/core/public/i18n/i18n_eui_mapping.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,22 +127,6 @@ export const getEuiContextMapping = (): EuiTokensObject => {
defaultMessage: 'Expand',
description: 'ARIA label for a button that enters fullscreen view',
}),
'euiCodeEditor.startEditing': i18n.translate('core.euiCodeEditor.startEditing', {
defaultMessage: 'Press Enter to start editing.',
description: 'Screen reader text to prompt editing',
}),
'euiCodeEditor.startInteracting': i18n.translate('core.euiCodeEditor.startInteracting', {
defaultMessage: 'Press Enter to start interacting with the code.',
description: 'Screen reader text to prompt interaction',
}),
'euiCodeEditor.stopEditing': i18n.translate('core.euiCodeEditor.stopEditing', {
defaultMessage: "When you're done, press Escape to stop editing.",
description: 'Screen reader text to describe ending editing',
}),
'euiCodeEditor.stopInteracting': i18n.translate('core.euiCodeEditor.stopInteracting', {
defaultMessage: "When you're done, press Escape to stop interacting with the code.",
description: 'Screen reader text to describe ending interactions',
}),
'euiCollapsedItemActions.allActions': i18n.translate(
'core.euiCollapsedItemActions.allActions',
{
Expand Down
4 changes: 2 additions & 2 deletions src/core/server/status/legacy_status.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('calculateLegacyStatus', () => {
title: 'Green',
nickname: 'Looking good',
icon: 'success',
uiColor: 'secondary',
uiColor: 'success',
since: expect.any(String),
});
});
Expand Down Expand Up @@ -80,7 +80,7 @@ describe('calculateLegacyStatus', () => {
message: 'Available',
since: expect.any(String),
state: 'green',
uiColor: 'secondary',
uiColor: 'success',
},
{
icon: 'danger',
Expand Down
4 changes: 2 additions & 2 deletions src/core/server/status/legacy_status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ interface LegacyStatusOverall {

type LegacyStatusState = 'green' | 'yellow' | 'red';
type LegacyStatusIcon = 'danger' | 'warning' | 'success';
type LegacyStatusUiColor = 'secondary' | 'warning' | 'danger';
type LegacyStatusUiColor = 'success' | 'warning' | 'danger';

interface LegacyStateAttr {
id: LegacyStatusState;
Expand Down Expand Up @@ -141,7 +141,7 @@ const STATUS_LEVEL_LEGACY_ATTRS = deepFreeze<Record<string, LegacyStateAttr>>({
defaultMessage: 'Green',
}),
icon: 'success',
uiColor: 'secondary',
uiColor: 'success',
nickname: 'Looking good',
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ describe('GET /api/status', () => {
since: expect.any(String),
state: 'green',
title: 'Green',
uiColor: 'secondary',
uiColor: 'success',
},
statuses: [
{
Expand All @@ -173,23 +173,23 @@ describe('GET /api/status', () => {
message: 'Service is working',
since: expect.any(String),
state: 'green',
uiColor: 'secondary',
uiColor: 'success',
},
{
icon: 'success',
id: 'core:savedObjects@9.9.9',
message: 'Service is working',
since: expect.any(String),
state: 'green',
uiColor: 'secondary',
uiColor: 'success',
},
{
icon: 'success',
id: 'plugin:a@9.9.9',
message: 'a is available',
since: expect.any(String),
state: 'green',
uiColor: 'secondary',
uiColor: 'success',
},
{
icon: 'warning',
Expand Down
2 changes: 1 addition & 1 deletion src/dev/license_checker/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ export const LICENSE_OVERRIDES = {
'jsts@1.6.2': ['Eclipse Distribution License - v 1.0'], // cf. https://github.com/bjornharrtell/jsts
'@mapbox/jsonlint-lines-primitives@2.0.2': ['MIT'], // license in readme https://github.com/tmcw/jsonlint
'@elastic/ems-client@8.0.0': ['Elastic License 2.0'],
'@elastic/eui@40.1.0': ['SSPL-1.0 OR Elastic License 2.0'],
'@elastic/eui@41.0.0': ['SSPL-1.0 OR Elastic License 2.0'],
'language-subtag-registry@0.3.21': ['CC-BY-4.0'], // retired ODC‑By license https://github.com/mattcg/language-subtag-registry
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import React, { PureComponent, Fragment } from 'react';
import classNames from 'classnames';
import 'react-ace';
import 'brace/theme/textmate';
import 'brace/mode/markdown';
import 'brace/mode/json';
Expand Down
Loading

0 comments on commit 341ad3a

Please sign in to comment.