Skip to content

Commit

Permalink
fix(insights): adapt aggregation table title for 3000 (#19278)
Browse files Browse the repository at this point in the history
  • Loading branch information
thmsobrmlr authored Dec 13, 2023
1 parent d195b3d commit b2dfd00
Show file tree
Hide file tree
Showing 38 changed files with 32 additions and 25 deletions.
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 frontend/__snapshots__/insights-insightstable--default.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 frontend/__snapshots__/insights-insightstable--embedded.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 frontend/__snapshots__/insights-insightstable--hourly.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 frontend/__snapshots__/insights-insightstable--is-legend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 frontend/__snapshots__/scenes-app-insights--trends-area-edit.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 frontend/__snapshots__/scenes-app-insights--trends-area.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 frontend/__snapshots__/scenes-app-insights--trends-bar--webkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 frontend/__snapshots__/scenes-app-insights--trends-bar-edit.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 frontend/__snapshots__/scenes-app-insights--trends-bar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 frontend/__snapshots__/scenes-app-insights--trends-line-edit.png
Binary file modified frontend/__snapshots__/scenes-app-insights--trends-line-multi.png
Binary file modified frontend/__snapshots__/scenes-app-insights--trends-line.png
6 changes: 4 additions & 2 deletions frontend/src/lib/lemon-ui/LemonTable/LemonTable.scss
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,10 @@

.posthog-3000 & {
&:hover {
.LemonTable__header-content {
color: var(--default);
&:not(:has(.LemonTable__header--no-hover:hover)) {
.LemonTable__header-content {
color: var(--default);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.AggregationColumn__title {
color: var(--text-secondary);

&:hover {
color: var(--default);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// eslint-disable-next-line no-restricted-imports
import { DownOutlined } from '@ant-design/icons'
import { Dropdown, Menu } from 'antd'
import './AggregationColumn.scss'

import { LemonMenu, LemonMenuItem } from '@posthog/lemon-ui'
import { useActions, useValues } from 'kea'
import { IconArrowDropDown } from 'lib/lemon-ui/icons'

Check failure on line 5 in frontend/src/scenes/insights/views/InsightsTable/columns/AggregationColumn.tsx

View workflow job for this annotation

GitHub Actions / Code quality checks

'"lib/lemon-ui/icons"' has no exported member named 'IconArrowDropDown'. Did you mean 'IconArrowDown'?
import { average, median } from 'lib/utils'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
import { formatAggregationAxisValue } from 'scenes/insights/aggregationAxisFormat'
Expand Down Expand Up @@ -37,29 +38,26 @@ export function AggregationColumnTitle({
return <span>{CALC_COLUMN_LABELS.total}</span>
}

const calcColumnMenu = (
<Menu>
{Object.keys(CALC_COLUMN_LABELS).map((key) => (
<Menu.Item
key={key}
onClick={(e) => {
setAggregationType(key as CalcColumnState)
reportInsightsTableCalcToggled(key)
e.domEvent.stopPropagation() // Prevent click here from affecting table sorting
}}
>
{CALC_COLUMN_LABELS[key as CalcColumnState]}
</Menu.Item>
))}
</Menu>
)
const items: LemonMenuItem[] = Object.entries(CALC_COLUMN_LABELS).map(([key, label]) => ({
label,
onClick: () => {
setAggregationType(key as CalcColumnState)
reportInsightsTableCalcToggled(key)
},
}))

return (
<Dropdown overlay={calcColumnMenu}>
<span className="cursor-pointer whitespace-nowrap">
<LemonMenu items={items}>
<span
className="AggregationColumn__title LemonTable__header--no-hover flex cursor-pointer whitespace-nowrap"
onClick={(e) => {
e.stopPropagation()
}}
>
{CALC_COLUMN_LABELS[aggregation]}
<DownOutlined className="ml-1" />
<IconArrowDropDown className="text-lg" />
</span>
</Dropdown>
</LemonMenu>
)
}

Expand Down

0 comments on commit b2dfd00

Please sign in to comment.