-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
chore(eco): add pending deletion state for sentry app installs #101125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -229,7 +229,10 @@ export default function SentryAppDetailedView() { | |
setApiQueryData<SentryAppInstallation[]>( | ||
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 | ||
) | ||
); | ||
Comment on lines
+232
to
236
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Potential bug: The frontend optimistically sets an installation's status to
|
||
} 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 ( | ||
<StyledButton size="sm" disabled> | ||
{t('Pending Deletion')} | ||
</StyledButton> | ||
); | ||
} | ||
if (install) { | ||
return ( | ||
<Confirm | ||
|
@@ -317,10 +327,10 @@ export default function SentryAppDetailedView() { | |
onConfirming={recordUninstallClicked} // called when the confirm modal opens | ||
priority="danger" | ||
> | ||
<StyledUninstallButton size="sm" data-test-id="sentry-app-uninstall"> | ||
<StyledButton size="sm" data-test-id="sentry-app-uninstall"> | ||
<IconSubtract isCircled style={{marginRight: space(0.75)}} /> | ||
{t('Uninstall')} | ||
</StyledUninstallButton> | ||
</StyledButton> | ||
</Confirm> | ||
); | ||
} | ||
|
@@ -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}; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have we updated the APIs to return sentry apps that are pending deletion? Also, is there an enum we can reference for object status? Seems fairly generic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The status looks like this https://github.com/getsentry/sentry/pull/101125/files#diff-b2f09d35e3f0947a8312823f96c548de7361dc682c81b6f9c272b7a97408baf4R270
Everything is returned unless it has been "soft deleted", in which case the object manager will not return it