123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- import AsyncComponent from 'sentry/components/asyncComponent';
- import LazyLoad from 'sentry/components/lazyLoad';
- import {IssueAttachment, Organization, Project} from 'sentry/types';
- import {Event} from 'sentry/types/event';
- type Props = {
- event: Event;
- orgId: Organization['id'];
- projectSlug: Project['slug'];
- renderer?: Function;
- } & AsyncComponent['props'];
- type State = {
- attachmentList: Array<IssueAttachment> | null;
- } & AsyncComponent['state'];
- export class EventRRWebIntegration extends AsyncComponent<Props, State> {
- getEndpoints(): ReturnType<AsyncComponent['getEndpoints']> {
- const {orgId, projectSlug, event} = this.props;
- return [
- [
- 'attachmentList',
- `/projects/${orgId}/${projectSlug}/events/${event.id}/attachments/`,
-
-
-
-
-
-
-
-
-
-
- {query: {query: 'rrweb'}},
- ],
- ];
- }
- renderLoading() {
-
- return null;
- }
- renderBody() {
- const {attachmentList} = this.state;
- const renderer = this.props.renderer || (children => children);
- if (!attachmentList?.length) {
- return null;
- }
- const {orgId, projectSlug, event} = this.props;
- function createAttachmentUrl(attachment: IssueAttachment) {
- return `/api/0/projects/${orgId}/${projectSlug}/events/${event.id}/attachments/${attachment.id}/?download`;
- }
- return renderer(
- <LazyLoad
- component={() => import('./rrwebReplayer')}
- urls={attachmentList.map(createAttachmentUrl)}
- />
- );
- }
- }
|