Skip to content

Commit

Permalink
chore(dashboards): Purge dive-dashboards (#8946)
Browse files Browse the repository at this point in the history
* chore(dashboards): Purge `dive-dashboards`

* Update constants.tsx

* Update funnelLogic.test.ts
  • Loading branch information
Twixes authored Mar 14, 2022
1 parent aa5f741 commit 7438d04
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 16 deletions.
1 change: 0 additions & 1 deletion frontend/src/lib/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ export const FEATURE_FLAGS = {
NPS_PROMPT: '4562-nps', // owner: @paolodamico
// Experiments / beta features
INGESTION_GRID: 'ingestion-grid-exp-3', // owner: @kpthatsme
DIVE_DASHBOARDS: 'hackathon-dive-dashboards', // owner: @tiina303
NEW_PATHS_UI_EDGE_WEIGHTS: 'new-paths-ui-edge-weights', // owner: @neilkakkar
BREAKDOWN_BY_MULTIPLE_PROPERTIES: '938-breakdown-by-multiple-properties', // owner: @pauldambra
FUNNELS_CUE_OPT_OUT: 'funnels-cue-opt-out-7301', // owner: @paolodamico
Expand Down
1 change: 0 additions & 1 deletion frontend/src/scenes/funnels/funnelLogic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ export const mockInsight = {
order: null,
deleted: false,
dashboard: null,
dive_dashboard: null,
layouts: {},
color: null,
last_refresh: null,
Expand Down
1 change: 0 additions & 1 deletion frontend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,6 @@ export interface InsightModel {
refreshing: boolean
is_sample: boolean
dashboard: number | null
dive_dashboard?: number
result: any | null
updated_at: string
tags?: string[]
Expand Down
3 changes: 1 addition & 2 deletions posthog/api/insight.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ class Meta:
"order",
"deleted",
"dashboard",
"dive_dashboard",
"layouts",
"color",
"last_refresh",
Expand Down Expand Up @@ -140,7 +139,7 @@ def create(self, validated_data: Dict, *args: Any, **kwargs: Any) -> Insight:
validated_data.pop("last_refresh", None) # last_refresh sometimes gets sent if dashboard_item is duplicated
tags = validated_data.pop("tags", None) # tags are created separately as global tag relationships

if not validated_data.get("dashboard", None) and not validated_data.get("dive_dashboard", None):
if not validated_data.get("dashboard", None):
dashboard_item = Insight.objects.create(
team=team, created_by=request.user, last_modified_by=request.user, **validated_data
)
Expand Down
20 changes: 10 additions & 10 deletions posthog/api/test/__snapshots__/test_dashboard.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@
'
SELECT "posthog_dashboarditem"."id",
"posthog_dashboarditem"."dashboard_id",
"posthog_dashboarditem"."dive_dashboard_id",
"posthog_dashboarditem"."name",
"posthog_dashboarditem"."derived_name",
"posthog_dashboarditem"."description",
Expand All @@ -181,6 +180,7 @@
"posthog_dashboarditem"."refresh_attempt",
"posthog_dashboarditem"."last_modified_at",
"posthog_dashboarditem"."last_modified_by_id",
"posthog_dashboarditem"."dive_dashboard_id",
"posthog_dashboarditem"."updated_at"
FROM "posthog_dashboarditem"
WHERE (NOT "posthog_dashboarditem"."deleted"
Expand All @@ -196,7 +196,6 @@
'
SELECT "posthog_dashboarditem"."id",
"posthog_dashboarditem"."dashboard_id",
"posthog_dashboarditem"."dive_dashboard_id",
"posthog_dashboarditem"."name",
"posthog_dashboarditem"."derived_name",
"posthog_dashboarditem"."description",
Expand All @@ -218,6 +217,7 @@
"posthog_dashboarditem"."refresh_attempt",
"posthog_dashboarditem"."last_modified_at",
"posthog_dashboarditem"."last_modified_by_id",
"posthog_dashboarditem"."dive_dashboard_id",
"posthog_dashboarditem"."updated_at"
FROM "posthog_dashboarditem"
WHERE (NOT "posthog_dashboarditem"."deleted"
Expand Down Expand Up @@ -488,7 +488,6 @@
'
SELECT "posthog_dashboarditem"."id",
"posthog_dashboarditem"."dashboard_id",
"posthog_dashboarditem"."dive_dashboard_id",
"posthog_dashboarditem"."name",
"posthog_dashboarditem"."derived_name",
"posthog_dashboarditem"."description",
Expand All @@ -510,6 +509,7 @@
"posthog_dashboarditem"."refresh_attempt",
"posthog_dashboarditem"."last_modified_at",
"posthog_dashboarditem"."last_modified_by_id",
"posthog_dashboarditem"."dive_dashboard_id",
"posthog_dashboarditem"."updated_at"
FROM "posthog_dashboarditem"
WHERE ("posthog_dashboarditem"."dashboard_id" = 2
Expand Down Expand Up @@ -732,7 +732,6 @@
'
SELECT "posthog_dashboarditem"."id",
"posthog_dashboarditem"."dashboard_id",
"posthog_dashboarditem"."dive_dashboard_id",
"posthog_dashboarditem"."name",
"posthog_dashboarditem"."derived_name",
"posthog_dashboarditem"."description",
Expand All @@ -754,6 +753,7 @@
"posthog_dashboarditem"."refresh_attempt",
"posthog_dashboarditem"."last_modified_at",
"posthog_dashboarditem"."last_modified_by_id",
"posthog_dashboarditem"."dive_dashboard_id",
"posthog_dashboarditem"."updated_at"
FROM "posthog_dashboarditem"
WHERE (NOT "posthog_dashboarditem"."deleted"
Expand Down Expand Up @@ -876,7 +876,6 @@
'
SELECT "posthog_dashboarditem"."id",
"posthog_dashboarditem"."dashboard_id",
"posthog_dashboarditem"."dive_dashboard_id",
"posthog_dashboarditem"."name",
"posthog_dashboarditem"."derived_name",
"posthog_dashboarditem"."description",
Expand All @@ -898,6 +897,7 @@
"posthog_dashboarditem"."refresh_attempt",
"posthog_dashboarditem"."last_modified_at",
"posthog_dashboarditem"."last_modified_by_id",
"posthog_dashboarditem"."dive_dashboard_id",
"posthog_dashboarditem"."updated_at"
FROM "posthog_dashboarditem"
WHERE ("posthog_dashboarditem"."dashboard_id" = 2
Expand Down Expand Up @@ -1155,7 +1155,6 @@
'
SELECT "posthog_dashboarditem"."id",
"posthog_dashboarditem"."dashboard_id",
"posthog_dashboarditem"."dive_dashboard_id",
"posthog_dashboarditem"."name",
"posthog_dashboarditem"."derived_name",
"posthog_dashboarditem"."description",
Expand All @@ -1177,6 +1176,7 @@
"posthog_dashboarditem"."refresh_attempt",
"posthog_dashboarditem"."last_modified_at",
"posthog_dashboarditem"."last_modified_by_id",
"posthog_dashboarditem"."dive_dashboard_id",
"posthog_dashboarditem"."updated_at"
FROM "posthog_dashboarditem"
WHERE (NOT "posthog_dashboarditem"."deleted"
Expand Down Expand Up @@ -1415,7 +1415,6 @@
'
SELECT "posthog_dashboarditem"."id",
"posthog_dashboarditem"."dashboard_id",
"posthog_dashboarditem"."dive_dashboard_id",
"posthog_dashboarditem"."name",
"posthog_dashboarditem"."derived_name",
"posthog_dashboarditem"."description",
Expand All @@ -1437,6 +1436,7 @@
"posthog_dashboarditem"."refresh_attempt",
"posthog_dashboarditem"."last_modified_at",
"posthog_dashboarditem"."last_modified_by_id",
"posthog_dashboarditem"."dive_dashboard_id",
"posthog_dashboarditem"."updated_at"
FROM "posthog_dashboarditem"
WHERE ("posthog_dashboarditem"."dashboard_id" = 2
Expand Down Expand Up @@ -1700,7 +1700,6 @@
'
SELECT "posthog_dashboarditem"."id",
"posthog_dashboarditem"."dashboard_id",
"posthog_dashboarditem"."dive_dashboard_id",
"posthog_dashboarditem"."name",
"posthog_dashboarditem"."derived_name",
"posthog_dashboarditem"."description",
Expand All @@ -1722,6 +1721,7 @@
"posthog_dashboarditem"."refresh_attempt",
"posthog_dashboarditem"."last_modified_at",
"posthog_dashboarditem"."last_modified_by_id",
"posthog_dashboarditem"."dive_dashboard_id",
"posthog_dashboarditem"."updated_at"
FROM "posthog_dashboarditem"
WHERE ("posthog_dashboarditem"."dashboard_id" = 2
Expand Down Expand Up @@ -1936,7 +1936,6 @@
'
SELECT "posthog_dashboarditem"."id",
"posthog_dashboarditem"."dashboard_id",
"posthog_dashboarditem"."dive_dashboard_id",
"posthog_dashboarditem"."name",
"posthog_dashboarditem"."derived_name",
"posthog_dashboarditem"."description",
Expand All @@ -1958,6 +1957,7 @@
"posthog_dashboarditem"."refresh_attempt",
"posthog_dashboarditem"."last_modified_at",
"posthog_dashboarditem"."last_modified_by_id",
"posthog_dashboarditem"."dive_dashboard_id",
"posthog_dashboarditem"."updated_at"
FROM "posthog_dashboarditem"
WHERE (NOT "posthog_dashboarditem"."deleted"
Expand Down Expand Up @@ -2024,7 +2024,6 @@
'
SELECT "posthog_dashboarditem"."id",
"posthog_dashboarditem"."dashboard_id",
"posthog_dashboarditem"."dive_dashboard_id",
"posthog_dashboarditem"."name",
"posthog_dashboarditem"."derived_name",
"posthog_dashboarditem"."description",
Expand All @@ -2046,6 +2045,7 @@
"posthog_dashboarditem"."refresh_attempt",
"posthog_dashboarditem"."last_modified_at",
"posthog_dashboarditem"."last_modified_by_id",
"posthog_dashboarditem"."dive_dashboard_id",
"posthog_dashboarditem"."updated_at"
FROM "posthog_dashboarditem"
WHERE ("posthog_dashboarditem"."dashboard_id" = 2
Expand Down
3 changes: 2 additions & 1 deletion posthog/models/insight.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class Insight(models.Model):
dashboard: models.ForeignKey = models.ForeignKey(
"Dashboard", related_name="items", on_delete=models.CASCADE, null=True, blank=True,
)
dive_dashboard: models.ForeignKey = models.ForeignKey("Dashboard", on_delete=models.SET_NULL, null=True, blank=True)
name: models.CharField = models.CharField(max_length=400, null=True, blank=True)
derived_name: models.CharField = models.CharField(max_length=400, null=True, blank=True)
description: models.CharField = models.CharField(max_length=400, null=True, blank=True)
Expand Down Expand Up @@ -57,6 +56,8 @@ class Insight(models.Model):
"User", on_delete=models.SET_NULL, null=True, blank=True, related_name="modified_insights",
)

# TODO: dive dashboards have never been shipped, but they still may be in the future
dive_dashboard: models.ForeignKey = models.ForeignKey("Dashboard", on_delete=models.SET_NULL, null=True, blank=True)
# DEPRECATED: in practically all cases field `last_modified_at` should be used instead
updated_at: models.DateTimeField = models.DateTimeField(auto_now=True)
# DEPRECATED: use `display` property of the Filter object instead
Expand Down

0 comments on commit 7438d04

Please sign in to comment.