File tree Expand file tree Collapse file tree 6 files changed +18
-18
lines changed
pub-sub/components/messages-list/MessagesList Expand file tree Collapse file tree 6 files changed +18
-18
lines changed Original file line number Diff line number Diff line change 1
- import { EuiToolTip } from '@elastic/eui'
2
1
import React from 'react'
3
2
import { useSelector } from 'react-redux'
4
3
import { DATETIME_FORMATTER_DEFAULT , TimezoneOption } from 'uiSrc/constants'
5
4
import { userSettingsConfigSelector } from 'uiSrc/slices/user/user-settings'
6
5
import { formatTimestamp } from 'uiSrc/utils'
6
+ import styles from './styles.module.scss'
7
7
8
8
export interface Props {
9
9
date : Date | string | number
10
- truncate ?: number
11
10
}
12
11
13
- const FormatedDate = ( { date, truncate } : Props ) => {
12
+ const FormatedDate = ( { date } : Props ) => {
14
13
const config = useSelector ( userSettingsConfigSelector )
15
14
const dateFormat = config ?. dateFormat || DATETIME_FORMATTER_DEFAULT
16
15
const timezone = config ?. timezone || TimezoneOption . Local
17
16
18
17
const formatedDate = formatTimestamp ( date , dateFormat , timezone )
19
18
20
- if ( truncate && dateFormat . length > truncate ) {
21
- return (
22
- < EuiToolTip
23
- content = { formatedDate }
24
- >
25
- < > { formatedDate . slice ( 0 , truncate ) . concat ( '...' ) } </ >
26
- </ EuiToolTip >
27
- )
28
- }
29
-
30
19
return (
31
- < span > { formatedDate } </ span >
20
+ < span className = { styles . text } >
21
+ { formatedDate }
22
+ </ span >
32
23
)
33
24
}
34
25
Original file line number Diff line number Diff line change
1
+ .text {
2
+ display : inline-block ;
3
+ text-overflow : ellipsis ;
4
+ white-space : nowrap ;
5
+ overflow : hidden ;
6
+ position : relative ;
7
+ max-width : 100% ;
8
+ vertical-align : middle ;
9
+ }
Original file line number Diff line number Diff line change @@ -311,7 +311,7 @@ const QueryCardHeader = (props: Props) => {
311
311
< EuiFlexItem className = { cx ( styles . time ) } data-testid = "command-execution-date-time" >
312
312
{ ! ! createdAt && (
313
313
< EuiTextColor className = { styles . timeText } component = "div" >
314
- < FormatedDate date = { createdAt } truncate = { 15 } />
314
+ < FormatedDate date = { createdAt } />
315
315
</ EuiTextColor >
316
316
) }
317
317
</ EuiFlexItem >
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ const MessagesList = (props: Props) => {
120
120
121
121
return (
122
122
< div style = { style } className = { styles . item } data-testid = { `row-${ index } ` } >
123
- < div className = { styles . time } > < FormatedDate date = { time } truncate = { 18 } /> </ div >
123
+ < div className = { styles . time } > < FormatedDate date = { time } /> </ div >
124
124
< div className = { styles . channel } >
125
125
< EuiToolTip
126
126
content = { channel }
Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ const SlowLogPage = () => {
174
174
{ lastTimestamp && (
175
175
< >
176
176
< span > from </ span >
177
- < FormatedDate date = { lastTimestamp * 1000 } truncate = { 30 } />
177
+ < FormatedDate date = { lastTimestamp * 1000 } />
178
178
</ >
179
179
) } )
180
180
</ EuiText >
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ const SlowLogTable = (props: Props) => {
47
47
isSortable : true ,
48
48
render : ( timestamp ) => (
49
49
< EuiText size = "s" color = "subdued" data-testid = "timestamp-value" >
50
- < FormatedDate date = { timestamp * 1000 } truncate = { 20 } />
50
+ < FormatedDate date = { timestamp * 1000 } />
51
51
</ EuiText >
52
52
)
53
53
} ,
You can’t perform that action at this time.
0 commit comments