mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Miriam <31922082+MiriamAparicio@users.noreply.github.com>
This commit is contained in:
parent
9b395a8a42
commit
d225eadf3a
2 changed files with 12 additions and 2 deletions
|
@ -102,6 +102,8 @@ export function AccordionWaterfall(props: AccordionWaterfallProps) {
|
|||
setIsOpen((isCurrentOpen) => !isCurrentOpen);
|
||||
}
|
||||
|
||||
const hasToggle = !!children.length;
|
||||
|
||||
return (
|
||||
<StyledAccordion
|
||||
className="waterfall_accordion"
|
||||
|
@ -117,7 +119,7 @@ export function AccordionWaterfall(props: AccordionWaterfallProps) {
|
|||
<EuiFlexGroup gutterSize="none">
|
||||
<EuiFlexItem grow={false}>
|
||||
<ToggleAccordionButton
|
||||
show={!!children.length}
|
||||
show={hasToggle}
|
||||
isOpen={isOpen}
|
||||
childrenAmount={children.length}
|
||||
onClick={toggleAccordion}
|
||||
|
@ -129,6 +131,7 @@ export function AccordionWaterfall(props: AccordionWaterfallProps) {
|
|||
timelineMargins={timelineMargins}
|
||||
color={item.color}
|
||||
item={item}
|
||||
hasToggle={hasToggle}
|
||||
totalDuration={duration}
|
||||
isSelected={item.id === waterfallItemId}
|
||||
errorCount={errorCount}
|
||||
|
|
|
@ -30,6 +30,7 @@ interface IContainerStyleProps {
|
|||
type: ItemType;
|
||||
timelineMargins: Margins;
|
||||
isSelected: boolean;
|
||||
hasToggle: boolean;
|
||||
}
|
||||
|
||||
interface IBarStyleProps {
|
||||
|
@ -44,7 +45,10 @@ const Container = euiStyled.div<IContainerStyleProps>`
|
|||
padding-top: ${({ theme }) => theme.eui.paddingSizes.s};
|
||||
padding-bottom: ${({ theme }) => theme.eui.euiSizeM};
|
||||
margin-right: ${(props) => props.timelineMargins.right}px;
|
||||
margin-left: ${(props) => props.timelineMargins.left}px;
|
||||
margin-left: ${(props) =>
|
||||
props.hasToggle
|
||||
? props.timelineMargins.left - 30 // fix margin if there is a toggle
|
||||
: props.timelineMargins.left}px ;
|
||||
background-color: ${({ isSelected, theme }) =>
|
||||
isSelected ? theme.eui.euiColorLightestShade : 'initial'};
|
||||
cursor: pointer;
|
||||
|
@ -81,6 +85,7 @@ interface IWaterfallItemProps {
|
|||
timelineMargins: Margins;
|
||||
totalDuration?: number;
|
||||
item: IWaterfallSpanOrTransaction;
|
||||
hasToggle: boolean;
|
||||
color: string;
|
||||
isSelected: boolean;
|
||||
errorCount: number;
|
||||
|
@ -180,6 +185,7 @@ export function WaterfallItem({
|
|||
timelineMargins,
|
||||
totalDuration,
|
||||
item,
|
||||
hasToggle,
|
||||
color,
|
||||
isSelected,
|
||||
errorCount,
|
||||
|
@ -200,6 +206,7 @@ export function WaterfallItem({
|
|||
type={item.docType}
|
||||
timelineMargins={timelineMargins}
|
||||
isSelected={isSelected}
|
||||
hasToggle={hasToggle}
|
||||
onClick={(e: React.MouseEvent) => {
|
||||
e.stopPropagation();
|
||||
onClick();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue