mirror of
https://github.com/grafana/grafana.git
synced 2025-01-07 22:53:56 -06:00
Annotations Panel: Show annotations end time if present (#38425)
* Annotation Panel: Show annotation end time if present * Added hyphen between dates
This commit is contained in:
parent
6548cd89af
commit
4cb87b6b60
@ -23,7 +23,7 @@ export const AnnotationListItem: FC<Props> = ({
|
||||
}) => {
|
||||
const styles = useStyles2(getStyles);
|
||||
const { showUser, showTags, showTime } = options;
|
||||
const { text, login, email, avatarUrl, tags, time } = annotation;
|
||||
const { text, login, email, avatarUrl, tags, time, timeEnd } = annotation;
|
||||
const onItemClick = (e: MouseEvent) => {
|
||||
e.stopPropagation();
|
||||
onClick(annotation);
|
||||
@ -33,6 +33,7 @@ export const AnnotationListItem: FC<Props> = ({
|
||||
};
|
||||
const showAvatar = login && showUser;
|
||||
const showTimeStamp = time && showTime;
|
||||
const showTimeStampEnd = timeEnd && timeEnd !== time && showTime;
|
||||
|
||||
return (
|
||||
<div>
|
||||
@ -40,6 +41,8 @@ export const AnnotationListItem: FC<Props> = ({
|
||||
<div className={styles.title}>
|
||||
<span>{text}</span>
|
||||
{showTimeStamp ? <TimeStamp formatDate={formatDate} time={time!} /> : null}
|
||||
{showTimeStampEnd ? <span className={styles.time}>-</span> : null}
|
||||
{showTimeStampEnd ? <TimeStamp formatDate={formatDate} time={timeEnd!} /> : null}
|
||||
</div>
|
||||
<div className={styles.login}>
|
||||
{showAvatar ? <Avatar email={email} login={login!} avatarUrl={avatarUrl} onClick={onLoginClick} /> : null}
|
||||
@ -129,6 +132,7 @@ function getStyles(theme: GrafanaTheme2) {
|
||||
`,
|
||||
time: css`
|
||||
margin-left: ${theme.spacing(1)};
|
||||
margin-right: ${theme.spacing(1)}
|
||||
font-size: ${theme.typography.bodySmall.fontSize};
|
||||
color: ${theme.colors.text.secondary};
|
||||
`,
|
||||
|
Loading…
Reference in New Issue
Block a user