-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[APM] Fix SVG rendered agent icon in Service Map, and improve storybo…
…ok for icons (#102182)
- Loading branch information
Showing
30 changed files
with
205 additions
and
302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
x-pack/plugins/apm/public/components/shared/agent_icon/agent_icon.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { | ||
EuiCard, | ||
EuiFlexGroup, | ||
EuiImage, | ||
EuiFlexItem, | ||
EuiSpacer, | ||
EuiToolTip, | ||
EuiCodeBlock, | ||
} from '@elastic/eui'; | ||
import React, { ComponentType } from 'react'; | ||
import { AgentIcon } from './index'; | ||
import { EuiThemeProvider } from '../../../../../../../src/plugins/kibana_react/common'; | ||
import { AGENT_NAMES } from '../../../../common/agent_name'; | ||
import { getAgentIcon } from './get_agent_icon'; | ||
import { useTheme } from '../../../hooks/use_theme'; | ||
|
||
export default { | ||
title: 'shared/icons', | ||
component: AgentIcon, | ||
decorators: [ | ||
(Story: ComponentType) => ( | ||
<EuiThemeProvider> | ||
<Story /> | ||
</EuiThemeProvider> | ||
), | ||
], | ||
}; | ||
|
||
export function AgentIcons() { | ||
const theme = useTheme(); | ||
|
||
return ( | ||
<> | ||
<EuiCodeBlock language="html" isCopyable paddingSize="m"> | ||
{'<AgentIcon agentName="dotnet" />'} | ||
</EuiCodeBlock> | ||
|
||
<EuiSpacer /> | ||
|
||
<EuiFlexGroup gutterSize="l" wrap={true}> | ||
{AGENT_NAMES.map((agentName) => { | ||
return ( | ||
<EuiFlexItem key={agentName} grow={false}> | ||
<EuiCard | ||
icon={ | ||
<> | ||
<p> | ||
<EuiToolTip | ||
position="top" | ||
content="Icon rendered with `EuiImage`" | ||
> | ||
<EuiImage | ||
size="s" | ||
hasShadow | ||
alt={agentName} | ||
src={getAgentIcon(agentName, theme.darkMode)} | ||
/> | ||
</EuiToolTip> | ||
</p> | ||
</> | ||
} | ||
title={agentName} | ||
description={ | ||
<div> | ||
<EuiToolTip | ||
position="bottom" | ||
content="Icon rendered with `AgentIcon`" | ||
> | ||
<AgentIcon agentName={agentName} /> | ||
</EuiToolTip> | ||
</div> | ||
} | ||
/> | ||
</EuiFlexItem> | ||
); | ||
})} | ||
</EuiFlexGroup> | ||
</> | ||
); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.