|
@@ -13,7 +13,7 @@ import Pagination from 'sentry/components/pagination';
|
|
|
import {Panel, PanelBody} from 'sentry/components/panels';
|
|
|
import {t} from 'sentry/locale';
|
|
|
import space from 'sentry/styles/space';
|
|
|
-import {IssueAttachment} from 'sentry/types';
|
|
|
+import {IssueAttachment, Project} from 'sentry/types';
|
|
|
import {decodeList} from 'sentry/utils/queryString';
|
|
|
|
|
|
import GroupEventAttachmentsFilter, {
|
|
@@ -24,7 +24,7 @@ import GroupEventAttachmentsTable from './groupEventAttachmentsTable';
|
|
|
import {ScreenshotCard} from './screenshotCard';
|
|
|
|
|
|
type Props = {
|
|
|
- projectSlug: string;
|
|
|
+ project: Project;
|
|
|
} & WithRouterProps<{groupId: string; orgId: string}> &
|
|
|
AsyncComponent['props'];
|
|
|
|
|
@@ -100,7 +100,7 @@ class GroupEventAttachments extends AsyncComponent<Props, State> {
|
|
|
}
|
|
|
|
|
|
handleDelete = async (deletedAttachmentId: string) => {
|
|
|
- const {params, projectSlug} = this.props;
|
|
|
+ const {params, project} = this.props;
|
|
|
const attachment = this.state?.eventAttachments?.find(
|
|
|
item => item.id === deletedAttachmentId
|
|
|
);
|
|
@@ -114,7 +114,7 @@ class GroupEventAttachments extends AsyncComponent<Props, State> {
|
|
|
|
|
|
try {
|
|
|
await this.api.requestPromise(
|
|
|
- `/projects/${params.orgId}/${projectSlug}/events/${attachment.event_id}/attachments/${attachment.id}/`,
|
|
|
+ `/projects/${params.orgId}/${project.slug}/events/${attachment.event_id}/attachments/${attachment.id}/`,
|
|
|
{
|
|
|
method: 'DELETE',
|
|
|
}
|
|
@@ -153,7 +153,7 @@ class GroupEventAttachments extends AsyncComponent<Props, State> {
|
|
|
}
|
|
|
|
|
|
renderInnerBody() {
|
|
|
- const {projectSlug, params} = this.props;
|
|
|
+ const {project, params} = this.props;
|
|
|
const {loading, eventAttachments, deletedAttachments} = this.state;
|
|
|
|
|
|
if (loading) {
|
|
@@ -165,7 +165,7 @@ class GroupEventAttachments extends AsyncComponent<Props, State> {
|
|
|
<GroupEventAttachmentsTable
|
|
|
attachments={eventAttachments}
|
|
|
orgId={params.orgId}
|
|
|
- projectId={projectSlug}
|
|
|
+ projectId={project.slug}
|
|
|
groupId={params.groupId}
|
|
|
onDelete={this.handleDelete}
|
|
|
deletedAttachments={deletedAttachments}
|
|
@@ -181,7 +181,7 @@ class GroupEventAttachments extends AsyncComponent<Props, State> {
|
|
|
}
|
|
|
renderScreenshotGallery() {
|
|
|
const {eventAttachments, loading} = this.state;
|
|
|
- const {projectSlug, params} = this.props;
|
|
|
+ const {project, params} = this.props;
|
|
|
|
|
|
if (loading) {
|
|
|
return <LoadingIndicator />;
|
|
@@ -196,7 +196,7 @@ class GroupEventAttachments extends AsyncComponent<Props, State> {
|
|
|
key={`${index}-${screenshot.id}`}
|
|
|
eventAttachment={screenshot}
|
|
|
eventId={screenshot.event_id}
|
|
|
- projectSlug={projectSlug}
|
|
|
+ projectSlug={project.slug}
|
|
|
groupId={params.groupId}
|
|
|
onDelete={this.handleDelete}
|
|
|
pageLinks={this.state.eventAttachmentsPageLinks}
|
|
@@ -221,10 +221,11 @@ class GroupEventAttachments extends AsyncComponent<Props, State> {
|
|
|
}
|
|
|
|
|
|
renderBody() {
|
|
|
+ const {project} = this.props;
|
|
|
return (
|
|
|
<Layout.Body>
|
|
|
<Layout.Main fullWidth>
|
|
|
- <GroupEventAttachmentsFilter />
|
|
|
+ <GroupEventAttachmentsFilter project={project} />
|
|
|
{this.getActiveAttachmentsTab() === EventAttachmentFilter.SCREENSHOTS
|
|
|
? this.renderScreenshotGallery()
|
|
|
: this.renderAttachmentsTable()}
|