Skip to content

Commit 55bd494

Browse files
authored
fix(integrations): integration status consistent in integration details and directory (#54339)
Change: <img width="911" alt="Screenshot 2023-08-07 at 3 25 56 PM" src="https://github.com/getsentry/sentry/assets/56209417/a528df77-5653-491b-b937-84a90318bdda"> <img width="912" alt="Screenshot 2023-08-07 at 3 26 07 PM" src="https://github.com/getsentry/sentry/assets/56209417/e22a6ebb-e4e1-4c71-bd52-f755fd32a799"> Previously: ![Screenshot 2023-08-04 at 11 48 26 AM](https://github.com/getsentry/sentry/assets/56209417/a912307f-5ab5-4c35-a95e-0eabe59682e7) ![Screenshot 2023-08-04 at 11 48 35 AM](https://github.com/getsentry/sentry/assets/56209417/228924fc-5da4-48e9-afae-50b1235179ac)
1 parent 0795d07 commit 55bd494

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

static/app/views/settings/organizationIntegrations/integrationListDirectory.tsx

+17-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import {createFuzzySearch, Fuse} from 'sentry/utils/fuzzySearch';
3434
import {
3535
getAlertText,
3636
getCategoriesForIntegration,
37+
getIntegrationStatus,
3738
getSentryAppInstallStatus,
3839
isDocIntegration,
3940
isPlugin,
@@ -236,6 +237,21 @@ export class IntegrationListDirectory extends DeprecatedAsyncComponent<
236237
return integrations?.find(i => i.provider.key === integration.key) ? 2 : 0;
237238
}
238239

240+
getInstallStatuses(integrations: Integration[]) {
241+
const statusList = integrations?.map(getIntegrationStatus);
242+
// if we have conflicting statuses, we have a priority order
243+
if (statusList.includes('active')) {
244+
return 'Installed';
245+
}
246+
if (statusList.includes('disabled')) {
247+
return 'Disabled';
248+
}
249+
if (statusList.includes('pending_deletion')) {
250+
return 'Pending Deletion';
251+
}
252+
return 'Not Installed';
253+
}
254+
239255
getPopularityWeight = (integration: AppOrProviderOrPlugin) => {
240256
if (isSentryApp(integration) || isDocIntegration(integration)) {
241257
return integration?.popularity ?? 1;
@@ -395,7 +411,7 @@ export class IntegrationListDirectory extends DeprecatedAsyncComponent<
395411
type="firstParty"
396412
slug={provider.slug}
397413
displayName={provider.name}
398-
status={integrations.length ? 'Installed' : 'Not Installed'}
414+
status={this.getInstallStatuses(integrations)}
399415
publishStatus="published"
400416
configurations={integrations.length}
401417
categories={getCategoriesForIntegration(provider)}

0 commit comments

Comments
 (0)