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

[Uptime] Reintroduce a column for url #55451

Merged
merged 7 commits 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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: labels.URL,
name: labels.URL,
render: (url: string, summary: MonitorSummary) => (
<>
<EuiLink href={url} target="_blank" color="text">
{url} <EuiIcon size="s" type="popout" color="subbdued" />
</EuiLink>
</>
),

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should restore it the way it originally was, i think it looked better that way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to comment here to make sure there's a summary of a discussion had in a more ephemeral medium:

We spent some time talking about @shahzad31's idea on the original issue; the idea is to place the URL link under the location name in the second column. Feedback was mixed, some feel it is too cluttered, and there's not enough space between two clickable elements, while others like the change looks nice and conserves space.

Here's a screenshot of a "PoC"-style change to the UI.

image

We determined that because this patch is intended to resolve a UX bug, it was inappropriate to entertain the addition of complexity to the app targeting 7.6 after FF. We may come back to this discussion later.

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',
});