forked from PostHog/posthog
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: change poe on an insight (PostHog#27987)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
fd50aa0
commit 05709b1
Showing
107 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
Binary file modified
BIN
+3.84 KB
(100%)
...napshots__/scenes-app-insights--funnel-historical-trends-edit--dark--webkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.25 KB
(100%)
...tend/__snapshots__/scenes-app-insights--funnel-historical-trends-edit--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.74 KB
(100%)
...apshots__/scenes-app-insights--funnel-historical-trends-edit--light--webkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.29 KB
(100%)
...end/__snapshots__/scenes-app-insights--funnel-historical-trends-edit--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.32 KB
(100%)
...ts__/scenes-app-insights--funnel-left-to-right-breakdown-edit--dark--webkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.15 KB
(100%)
..._snapshots__/scenes-app-insights--funnel-left-to-right-breakdown-edit--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.41 KB
(100%)
...s__/scenes-app-insights--funnel-left-to-right-breakdown-edit--light--webkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.08 KB
(100%)
...snapshots__/scenes-app-insights--funnel-left-to-right-breakdown-edit--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.76 KB
(100%)
.../__snapshots__/scenes-app-insights--funnel-left-to-right-edit--dark--webkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.47 KB
(100%)
frontend/__snapshots__/scenes-app-insights--funnel-left-to-right-edit--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.74 KB
(100%)
...__snapshots__/scenes-app-insights--funnel-left-to-right-edit--light--webkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.48 KB
(100%)
frontend/__snapshots__/scenes-app-insights--funnel-left-to-right-edit--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.77 KB
(100%)
..._snapshots__/scenes-app-insights--funnel-time-to-convert-edit--dark--webkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.47 KB
(100%)
frontend/__snapshots__/scenes-app-insights--funnel-time-to-convert-edit--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.71 KB
(100%)
...snapshots__/scenes-app-insights--funnel-time-to-convert-edit--light--webkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.46 KB
(100%)
frontend/__snapshots__/scenes-app-insights--funnel-time-to-convert-edit--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.76 KB
(100%)
...ts__/scenes-app-insights--funnel-top-to-bottom-breakdown-edit--dark--webkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.46 KB
(100%)
..._snapshots__/scenes-app-insights--funnel-top-to-bottom-breakdown-edit--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.75 KB
(100%)
...s__/scenes-app-insights--funnel-top-to-bottom-breakdown-edit--light--webkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.43 KB
(100%)
...snapshots__/scenes-app-insights--funnel-top-to-bottom-breakdown-edit--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.75 KB
(100%)
.../__snapshots__/scenes-app-insights--funnel-top-to-bottom-edit--dark--webkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.52 KB
(100%)
frontend/__snapshots__/scenes-app-insights--funnel-top-to-bottom-edit--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.71 KB
(100%)
...__snapshots__/scenes-app-insights--funnel-top-to-bottom-edit--light--webkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.45 KB
(100%)
frontend/__snapshots__/scenes-app-insights--funnel-top-to-bottom-edit--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.46 KB
(100%)
frontend/__snapshots__/scenes-app-insights--lifecycle-edit--dark--webkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.74 KB
(110%)
frontend/__snapshots__/scenes-app-insights--lifecycle-edit--dark.png
Oops, something went wrong.
Binary file modified
BIN
+3.43 KB
(100%)
frontend/__snapshots__/scenes-app-insights--lifecycle-edit--light--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.72 KB
(110%)
frontend/__snapshots__/scenes-app-insights--lifecycle-edit--light.png
Oops, something went wrong.
Binary file modified
BIN
+3.43 KB
(100%)
...d/__snapshots__/scenes-app-insights--retention-breakdown-edit--dark--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.02 KB
(100%)
frontend/__snapshots__/scenes-app-insights--retention-breakdown-edit--dark.png
Oops, something went wrong.
Binary file modified
BIN
+3.36 KB
(100%)
.../__snapshots__/scenes-app-insights--retention-breakdown-edit--light--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3 KB
(100%)
frontend/__snapshots__/scenes-app-insights--retention-breakdown-edit--light.png
Oops, something went wrong.
Binary file modified
BIN
+3.35 KB
(100%)
frontend/__snapshots__/scenes-app-insights--retention-edit--dark--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.23 KB
(100%)
frontend/__snapshots__/scenes-app-insights--retention-edit--dark.png
Oops, something went wrong.
Binary file modified
BIN
+3.33 KB
(100%)
frontend/__snapshots__/scenes-app-insights--retention-edit--light--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.05 KB
(100%)
frontend/__snapshots__/scenes-app-insights--retention-edit--light.png
Oops, something went wrong.
Binary file modified
BIN
+2.77 KB
(100%)
frontend/__snapshots__/scenes-app-insights--stickiness-edit--dark--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.06 KB
(100%)
frontend/__snapshots__/scenes-app-insights--stickiness-edit--dark.png
Oops, something went wrong.
Binary file modified
BIN
+2.87 KB
(100%)
frontend/__snapshots__/scenes-app-insights--stickiness-edit--light--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.1 KB
(100%)
frontend/__snapshots__/scenes-app-insights--stickiness-edit--light.png
Oops, something went wrong.
Binary file modified
BIN
+3.58 KB
(100%)
...__snapshots__/scenes-app-insights--trends-area-breakdown-edit--dark--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.07 KB
(100%)
frontend/__snapshots__/scenes-app-insights--trends-area-breakdown-edit--dark.png
Oops, something went wrong.
Binary file modified
BIN
+3.76 KB
(100%)
..._snapshots__/scenes-app-insights--trends-area-breakdown-edit--light--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.35 KB
(100%)
frontend/__snapshots__/scenes-app-insights--trends-area-breakdown-edit--light.png
Oops, something went wrong.
Binary file modified
BIN
+3.88 KB
(110%)
frontend/__snapshots__/scenes-app-insights--trends-area-edit--dark--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.28 KB
(100%)
frontend/__snapshots__/scenes-app-insights--trends-area-edit--dark.png
Oops, something went wrong.
Binary file modified
BIN
+3.66 KB
(100%)
frontend/__snapshots__/scenes-app-insights--trends-area-edit--light--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.3 KB
(100%)
frontend/__snapshots__/scenes-app-insights--trends-area-edit--light.png
Oops, something went wrong.
Binary file modified
BIN
+3.52 KB
(100%)
.../__snapshots__/scenes-app-insights--trends-bar-breakdown-edit--dark--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.62 KB
(100%)
frontend/__snapshots__/scenes-app-insights--trends-bar-breakdown-edit--dark.png
Oops, something went wrong.
Binary file modified
BIN
+3.9 KB
(100%)
...__snapshots__/scenes-app-insights--trends-bar-breakdown-edit--light--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.54 KB
(100%)
frontend/__snapshots__/scenes-app-insights--trends-bar-breakdown-edit--light.png
Oops, something went wrong.
Binary file modified
BIN
+3.34 KB
(100%)
frontend/__snapshots__/scenes-app-insights--trends-bar-edit--dark--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.71 KB
(100%)
frontend/__snapshots__/scenes-app-insights--trends-bar-edit--dark.png
Oops, something went wrong.
Binary file modified
BIN
+3.46 KB
(100%)
frontend/__snapshots__/scenes-app-insights--trends-bar-edit--light--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.8 KB
(100%)
frontend/__snapshots__/scenes-app-insights--trends-bar-edit--light.png
Oops, something went wrong.
Binary file modified
BIN
+3.58 KB
(100%)
...__snapshots__/scenes-app-insights--trends-line-breakdown-edit--dark--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.56 KB
(100%)
frontend/__snapshots__/scenes-app-insights--trends-line-breakdown-edit--dark.png
Oops, something went wrong.
Binary file modified
BIN
+3.96 KB
(100%)
..._snapshots__/scenes-app-insights--trends-line-breakdown-edit--light--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.49 KB
(100%)
frontend/__snapshots__/scenes-app-insights--trends-line-breakdown-edit--light.png
Oops, something went wrong.
Binary file modified
BIN
+3.86 KB
(100%)
frontend/__snapshots__/scenes-app-insights--trends-line-edit--dark--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.57 KB
(100%)
frontend/__snapshots__/scenes-app-insights--trends-line-edit--dark.png
Oops, something went wrong.
Binary file modified
BIN
+4.01 KB
(100%)
frontend/__snapshots__/scenes-app-insights--trends-line-edit--light--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.37 KB
(100%)
frontend/__snapshots__/scenes-app-insights--trends-line-edit--light.png
Oops, something went wrong.
Binary file modified
BIN
+3.53 KB
(100%)
...end/__snapshots__/scenes-app-insights--trends-line-multi-edit--dark--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.32 KB
(100%)
frontend/__snapshots__/scenes-app-insights--trends-line-multi-edit--dark.png
Oops, something went wrong.
Binary file modified
BIN
+3.35 KB
(100%)
...nd/__snapshots__/scenes-app-insights--trends-line-multi-edit--light--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.33 KB
(100%)
frontend/__snapshots__/scenes-app-insights--trends-line-multi-edit--light.png
Oops, something went wrong.
Binary file modified
BIN
+3.82 KB
(110%)
frontend/__snapshots__/scenes-app-insights--trends-number-edit--dark--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.43 KB
(110%)
frontend/__snapshots__/scenes-app-insights--trends-number-edit--dark.png
Oops, something went wrong.
Binary file modified
BIN
+3.82 KB
(110%)
frontend/__snapshots__/scenes-app-insights--trends-number-edit--light--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.46 KB
(110%)
frontend/__snapshots__/scenes-app-insights--trends-number-edit--light.png
Oops, something went wrong.
Binary file modified
BIN
+3.74 KB
(100%)
.../__snapshots__/scenes-app-insights--trends-pie-breakdown-edit--dark--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.41 KB
(100%)
frontend/__snapshots__/scenes-app-insights--trends-pie-breakdown-edit--dark.png
Oops, something went wrong.
Binary file modified
BIN
+3.91 KB
(100%)
...__snapshots__/scenes-app-insights--trends-pie-breakdown-edit--light--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.45 KB
(100%)
frontend/__snapshots__/scenes-app-insights--trends-pie-breakdown-edit--light.png
Oops, something went wrong.
Binary file modified
BIN
+3.8 KB
(100%)
frontend/__snapshots__/scenes-app-insights--trends-pie-edit--dark--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.51 KB
(100%)
frontend/__snapshots__/scenes-app-insights--trends-pie-edit--dark.png
Oops, something went wrong.
Binary file modified
BIN
+3.82 KB
(100%)
frontend/__snapshots__/scenes-app-insights--trends-pie-edit--light--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.61 KB
(100%)
frontend/__snapshots__/scenes-app-insights--trends-pie-edit--light.png
Oops, something went wrong.
Binary file modified
BIN
+3.71 KB
(100%)
..._snapshots__/scenes-app-insights--trends-table-breakdown-edit--dark--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.64 KB
(110%)
frontend/__snapshots__/scenes-app-insights--trends-table-breakdown-edit--dark.png
Oops, something went wrong.
Binary file modified
BIN
+3.74 KB
(110%)
...snapshots__/scenes-app-insights--trends-table-breakdown-edit--light--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.54 KB
(100%)
frontend/__snapshots__/scenes-app-insights--trends-table-breakdown-edit--light.png
Oops, something went wrong.
Binary file modified
BIN
+3.81 KB
(110%)
frontend/__snapshots__/scenes-app-insights--trends-table-edit--dark--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.46 KB
(110%)
frontend/__snapshots__/scenes-app-insights--trends-table-edit--dark.png
Oops, something went wrong.
Binary file modified
BIN
+3.84 KB
(110%)
frontend/__snapshots__/scenes-app-insights--trends-table-edit--light--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.44 KB
(110%)
frontend/__snapshots__/scenes-app-insights--trends-table-edit--light.png
Oops, something went wrong.
Binary file modified
BIN
+3.58 KB
(110%)
..._snapshots__/scenes-app-insights--trends-value-breakdown-edit--dark--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.73 KB
(110%)
frontend/__snapshots__/scenes-app-insights--trends-value-breakdown-edit--dark.png
Oops, something went wrong.
Binary file modified
BIN
+3.86 KB
(110%)
...snapshots__/scenes-app-insights--trends-value-breakdown-edit--light--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.7 KB
(110%)
frontend/__snapshots__/scenes-app-insights--trends-value-breakdown-edit--light.png
Oops, something went wrong.
Binary file modified
BIN
+3.87 KB
(110%)
frontend/__snapshots__/scenes-app-insights--trends-value-edit--dark--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.8 KB
(110%)
frontend/__snapshots__/scenes-app-insights--trends-value-edit--dark.png
Oops, something went wrong.
Binary file modified
BIN
+4.1 KB
(110%)
frontend/__snapshots__/scenes-app-insights--trends-value-edit--light--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.87 KB
(110%)
frontend/__snapshots__/scenes-app-insights--trends-value-edit--light.png
Oops, something went wrong.
Binary file modified
BIN
+3.77 KB
(100%)
...tend/__snapshots__/scenes-app-insights--trends-world-map-edit--dark--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.75 KB
(100%)
frontend/__snapshots__/scenes-app-insights--trends-world-map-edit--dark.png
Oops, something went wrong.
Binary file modified
BIN
+3.72 KB
(100%)
...end/__snapshots__/scenes-app-insights--trends-world-map-edit--light--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.65 KB
(100%)
frontend/__snapshots__/scenes-app-insights--trends-world-map-edit--light.png
Oops, something went wrong.
Binary file modified
BIN
+3.25 KB
(100%)
frontend/__snapshots__/scenes-app-insights--user-paths-edit--dark--webkit.png
Oops, something went wrong.
Binary file modified
BIN
+3.04 KB
(100%)
frontend/__snapshots__/scenes-app-insights--user-paths-edit--dark.png
Oops, something went wrong.
Binary file modified
BIN
-5.2 KB
(97%)
frontend/__snapshots__/scenes-app-insights--user-paths-edit--light--webkit.png
Oops, something went wrong.
Binary file modified
BIN
-5.02 KB
(97%)
frontend/__snapshots__/scenes-app-insights--user-paths-edit--light.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { LemonLabel, LemonSwitch } from '@posthog/lemon-ui' | ||
import { useActions, useValues } from 'kea' | ||
|
||
import { InsightLogicProps } from '~/types' | ||
|
||
import { poeFilterLogic } from './poeFilterLogic' | ||
|
||
interface PoeFilterProps { | ||
insightProps: InsightLogicProps | ||
} | ||
|
||
export function PoeFilter({ insightProps }: PoeFilterProps): JSX.Element { | ||
const { poeMode } = useValues(poeFilterLogic(insightProps)) | ||
const { setPoeMode } = useActions(poeFilterLogic(insightProps)) | ||
|
||
return ( | ||
<> | ||
<div className="flex items-center gap-1"> | ||
<LemonLabel | ||
info="Overides the default person properties mode for this insight to use person properties from query time instead of from the time of the event. This can be useful for specific queries that require person data that comes in after the event in question, but it slows down performance considerably, so use it with care." | ||
infoLink="https://posthog.com/docs/how-posthog-works/queries#filtering-on-person-properties" | ||
> | ||
Use person properties from query time | ||
</LemonLabel> | ||
<LemonSwitch | ||
className="m-2" | ||
onChange={(checked) => { | ||
if (checked) { | ||
setPoeMode('person_id_override_properties_joined') | ||
} else { | ||
setPoeMode(null) | ||
} | ||
}} | ||
checked={!!poeMode} | ||
/> | ||
</div> | ||
</> | ||
) | ||
} |
49 changes: 49 additions & 0 deletions
49
frontend/src/scenes/insights/EditorFilters/poeFilterLogic.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { actions, connect, kea, key, listeners, path, props, reducers } from 'kea' | ||
import { subscriptions } from 'kea-subscriptions' | ||
import { keyForInsightLogicProps } from 'scenes/insights/sharedUtils' | ||
|
||
import { HogQLQueryModifiers } from '~/queries/schema' | ||
import { InsightLogicProps } from '~/types' | ||
|
||
import { insightVizDataLogic } from '../insightVizDataLogic' | ||
import type { poeFilterLogicType } from './poeFilterLogicType' | ||
|
||
export type PoeModeTypes = HogQLQueryModifiers['personsOnEventsMode'] | null | ||
|
||
export const poeFilterLogic = kea<poeFilterLogicType>([ | ||
props({} as InsightLogicProps), | ||
key(keyForInsightLogicProps('new')), | ||
path((key) => ['scenes', 'insights', 'EditorFilters', 'poeFilterLogic', key]), | ||
connect((props: InsightLogicProps) => ({ | ||
values: [insightVizDataLogic(props), ['querySource']], | ||
actions: [insightVizDataLogic(props), ['updateQuerySource']], | ||
})), | ||
actions(() => ({ | ||
setPoeMode: (poeMode: PoeModeTypes) => ({ poeMode }), | ||
})), | ||
reducers({ | ||
poeMode: [ | ||
null as PoeModeTypes, | ||
{ | ||
setPoeMode: (_, { poeMode }) => poeMode || null, | ||
}, | ||
], | ||
}), | ||
listeners(({ actions, values }) => ({ | ||
setPoeMode: () => { | ||
actions.updateQuerySource({ | ||
modifiers: { | ||
personsOnEventsMode: values.poeMode || undefined, | ||
}, | ||
}) | ||
}, | ||
})), | ||
subscriptions(({ values, actions }) => ({ | ||
querySource: (querySource) => { | ||
const newPoeMode = querySource?.modifiers?.personsOnEventsMode | ||
if ((!!newPoeMode || !!values.poeMode) && newPoeMode != values.poeMode) { | ||
actions.setPoeMode(newPoeMode) | ||
} | ||
}, | ||
})), | ||
]) |