-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into experiments/trends-continuous
- Loading branch information
Showing
105 changed files
with
3,883 additions
and
1,558 deletions.
There are no files selected for viewing
564 changes: 282 additions & 282 deletions
564
ee/session_recordings/queries/test/__snapshots__/test_session_recording_list_from_query.ambr
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file modified
BIN
-1.59 KB
(82%)
...tend/__snapshots__/components-networkrequest-navigationitem--all-slow--dark.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
BIN
-1.87 KB
(79%)
...end/__snapshots__/components-networkrequest-navigationitem--all-slow--light.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
BIN
-563 Bytes
(98%)
frontend/__snapshots__/components-networkrequest-navigationitem--default--dark.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
BIN
-649 Bytes
(98%)
...tend/__snapshots__/components-networkrequest-navigationitem--default--light.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
BIN
-563 Bytes
(98%)
...tend/__snapshots__/components-networkrequest-navigationitem--expanded--dark.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
BIN
-649 Bytes
(98%)
...end/__snapshots__/components-networkrequest-navigationitem--expanded--light.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
BIN
-1.41 KB
(84%)
...components-networkrequest-navigationitem--really-slow-dom-interactive--dark.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
BIN
-1.87 KB
(79%)
...omponents-networkrequest-navigationitem--really-slow-dom-interactive--light.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
BIN
-1.21 KB
(86%)
...snapshots__/components-networkrequest-navigationitem--really-slow-fcp--dark.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
BIN
-1.43 KB
(84%)
...napshots__/components-networkrequest-navigationitem--really-slow-fcp--light.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
BIN
-1.36 KB
(84%)
...ts__/components-networkrequest-navigationitem--really-slow-load-event--dark.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
BIN
-1.71 KB
(81%)
...s__/components-networkrequest-navigationitem--really-slow-load-event--light.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
BIN
-1.56 KB
(83%)
...hots__/components-networkrequest-navigationitem--slow-dom-interactive--dark.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
BIN
-1.98 KB
(79%)
...ots__/components-networkrequest-navigationitem--slow-dom-interactive--light.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
BIN
-1.2 KB
(87%)
...tend/__snapshots__/components-networkrequest-navigationitem--slow-fcp--dark.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
BIN
-1.35 KB
(85%)
...end/__snapshots__/components-networkrequest-navigationitem--slow-fcp--light.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
BIN
-1.48 KB
(83%)
...snapshots__/components-networkrequest-navigationitem--slow-load-event--dark.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
BIN
-1.85 KB
(80%)
...napshots__/components-networkrequest-navigationitem--slow-load-event--light.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
BIN
-2.5 KB
(68%)
...shots__/components-networkrequest-navigationitem--web-vitals-all-fast--dark.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
BIN
-2.95 KB
(64%)
...hots__/components-networkrequest-navigationitem--web-vitals-all-fast--light.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
BIN
-2.4 KB
(71%)
...ots__/components-networkrequest-navigationitem--web-vitals-all-medium--dark.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
BIN
-2.49 KB
(71%)
...ts__/components-networkrequest-navigationitem--web-vitals-all-medium--light.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
BIN
-2.16 KB
(73%)
...shots__/components-networkrequest-navigationitem--web-vitals-all-slow--dark.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
BIN
-2.5 KB
(69%)
...hots__/components-networkrequest-navigationitem--web-vitals-all-slow--light.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
BIN
-2.16 KB
(82%)
...pshots__/components-networkrequest-navigationitem--web-vitals-loading--dark.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
BIN
-2.01 KB
(83%)
...shots__/components-networkrequest-navigationitem--web-vitals-loading--light.png
Oops, something went wrong.
Binary file modified
BIN
-137 Bytes
(100%)
frontend/__snapshots__/components-playerinspector--default--dark.png
Oops, something went wrong.
Binary file modified
BIN
-129 Bytes
(100%)
frontend/__snapshots__/components-playerinspector--default--light.png
Oops, something went wrong.
65 changes: 65 additions & 0 deletions
65
frontend/src/lib/integrations/IntegrationScopesWarning.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import api from 'lib/api' | ||
import { LemonBanner } from 'lib/lemon-ui/LemonBanner' | ||
import { Link } from 'lib/lemon-ui/Link' | ||
import { useMemo } from 'react' | ||
|
||
import { HogFunctionInputSchemaType, IntegrationType } from '~/types' | ||
|
||
export function IntegrationScopesWarning({ | ||
integration, | ||
schema, | ||
}: { | ||
integration: IntegrationType | ||
schema?: HogFunctionInputSchemaType | ||
}): JSX.Element { | ||
const getScopes = useMemo((): string[] => { | ||
const scopes: any[] = [] | ||
const possibleScopeLocation = [integration.config.scope, integration.config.scopes] | ||
|
||
possibleScopeLocation.map((scope) => { | ||
if (typeof scope === 'string') { | ||
scopes.push(scope.split(' ')) | ||
scopes.push(scope.split(',')) | ||
} | ||
if (typeof scope === 'object') { | ||
scopes.push(scope) | ||
} | ||
}) | ||
return scopes | ||
.filter((scope: any) => typeof scope === 'object') | ||
.reduce((a, b) => (a.length > b.length ? a : b), []) | ||
}, [integration.config]) | ||
|
||
const requiredScopes = schema?.requiredScopes?.split(' ') || [] | ||
const missingScopes = requiredScopes.filter((scope: string) => !getScopes.includes(scope)) | ||
|
||
if (missingScopes.length === 0 || getScopes.length === 0) { | ||
return <></> | ||
} | ||
return ( | ||
<div className="p-2"> | ||
<LemonBanner | ||
type="error" | ||
action={{ | ||
children: 'Reconnect', | ||
disableClientSideRouting: true, | ||
to: api.integrations.authorizeUrl({ | ||
kind: integration.kind, | ||
next: window.location.pathname, | ||
}), | ||
}} | ||
> | ||
<span>Required scopes are missing: [{missingScopes.join(', ')}].</span> | ||
{integration.kind === 'hubspot' ? ( | ||
<span> | ||
Note that some features may not be available on your current HubSpot plan. Check out{' '} | ||
<Link to="https://developers.hubspot.com/beta-docs/guides/apps/authentication/scopes"> | ||
this page | ||
</Link>{' '} | ||
for more details. | ||
</span> | ||
) : null} | ||
</LemonBanner> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
135 changes: 113 additions & 22 deletions
135
frontend/src/scenes/dashboard/newDashboardLogic.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,132 @@ | ||
import { NodeKind } from '~/queries/schema' | ||
|
||
import { applyTemplate } from './newDashboardLogic' | ||
|
||
describe('template function in newDashboardLogic', () => { | ||
it('ignores unused variables', () => { | ||
expect( | ||
applyTemplate({ a: 'hello', b: 'hi' }, [ | ||
{ | ||
id: 'VARIABLE_1', | ||
name: 'a', | ||
default: { | ||
event: '$pageview', | ||
applyTemplate( | ||
{ a: 'hello', b: 'hi' }, | ||
[ | ||
{ | ||
id: 'VARIABLE_1', | ||
name: 'a', | ||
default: { | ||
event: '$pageview', | ||
}, | ||
description: 'The description of the variable', | ||
required: true, | ||
type: 'event', | ||
}, | ||
description: 'The description of the variable', | ||
required: true, | ||
type: 'event', | ||
}, | ||
]) | ||
], | ||
null | ||
) | ||
).toEqual({ a: 'hello', b: 'hi' }) | ||
}) | ||
it('uses identified variables', () => { | ||
expect( | ||
applyTemplate({ a: '{VARIABLE_1}', b: 'hi' }, [ | ||
{ | ||
id: 'VARIABLE_1', | ||
name: 'a', | ||
default: { | ||
event: '$pageview', | ||
applyTemplate( | ||
{ a: '{VARIABLE_1}', b: 'hi' }, | ||
[ | ||
{ | ||
id: 'VARIABLE_1', | ||
name: 'a', | ||
default: { | ||
event: '$pageview', | ||
}, | ||
description: 'The description of the variable', | ||
required: true, | ||
type: 'event', | ||
}, | ||
description: 'The description of the variable', | ||
required: true, | ||
type: 'event', | ||
}, | ||
]) | ||
], | ||
null | ||
) | ||
).toEqual({ | ||
a: { | ||
event: '$pageview', | ||
}, | ||
b: 'hi', | ||
}) | ||
}) | ||
|
||
it('replaces variables in query based tiles', () => { | ||
expect( | ||
applyTemplate( | ||
{ a: '{VARIABLE_1}' }, | ||
[ | ||
{ | ||
id: 'VARIABLE_1', | ||
name: 'a', | ||
default: { | ||
id: '$pageview', | ||
}, | ||
description: 'The description of the variable', | ||
required: true, | ||
type: 'event', | ||
}, | ||
], | ||
NodeKind.TrendsQuery | ||
) | ||
).toEqual({ | ||
a: { | ||
event: '$pageview', | ||
kind: 'EventsNode', | ||
math: 'total', | ||
}, | ||
}) | ||
}) | ||
|
||
it("removes the math property from query based tiles that don't support it", () => { | ||
expect( | ||
applyTemplate( | ||
{ a: '{VARIABLE_1}' }, | ||
[ | ||
{ | ||
id: 'VARIABLE_1', | ||
name: 'a', | ||
default: { | ||
id: '$pageview', | ||
}, | ||
description: 'The description of the variable', | ||
required: true, | ||
type: 'event', | ||
}, | ||
], | ||
NodeKind.LifecycleQuery | ||
) | ||
).toEqual({ | ||
a: { | ||
event: '$pageview', | ||
kind: 'EventsNode', | ||
}, | ||
}) | ||
}) | ||
|
||
it('removes the math property from retention insight tiles', () => { | ||
expect( | ||
applyTemplate( | ||
{ a: '{VARIABLE_1}' }, | ||
[ | ||
{ | ||
id: 'VARIABLE_1', | ||
name: 'a', | ||
default: { | ||
id: '$pageview', | ||
math: 'dau' as any, | ||
type: 'events' as any, | ||
}, | ||
description: 'The description of the variable', | ||
required: true, | ||
type: 'event', | ||
}, | ||
], | ||
NodeKind.RetentionQuery | ||
) | ||
).toEqual({ | ||
a: { | ||
id: '$pageview', | ||
type: 'events', | ||
}, | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.