Skip to content
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
32 changes: 23 additions & 9 deletions static/app/views/issueDetails/actions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import {Fragment, useMemo} from 'react';
import styled from '@emotion/styled';

import {bulkDelete, bulkUpdate} from 'sentry/actionCreators/group';
import {addLoadingMessage, clearIndicators} from 'sentry/actionCreators/indicator';
import {
addLoadingMessage,
addSuccessMessage,
clearIndicators,
} from 'sentry/actionCreators/indicator';
import type {ModalRenderProps} from 'sentry/actionCreators/modal';
import {openModal, openReprocessEventModal} from 'sentry/actionCreators/modal';
import Feature from 'sentry/components/acl/feature';
Expand Down Expand Up @@ -170,6 +174,7 @@ export function GroupActions({group, project, disabled, event}: GroupActionsProp
complete: () => {
clearIndicators();

addSuccessMessage(t('Issue deleted'));
navigate({
pathname: `/organizations/${organization.slug}/issues/`,
query: {project: project.id},
Expand All @@ -182,9 +187,7 @@ export function GroupActions({group, project, disabled, event}: GroupActionsProp
IssueListCacheStore.reset();
};

const onUpdate = (data: UpdateData) => {
addLoadingMessage(t('Saving changes\u2026'));

const onUpdate = (data: UpdateData, onComplete?: () => void) => {
bulkUpdate(
api,
{
Expand All @@ -194,7 +197,10 @@ export function GroupActions({group, project, disabled, event}: GroupActionsProp
data,
},
{
complete: clearIndicators,
complete: () => {
clearIndicators();
onComplete?.();
},
}
);

Expand Down Expand Up @@ -226,13 +232,21 @@ export function GroupActions({group, project, disabled, event}: GroupActionsProp
};

const onToggleBookmark = () => {
onUpdate({isBookmarked: !group.isBookmarked});
trackIssueAction('bookmarked');
onUpdate({isBookmarked: !group.isBookmarked}, () => {
trackIssueAction('bookmarked');
addSuccessMessage(
group.isBookmarked ? t('Issue bookmark removed') : t('Issue bookmarked')
);
});
};

const onToggleSubscribe = () => {
onUpdate({isSubscribed: !group.isSubscribed});
trackIssueAction('subscribed');
onUpdate({isSubscribed: !group.isSubscribed}, () => {
trackIssueAction('subscribed');
addSuccessMessage(
group.isSubscribed ? t('Unsubscribed from issue') : t('Subscribed to issue')
);
});
};

const onDiscard = () => {
Expand Down
Loading