Skip to content

Commit

Permalink
Revert "Insights short share URL (#4513)"
Browse files Browse the repository at this point in the history
This reverts commit 1b0240d.
  • Loading branch information
paolodamico authored Jun 1, 2021
1 parent 1b0240d commit 9c98cb8
Show file tree
Hide file tree
Showing 17 changed files with 64 additions and 327 deletions.
10 changes: 4 additions & 6 deletions frontend/src/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ code.code {
}

// Random general styles

.cursor-pointer {
cursor: pointer;
}
Expand All @@ -282,10 +281,6 @@ code.code {
}
}

.fullscreen-scroll {
overflow-y: auto;
}

// Toasts

.Toastify__toast-container {
Expand Down Expand Up @@ -453,7 +448,6 @@ code.code {
}

// Badges styles

.badge {
border-radius: 50%;
width: 22px;
Expand Down Expand Up @@ -629,3 +623,7 @@ code.code {
font-size: 1rem;
}
}

.fullscreen-scroll {
overflow-y: auto;
}
15 changes: 0 additions & 15 deletions frontend/src/lib/components/NotFound/NotFound.scss

This file was deleted.

30 changes: 0 additions & 30 deletions frontend/src/lib/components/NotFound/index.tsx

This file was deleted.

13 changes: 13 additions & 0 deletions frontend/src/scenes/dashboard/Dashboard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@ $dashboard-title-size: 32px;
}
}

&.not-found {
text-align: center;
.graphic {
background: url('../../../public/not-found-rocket.svg') no-repeat center center;
height: 270px;
width: 100%;
}
p {
margin: 0 auto;
max-width: 600px;
}
}

.dashboard-description {
margin-bottom: $default_spacing;

Expand Down
22 changes: 20 additions & 2 deletions frontend/src/scenes/dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { useKeyboardHotkeys } from '../../lib/hooks/useKeyboardHotkeys'
import { DashboardMode } from '../../types'
import { DashboardEventSource } from '../../lib/utils/eventUsageLogic'
import { TZIndicator } from 'lib/components/TimezoneAware'
import { Link } from 'lib/components/Link'
import { EmptyDashboardComponent } from './EmptyDashboardComponent'
import { NotFound } from 'lib/components/NotFound'

interface Props {
id: string
Expand Down Expand Up @@ -80,7 +80,25 @@ function DashboardView(): JSX.Element {
}

if (!dashboard) {
return <NotFound object="dashboard" />
return (
<div className="dashboard not-found">
<div className="graphic" />
<h1 className="page-title">Dashboard not found</h1>
<b>It seems this page may have been lost in space.</b>
<p>
It’s possible this dashboard may have been deleted or its sharing settings changed. Please check
with the person who sent you here, or{' '}
<Link
to="https://posthog.com/support?utm_medium=in-product&utm_campaign=dashboard-not-found"
target="_blank"
rel="noopener"
>
contact support
</Link>{' '}
if you think this is a mistake
</p>
</div>
)
}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ const updateInsightState = (
return map
}

/* insightHistoryLogic - Handles all logic for saved insights and recent history */
export const insightHistoryLogic = kea<insightHistoryLogicType<DashboardItemType>>({
loaders: ({ actions }) => ({
insights: {
Expand Down Expand Up @@ -84,17 +83,20 @@ export const insightHistoryLogic = kea<insightHistoryLogicType<DashboardItemType
insights: {
updateInsights: (state, { insights }) => [...state, ...insights],
updateInsightSuccess: updateInsightState,
[dashboardItemsModel.actionTypes.renameDashboardItemSuccess]: updateInsightState,
// @ts-expect-error - kea.js typing issue
[dashboardItemsModel.actions.renameDashboardItemSuccess]: updateInsightState,
},
savedInsights: {
updateSavedInsights: (state, { insights }) => [...state, ...insights],
updateInsightSuccess: (state, itemOrInsight) => updateInsightState(state, itemOrInsight, true),
[dashboardItemsModel.actionTypes.renameDashboardItemSuccess]: updateInsightState,
// @ts-expect-error - kea.js typing issue
[dashboardItemsModel.actions.renameDashboardItemSuccess]: updateInsightState,
},
teamInsights: {
updateTeamInsights: (state, { insights }) => [...state, ...insights],
updateInsightSuccess: (state, itemOrInsight) => updateInsightState(state, itemOrInsight, true),
[dashboardItemsModel.actionTypes.renameDashboardItemSuccess]: updateInsightState,
// @ts-expect-error - kea.js typing issue
[dashboardItemsModel.actions.renameDashboardItemSuccess]: updateInsightState,
},
insightsNext: [
null as null | string,
Expand Down
75 changes: 0 additions & 75 deletions frontend/src/scenes/insights/InsightRouter.tsx

This file was deleted.

6 changes: 0 additions & 6 deletions frontend/src/scenes/sceneLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export enum Scene {
Dashboard = 'dashboard',
DashboardInsight = 'dashboardInsight',
Insights = 'insights',
InsightRouter = 'insightRouter',
Cohorts = 'cohorts',
Events = 'events',
Sessions = 'sessions',
Expand Down Expand Up @@ -60,7 +59,6 @@ export const scenes: Record<Scene, () => any> = {
[Scene.DashboardInsight]: () =>
import(/* webpackChunkName: 'dashboardInsight' */ './dashboard-insight/DashboardInsight'),
[Scene.Insights]: () => import(/* webpackChunkName: 'insights' */ './insights/Insights'),
[Scene.InsightRouter]: () => import(/* webpackChunkName: 'insightRouter' */ './insights/InsightRouter'),
[Scene.Cohorts]: () => import(/* webpackChunkName: 'cohorts' */ './persons/Cohorts'),
[Scene.Events]: () => import(/* webpackChunkName: 'events' */ './events/Events'),
[Scene.Sessions]: () => import(/* webpackChunkName: 'sessions' */ './sessions/Sessions'),
Expand Down Expand Up @@ -140,9 +138,6 @@ export const sceneConfigurations: Partial<Record<Scene, SceneConfig>> = {
[Scene.ProjectSettings]: {
hideDemoWarnings: true,
},
[Scene.InsightRouter]: {
dark: true,
},
}

export const redirects: Record<string, string | ((params: Params) => any)> = {
Expand All @@ -159,7 +154,6 @@ export const routes: Record<string, Scene> = {
'/action/:id': Scene.Action,
'/action': Scene.Action,
'/insights': Scene.Insights,
'/i/:id': Scene.InsightRouter,
'/events': Scene.Events,
'/events/*': Scene.Events,
'/sessions': Scene.Sessions,
Expand Down
1 change: 0 additions & 1 deletion frontend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,6 @@ export interface PlanInterface {
export interface DashboardItemType {
id: number
name: string
short_id: string
description?: string
filters: Record<string, any>
filters_hash: string
Expand Down
2 changes: 1 addition & 1 deletion latest_migrations.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ auth: 0012_alter_user_first_name_max_length
axes: 0006_remove_accesslog_trusted
contenttypes: 0002_remove_content_type_name
ee: 0003_license_max_users
posthog: 0156_insight_short_id
posthog: 0155_organization_available_features
rest_hooks: 0002_swappable_hook_model
sessions: 0001_initial
social_django: 0010_uid_db_index
1 change: 0 additions & 1 deletion posthog/api/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ class Meta:
model = DashboardItem
fields = [
"id",
"short_id",
"name",
"description",
"filters",
Expand Down
Loading

0 comments on commit 9c98cb8

Please sign in to comment.