Skip to content

feat(ui): Remove identifier from Incident details header [SEN-693] #13439

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

Merged
merged 1 commit into from
May 31, 2019
Merged
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {Link} from 'react-router';
import PropTypes from 'prop-types';
import React from 'react';
import moment from 'moment';
import styled from 'react-emotion';

import {PageHeader} from 'app/styles/organization';
Expand Down Expand Up @@ -55,10 +56,6 @@ export default class DetailsHeader extends React.Component {

render() {
const {hasIncidentDetailsError, incident, params, onSubscriptionChange} = this.props;
const incidentIdAsInt = parseInt(params.incidentId, 10);
const formattedIncidentId = !isNaN(incidentIdAsInt)
? incidentIdAsInt.toLocaleString()
: t('Invalid Incident');
const isIncidentReady = !!incident && !hasIncidentDetailsError;
const eventLink = incident && {
pathname: `/organizations/${params.orgId}/events/`,
Expand All @@ -69,6 +66,7 @@ export default class DetailsHeader extends React.Component {
group: incident.groups,
},
};
const dateStarted = incident && moment(incident.dateStarted).format('LL');

return (
<Header>
Expand All @@ -78,8 +76,12 @@ export default class DetailsHeader extends React.Component {
<IncidentsLink to={`/organizations/${params.orgId}/incidents/`}>
{t('Incidents')}
</IncidentsLink>
<Chevron src="icon-chevron-right" size={space(2)} />
{formattedIncidentId}
{dateStarted && (
<React.Fragment>
<Chevron src="icon-chevron-right" size={space(2)} />
<IncidentDate>{dateStarted}</IncidentDate>
</React.Fragment>
)}
</Breadcrumb>
<IncidentTitle loading={!isIncidentReady}>
{isIncidentReady ? incident.title : 'Loading'}
Expand Down Expand Up @@ -171,13 +173,20 @@ const ItemValue = styled('div')`
`;

const Breadcrumb = styled('div')`
margin-bottom: ${space(2)};
display: flex;
align-items: center;
margin-bottom: ${space(1)};
`;

const IncidentTitle = styled('div')`
${p => p.loading && 'opacity: 0'};
`;

const IncidentDate = styled('div')`
font-size: 0.8em;
color: ${p => p.theme.gray2};
`;

const IncidentsLink = styled(Link)`
color: inherit;
`;
Expand Down