-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(insights): Add cumulative retention (#24240)
- Loading branch information
Showing
37 changed files
with
131 additions
and
34 deletions.
There are no files selected for viewing
Binary file modified
BIN
+1.91 KB
(100%)
frontend/__snapshots__/scenes-app-insights--retention--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
-6.61 KB
(93%)
frontend/__snapshots__/scenes-app-insights--retention--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
+1.78 KB
(100%)
frontend/__snapshots__/scenes-app-insights--retention--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
-6.06 KB
(93%)
frontend/__snapshots__/scenes-app-insights--retention--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
+1.9 KB
(100%)
frontend/__snapshots__/scenes-app-insights--retention-breakdown--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
-6.92 KB
(93%)
frontend/__snapshots__/scenes-app-insights--retention-breakdown--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
+1.28 KB
(100%)
frontend/__snapshots__/scenes-app-insights--retention-breakdown--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
-5.75 KB
(94%)
frontend/__snapshots__/scenes-app-insights--retention-breakdown--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
+1.68 KB
(100%)
...d/__snapshots__/scenes-app-insights--retention-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
+1.37 KB
(100%)
frontend/__snapshots__/scenes-app-insights--retention-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
+1.76 KB
(100%)
.../__snapshots__/scenes-app-insights--retention-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
+1.27 KB
(100%)
frontend/__snapshots__/scenes-app-insights--retention-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
+1.58 KB
(100%)
frontend/__snapshots__/scenes-app-insights--retention-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
+1.41 KB
(100%)
frontend/__snapshots__/scenes-app-insights--retention-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
+1.67 KB
(100%)
frontend/__snapshots__/scenes-app-insights--retention-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
+1.18 KB
(100%)
frontend/__snapshots__/scenes-app-insights--retention-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
-4.77 KB
(92%)
frontend/__snapshots__/scenes-app-insights--trends-line-multi--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
45 changes: 45 additions & 0 deletions
45
frontend/src/scenes/insights/filters/RetentionCumulativeCheckbox.tsx
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,45 @@ | ||
import { IconInfo } from '@posthog/icons' | ||
import { LemonSwitch, Tooltip } from '@posthog/lemon-ui' | ||
import { useActions, useValues } from 'kea' | ||
import { insightLogic } from 'scenes/insights/insightLogic' | ||
import { insightVizDataLogic } from 'scenes/insights/insightVizDataLogic' | ||
|
||
export function RetentionCumulativeCheckbox(): JSX.Element | null { | ||
const { insightProps, canEditInsight } = useValues(insightLogic) | ||
|
||
const { retentionFilter } = useValues(insightVizDataLogic(insightProps)) | ||
const { updateInsightFilter } = useActions(insightVizDataLogic(insightProps)) | ||
|
||
const cumulativeRetention = retentionFilter?.cumulative || false | ||
|
||
if (!canEditInsight) { | ||
return null | ||
} | ||
|
||
return ( | ||
<LemonSwitch | ||
onChange={(cumulative: boolean) => { | ||
updateInsightFilter({ cumulative }) | ||
}} | ||
checked={cumulativeRetention} | ||
label={ | ||
<span className="font-normal"> | ||
Rolling retention | ||
<Tooltip | ||
title={ | ||
<> | ||
Rolling, or unbounded, retention includes any subsequent time period, instead of only | ||
the next period. For example, if a user is comes back on day 7, they are counted in all | ||
previous retention periods. | ||
</> | ||
} | ||
> | ||
<IconInfo className="w-4 info-indicator" /> | ||
</Tooltip> | ||
</span> | ||
} | ||
bordered | ||
size="small" | ||
/> | ||
) | ||
} |
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
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
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
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
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
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
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