import styled from '@emotion/styled'; import {Alert} from 'sentry/components/alert'; import {SectionHeading} from 'sentry/components/charts/styles'; import DeprecatedAsyncComponent from 'sentry/components/deprecatedAsyncComponent'; import Times from 'sentry/components/group/times'; import ProjectBadge from 'sentry/components/idBadge/projectBadge'; import Link from 'sentry/components/links/link'; import Placeholder from 'sentry/components/placeholder'; import SeenByList from 'sentry/components/seenByList'; import ShortId from 'sentry/components/shortId'; import GroupChart from 'sentry/components/stream/groupChart'; import {t} from 'sentry/locale'; import {space} from 'sentry/styles/space'; import {Group} from 'sentry/types'; type Props = { eventId: string; groupId: string; }; type State = { group: Group; }; class LinkedIssue extends DeprecatedAsyncComponent< Props & DeprecatedAsyncComponent['props'], State & DeprecatedAsyncComponent['state'] > { getEndpoints(): ReturnType { const {groupId} = this.props; const groupUrl = `/issues/${groupId}/`; return [['group', groupUrl]]; } renderLoading() { return ; } renderError(error?: Error, disableLog = false): React.ReactNode { const {errors} = this.state; const hasNotFound = Object.values(errors).find(resp => resp && resp.status === 404); if (hasNotFound) { return ( {t('The linked issue cannot be found. It may have been deleted, or merged.')} ); } return super.renderError(error, disableLog); } renderBody() { const {eventId} = this.props; const {group} = this.state; const issueUrl = `${group.permalink}events/${eventId}/`; return (
{t('Event Issue')} } />
); } } const Section = styled('div')` margin-bottom: ${space(4)}; `; const StyledIssueCard = styled('div')` border: 1px solid ${p => p.theme.border}; border-radius: ${p => p.theme.borderRadius}; `; const IssueCardHeader = styled('div')` display: flex; align-items: center; justify-content: space-between; padding: ${space(1)}; `; const StyledLink = styled(Link)` justify-content: flex-start; `; const IssueCardBody = styled('div')` background: ${p => p.theme.backgroundSecondary}; padding-top: ${space(1)}; `; const StyledShortId = styled(ShortId)` font-size: ${p => p.theme.fontSizeMedium}; color: ${p => p.theme.textColor}; `; const IssueCardFooter = styled('div')` color: ${p => p.theme.gray300}; font-size: ${p => p.theme.fontSizeSmall}; padding: ${space(0.5)} ${space(1)}; `; export default LinkedIssue;