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

[EuiIcon] Add legacy/undocumented alert->warning alias #6640

Merged
merged 3 commits into from
Mar 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src-docs/src/services/playground/iconValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { mapOptions } from './mapOptions';
import { PropTypes } from 'react-view';

const iconOptions = mapOptions(iconTypes.concat(logoTypes));
iconOptions.alert = 'warning'; // Legacy alias for Elastic Charts - primarily here for playground testing

export const iconValidator = (prop = { custom: {} }, value) => {
const newProp = {
Expand Down
21 changes: 21 additions & 0 deletions src/components/icon/__snapshots__/icon.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,27 @@ exports[`EuiIcon props type aggregate is rendered 1`] = `
</svg>
`;

exports[`EuiIcon props type alert is rendered 1`] = `
<svg
aria-hidden="true"
class="euiIcon emotion-euiIcon-m-isLoaded"
data-icon-type="alert"
data-is-loaded="true"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M8.55 9.502l.35-3.507a.905.905 0 10-1.8 0l.35 3.507a.552.552 0 001.1 0zM9 12a1 1 0 11-2 0 1 1 0 012 0z"
/>
<path
d="M8.864 1.496a1 1 0 00-1.728 0l-7 12A1 1 0 001 15h14a1 1 0 00.864-1.504l-7-12zM1 14L8 2l7 12H1z"
/>
</svg>
`;

exports[`EuiIcon props type analyzeEvent is rendered 1`] = `
<svg
aria-hidden="true"
Expand Down
1 change: 1 addition & 0 deletions src/components/icon/icon_map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ export const typeToPathMap = {
visVisualBuilder: 'vis_visual_builder',
visualizeApp: 'app_visualize',
warning: 'warning',
alert: 'warning', // NOTE: This is an undocumented alias for `warning`, added for legacy compatability with Elastic Charts
watchesApp: 'app_watches',
wordWrap: 'wordWrap',
wordWrapDisabled: 'wordWrapDisabled',
Expand Down
3 changes: 3 additions & 0 deletions upcoming_changelogs/6640.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Bug fixes**

- Added a legacy `alert` alias for the `warning` `EuiIcon` type