12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- import {Component} from 'react';
- import ClippedBox from 'sentry/components/clippedBox';
- import ErrorBoundary from 'sentry/components/errorBoundary';
- import EventDataSection from 'sentry/components/events/eventDataSection';
- import KeyValueList from 'sentry/components/events/interfaces/keyValueList';
- import {getMeta} from 'sentry/components/events/meta/metaProxy';
- import {t} from 'sentry/locale';
- import {Event} from 'sentry/types/event';
- type Props = {
- event: Event;
- };
- class EventPackageData extends Component<Props> {
- shouldComponentUpdate(nextProps: Props) {
- return this.props.event.id !== nextProps.event.id;
- }
- render() {
- const {event} = this.props;
- let longKeys: boolean, title: string;
- const packages = Object.entries(event.packages || {}).map(([key, value]) => ({
- key,
- value,
- subject: key,
- meta: getMeta(event.packages, key),
- }));
- switch (event.platform) {
- case 'csharp':
- longKeys = true;
- title = t('Assemblies');
- break;
- default:
- longKeys = false;
- title = t('Packages');
- }
- return (
- <EventDataSection type="packages" title={title}>
- <ClippedBox>
- <ErrorBoundary mini>
- <KeyValueList data={packages} longKeys={longKeys} />
- </ErrorBoundary>
- </ClippedBox>
- </EventDataSection>
- );
- }
- }
- export default EventPackageData;
|