Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(signals): show monitoring filter when project has reports (#130019)

Mikayla Thompson33f0f4ce1a8e
diff --git a/docs/internal/signals-pr-lifecycle.md b/docs/internal/signals-pr-lifecycle.md
index 2439bda5bdd6..15887cda8c3c 100644
--- a/docs/internal/signals-pr-lifecycle.md
+++ b/docs/internal/signals-pr-lifecycle.md
@@ -2,7 +2,7 @@
The inbox includes Closed reports in All statuses. The Closed filter appears when the project has closed reports, or when it is selected.
-Monitoring reports show an eye icon below their priority in the inbox list, aligned with the repository and source metadata. When Monitoring is enabled, the Monitoring option in the statuses dropdown filters by `status=monitoring`; disabled projects hide that option and skip its list and count requests. Review and merge continues to show reports with an open implementation PR.
+Monitoring reports show an eye icon below their priority in the inbox list, aligned with the repository and source metadata. The Monitoring option in the statuses dropdown appears when the current project has monitoring reports across any inbox scope, or when it is already selected. It filters by `status=monitoring`, which returns an empty result when monitoring is disabled. Review and merge continues to show reports with an open implementation PR.
A report completes after all linked implementation PRs are closed or merged.
At least one merged PR completes implementation: applicable follow-up checks enter Monitoring when enabled; otherwise the report resolves directly. All closed PRs without a merge suppress it.
diff --git a/products/signals/backend/test/test_signal_report_api.py b/products/signals/backend/test/test_signal_report_api.py
index 1bca7a32016f..30ac948f2bc5 100644
--- a/products/signals/backend/test/test_signal_report_api.py
+++ b/products/signals/backend/test/test_signal_report_api.py
@@ -1486,6 +1486,14 @@ class TestSignalReportListAPI(APIBaseTest):
return_value=flag_result if isinstance(flag_result, bool) else False,
side_effect=flag_result if isinstance(flag_result, Exception) else None,
):
+ expected_monitoring = {str(monitoring.id)} if enabled else set()
+ filtered = self.client.get(self._list_url(status="monitoring"))
+ assert filtered.status_code == status.HTTP_200_OK
+ assert {row["id"] for row in filtered.json()["results"]} == expected_monitoring
+ filtered_count = self.client.get(self._list_url(status="monitoring", count_only="true"))
+ assert filtered_count.status_code == status.HTTP_200_OK
+ assert filtered_count.json()["count"] == len(expected_monitoring)
+
for query in [{"status": "resolved"}, {"view": "resolved"}]:
response = self.client.get(self._list_url(**query))
assert response.status_code == status.HTTP_200_OK
@@ -1593,7 +1601,7 @@ class TestSignalReportListAPI(APIBaseTest):
@parameterized.expand(
[
- ("monitoring", "monitoring"),
+ ("monitoring_and_invalid", "monitoring,bogus_status"),
("garbage", "bogus_status"),
("mixed_valid_and_invalid", "ready,bogus_status"),
("deleted_not_filterable", "deleted"),
diff --git a/products/signals/backend/views.py b/products/signals/backend/views.py
index 78d773c90991..5cd0254d6525 100644
--- a/products/signals/backend/views.py
+++ b/products/signals/backend/views.py
@@ -2125,14 +2125,14 @@ class SignalReportViewSet(
# `(team, status, promoted_at)` index condition, while `exclude(status=...)` leaves the
# status as a filter that runs on rows the index already made it read.
statuses = self._visible_statuses()
+ if not self._report_monitoring_enabled:
+ statuses -= {SignalReport.Status.MONITORING}
if SignalReport.Status.RESOLVED in statuses:
statuses |= self._resolved_read_statuses()
return queryset.filter(status__in=sorted(statuses))
def _visible_statuses(self) -> frozenset[str]:
- filterable_statuses = self._FILTERABLE_STATUSES
- if self._report_monitoring_enabled:
- filterable_statuses |= {SignalReport.Status.MONITORING}
+ filterable_statuses = self._FILTERABLE_STATUSES | {SignalReport.Status.MONITORING}
status_filter = self.request.query_params.get("status")
if status_filter:
statuses = [s.strip() for s in status_filter.split(",") if s.strip()]
diff --git a/products/signals/frontend/inbox/InboxScene.stories.tsx b/products/signals/frontend/inbox/InboxScene.stories.tsx
index 60d80611ee0f..5828fea6e8e7 100644
--- a/products/signals/frontend/inbox/InboxScene.stories.tsx
+++ b/products/signals/frontend/inbox/InboxScene.stories.tsx
@@ -22,8 +22,10 @@ import {
reportTabReports,
} from './__mocks__/inboxMocks'
import { mockLargeScoutFleet, mockScoutConfigs, mockScoutRuns, mockScoutSuggestionSet } from './__mocks__/scoutConfigs'
+import { InboxStateFilter } from './components/shell/InboxStateFilter'
import { InboxScene } from './InboxScene'
import { INBOX_LAST_UI_STATE_STORAGE_KEY } from './logics/inboxOnboardingLogic'
+import { reportListLogic, sectionListLogicProps } from './logics/reportListLogic'
// Full Inbox scene with a populated report list. Use this to polish the holistic
// layout: header, page tabs, the Reports view switcher, scope picker, filter bar, and the
@@ -104,6 +106,53 @@ type Story = StoryObj
export const Inbox: Story = {}
+function statusAvailabilityMocks(monitoringCount: number): Decorator {
+ return mswDecorator({
+ get: {
+ '/api/projects/:id/signals/reports': ({ request }) => [
+ 200,
+ {
+ results: [],
+ count: new URL(request.url).searchParams.get('status') === 'monitoring' ? monitoringCount : 0,
+ next: null,
+ previous: null,
+ },
+ ],
+ },
+ })
+}
+
+export const MonitoringReportsExist: Story = {
+ parameters: {
+ featureFlags: { [FEATURE_FLAGS.SIGNALS_REPORT_MONITORING]: false },
+ testOptions: { snapshotBrowsers: [] },
+ },
+ decorators: [statusAvailabilityMocks(1)],
+ render: () => (
+ <div className="p-4">
+ <InboxStateFilter />
+ </div>
+ ),
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement)
+ await userEvent.click(await canvas.findByRole('button', { name: /statuses/ }))
+ await waitFor(() => expect(within(document.body).getByText('Monitoring', { exact: true })).toBeVisible())
+ },
+}
+
+export const NoMonitoringReports: Story = {
+ ...MonitoringReportsExist,
+ decorators: [statusAvailabilityMocks(0)],
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement)
+ await waitFor(() =>
+ expect(reportListLogic(sectionListLogicProps('outcome-monitoring')).values.hasProjectReports).toBe(false)
+ )
+ await userEvent.click(await canvas.findByRole('button', { name: /statuses/ }))
+ expect(within(document.body).queryByText('Monitoring', { exact: true })).not.toBeInTheDocument()
+ },
+}
+
const valueSummaryMocks = mswDecorator({
get: {
'/api/projects/:team_id/signals/inbox_summary/': {
diff --git a/products/signals/frontend/inbox/components/shell/InboxStateFilter.tsx b/products/signals/frontend/inbox/components/shell/InboxStateFilter.tsx
index afbc67f86bec..e289ea44d687 100644
--- a/products/signals/frontend/inbox/components/shell/InboxStateFilter.tsx
+++ b/products/signals/frontend/inbox/components/shell/InboxStateFilter.tsx
@@ -22,15 +22,18 @@ import {
*/
export function InboxStateFilter(): JSX.Element {
const { isStaff } = useValues(inboxSceneLogic)
- const { stateFilter, visibleStateFilter, monitoringAvailable } = useValues(inboxFiltersLogic)
- const { hasProjectClosedReports } = useValues(reportListLogic(sectionListLogicProps('closed')))
+ const { stateFilter, visibleStateFilter } = useValues(inboxFiltersLogic)
+ const { hasProjectReports: hasProjectClosedReports } = useValues(reportListLogic(sectionListLogicProps('closed')))
+ const { hasProjectReports: hasProjectMonitoringReports } = useValues(
+ reportListLogic(sectionListLogicProps('outcome-monitoring'))
+ )
const { toggleState } = useActions(inboxFiltersLogic)
const [visible, setVisible] = useState(false)
const options = INBOX_REPORT_SECTION_KEYS.filter(
(key) =>
(isStaff || !INBOX_STAFF_ONLY_REPORT_SECTION_KEYS.includes(key)) &&
- (key !== 'outcome-monitoring' || monitoringAvailable) &&
+ (key !== 'outcome-monitoring' || hasProjectMonitoringReports || stateFilter.includes(key)) &&
(key !== 'closed' || hasProjectClosedReports || stateFilter.includes(key))
)
// Label from the visible selection: a shared link can carry the staff-only state, and the
diff --git a/products/signals/frontend/inbox/components/tabs/ReportsTab.test.tsx b/products/signals/frontend/inbox/components/tabs/ReportsTab.test.tsx
index bf3e246d87da..26d4f1be13e5 100644
--- a/products/signals/frontend/inbox/components/tabs/ReportsTab.test.tsx
+++ b/products/signals/frontend/inbox/components/tabs/ReportsTab.test.tsx
@@ -453,11 +453,20 @@ describe('ReportsTab', () => {
expect(document.querySelector('[data-attr="report-card-closed"]')).not.toBeNull()
})
- it.each([0, 2])('offers Closed only when the project has closed reports (%s)', async (count) => {
+ it.each([
+ ['closed', 'Closed', 0],
+ ['closed', 'Closed', 2],
+ ['outcome-monitoring', 'Monitoring', 0],
+ ['outcome-monitoring', 'Monitoring', 2],
+ ] as const)('offers %s only when the project has matching reports (%s, %s)', async (sectionKey, label, count) => {
mockReportCounts([
{
match: (params) =>
- params.get('view') === 'closed' && !params.has('search') && !params.has('suggested_reviewers'),
+ (sectionKey === 'closed'
+ ? params.get('view') === 'closed'
+ : params.get('status') === 'monitoring') &&
+ !params.has('search') &&
+ !params.has('suggested_reviewers'),
count,
},
])
@@ -466,10 +475,10 @@ describe('ReportsTab', () => {
render(<InboxStateFilter />)
await waitFor(() =>
- expect(reportListLogic(sectionListLogicProps('closed')).values.hasProjectClosedReports).toBe(count > 0)
+ expect(reportListLogic(sectionListLogicProps(sectionKey)).values.hasProjectReports).toBe(count > 0)
)
fireEvent.click(screen.getByText('2 statuses'))
- expect(screen.queryByText('Closed') !== null).toBe(count > 0)
+ expect(screen.queryByText(label) !== null).toBe(count > 0)
})
// A shared link or persisted storage can carry `state=not-actionable`, a staff-only state the
diff --git a/products/signals/frontend/inbox/logics/inboxFiltersLogic.test.ts b/products/signals/frontend/inbox/logics/inboxFiltersLogic.test.ts
index 86905f513bb4..e9d28c2931fc 100644
--- a/products/signals/frontend/inbox/logics/inboxFiltersLogic.test.ts
+++ b/products/signals/frontend/inbox/logics/inboxFiltersLogic.test.ts
@@ -342,11 +342,11 @@ describe('inboxFiltersLogic', () => {
.toMatchValues({ activeScoutFilter: ['my-custom-scout'], hasActiveFilters: true })
})
- it('preserves a monitoring URL selection while hiding it until monitoring is enabled', async () => {
+ it('keeps a monitoring URL selection visible without a browser rollout flag', async () => {
router.actions.push(urls.inbox('reports'), { state: 'outcome-monitoring' })
await expectLogic(logic).toFinishAllListeners()
- expect(logic.values.visibleStateFilter).toEqual([])
+ expect(logic.values.visibleStateFilter).toEqual(['outcome-monitoring'])
expect(router.values.searchParams.state).toBe('outcome-monitoring')
featureFlagLogic.actions.setFeatureFlags([FEATURE_FLAGS.SIGNALS_REPORT_MONITORING], {
diff --git a/products/signals/frontend/inbox/logics/inboxFiltersLogic.ts b/products/signals/frontend/inbox/logics/inboxFiltersLogic.ts
index badffba45763..f599db6b69f2 100644
--- a/products/signals/frontend/inbox/logics/inboxFiltersLogic.ts
+++ b/products/signals/frontend/inbox/logics/inboxFiltersLogic.ts
@@ -339,7 +339,6 @@ export interface inboxFiltersLogicValues {
uuid: string
} | null
modelSortAvailable: boolean
- monitoringAvailable: boolean
nonDefaultReportFilterCount: number
priorityFilter: SignalReportPriority[]
scope: InboxScope
@@ -475,7 +474,6 @@ export interface inboxFiltersLogicActions {
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface inboxFiltersLogicMeta {
__keaTypeGenInternalSelectorTypes: {
- monitoringAvailable: (featureFlags: FeatureFlagsSet) => boolean
hasActiveFilters: (
searchQuery: string,
activeSourceProductFilter: string[],
@@ -514,8 +512,7 @@ export interface inboxFiltersLogicMeta {
| 'outcome-monitoring'
| 'resolved'
)[],
- user: UserType | null,
- monitoringAvailable: boolean
+ user: UserType | null
) => InboxReportSectionKey[]
nonDefaultReportFilterCount: (
visibleStateFilter: (
@@ -822,10 +819,6 @@ export const inboxFiltersLogic = kea<inboxFiltersLogicType>([
}),
selectors({
- monitoringAvailable: [
- (s) => [s.featureFlags],
- (featureFlags: FeatureFlagsSet): boolean => !!featureFlags[FEATURE_FLAGS.SIGNALS_REPORT_MONITORING],
- ],
// Whether any server-side list-narrowing filter is active. Scope and sort are excluded: they
// don't hide reports the way search/source/priority/created window do, and `clearFilters` leaves them
// untouched. The state filter is also excluded: it only narrows which states the flat
@@ -921,17 +914,9 @@ export const inboxFiltersLogic = kea<inboxFiltersLogicType>([
// selection the control has no checkbox to clear. The raw `stateFilter` stays stored and in
// the URL, so a staff user opening the same link still gets the full selection.
visibleStateFilter: [
- (s) => [s.stateFilter, s.user, s.monitoringAvailable],
- (
- stateFilter: InboxReportSectionKey[],
- user: UserType | null,
- monitoringAvailable: boolean
- ): InboxReportSectionKey[] =>
- stateFilter.filter(
- (key) =>
- (user?.is_staff || !INBOX_STAFF_ONLY_REPORT_SECTION_KEYS.includes(key)) &&
- (key !== 'outcome-monitoring' || monitoringAvailable)
- ),
+ (s) => [s.stateFilter, s.user],
+ (stateFilter: InboxReportSectionKey[], user: UserType | null): InboxReportSectionKey[] =>
+ stateFilter.filter((key) => user?.is_staff || !INBOX_STAFF_ONLY_REPORT_SECTION_KEYS.includes(key)),
],
// The window a ranking sort applies on its own is that sort's default, so it does not count.
nonDefaultReportFilterCount: [
diff --git a/products/signals/frontend/inbox/logics/reportListLogic.test.ts b/products/signals/frontend/inbox/logics/reportListLogic.test.ts
index 2bc1b2245bd8..63c9f44244a8 100644
--- a/products/signals/frontend/inbox/logics/reportListLogic.test.ts
+++ b/products/signals/frontend/inbox/logics/reportListLogic.test.ts
@@ -53,7 +53,7 @@ function makeReport(id: string): SignalReport {
}
describe('reportListLogic', () => {
- it('settles monitoring without requests while disabled and reloads when the flag changes', async () => {
+ it('loads monitoring from the server without a browser rollout flag', async () => {
const requests: string[] = []
useMocks({
get: {
@@ -72,21 +72,9 @@ describe('reportListLogic', () => {
logic.mount()
try {
await expectLogic(logic, () => logic.actions.ensureLoaded()).toFinishAllListeners()
- expect(requests).toEqual([])
- expect(logic.values).toMatchObject({ count: 0, reports: [], isLoaded: true, hasMore: false })
-
- await expectLogic(logic, () =>
- featureFlagLogic.actions.setFeatureFlags([FEATURE_FLAGS.SIGNALS_REPORT_MONITORING], {
- [FEATURE_FLAGS.SIGNALS_REPORT_MONITORING]: true,
- })
- ).toFinishAllListeners()
- expect(requests).toHaveLength(1)
+ expect(requests.length).toBeGreaterThan(0)
expect(requests.every((url) => new URL(url).searchParams.get('status') === 'monitoring')).toBe(true)
expect(logic.values).toMatchObject({ count: 1, reports: [makeReport('monitored')] })
-
- await expectLogic(logic, () => featureFlagLogic.actions.setFeatureFlags([], {})).toFinishAllListeners()
- expect(requests).toHaveLength(1)
- expect(logic.values).toMatchObject({ count: 0, reports: [], hasMore: false })
} finally {
logic.unmount()
}
@@ -488,43 +476,51 @@ describe('reportListLogic', () => {
)
})
- // `InboxStateFilter` hides the Closed state until the project holds a closed report, so this
- // project-wide check has to keep up with reports that close while the inbox is open.
- describe('closed state availability', () => {
- let projectClosedReports: number
+ describe.each(['closed', 'outcome-monitoring'] as const)('%s state availability', (sectionKey) => {
+ let projectReports: number
let logic: ReturnType<typeof reportListLogic.build>
beforeEach(async () => {
- projectClosedReports = 0
+ projectReports = 0
useMocks({
get: {
'/api/projects/:team_id/signals/reports/available_reviewers': {},
[REPORTS_URL]: ({ request }) => {
const params = new URL(request.url).searchParams
- if (params.get('count_only') === 'true') {
- return [200, { count: projectClosedReports, next: null, previous: null, results: [] }]
+ if (
+ params.get('count_only') === 'true' &&
+ !params.has('priority') &&
+ !params.has('suggested_reviewers')
+ ) {
+ return [200, { count: projectReports, next: null, previous: null, results: [] }]
}
return [200, { count: 0, next: null, previous: null, results: [] }]
},
},
})
initKeaTests()
- logic = reportListLogic(sectionListLogicProps('closed'))
+ logic = reportListLogic(sectionListLogicProps(sectionKey))
logic.mount()
+ inboxFiltersLogic.actions.setPriorityFilter(['P0'])
logic.actions.ensureLoaded()
await expectLogic(logic).toFinishAllListeners()
})
afterEach(() => logic.unmount())
- it('rechecks the project for closed reports when the loaded section refreshes', async () => {
- expect(logic.values.hasProjectClosedReports).toBe(false)
+ it('rechecks the project independently of scoped rows when the loaded section refreshes', async () => {
+ expect(logic.values.hasProjectReports).toBe(false)
- projectClosedReports = 1
+ projectReports = 1
logic.actions.refresh()
await expectLogic(logic).toFinishAllListeners()
- expect(logic.values.hasProjectClosedReports).toBe(true)
+ expect(logic.values.hasProjectReports).toBe(true)
+ expect(logic.values.reports).toEqual([])
+
+ projectReports = 0
+ await expectLogic(logic, () => logic.actions.refresh()).toFinishAllListeners()
+ expect(logic.values.hasProjectReports).toBe(false)
})
})
diff --git a/products/signals/frontend/inbox/logics/reportListLogic.ts b/products/signals/frontend/inbox/logics/reportListLogic.ts
index 294f2a932b0e..94cc3f120d8c 100644
--- a/products/signals/frontend/inbox/logics/reportListLogic.ts
+++ b/products/signals/frontend/inbox/logics/reportListLogic.ts
@@ -215,7 +215,6 @@ export interface reportListLogicValues {
activeSourceProductFilter: string[] // inboxFiltersLogic
hasUserChosenScope: boolean // inboxFiltersLogic
isScopedToMe: boolean // inboxFiltersLogic
- monitoringAvailable: boolean // inboxFiltersLogic
priorityFilter: SignalReportPriority[] // inboxFiltersLogic
scope: InboxScope // inboxFiltersLogic
searchQuery: string // inboxFiltersLogic
@@ -226,8 +225,8 @@ export interface reportListLogicValues {
countLoading: boolean
countSettled: boolean
hasMore: boolean
- hasProjectClosedReports: boolean | null
- hasProjectClosedReportsLoading: boolean
+ hasProjectReports: boolean | null
+ hasProjectReportsLoading: boolean
isLoaded: boolean
listApiParams: any
livePrReportIds: string[]
@@ -337,19 +336,19 @@ export interface reportListLogicActions {
count: number | null
payload?: void
}
- loadHasProjectClosedReports: (_: void) => void
- loadHasProjectClosedReportsFailure: (
+ loadHasProjectReports: (_: void) => void
+ loadHasProjectReportsFailure: (
error: string,
errorObject?: any
) => {
error: string
errorObject?: any
}
- loadHasProjectClosedReportsSuccess: (
- hasProjectClosedReports: boolean,
+ loadHasProjectReportsSuccess: (
+ hasProjectReports: boolean,
payload?: void
) => {
- hasProjectClosedReports: boolean
+ hasProjectReports: boolean
payload?: void
}
loadMore: () => {
@@ -540,7 +539,6 @@ export const reportListLogic = kea<reportListLogicType>([
'activeScoutFilter',
'priorityFilter',
'activeCreatedWindow',
- 'monitoringAvailable',
],
userLogic,
['user'],
@@ -606,12 +604,12 @@ export const reportListLogic = kea<reportListLogicType>([
}),
loaders(({ values, cache, props }) => ({
- hasProjectClosedReports: [
+ hasProjectReports: [
null as boolean | null,
{
- loadHasProjectClosedReports: async (_: void, breakpoint) => {
+ loadHasProjectReports: async (_: void, breakpoint) => {
const response = await signalsReportsList(String(values.currentTeamId), {
- view: 'closed',
+ ...props.listParams,
count_only: true,
limit: 1,
})
@@ -627,9 +625,6 @@ export const reportListLogic = kea<reportListLogicType>([
null as number | null,
{
loadCount: async (_: void, breakpoint) => {
- if (props.sectionKey === 'outcome-monitoring' && !values.monitoringAvailable) {
- return 0
- }
const params = values.listApiParams
const pageAtRequest = values.reportsResponse
// nosemgrep: prefer-codegen-api-namespaced-signals -- the Inbox renders the handwritten SignalReport. The generated report type is wider (string status and priority, read-only arrays), so the list calls move to generated types together with the Inbox.
@@ -663,16 +658,6 @@ export const reportListLogic = kea<reportListLogicType>([
const params = values.listApiParams
const requestContext = requestContextFromValues(values)
cache.firstPageRequestId = (cache.firstPageRequestId ?? 0) + 1
- if (props.sectionKey === 'outcome-monitoring' && !values.monitoringAvailable) {
- return {
- count: 0,
- results: [],
- next: null,
- previous: null,
- requestParams: params,
- requestContext,
- }
- }
const rowsBefore = values.reportsResponse?.results
// nosemgrep: prefer-codegen-api-namespaced-signals -- the Inbox renders the handwritten SignalReport. The generated report type is wider (string status and priority, read-only arrays), so the list calls move to generated types together with the Inbox.
const response = await api.signalReports.list({
@@ -696,16 +681,6 @@ export const reportListLogic = kea<reportListLogicType>([
loadMoreReports: async (): Promise<ReportListResponse> => {
const params = values.listApiParams
const requestContext = requestContextFromValues(values)
- if (props.sectionKey === 'outcome-monitoring' && !values.monitoringAvailable) {
- return {
- count: 0,
- results: [],
- next: null,
- previous: null,
- requestParams: params,
- requestContext,
- }
- }
const firstPageRequestId = cache.firstPageRequestId
const current = values.reportsResponse?.results ?? []
// `removeReport` records ids here while the request is in flight. `current` predates
@@ -981,8 +956,8 @@ export const reportListLogic = kea<reportListLogicType>([
listeners(({ actions, values, props, cache }) => ({
loadCount: () => {
- if (props.sectionKey === 'closed') {
- actions.loadHasProjectClosedReports()
+ if (props.sectionKey === 'closed' || props.sectionKey === 'outcome-monitoring') {
+ actions.loadHasProjectReports()
}
},
// Announce this section's open pull requests so their CI state is resolved in one batch. Both
@@ -1076,11 +1051,10 @@ export const reportListLogic = kea<reportListLogicType>([
// response carries the total, so a separate count would run the same COUNT(*) twice.
if (values.isLoaded || values.reportsResponseLoading) {
actions.loadReports()
- // Whether the project holds any closed report is a project-wide question that this
- // section's page does not answer, and the `loadCount` listener that asks it does not
- // run on this path. The Closed tab stays hidden until this check runs again.
- if (props.sectionKey === 'closed') {
- actions.loadHasProjectClosedReports()
+ // Status option availability is project-wide, so a scoped page cannot answer it.
+ // The `loadCount` listener does not run on this path.
+ if (props.sectionKey === 'closed' || props.sectionKey === 'outcome-monitoring') {
+ actions.loadHasProjectReports()
}
} else {
actions.loadCount()
@@ -1105,12 +1079,6 @@ export const reportListLogic = kea<reportListLogicType>([
applyDefaultScope: () => actions.refresh(),
setFilters: () => actions.refresh(),
clearFilters: () => actions.refresh(),
- [featureFlagLogic.actionTypes.setFeatureFlags]: () => {
- if (props.sectionKey === 'outcome-monitoring' && cache.monitoringAvailable !== values.monitoringAvailable) {
- cache.monitoringAvailable = values.monitoringAvailable
- actions.refresh()
- }
- },
// For-you scope needs the current user's uuid; reload once it resolves.
[userLogic.actionTypes.loadUserSuccess]: () => {
if (values.scope === INBOX_SCOPE_FOR_YOU) {
@@ -1267,9 +1235,8 @@ export const reportListLogic = kea<reportListLogicType>([
},
})),
- events(({ actions, values, cache }) => ({
+ events(({ actions }) => ({
afterMount: () => {
- cache.monitoringAvailable = values.monitoringAvailable
actions.loadCount()
},
})),