diff --git a/static/app/actionCreators/sentryAppInstallations.tsx b/static/app/actionCreators/sentryAppInstallations.tsx index 1d6d7fdf145a35..1346024d852661 100644 --- a/static/app/actionCreators/sentryAppInstallations.tsx +++ b/static/app/actionCreators/sentryAppInstallations.tsx @@ -53,7 +53,7 @@ export function uninstallSentryApp( install.app.slug.charAt(0).toUpperCase() + install.app.slug.slice(1); promise.then( () => { - addSuccessMessage(t('%s successfully uninstalled.', capitalizedAppSlug)); + addSuccessMessage(t('%s successfully queued for deletion.', capitalizedAppSlug)); }, () => clearIndicators() ); diff --git a/static/app/types/integrations.tsx b/static/app/types/integrations.tsx index f2abc3a69e5282..40512ae045529f 100644 --- a/static/app/types/integrations.tsx +++ b/static/app/types/integrations.tsx @@ -267,7 +267,7 @@ export type SentryAppInstallation = { organization: { slug: string; }; - status: 'installed' | 'pending'; + status: 'installed' | 'pending' | 'pending_deletion'; uuid: string; code?: string; }; diff --git a/static/app/utils/integrationUtil.tsx b/static/app/utils/integrationUtil.tsx index 4c925a31596dcf..b71d10a168f486 100644 --- a/static/app/utils/integrationUtil.tsx +++ b/static/app/utils/integrationUtil.tsx @@ -74,9 +74,12 @@ export const getIntegrationFeatureGate = () => { }; export const getSentryAppInstallStatus = (install: SentryAppInstallation | undefined) => { - if (install) { + if (install && install.status !== 'pending_deletion') { return capitalize(install.status) as IntegrationInstallationStatus; } + if (install && install.status === 'pending_deletion') { + return 'Pending Deletion'; + } return 'Not Installed'; }; diff --git a/static/app/views/settings/organizationIntegrations/sentryAppDetailedView.spec.tsx b/static/app/views/settings/organizationIntegrations/sentryAppDetailedView.spec.tsx index 8452d547702343..2a26638d17b20f 100644 --- a/static/app/views/settings/organizationIntegrations/sentryAppDetailedView.spec.tsx +++ b/static/app/views/settings/organizationIntegrations/sentryAppDetailedView.spec.tsx @@ -140,6 +140,12 @@ describe('SentryAppDetailedView', () => { await userEvent.click(screen.getByRole('button', {name: 'Uninstall'})); await userEvent.click(screen.getByRole('button', {name: 'Confirm'})); expect(deleteRequest).toHaveBeenCalledTimes(1); + + expect(await screen.findAllByText('Pending Deletion')).toHaveLength(2); + + expect( + await screen.findByRole('button', {name: 'Pending Deletion'}) + ).toBeInTheDocument(); }); }); diff --git a/static/app/views/settings/organizationIntegrations/sentryAppDetailedView.tsx b/static/app/views/settings/organizationIntegrations/sentryAppDetailedView.tsx index 1300bc139b6d86..29c0fc023e152d 100644 --- a/static/app/views/settings/organizationIntegrations/sentryAppDetailedView.tsx +++ b/static/app/views/settings/organizationIntegrations/sentryAppDetailedView.tsx @@ -229,7 +229,10 @@ export default function SentryAppDetailedView() { setApiQueryData( queryClient, makeSentryAppInstallationsQueryKey({orgSlug: organization.slug}), - (existingData = []) => existingData.filter(i => i.app.slug !== sentryApp.slug) + (existingData = []) => + existingData.map(i => + i.app.slug === sentryApp.slug ? {...i, status: 'pending_deletion'} : i + ) ); } catch (error) { addErrorMessage(t('Unable to uninstall %s', sentryApp.name)); @@ -306,6 +309,13 @@ export default function SentryAppDetailedView() { (disabledFromFeatures: boolean, userHasAccess: boolean) => { const capitalizedSlug = integrationSlug.charAt(0).toUpperCase() + integrationSlug.slice(1); + if (install?.status === 'pending_deletion') { + return ( + + {t('Pending Deletion')} + + ); + } if (install) { return ( - + {t('Uninstall')} - + ); } @@ -431,7 +441,7 @@ const InstallButton = styled(Button)` margin-left: ${space(1)}; `; -const StyledUninstallButton = styled(Button)` +const StyledButton = styled(Button)` color: ${p => p.theme.subText}; background: ${p => p.theme.background};