Skip to content

Commit

Permalink
Merge branch 'master' into file_test
Browse files Browse the repository at this point in the history
* master: (28 commits)
  fix: refactor update animation to do less (#21901)
  fix(plugin-server): add time component to person.force_upgrade (#21899)
  fix(dashboards): Indicate 404/400/500 properly (#21853)
  fix: recording exports (#21900)
  feat: Update SLAs, remove GitHub buttons (#21818)
  chore: Removed feature flag for heatmaps (#21886)
  fix(data-warehouse): Added an error message for empty data source files (#21843)
  feat(surveys): allow to stop surveys once reached enough responses (#21528)
  fix: patch missing pause method in rrweb (#21898)
  fix(hogql): make funnels fast again (#21890)
  fix: Explicitly call out readonly user fields (#21889)
  chore(dev): Allow mypy to run in VS Code extension (#21891)
  feat: Small heatmap UI fixes (#21849)
  feat: Improve Heatmaps UI and notices (#21887)
  fix: Redirection to keep query params (#21881)
  fix: hot path is cooler now (#21888)
  feat(data-warehouse): Moved the table model creation to the data pipeline activity (#21817)
  fix: snapshot response timings (#21885)
  chore(deps): Update posthog-js to 1.130.0 (#21884)
  feat(debug): tabs + better view for non-hogql-query nodes (#21867)
  ...
  • Loading branch information
fuziontech committed Apr 26, 2024
2 parents 37088dc + 226f768 commit cc3c244
Show file tree
Hide file tree
Showing 175 changed files with 2,083 additions and 1,421 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ module.exports = {
],
},
],
'no-else-return': 'warn'
},
overrides: [
{
Expand Down
19 changes: 19 additions & 0 deletions cypress/e2e/surveys.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,4 +281,23 @@ describe('Surveys', () => {
.contains('DRAFT')
.should('exist')
})

it.only('can set responses limit', () => {
cy.get('h1').should('contain', 'Surveys')
cy.get('[data-attr=new-survey]').click()
cy.get('[data-attr=new-blank-survey]').click()

cy.get('[data-attr=survey-name]').focus().type(name)

// Set responses limit
cy.get('.LemonCollapsePanel').contains('Completion conditions').click()
cy.get('[data-attr=survey-responses-limit-input]').focus().type('228').click()

// Save the survey
cy.get('[data-attr=save-survey]').first().click()
cy.get('button[data-attr="launch-survey"]').should('have.text', 'Launch')

cy.reload()
cy.contains('The survey will be stopped once 228 responses are received.').should('be.visible')
})
})
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.
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-surveys--new-survey--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 frontend/__snapshots__/scenes-app-surveys--new-survey--light.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.
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-other-toolbar--heatmap--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 frontend/__snapshots__/scenes-other-toolbar--heatmap--light.png
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
IconBug,
IconChevronDown,
IconFeatures,
IconFlask,
Expand Down Expand Up @@ -76,8 +75,8 @@ const SupportFormBlock = ({ onCancel }: { onCancel: () => void }): JSX.Element =

// TODO(@zach): remove after updated plans w/ support levels are shipped
const supportResponseTimes = {
[AvailableFeature.EMAIL_SUPPORT]: '2-3 days',
[AvailableFeature.PRIORITY_SUPPORT]: '4-6 hours',
[AvailableFeature.EMAIL_SUPPORT]: '24 hours',
[AvailableFeature.PRIORITY_SUPPORT]: '12 hours',
}

return (
Expand Down Expand Up @@ -144,7 +143,6 @@ const SupportFormBlock = ({ onCancel }: { onCancel: () => void }): JSX.Element =

export const SidePanelSupport = (): JSX.Element => {
const { openSidePanel, closeSidePanel } = useActions(sidePanelStateLogic)
const { hasAvailableFeature } = useValues(userLogic)
const { openEmailForm, closeEmailForm } = useActions(supportLogic)
const { isEmailFormOpen } = useValues(supportLogic)
const { preflight } = useValues(preflightLogic)
Expand Down Expand Up @@ -214,64 +212,29 @@ export const SidePanelSupport = (): JSX.Element => {
</Section>
) : null}

{hasAvailableFeature(AvailableFeature.EMAIL_SUPPORT) ||
window.location.href.includes(urls.organizationBilling()) ? (
<>
<Section title="Contact us">
<p>Can't find what you need in the docs?</p>
<LemonButton
type="primary"
fullWidth
center
onClick={() => openEmailForm()}
targetBlank
className="mt-2"
>
Email an engineer
</LemonButton>
</Section>
<Section title="Ask the community">
<p>
Questions about features, how to's, or use cases? There are thousands of
discussions in our community forums.{' '}
<Link to="https://posthog.com/questions">Ask a question</Link>
</p>
</Section>
</>
) : (
<Section title="Ask the community">
<p>
Questions about features, how to's, or use cases? There are thousands of
discussions in our community forums.
</p>
<LemonButton
type="primary"
fullWidth
center
to="https://posthog.com/questions"
targetBlank
className="mt-2"
>
Ask a question
</LemonButton>
</Section>
)}
<Section title="Contact us">
<p>Can't find what you need in the docs?</p>
<LemonButton
type="primary"
fullWidth
center
onClick={() => openEmailForm()}
targetBlank
className="mt-2"
>
Email an engineer
</LemonButton>
</Section>
<Section title="Ask the community">
<p>
Questions about features, how to's, or use cases? There are thousands of discussions
in our community forums.{' '}
<Link to="https://posthog.com/questions">Ask a question</Link>
</p>
</Section>

<Section title="Share feedback">
<ul>
<li>
<LemonButton
type="secondary"
status="alt"
to={`https://github.com/PostHog/posthog/issues/new?&labels=bug&template=bug_report.yml&debug-info=${encodeURIComponent(
getPublicSupportSnippet(region, user)
)}`}
icon={<IconBug />}
targetBlank
>
Report a bug
</LemonButton>
</li>
<li>
<LemonButton
type="secondary"
Expand Down Expand Up @@ -309,55 +272,6 @@ export const SidePanelSupport = (): JSX.Element => {
</li>
</ul>
</Section>

{hasAvailableFeature(AvailableFeature.EMAIL_SUPPORT) ||
window.location.href.includes(urls.organizationBilling()) ? null : (
<Section title="Contact support">
<p>
Due to our large userbase, we're unable to offer email support to organizations
on the free plan. But we still want to help!
</p>

<ol className="pl-5">
<li>
<strong className="block">Search our docs</strong>
<p>
We're constantly updating our docs and tutorials to provide the latest
information about installing, using, and troubleshooting.
</p>
</li>
<li>
<strong className="block">Ask a community question</strong>
<p>
Many common (and niche) questions have already been resolved by users
just like you. (Our own engineers also keep an eye on the questions as
they have time!){' '}
<Link to="https://posthog.com/question" className="block">
Search community questions or ask your own.
</Link>
</p>
</li>
<li>
<strong className="block">
Explore <Link to="https://posthog.com/partners">PostHog partners</Link>
</strong>
<p>
Third-party providers can help with installation and debugging of data
issues.
</p>
</li>
<li>
<strong className="block">Upgrade to a paid plan</strong>
<p>
Our paid plans offer email support.{' '}
<Link to={urls.organizationBilling([ProductKey.PLATFORM_AND_SUPPORT])}>
Explore options.
</Link>
</p>
</li>
</ol>
</Section>
)}
</>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@ export const activityForSceneLogic = kea<activityForSceneLogicType>([
state,
activeLoadedScene?.paramsToProps?.(activeLoadedScene?.sceneParams) || props
)
} else {
return activityFiltersForScene(sceneConfig)
}
return activityFiltersForScene(sceneConfig)
},
],
(filters): ActivityFilters | null => filters,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ export function useAnnotationsPositioning(
tickIntervalPx: (lastTickLeftPx - firstTickLeftPx) / (tickCount - 1),
firstTickLeftPx,
}
} else {
return {
tickIntervalPx: 0,
firstTickLeftPx: 0,
}
}
return {
tickIntervalPx: 0,
firstTickLeftPx: 0,
}
}, [chart, chartWidth, chartHeight])
}
5 changes: 3 additions & 2 deletions frontend/src/lib/components/Cards/InsightCard/InsightCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,13 @@ export function FilterBasedCardContent({
{tooFewFunnelSteps ? (
<FunnelSingleStepState actionable={false} />
) : validationError ? (
<InsightValidationError detail={validationError} />
<InsightValidationError query={query} detail={validationError} />
) : empty ? (
<InsightEmptyState heading={context?.emptyStateHeading} detail={context?.emptyStateDetail} />
) : !loading && timedOut ? (
<InsightTimeoutState isLoading={false} insightProps={{ dashboardItemId: undefined }} />
) : apiErrored && !loading ? (
<InsightErrorState excludeDetail />
<InsightErrorState query={query} excludeDetail />
) : (
!apiErrored && <VizComponent inCardView={true} showPersonsModal={false} context={context} />
)}
Expand Down Expand Up @@ -348,6 +348,7 @@ function InsightCardInternal(
) : (
<div className="flex justify-between items-center h-full">
<InsightErrorState
query={insight.query}
excludeDetail
title="Missing 'filters.insight' property, can't display insight"
/>
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/lib/components/CommandBar/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { actionScopeToName } from './constants'
export const getNameFromActionScope = (scope: string): string => {
if (scope in actionScopeToName) {
return actionScopeToName[scope]
} else {
return scope
}
return scope
}
2 changes: 1 addition & 1 deletion frontend/src/lib/components/DatabaseTableTree/TreeRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface TreeRowProps {
export function TreeRow({ item, onClick, selected }: TreeRowProps): JSX.Element {
const _onClick = useCallback(() => {
onClick && onClick(item.table)
}, [])
}, [onClick, item])

return (
<li>
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/lib/components/JSBookmarklet.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { useActions } from 'kea'
import { IconBookmarkBorder } from 'lib/lemon-ui/icons'
import { apiHostOrigin } from 'lib/utils/apiHost'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
import { useEffect, useRef } from 'react'

import { TeamBasicType } from '~/types'

export function JSBookmarklet({ team }: { team: TeamBasicType }): JSX.Element {
const initCall = `posthog.init('${team?.api_token}',{api_host:'${location.origin}', loaded: () => alert('PostHog is now tracking events!')})`
const initCall = `posthog.init('${
team?.api_token
}',{api_host:'${apiHostOrigin()}', loaded: () => alert('PostHog is now tracking events!')})`
const href = `javascript:(function()%7Bif%20(window.posthog)%20%7Balert(%22Error%3A%20PostHog%20already%20is%20installed%20on%20this%20site%22)%7D%20else%20%7B!function(t%2Ce)%7Bvar%20o%2Cn%2Cp%2Cr%3Be.__SV%7C%7C(window.posthog%3De%2Ce._i%3D%5B%5D%2Ce.init%3Dfunction(i%2Cs%2Ca)%7Bfunction%20g(t%2Ce)%7Bvar%20o%3De.split(%22.%22)%3B2%3D%3Do.length%26%26(t%3Dt%5Bo%5B0%5D%5D%2Ce%3Do%5B1%5D)%2Ct%5Be%5D%3Dfunction()%7Bt.push(%5Be%5D.concat(Array.prototype.slice.call(arguments%2C0)))%7D%7D(p%3Dt.createElement(%22script%22)).type%3D%22text%2Fjavascript%22%2Cp.async%3D!0%2Cp.src%3Ds.api_host%2B%22%2Fstatic%2Farray.js%22%2C(r%3Dt.getElementsByTagName(%22script%22)%5B0%5D).parentNode.insertBefore(p%2Cr)%3Bvar%20u%3De%3Bfor(void%200!%3D%3Da%3Fu%3De%5Ba%5D%3D%5B%5D%3Aa%3D%22posthog%22%2Cu.people%3Du.people%7C%7C%5B%5D%2Cu.toString%3Dfunction(t)%7Bvar%20e%3D%22posthog%22%3Breturn%22posthog%22!%3D%3Da%26%26(e%2B%3D%22.%22%2Ba)%2Ct%7C%7C(e%2B%3D%22%20(stub)%22)%2Ce%7D%2Cu.people.toString%3Dfunction()%7Breturn%20u.toString(1)%2B%22.people%20(stub)%22%7D%2Co%3D%22capture%20identify%20alias%20people.set%20people.set_once%20set_config%20register%20register_once%20unregister%20opt_out_capturing%20has_opted_out_capturing%20opt_in_capturing%20reset%20isFeatureEnabled%20onFeatureFlags%22.split(%22%20%22)%2Cn%3D0%3Bn%3Co.length%3Bn%2B%2B)g(u%2Co%5Bn%5D)%3Be._i.push(%5Bi%2Cs%2Ca%5D)%7D%2Ce.__SV%3D1)%7D(document%2Cwindow.posthog%7C%7C%5B%5D)%3B${encodeURIComponent(
initCall
)}%7D%7D)()`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,8 @@ export const propertyFilterLogic = kea<propertyFilterLogicType>([
(filters) => {
if (filters.length === 0 || isValidPropertyFilter(filters[filters.length - 1])) {
return [...filters, {} as AnyPropertyFilter]
} else {
return filters
}
return filters
},
],
}),
Expand Down
6 changes: 1 addition & 5 deletions frontend/src/lib/components/Support/SupportForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import { useEffect, useRef } from 'react'
import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
import { userLogic } from 'scenes/userLogic'

import { AvailableFeature } from '~/types'

import {
SEVERITY_LEVEL_TO_NAME,
SUPPORT_TICKET_TEMPLATES,
Expand Down Expand Up @@ -58,7 +56,7 @@ export function SupportForm(): JSX.Element | null {
const { setSendSupportRequestValue } = useActions(supportLogic)
const { objectStorageAvailable } = useValues(preflightLogic)
// the support model can be shown when logged out, file upload is not offered to anonymous users
const { user, hasAvailableFeature } = useValues(userLogic)
const { user } = useValues(userLogic)
// only allow authentication issues for logged out users

const dropRef = useRef<HTMLDivElement>(null)
Expand Down Expand Up @@ -131,8 +129,6 @@ export function SupportForm(): JSX.Element | null {
disabledReason={
!user
? 'Please login to your account before opening a ticket unrelated to authentication issues.'
: !hasAvailableFeature(AvailableFeature.EMAIL_SUPPORT)
? 'You can only create billing related issues while viewing the billing page.'
: null
}
fullWidth
Expand Down
14 changes: 4 additions & 10 deletions frontend/src/lib/components/Support/supportLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { uuid } from 'lib/utils'
import posthog from 'posthog-js'
import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
import { teamLogic } from 'scenes/teamLogic'
import { urls } from 'scenes/urls'
import { userLogic } from 'scenes/userLogic'

import { sidePanelStateLogic } from '~/layout/navigation-3000/sidepanel/sidePanelStateLogic'
Expand Down Expand Up @@ -167,10 +166,10 @@ export const TARGET_AREA_TO_NAME = [
]

export const SEVERITY_LEVEL_TO_NAME = {
critical: 'Product outage / data loss / data breach',
high: 'Specific feature not working at all',
medium: 'Feature functioning but not as expected',
low: 'General question or feature request',
critical: 'Outage, data loss, or data breach',
high: 'Feature is not working at all',
medium: 'Feature not working as expected',
low: 'Question or feature request',
}

export const SUPPORT_KIND_TO_SUBJECT = {
Expand Down Expand Up @@ -338,11 +337,6 @@ export const supportLogic = kea<supportLogicType>([
actions.setSidePanelOptions(panelOptions)
}
},
openEmailForm: async () => {
if (window.location.href.includes(urls.organizationBilling())) {
actions.setSendSupportRequestValue('target_area', 'billing')
}
},
openSupportForm: async ({ name, email, kind, target_area, severity_level, message }) => {
let area = target_area ?? getURLPathToTargetArea(window.location.pathname)
if (!userLogic.values.user) {
Expand Down
1 change: 0 additions & 1 deletion frontend/src/lib/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ export const FEATURE_FLAGS = {
SESSION_REPLAY_MOBILE_ONBOARDING: 'session-replay-mobile-onboarding', // owner: #team-replay
IP_ALLOWLIST_SETTING: 'ip-allowlist-setting', // owner: @benjackwhite
EMAIL_VERIFICATION_TICKET_SUBMISSION: 'email-verification-ticket-submission', // owner: #team-growth
TOOLBAR_HEATMAPS: 'toolbar-heatmaps', // owner: #team-replay
THEME: 'theme', // owner: @aprilfools
SESSION_TABLE_PROPERTY_FILTERS: 'session-table-property-filters', // owner: @robbie-c
} as const
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/lib/hooks/useOutsideClickHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ export function useOutsideClickHandler(
allRefs.some((maybeRef) => {
if (typeof maybeRef === 'string') {
return event.composedPath?.()?.find((e) => (e as HTMLElement)?.matches?.(maybeRef))
} else {
const ref = maybeRef.current
return event.target && ref && `contains` in ref && ref.contains(event.target as Element)
}
const ref = maybeRef.current
return event.target && ref && `contains` in ref && ref.contains(event.target as Element)
})
) {
return
Expand Down
Loading

0 comments on commit cc3c244

Please sign in to comment.