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

[Backport 1.x] Add history icon and alias it as recent #1349

Merged
merged 1 commit into from
Aug 16, 2024
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
2 changes: 2 additions & 0 deletions src-docs/src/views/icon/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export const iconTypes = [
'heart',
'heatmap',
'help',
'history',
'home',
'iInCircle',
'image',
Expand Down Expand Up @@ -201,6 +202,7 @@ export const iconTypes = [
'questionInCircle',
'quote',
'radius',
'recent',
'redeploy',
'refresh',
'reporter',
Expand Down
34 changes: 34 additions & 0 deletions src/components/icon/__snapshots__/icon.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3265,6 +3265,23 @@ exports[`OuiIcon props type help is rendered 1`] = `
</svg>
`;

exports[`OuiIcon props type history is rendered 1`] = `
<svg
aria-hidden="true"
class="ouiIcon ouiIcon--medium ouiIcon-isLoaded"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M8 0a7.944 7.944 0 0 0-5.656 2.343.5.5 0 0 0 .707.707A6.954 6.954 0 0 1 8 1c3.859 0 7 3.14 7 7s-3.141 7-7 7c-3.776 0-6.916-3.07-6.998-6.843-.006-.275-.237-.48-.511-.489a.5.5 0 0 0-.489.511C.096 12.492 3.684 16.001 8 16.001c4.411 0 8-3.589 8-8S12.411 0 8 0zm0 3.5a.5.5 0 0 0-.5.5v4c0 .008.004.014.004.022.002.035.012.067.02.101.008.03.012.061.025.088.012.025.031.046.047.07.021.031.041.061.069.086.005.005.007.011.013.016l3.064 2.571a.497.497 0 0 0 .704-.062.499.499 0 0 0-.062-.704L8.498 7.767V4a.5.5 0 0 0-.5-.5zM.5 0a.5.5 0 0 1 .5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 1 0 1h-3A1.5 1.5 0 0 1 0 3.5v-3A.5.5 0 0 1 .5 0z"
/>
</svg>
`;

exports[`OuiIcon props type home is rendered 1`] = `
<svg
aria-hidden="true"
Expand Down Expand Up @@ -7502,6 +7519,23 @@ exports[`OuiIcon props type radius is rendered 1`] = `
</svg>
`;

exports[`OuiIcon props type recent is rendered 1`] = `
<svg
aria-hidden="true"
class="ouiIcon ouiIcon--medium ouiIcon-isLoaded"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M8 0a7.944 7.944 0 0 0-5.656 2.343.5.5 0 0 0 .707.707A6.954 6.954 0 0 1 8 1c3.859 0 7 3.14 7 7s-3.141 7-7 7c-3.776 0-6.916-3.07-6.998-6.843-.006-.275-.237-.48-.511-.489a.5.5 0 0 0-.489.511C.096 12.492 3.684 16.001 8 16.001c4.411 0 8-3.589 8-8S12.411 0 8 0zm0 3.5a.5.5 0 0 0-.5.5v4c0 .008.004.014.004.022.002.035.012.067.02.101.008.03.012.061.025.088.012.025.031.046.047.07.021.031.041.061.069.086.005.005.007.011.013.016l3.064 2.571a.497.497 0 0 0 .704-.062.499.499 0 0 0-.062-.704L8.498 7.767V4a.5.5 0 0 0-.5-.5zM.5 0a.5.5 0 0 1 .5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 1 0 1h-3A1.5 1.5 0 0 1 0 3.5v-3A.5.5 0 0 1 .5 0z"
/>
</svg>
`;

exports[`OuiIcon props type recentlyViewedApp is rendered 1`] = `
<svg
aria-hidden="true"
Expand Down
25 changes: 25 additions & 0 deletions src/components/icon/assets/history.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

import * as React from 'react';
const OuiIconHistory = ({ title, titleId, ...props }) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width={16}
height={16}
viewBox="0 0 16 16"
aria-labelledby={titleId}
{...props}>
{title ? <title id={titleId}>{title}</title> : null}
<path d="M8 0a7.944 7.944 0 0 0-5.656 2.343.5.5 0 0 0 .707.707A6.954 6.954 0 0 1 8 1c3.859 0 7 3.14 7 7s-3.141 7-7 7c-3.776 0-6.916-3.07-6.998-6.843-.006-.275-.237-.48-.511-.489a.5.5 0 0 0-.489.511C.096 12.492 3.684 16.001 8 16.001c4.411 0 8-3.589 8-8S12.411 0 8 0zm0 3.5a.5.5 0 0 0-.5.5v4c0 .008.004.014.004.022.002.035.012.067.02.101.008.03.012.061.025.088.012.025.031.046.047.07.021.031.041.061.069.086.005.005.007.011.013.016l3.064 2.571a.497.497 0 0 0 .704-.062.499.499 0 0 0-.062-.704L8.498 7.767V4a.5.5 0 0 0-.5-.5zM.5 0a.5.5 0 0 1 .5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 1 0 1h-3A1.5 1.5 0 0 1 0 3.5v-3A.5.5 0 0 1 .5 0z" />
</svg>
);
export const icon = OuiIconHistory;
6 changes: 6 additions & 0 deletions src/components/icon/assets/history.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/components/icon/icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ const typeToPathMap = {
heartbeatApp: 'app_heartbeat',
heatmap: 'heatmap',
help: 'help',
history: 'history',
home: 'home',
iInCircle: 'iInCircle',
image: 'image',
Expand Down Expand Up @@ -352,6 +353,7 @@ const typeToPathMap = {
questionInCircle: 'question_in_circle',
quote: 'quote',
radius: 'radius',
recent: 'history',
recentlyViewedApp: 'app_recently_viewed',
redeploy: 'redeploy',
refresh: 'refresh',
Expand Down
Loading