Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.x] [Uptime] Reintroduce a column for url (#55451) #56074

Merged
merged 1 commit into from
Jan 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@
*/

import {
EuiButtonIcon,
EuiBasicTable,
EuiFlexGroup,
EuiPanel,
EuiTitle,
EuiButtonIcon,
EuiFlexItem,
EuiIcon,
EuiLink,
EuiPanel,
EuiSpacer,
EuiTitle,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { get } from 'lodash';
import React, { useState, Fragment } from 'react';
import styled from 'styled-components';
import { withUptimeGraphQL, UptimeGraphQLQueryProps } from '../../higher_order';
import { monitorStatesQuery } from '../../../queries/monitor_states_query';
import {
Expand Down Expand Up @@ -47,6 +50,12 @@ interface MonitorListProps {

type Props = UptimeGraphQLQueryProps<MonitorListQueryResult> & MonitorListProps;

const TruncatedEuiLink = styled(EuiLink)`
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
`;

export const MonitorListComponent = (props: Props) => {
const {
absoluteStartDate,
Expand Down Expand Up @@ -99,6 +108,16 @@ export const MonitorListComponent = (props: Props) => {
),
sortable: true,
},
{
aligh: 'left' as const,
field: 'state.url.full',
name: labels.URL,
render: (url: string, summary: MonitorSummary) => (
<TruncatedEuiLink href={url} target="_blank" color="text">
{url} <EuiIcon size="s" type="popout" color="subbdued" />
</TruncatedEuiLink>
),
},
{
align: 'center' as const,
field: 'histogram.points',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,7 @@ export const NO_DATA_MESSAGE = i18n.translate('xpack.uptime.monitorList.noItemMe
defaultMessage: 'No uptime monitors found',
description: 'This message is shown if the monitors table is rendered but has no items.',
});

export const URL = i18n.translate('xpack.uptime.monitorList.table.url.name', {
defaultMessage: 'Url',
});