Skip to content

Commit ea2983e

Browse files
[Uptime] Reintroduce a column for url (#55451) (#56075)
* Reintroduce a column for url. * Reintroduce original URL column. * Update busted test snapshots. * Truncate long URLs. Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
1 parent 0284bea commit ea2983e

File tree

4 files changed

+50
-3
lines changed

4 files changed

+50
-3
lines changed

x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list.test.tsx.snap

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list_pagination.test.tsx.snap

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list.tsx

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,20 @@
55
*/
66

77
import {
8+
EuiButtonIcon,
89
EuiBasicTable,
910
EuiFlexGroup,
10-
EuiPanel,
11-
EuiTitle,
12-
EuiButtonIcon,
1311
EuiFlexItem,
12+
EuiIcon,
13+
EuiLink,
14+
EuiPanel,
1415
EuiSpacer,
16+
EuiTitle,
1517
} from '@elastic/eui';
1618
import { FormattedMessage } from '@kbn/i18n/react';
1719
import { get } from 'lodash';
1820
import React, { useState, Fragment } from 'react';
21+
import styled from 'styled-components';
1922
import { withUptimeGraphQL, UptimeGraphQLQueryProps } from '../../higher_order';
2023
import { monitorStatesQuery } from '../../../queries/monitor_states_query';
2124
import {
@@ -47,6 +50,12 @@ interface MonitorListProps {
4750

4851
type Props = UptimeGraphQLQueryProps<MonitorListQueryResult> & MonitorListProps;
4952

53+
const TruncatedEuiLink = styled(EuiLink)`
54+
white-space: nowrap;
55+
overflow: hidden;
56+
text-overflow: ellipsis;
57+
`;
58+
5059
export const MonitorListComponent = (props: Props) => {
5160
const {
5261
absoluteStartDate,
@@ -99,6 +108,16 @@ export const MonitorListComponent = (props: Props) => {
99108
),
100109
sortable: true,
101110
},
111+
{
112+
aligh: 'left' as const,
113+
field: 'state.url.full',
114+
name: labels.URL,
115+
render: (url: string, summary: MonitorSummary) => (
116+
<TruncatedEuiLink href={url} target="_blank" color="text">
117+
{url} <EuiIcon size="s" type="popout" color="subbdued" />
118+
</TruncatedEuiLink>
119+
),
120+
},
102121
{
103122
align: 'center' as const,
104123
field: 'histogram.points',

x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/translations.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,7 @@ export const NO_DATA_MESSAGE = i18n.translate('xpack.uptime.monitorList.noItemMe
5252
defaultMessage: 'No uptime monitors found',
5353
description: 'This message is shown if the monitors table is rendered but has no items.',
5454
});
55+
56+
export const URL = i18n.translate('xpack.uptime.monitorList.table.url.name', {
57+
defaultMessage: 'Url',
58+
});

0 commit comments

Comments
 (0)