Skip to content

Commit

Permalink
Merge branch 'master' into dn-chore/remove-rows
Browse files Browse the repository at this point in the history
  • Loading branch information
daibhin committed Dec 22, 2023
2 parents 4d5d6b7 + 8c21377 commit 13b796f
Show file tree
Hide file tree
Showing 1,193 changed files with 708 additions and 651 deletions.
18 changes: 10 additions & 8 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,16 @@ module.exports = {
message:
'use flex utility classes instead, e.g. <Row align="middle"> could be <div className="flex items-center">',
},
{
name: 'antd',
importNames: ['Col'],
message: 'use flex utility classes instead - most of the time can simply be a plain <div>',
},
{
name: 'antd',
importNames: ['Card'],
message: 'use utility classes instead',
},
],
},
],
Expand All @@ -147,18 +157,10 @@ module.exports = {
'warn',
{
forbid: [
{
element: 'Col',
message: 'use flex utility classes instead - most of the time can simply be a plain <div>',
},
{
element: 'Divider',
message: 'use <LemonDivider> instead',
},
{
element: 'Card',
message: 'use utility classes instead',
},
{
element: 'Button',
message: 'use <LemonButton> instead',
Expand Down
23 changes: 9 additions & 14 deletions .storybook/test-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ declare module '@storybook/types' {
snapshotBrowsers?: SupportedBrowserName[]
/** If taking a component snapshot, you can narrow it down by specifying the selector. */
snapshotTargetSelector?: string
/** Include snapshots of buttons in 3000. */
include3000?: boolean
}
msw?: {
mocks?: Mocks
Expand Down Expand Up @@ -99,7 +97,6 @@ async function expectStoryToMatchSnapshot(
waitForLoadersToDisappear = true,
waitForSelector,
excludeNavigationFromSnapshot = false,
include3000 = false,
} = storyContext.parameters?.testOptions ?? {}

let check: (
Expand Down Expand Up @@ -141,20 +138,18 @@ async function expectStoryToMatchSnapshot(

await check(page, context, browser, 'legacy', storyContext.parameters?.testOptions?.snapshotTargetSelector)

if (include3000) {
await page.evaluate(() => {
document.body.classList.add('posthog-3000')
document.body.setAttribute('theme', 'light')
})
await page.evaluate(() => {
document.body.classList.add('posthog-3000')
document.body.setAttribute('theme', 'light')
})

await check(page, context, browser, 'light', storyContext.parameters?.testOptions?.snapshotTargetSelector)
await check(page, context, browser, 'light', storyContext.parameters?.testOptions?.snapshotTargetSelector)

await page.evaluate(() => {
document.body.setAttribute('theme', 'dark')
})
await page.evaluate(() => {
document.body.setAttribute('theme', 'dark')
})

await check(page, context, browser, 'dark', storyContext.parameters?.testOptions?.snapshotTargetSelector)
}
await check(page, context, browser, 'dark', storyContext.parameters?.testOptions?.snapshotTargetSelector)
}

async function expectStoryToMatchFullPageSnapshot(
Expand Down
4 changes: 2 additions & 2 deletions ee/billing/quota_limiting.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,12 @@ def set_org_usage_summary(
new_usage = copy.deepcopy(new_usage)

for field in ["events", "recordings", "rows_synced"]:
resource_usage = new_usage[field] # type: ignore
resource_usage = new_usage.get(field, {"limit": None, "usage": 0, "todays_usage": 0})
if not resource_usage:
continue

if todays_usage:
resource_usage["todays_usage"] = todays_usage[field] # type: ignore
resource_usage["todays_usage"] = todays_usage.get(field, 0)
else:
# TRICKY: If we are not explictly setting todays_usage, we want to reset it to 0 IF the incoming new_usage is different
if (organization.usage or {}).get(field, {}).get("usage") != resource_usage.get("usage"):
Expand Down
58 changes: 29 additions & 29 deletions ee/clickhouse/queries/funnels/test/__snapshots__/test_funnel.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
AND notEmpty(e.person_id)
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -160,7 +160,7 @@
AND notEmpty(e.person_id)
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -299,7 +299,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -437,7 +437,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -572,7 +572,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -707,7 +707,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -842,7 +842,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -979,7 +979,7 @@
AND notEmpty(e.person_id)
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -1120,7 +1120,7 @@
AND notEmpty(e.person_id)
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -1259,7 +1259,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -1397,7 +1397,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -1510,7 +1510,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -1623,7 +1623,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -1736,7 +1736,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -1851,7 +1851,7 @@
AND notEmpty(e.person_id)
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -1992,7 +1992,7 @@
AND notEmpty(e.person_id)
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -2131,7 +2131,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -2269,7 +2269,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand All @@ -2292,7 +2292,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand All @@ -2315,7 +2315,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -2547,7 +2547,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand All @@ -2570,7 +2570,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand All @@ -2593,7 +2593,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -2825,7 +2825,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand All @@ -2848,7 +2848,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand All @@ -2871,7 +2871,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -3103,7 +3103,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand All @@ -3126,7 +3126,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand All @@ -3149,7 +3149,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down
Loading

0 comments on commit 13b796f

Please sign in to comment.