From 772cadf91404b74c1b03a7c0bc0b710d94558819 Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Fri, 16 May 2025 14:17:21 -0700 Subject: [PATCH 1/9] feat(aci): Setup detector details --- .../types/workflowEngine/dataConditions.tsx | 9 ++- static/app/types/workflowEngine/detectors.tsx | 11 ++-- static/app/utils/useParams.tsx | 1 + static/app/views/detectors/detail.tsx | 64 ++++++++++++++++--- static/app/views/detectors/hooks.tsx | 27 ++++++++ static/app/views/detectors/routes.tsx | 2 +- 6 files changed, 97 insertions(+), 17 deletions(-) create mode 100644 static/app/views/detectors/hooks.tsx diff --git a/static/app/types/workflowEngine/dataConditions.tsx b/static/app/types/workflowEngine/dataConditions.tsx index bfd62ed54d9381..d3c24c7b7f2b52 100644 --- a/static/app/types/workflowEngine/dataConditions.tsx +++ b/static/app/types/workflowEngine/dataConditions.tsx @@ -9,9 +9,16 @@ interface SnubaQuery { environment?: string; } -export interface DataSource { +interface QueryObject { id: string; snubaQuery: SnubaQuery; + sourceId: string; + type: 'snuba_query_subscription'; +} + +export interface DataSource { + id: string; + queryObj: QueryObject; status: number; subscription?: string; } diff --git a/static/app/types/workflowEngine/detectors.tsx b/static/app/types/workflowEngine/detectors.tsx index 15de579d255d6e..fa43decd0791a3 100644 --- a/static/app/types/workflowEngine/detectors.tsx +++ b/static/app/types/workflowEngine/detectors.tsx @@ -12,9 +12,9 @@ export type DetectorType = | 'uptime'; interface NewDetector { + conditionGroup: DataConditionGroup; config: Record; - dataCondition: DataConditionGroup; - dataSource: DataSource; + dataSources: DataSource[]; disabled: boolean; name: string; projectId: string; @@ -23,9 +23,10 @@ interface NewDetector { } export interface Detector extends Readonly { + readonly connectedWorkflows: string[]; readonly createdBy: string; - readonly dateCreated: Date; - readonly dateUpdated: Date; + readonly dateCreated: string; + readonly dateUpdated: string; readonly id: string; - readonly lastTriggered: Date; + readonly lastTriggered: string; } diff --git a/static/app/utils/useParams.tsx b/static/app/utils/useParams.tsx index ac0add99d69a47..d7ce6243552afd 100644 --- a/static/app/utils/useParams.tsx +++ b/static/app/utils/useParams.tsx @@ -18,6 +18,7 @@ type ParamKeys = | 'codeId' | 'dataExportId' | 'dashboardId' + | 'detectorId' | 'docIntegrationSlug' | 'eventId' | 'fineTuneType' diff --git a/static/app/views/detectors/detail.tsx b/static/app/views/detectors/detail.tsx index fb42e08764de26..72a197c5db7f80 100644 --- a/static/app/views/detectors/detail.tsx +++ b/static/app/views/detectors/detail.tsx @@ -6,6 +6,8 @@ import {Button} from 'sentry/components/core/button'; import {LinkButton} from 'sentry/components/core/button/linkButton'; import {DateTime} from 'sentry/components/dateTime'; import {KeyValueTable, KeyValueTableRow} from 'sentry/components/keyValueTable'; +import LoadingError from 'sentry/components/loadingError'; +import LoadingIndicator from 'sentry/components/loadingIndicator'; import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle'; import TimeSince from 'sentry/components/timeSince'; import {ActionsProvider} from 'sentry/components/workflowEngine/layout/actions'; @@ -16,12 +18,19 @@ import {useWorkflowEngineFeatureGate} from 'sentry/components/workflowEngine/use import {IconArrow, IconEdit} from 'sentry/icons'; import {t} from 'sentry/locale'; import {space} from 'sentry/styles/space'; +import type {Detector} from 'sentry/types/workflowEngine/detectors'; import getDuration from 'sentry/utils/duration/getDuration'; import useOrganization from 'sentry/utils/useOrganization'; +import {useParams} from 'sentry/utils/useParams'; +import useProjects from 'sentry/utils/useProjects'; import {ConnectedAutomationsList} from 'sentry/views/detectors/components/connectedAutomationList'; import DetailsPanel from 'sentry/views/detectors/components/detailsPanel'; import IssuesList from 'sentry/views/detectors/components/issuesList'; -import {makeMonitorBasePathname} from 'sentry/views/detectors/pathnames'; +import {useDetector} from 'sentry/views/detectors/hooks'; +import { + makeMonitorBasePathname, + makeMonitorDetailsPathname, +} from 'sentry/views/detectors/pathnames'; type Priority = { sensitivity: string; @@ -33,16 +42,43 @@ const priorities: Priority[] = [ {sensitivity: 'high', threshold: 10}, ]; +function getEnvironmentFromDetector(detector: Detector) { + return detector.dataSources.find(ds => ds.queryObj.snubaQuery.environment)?.queryObj + .snubaQuery.environment; +} + export default function DetectorDetail() { const organization = useOrganization(); useWorkflowEngineFeatureGate({redirect: true}); + const params = useParams<{detectorId: string}>(); + const {projects} = useProjects(); + + const { + data: detector, + isPending, + isError, + refetch, + } = useDetector({ + // TODO: Remove hardcoded project slug or move to project url + projectSlug: 'sentry', + detectorId: params.detectorId, + }); + const project = projects.find(p => p.id === detector?.projectId); + + if (isPending) { + return ; + } + + if (isError || !project) { + return ; + } return ( - + - }> + }> {/* TODO: Add chart here */} @@ -81,15 +117,17 @@ export default function DetectorDetail() { } + value={} /> - + } + value={} + /> + - - @@ -100,7 +138,8 @@ export default function DetectorDetail() { ); } -function Actions() { +function Actions({detector}: {detector: Detector}) { + const organization = useOrganization(); const disable = () => { window.alert('disable'); }; @@ -109,7 +148,12 @@ function Actions() { - } size="sm"> + } + size="sm" + > {t('Edit')} diff --git a/static/app/views/detectors/hooks.tsx b/static/app/views/detectors/hooks.tsx new file mode 100644 index 00000000000000..8e70fd2ea128a2 --- /dev/null +++ b/static/app/views/detectors/hooks.tsx @@ -0,0 +1,27 @@ +import type {Detector} from 'sentry/types/workflowEngine/detectors'; +import type {ApiQueryKey} from 'sentry/utils/queryClient'; +import {useApiQuery} from 'sentry/utils/queryClient'; +import useOrganization from 'sentry/utils/useOrganization'; + +function getDetectorQueryKey( + organizationSlug: string, + projectSlug: string, + detectorId: string +): ApiQueryKey { + return [`/projects/${organizationSlug}/${projectSlug}/detectors/${detectorId}/`]; +} + +interface UseDetectorOptions { + detectorId: string; + projectSlug: string; +} + +export function useDetector({projectSlug, detectorId}: UseDetectorOptions) { + const organization = useOrganization(); + return useApiQuery( + getDetectorQueryKey(organization.slug, projectSlug, detectorId), + { + staleTime: 0, + } + ); +} diff --git a/static/app/views/detectors/routes.tsx b/static/app/views/detectors/routes.tsx index d686823673d3f6..5fc6029046bf30 100644 --- a/static/app/views/detectors/routes.tsx +++ b/static/app/views/detectors/routes.tsx @@ -11,7 +11,7 @@ export const detectorRoutes = ( component={make(() => import('sentry/views/detectors/new-settings'))} /> - + import('sentry/views/detectors/detail'))} /> import('sentry/views/detectors/edit'))} /> From 9e980a91ceb5c4512f02229c9349804db2c6eadd Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Fri, 16 May 2025 18:43:06 -0700 Subject: [PATCH 2/9] setup snuba query details --- .../types/workflowEngine/dataConditions.tsx | 26 +++++++++---- .../detectors/components/detailsPanel.tsx | 39 ++++++++++++++++--- static/app/views/detectors/detail.tsx | 8 ++-- 3 files changed, 57 insertions(+), 16 deletions(-) diff --git a/static/app/types/workflowEngine/dataConditions.tsx b/static/app/types/workflowEngine/dataConditions.tsx index e31bd2962f2e08..0efae5463526c6 100644 --- a/static/app/types/workflowEngine/dataConditions.tsx +++ b/static/app/types/workflowEngine/dataConditions.tsx @@ -5,6 +5,9 @@ interface SnubaQuery { dataset: string; id: string; query: string; + /** + * Time window in seconds + */ timeWindow: number; environment?: string; } @@ -12,17 +15,20 @@ interface SnubaQuery { interface QueryObject { id: string; snubaQuery: SnubaQuery; - sourceId: string; - type: 'snuba_query_subscription'; + status: number; + subscription: string; } -export interface DataSource { +export interface SnubaQueryDataSource { id: string; + organizationId: string; queryObj: QueryObject; - status: number; - subscription?: string; + sourceId: string; + type: 'snuba_query_subscription'; } +export type DataSource = SnubaQueryDataSource; + export enum DataConditionType { // operators EQUAL = 'eq', @@ -75,11 +81,17 @@ export enum DataConditionGroupLogicType { NONE = 'none', } +export const enum DetectorPriorityLevel { + HIGH = 75, + MEDIUM = 50, + LOW = 25, +} + export interface NewDataCondition { - comparison: any; + comparison: string | number; comparison_type: DataConditionType; condition_group?: DataConditionGroup; - condition_result?: any; + condition_result?: DetectorPriorityLevel; } export interface DataCondition extends Readonly { diff --git a/static/app/views/detectors/components/detailsPanel.tsx b/static/app/views/detectors/components/detailsPanel.tsx index 547ec9d5f4bf4b..7178b6c57e4d2f 100644 --- a/static/app/views/detectors/components/detailsPanel.tsx +++ b/static/app/views/detectors/components/detailsPanel.tsx @@ -4,17 +4,46 @@ import {Flex} from 'sentry/components/container/flex'; import {Container} from 'sentry/components/workflowEngine/ui/container'; import {t} from 'sentry/locale'; import {space} from 'sentry/styles/space'; +import type {SnubaQueryDataSource} from 'sentry/types/workflowEngine/dataConditions'; +import type {Detector} from 'sentry/types/workflowEngine/detectors'; +import {getExactDuration} from 'sentry/utils/duration/getExactDuration'; + +interface DetailsPanelProps { + detector: Detector; +} + +function SnubaQueryDetails({dataSource}: {dataSource: SnubaQueryDataSource}) { + return ( + + + {t('Query:')} + + {' '} + {dataSource.queryObj.snubaQuery.aggregate} + {' '} + {dataSource.queryObj.snubaQuery.query} + + + + {t('Threshold:')} + {getExactDuration(dataSource.queryObj.snubaQuery.timeWindow, true)} + + + ); +} + +function DetailsPanel({detector}: DetailsPanelProps) { + if (detector.dataSources[0]?.type === 'snuba_query_subscription') { + return ; + } -// TODO: Make component flexible for different alert types -function DetailsPanel() { return ( {t('Query:')} - {t('p75')} - {t('device.name is "Chrome"')} - {t('release')} + placeholder + placeholder {t('Threshold:')} diff --git a/static/app/views/detectors/detail.tsx b/static/app/views/detectors/detail.tsx index c81e4b9e65ca61..3255f586aee389 100644 --- a/static/app/views/detectors/detail.tsx +++ b/static/app/views/detectors/detail.tsx @@ -42,7 +42,7 @@ const priorities: Priority[] = [ {sensitivity: 'high', threshold: 10}, ]; -function getEnvironmentFromDetector(detector: Detector) { +function getDetectorEnvironment(detector: Detector) { return detector.dataSources.find(ds => ds.queryObj.snubaQuery.environment)?.queryObj .snubaQuery.environment; } @@ -75,7 +75,7 @@ export default function DetectorDetail() { crumb={{label: t('Monitors'), to: makeMonitorBasePathname(organization.slug)}} > }> - + {/* TODO: Add chart here */}
@@ -88,7 +88,7 @@ export default function DetectorDetail() {
- +
{t('Assign to %s', 'admin@sentry.io')} @@ -122,7 +122,7 @@ export default function DetectorDetail() { />
From daea1e906a0c04e051fceff9095f5f11b8ddd677 Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Mon, 19 May 2025 16:59:06 -0700 Subject: [PATCH 3/9] apply to types to fixtures --- .../types/workflowEngine/dataConditions.tsx | 2 +- tests/js/fixtures/dataConditions.ts | 6 ++-- tests/js/fixtures/detectors.ts | 32 ++++++++++++------- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/static/app/types/workflowEngine/dataConditions.tsx b/static/app/types/workflowEngine/dataConditions.tsx index 0efae5463526c6..9593d79169a723 100644 --- a/static/app/types/workflowEngine/dataConditions.tsx +++ b/static/app/types/workflowEngine/dataConditions.tsx @@ -88,7 +88,7 @@ export const enum DetectorPriorityLevel { } export interface NewDataCondition { - comparison: string | number; + comparison: any; comparison_type: DataConditionType; condition_group?: DataConditionGroup; condition_result?: DetectorPriorityLevel; diff --git a/tests/js/fixtures/dataConditions.ts b/tests/js/fixtures/dataConditions.ts index 2106c3d791e087..ac991be4024178 100644 --- a/tests/js/fixtures/dataConditions.ts +++ b/tests/js/fixtures/dataConditions.ts @@ -7,7 +7,7 @@ import { DataConditionType, } from 'sentry/types/workflowEngine/dataConditions'; -export function DataConditionFixture(params: Partial): DataCondition { +export function DataConditionFixture(params: Partial = {}): DataCondition { return { comparison_type: DataConditionType.EQUAL, comparison: '8', @@ -17,10 +17,10 @@ export function DataConditionFixture(params: Partial): DataCondit } export function DataConditionGroupFixture( - params: Partial + params: Partial = {} ): DataConditionGroup { return { - conditions: [DataConditionFixture({})], + conditions: [DataConditionFixture()], id: '1', logicType: DataConditionGroupLogicType.ANY, actions: [], diff --git a/tests/js/fixtures/detectors.ts b/tests/js/fixtures/detectors.ts index 31a151328807e7..3589179d0ae255 100644 --- a/tests/js/fixtures/detectors.ts +++ b/tests/js/fixtures/detectors.ts @@ -4,7 +4,7 @@ import {UserFixture} from 'sentry-fixture/user'; import type {DataSource} from 'sentry/types/workflowEngine/dataConditions'; import type {Detector} from 'sentry/types/workflowEngine/detectors'; -export function DetectorFixture(params: Partial): Detector { +export function DetectorFixture(params: Partial = {}): Detector { return { id: '1', name: 'detector', @@ -16,24 +16,32 @@ export function DetectorFixture(params: Partial): Detector { workflowIds: [], config: {}, type: 'metric', - dataCondition: DataConditionGroupFixture({}), disabled: false, - dataSource: params.dataSource ?? DetectorDataSource({}), + conditionGroup: params.conditionGroup ?? DataConditionGroupFixture(), + dataSources: params.dataSources ?? [DetectorDataSource()], + connectedWorkflows: [], ...params, }; } -export function DetectorDataSource(params: Partial): DataSource { +export function DetectorDataSource(params: Partial = {}): DataSource { return { id: '1', - status: 1, - snubaQuery: { - aggregate: '', - dataset: '', - id: '', - query: '', - timeWindow: 60, - ...params, + organizationId: '1', + sourceId: '1', + type: 'snuba_query_subscription', + queryObj: { + id: '1', + status: 1, + subscription: '1', + snubaQuery: { + aggregate: '', + dataset: '', + id: '', + query: '', + timeWindow: 60, + ...params, + }, }, }; } From 5dbdafcb3736a7f199f255649ce1a1ceaa1c177a Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Wed, 21 May 2025 10:55:23 -0700 Subject: [PATCH 4/9] add basic test --- static/app/views/detectors/detail.spec.tsx | 62 ++++++++++++++++++++++ static/app/views/detectors/detail.tsx | 2 +- tests/js/fixtures/detectors.ts | 6 +-- 3 files changed, 66 insertions(+), 4 deletions(-) create mode 100644 static/app/views/detectors/detail.spec.tsx diff --git a/static/app/views/detectors/detail.spec.tsx b/static/app/views/detectors/detail.spec.tsx new file mode 100644 index 00000000000000..0a2f6c3147b2ea --- /dev/null +++ b/static/app/views/detectors/detail.spec.tsx @@ -0,0 +1,62 @@ +import {DetectorDataSourceFixture, DetectorFixture} from 'sentry-fixture/detectors'; +import {OrganizationFixture} from 'sentry-fixture/organization'; +import {ProjectFixture} from 'sentry-fixture/project'; + +import {render, screen} from 'sentry-test/reactTestingLibrary'; + +import ProjectsStore from 'sentry/stores/projectsStore'; +import DetectorDetails from 'sentry/views/detectors/detail'; + +describe('DetectorDetails', function () { + const organization = OrganizationFixture({features: ['workflow-engine-ui']}); + const project = ProjectFixture(); + const defaultDataSource = DetectorDataSourceFixture(); + const subaQueryDetector = DetectorFixture({ + projectId: project.id, + dataSources: [ + DetectorDataSourceFixture({ + queryObj: { + ...defaultDataSource.queryObj, + snubaQuery: { + ...defaultDataSource.queryObj.snubaQuery, + query: 'test', + environment: 'test-environment', + }, + }, + }), + ], + }); + const initialRouterConfig = { + location: { + pathname: `/organizations/${organization.slug}/issues/detectors/${subaQueryDetector.id}/`, + }, + route: '/organizations/:orgId/issues/detectors/:detectorId/', + }; + + beforeEach(() => { + ProjectsStore.loadInitialData([project]); + MockApiClient.addMockResponse({ + url: `/organizations/${organization.slug}/detectors/${subaQueryDetector.id}/`, + body: subaQueryDetector, + }); + }); + + it('renders the detector name and snuba query', async function () { + render(, { + organization, + initialRouterConfig, + }); + + expect( + await screen.findByRole('heading', {name: subaQueryDetector.name}) + ).toBeInTheDocument(); + // Displays the snuba query + expect( + screen.getByText(subaQueryDetector.dataSources[0]!.queryObj.snubaQuery.query) + ).toBeInTheDocument(); + // Displays the environment + expect( + screen.getByText(subaQueryDetector.dataSources[0]!.queryObj.snubaQuery.environment!) + ).toBeInTheDocument(); + }); +}); diff --git a/static/app/views/detectors/detail.tsx b/static/app/views/detectors/detail.tsx index 3255f586aee389..6e60283e0304bb 100644 --- a/static/app/views/detectors/detail.tsx +++ b/static/app/views/detectors/detail.tsx @@ -47,7 +47,7 @@ function getDetectorEnvironment(detector: Detector) { .snubaQuery.environment; } -export default function DetectorDetail() { +export default function DetectorDetails() { const organization = useOrganization(); useWorkflowEngineFeatureGate({redirect: true}); const params = useParams<{detectorId: string}>(); diff --git a/tests/js/fixtures/detectors.ts b/tests/js/fixtures/detectors.ts index 3589179d0ae255..8d4ac5b826f8b5 100644 --- a/tests/js/fixtures/detectors.ts +++ b/tests/js/fixtures/detectors.ts @@ -18,13 +18,13 @@ export function DetectorFixture(params: Partial = {}): Detector { type: 'metric', disabled: false, conditionGroup: params.conditionGroup ?? DataConditionGroupFixture(), - dataSources: params.dataSources ?? [DetectorDataSource()], + dataSources: params.dataSources ?? [DetectorDataSourceFixture()], connectedWorkflows: [], ...params, }; } -export function DetectorDataSource(params: Partial = {}): DataSource { +export function DetectorDataSourceFixture(params: Partial = {}): DataSource { return { id: '1', organizationId: '1', @@ -40,8 +40,8 @@ export function DetectorDataSource(params: Partial = {}): DataSource id: '', query: '', timeWindow: 60, - ...params, }, }, + ...params, }; } From 8b9790d2b195efcbd59bb5bf962ccb1dfcd9f9ec Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Wed, 21 May 2025 11:26:39 -0700 Subject: [PATCH 5/9] change import location --- static/app/views/detectors/components/detailsPanel.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/static/app/views/detectors/components/detailsPanel.tsx b/static/app/views/detectors/components/detailsPanel.tsx index 7178b6c57e4d2f..5ad30548e618fd 100644 --- a/static/app/views/detectors/components/detailsPanel.tsx +++ b/static/app/views/detectors/components/detailsPanel.tsx @@ -4,8 +4,7 @@ import {Flex} from 'sentry/components/container/flex'; import {Container} from 'sentry/components/workflowEngine/ui/container'; import {t} from 'sentry/locale'; import {space} from 'sentry/styles/space'; -import type {SnubaQueryDataSource} from 'sentry/types/workflowEngine/dataConditions'; -import type {Detector} from 'sentry/types/workflowEngine/detectors'; +import type {Detector, SnubaQueryDataSource} from 'sentry/types/workflowEngine/detectors'; import {getExactDuration} from 'sentry/utils/duration/getExactDuration'; interface DetailsPanelProps { From 638491fc5ee4d06f4b76c214fc4bf69fb4286ac8 Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Wed, 21 May 2025 12:06:41 -0700 Subject: [PATCH 6/9] another import --- tests/js/fixtures/detectors.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/js/fixtures/detectors.ts b/tests/js/fixtures/detectors.ts index 8d4ac5b826f8b5..ca4b3ac5e7535f 100644 --- a/tests/js/fixtures/detectors.ts +++ b/tests/js/fixtures/detectors.ts @@ -1,8 +1,7 @@ import {DataConditionGroupFixture} from 'sentry-fixture/dataConditions'; import {UserFixture} from 'sentry-fixture/user'; -import type {DataSource} from 'sentry/types/workflowEngine/dataConditions'; -import type {Detector} from 'sentry/types/workflowEngine/detectors'; +import type {DataSource, Detector} from 'sentry/types/workflowEngine/detectors'; export function DetectorFixture(params: Partial = {}): Detector { return { From 1ffb7eaf8cb4c41ae283c6562a2578f55de9249e Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Wed, 21 May 2025 14:54:09 -0700 Subject: [PATCH 7/9] spelling hard --- static/app/views/detectors/detail.spec.tsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/static/app/views/detectors/detail.spec.tsx b/static/app/views/detectors/detail.spec.tsx index 0a2f6c3147b2ea..216adf4d0c5264 100644 --- a/static/app/views/detectors/detail.spec.tsx +++ b/static/app/views/detectors/detail.spec.tsx @@ -11,7 +11,7 @@ describe('DetectorDetails', function () { const organization = OrganizationFixture({features: ['workflow-engine-ui']}); const project = ProjectFixture(); const defaultDataSource = DetectorDataSourceFixture(); - const subaQueryDetector = DetectorFixture({ + const snubaQueryDetector = DetectorFixture({ projectId: project.id, dataSources: [ DetectorDataSourceFixture({ @@ -28,7 +28,7 @@ describe('DetectorDetails', function () { }); const initialRouterConfig = { location: { - pathname: `/organizations/${organization.slug}/issues/detectors/${subaQueryDetector.id}/`, + pathname: `/organizations/${organization.slug}/issues/detectors/${snubaQueryDetector.id}/`, }, route: '/organizations/:orgId/issues/detectors/:detectorId/', }; @@ -36,8 +36,8 @@ describe('DetectorDetails', function () { beforeEach(() => { ProjectsStore.loadInitialData([project]); MockApiClient.addMockResponse({ - url: `/organizations/${organization.slug}/detectors/${subaQueryDetector.id}/`, - body: subaQueryDetector, + url: `/organizations/${organization.slug}/detectors/${snubaQueryDetector.id}/`, + body: snubaQueryDetector, }); }); @@ -48,15 +48,17 @@ describe('DetectorDetails', function () { }); expect( - await screen.findByRole('heading', {name: subaQueryDetector.name}) + await screen.findByRole('heading', {name: snubaQueryDetector.name}) ).toBeInTheDocument(); // Displays the snuba query expect( - screen.getByText(subaQueryDetector.dataSources[0]!.queryObj.snubaQuery.query) + screen.getByText(snubaQueryDetector.dataSources[0]!.queryObj.snubaQuery.query) ).toBeInTheDocument(); // Displays the environment expect( - screen.getByText(subaQueryDetector.dataSources[0]!.queryObj.snubaQuery.environment!) + screen.getByText( + snubaQueryDetector.dataSources[0]!.queryObj.snubaQuery.environment! + ) ).toBeInTheDocument(); }); }); From 9435d3fe15c2a30597b813d27f1a07d24e7fac05 Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Wed, 21 May 2025 14:54:23 -0700 Subject: [PATCH 8/9] remove connectedworkflows --- static/app/types/workflowEngine/detectors.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/static/app/types/workflowEngine/detectors.tsx b/static/app/types/workflowEngine/detectors.tsx index f4ec178837e837..eda35234392e87 100644 --- a/static/app/types/workflowEngine/detectors.tsx +++ b/static/app/types/workflowEngine/detectors.tsx @@ -50,7 +50,6 @@ interface NewDetector { } export interface Detector extends Readonly { - readonly connectedWorkflows: string[]; readonly createdBy: string; readonly dateCreated: string; readonly dateUpdated: string; From 0ea182c6e0312497287380b7dc0b943920869422 Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Wed, 21 May 2025 14:59:41 -0700 Subject: [PATCH 9/9] types --- tests/js/fixtures/detectors.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/js/fixtures/detectors.ts b/tests/js/fixtures/detectors.ts index ca4b3ac5e7535f..333cc507001bf0 100644 --- a/tests/js/fixtures/detectors.ts +++ b/tests/js/fixtures/detectors.ts @@ -18,7 +18,6 @@ export function DetectorFixture(params: Partial = {}): Detector { disabled: false, conditionGroup: params.conditionGroup ?? DataConditionGroupFixture(), dataSources: params.dataSources ?? [DetectorDataSourceFixture()], - connectedWorkflows: [], ...params, }; }