-
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.
[Session View] [8.2] Load more style fix (#129676)
* Fix for process event pagination in session view * load more/previous buttons style now matches figma design. also added remaining events indication as per design updated test to look for total prop * icon fix for backwards pagination * missing space added Co-authored-by: mitodrummer <[email protected]>
- Loading branch information
1 parent
d92b7fe
commit 6afbe52
Showing
9 changed files
with
153 additions
and
17 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
50 changes: 50 additions & 0 deletions
50
x-pack/plugins/session_view/public/components/process_tree_load_more_button/index.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,50 @@ | ||
/* | ||
* 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 React from 'react'; | ||
import { FormattedMessage } from '@kbn/i18n-react'; | ||
import { EuiButtonEmpty } from '@elastic/eui'; | ||
import { useStyles } from './styles'; | ||
|
||
export interface ProcessTreeLoadMoreButtonDeps { | ||
onClick: () => void; | ||
text: string; | ||
isFetching: boolean; | ||
eventsRemaining: number; | ||
forward: boolean; | ||
} | ||
|
||
export const ProcessTreeLoadMoreButton = ({ | ||
onClick, | ||
text, | ||
isFetching, | ||
eventsRemaining, | ||
forward, | ||
}: ProcessTreeLoadMoreButtonDeps) => { | ||
const styles = useStyles(); | ||
|
||
return ( | ||
<div css={styles.wrapper}> | ||
<EuiButtonEmpty | ||
size="xs" | ||
iconType={forward ? 'arrowDown' : 'arrowUp'} | ||
onClick={onClick} | ||
isLoading={isFetching} | ||
> | ||
{text} | ||
{eventsRemaining !== 0 && ( | ||
<FormattedMessage | ||
id="xpack.sessionView.processTreeLoadMoreButton" | ||
defaultMessage=" ({count} left)" | ||
values={{ count: eventsRemaining }} | ||
/> | ||
)} | ||
</EuiButtonEmpty> | ||
<span css={styles.dottedLine} /> | ||
</div> | ||
); | ||
}; |
35 changes: 35 additions & 0 deletions
35
x-pack/plugins/session_view/public/components/process_tree_load_more_button/styles.ts
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,35 @@ | ||
/* | ||
* 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 { useMemo } from 'react'; | ||
import { useEuiTheme } from '@elastic/eui'; | ||
import { CSSObject } from '@emotion/react'; | ||
|
||
export const useStyles = () => { | ||
const { euiTheme } = useEuiTheme(); | ||
|
||
const cached = useMemo(() => { | ||
const { border } = euiTheme; | ||
|
||
const wrapper: CSSObject = { | ||
display: 'flex', | ||
alignItems: 'center', | ||
}; | ||
|
||
const dottedLine: CSSObject = { | ||
flex: 1, | ||
borderTop: `${border.width.thick} dotted ${border.color}`, | ||
}; | ||
|
||
return { | ||
wrapper, | ||
dottedLine, | ||
}; | ||
}, [euiTheme]); | ||
|
||
return cached; | ||
}; |
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