Skip to content

Commit

Permalink
border around filter bar as you can come back to dashboard in edit mode
Browse files Browse the repository at this point in the history
  • Loading branch information
anirudhpillai committed Sep 4, 2024
1 parent e64b83d commit 0951d00
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export function InsightMeta({
moreButtons={
<>
<>
<LemonButton to={urls.insightView(short_id)} fullWidth>
<LemonButton to={urls.insightView(short_id, filtersOverride)} fullWidth>
View
</LemonButton>
{refresh && (
Expand Down
10 changes: 9 additions & 1 deletion frontend/src/scenes/dashboard/DashboardEditBar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { IconCalendar } from '@posthog/icons'
import clsx from 'clsx'
import { useActions, useValues } from 'kea'
import { DateFilter } from 'lib/components/DateFilter/DateFilter'
import { PropertyFilters } from 'lib/components/PropertyFilters/PropertyFilters'
Expand All @@ -16,7 +17,14 @@ export function DashboardEditBar(): JSX.Element {
const disabledReason = !canEditDashboard ? "You don't have permission to edit this dashboard" : undefined

return (
<div className="flex gap-2 items-center justify-between flex-wrap">
<div
className={clsx(
'flex gap-2 items-center justify-between flex-wrap border',
dashboardMode === DashboardMode.Edit
? '-m-1.5 p-1.5 border-border-bold border-dashed rounded-lg'
: 'border-transparent'
)}
>
<DateFilter
showCustom
dateFrom={temporaryFilters.date_from}
Expand Down
1 change: 0 additions & 1 deletion frontend/src/scenes/dashboard/dashboardLogic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,6 @@ export const dashboardLogic = kea<dashboardLogicType>([
'/dashboard/:id': () => {
actions.setSubscriptionMode(false, undefined)
actions.setTextTileId(null)
actions.setDashboardMode(null, DashboardEventSource.Browser)
},
'/dashboard/:id/sharing': () => {
actions.setSubscriptionMode(false, undefined)
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/scenes/urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ export const urls = {
).url,
insightEdit: (id: InsightShortId): string => `/insights/${id}/edit`,
insightView: (id: InsightShortId, filtersOverride?: DashboardFilter): string =>
`/insights/${id}${filtersOverride !== undefined ? `?filters_override=${JSON.stringify(filtersOverride)}` : ''}`,
`/insights/${id}${
filtersOverride !== undefined
? `?filters_override=${encodeURIComponent(JSON.stringify(filtersOverride))}`
: ''
}`,
insightSubcriptions: (id: InsightShortId): string => `/insights/${id}/subscriptions`,
insightSubcription: (id: InsightShortId, subscriptionId: string): string =>
`/insights/${id}/subscriptions/${subscriptionId}`,
Expand Down

0 comments on commit 0951d00

Please sign in to comment.