Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite committed Dec 20, 2024
1 parent 4353b77 commit ecb9092
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export function SidePanelActivitySubscriptions(): JSX.Element {
<p>Get notified of your team's activity</p>

<LinkedHogFunctions
logicKey="activity-log"
type="internal_destination"
subTemplateId="activity-log"
filters={{
Expand Down
1 change: 1 addition & 0 deletions frontend/src/scenes/actions/ActionHogFunctions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export function ActionHogFunctions(): JSX.Element | null {
) : null}

<LinkedHogFunctions
logicKey="actions"
type="destination"
filters={filters}
newDisabledReason={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,15 @@ export function DefinitionView(props: DefinitionLogicProps = {}): JSX.Element {
<LemonDivider className="my-6" />
<div className="flex flex-wrap">
{isEvent && definition.created_at && (
<div className="flex-1 flex flex-col">
<div className="flex flex-col flex-1">
<h5>First seen</h5>
<b>
<TZLabel time={definition.created_at} />
</b>
</div>
)}
{isEvent && definition.last_seen_at && (
<div className="flex-1 flex flex-col">
<div className="flex flex-col flex-1">
<h5>Last seen</h5>
<b>
<TZLabel time={definition.last_seen_at} />
Expand All @@ -200,7 +200,7 @@ export function DefinitionView(props: DefinitionLogicProps = {}): JSX.Element {
)}

{isProperty && (
<div className="flex-1 flex flex-col">
<div className="flex flex-col flex-1">
<h5>Property type</h5>
<b>{(definition as PropertyDefinition).property_type ?? '-'}</b>
</div>
Expand All @@ -218,6 +218,7 @@ export function DefinitionView(props: DefinitionLogicProps = {}): JSX.Element {
<p>Get notified via Slack, webhooks or more whenever this event is captured.</p>

<LinkedHogFunctions
logicKey="event-definitions"
type="destination"
filters={{
events: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ export function EarlyAccessFeature({ id }: { id?: string } = {}): JSX.Element {
<h3>Notifications</h3>
<p>Get notified when people opt in or out of your feature.</p>
<LinkedHogFunctions
logicKey="eaf"
type="destination"
filters={destinationFilters}
subTemplateId="early-access-feature-enrollment"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@ export function ErrorTrackingAlertsScene(): JSX.Element {
/>

<LinkedHogFunctions
logicKey="error-tracking-alerts"
type="internal_destination"
subTemplateId="activity_log"
subTemplateId="errors"
filters={{
events: [
{
id: `$activity_log_entry_created`,
id: `$error_something`,
type: 'events',
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ import { HogFunctionList } from './HogFunctionsList'
import { HogFunctionTemplateList } from './HogFunctionTemplateList'

export type LinkedHogFunctionsProps = {
logicKey?: string
type: HogFunctionTypeType
filters: HogFunctionFiltersType
subTemplateId?: HogFunctionSubTemplateIdType
newDisabledReason?: string
}

export function LinkedHogFunctions({
logicKey,
type,
filters,
subTemplateId,
Expand All @@ -38,6 +40,7 @@ export function LinkedHogFunctions({
) : (
<HogFunctionList
forceFilters={{ filters }}
logicKey={logicKey}
type={type}
extraControls={
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export type HogFunctionListFilters = {
}

export type HogFunctionListLogicProps = {
logicKey?: string
type: HogFunctionTypeType
defaultFilters?: HogFunctionListFilters
forceFilters?: HogFunctionListFilters
Expand All @@ -33,7 +34,7 @@ export type HogFunctionListLogicProps = {

export const hogFunctionListLogic = kea<hogFunctionListLogicType>([
props({} as HogFunctionListLogicProps),
key((props) => (props.syncFiltersWithUrl ? 'scene' : 'default')),
key((props) => (props.syncFiltersWithUrl ? 'scene' : 'default') + (props.logicKey || props.type)),
path((id) => ['scenes', 'pipeline', 'hogFunctionListLogic', id]),
connect({
values: [
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/scenes/pipeline/hogfunctions/urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export function hogFunctionUrl(type: HogFunctionTypeType | PipelineStage, id?: s
return id ? urls.messagingProvider(id) : urls.messagingProviders()
} else if (type === 'broadcast') {
return id ? urls.messagingBroadcast(id) : urls.messagingBroadcasts()
} else if (type === 'error_tracking_alert') {
} else if (type === 'internal_destination') {
// TODO: Fix this somehow
return urls.errorTrackingAlerts()
}
return id
Expand Down
1 change: 1 addition & 0 deletions frontend/src/scenes/surveys/SurveyView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ export function SurveyView({ id }: { id: string }): JSX.Element {
<div>
<p>Get notified whenever a survey result is submitted</p>
<LinkedHogFunctions
logicKey="survey"
type="destination"
subTemplateId="survey-response"
filters={{
Expand Down
1 change: 1 addition & 0 deletions frontend/src/scenes/surveys/Surveys.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ export function Surveys(): JSX.Element {
<>
<p>Get notified whenever a survey result is submitted</p>
<LinkedHogFunctions
logicKey="surveys"
type="destination"
subTemplateId="survey-response"
filters={{
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4701,7 +4701,11 @@ export type HogFunctionType = {
}

export type HogFunctionTemplateStatus = 'alpha' | 'beta' | 'stable' | 'free' | 'deprecated' | 'client-side'
export type HogFunctionSubTemplateIdType = 'early-access-feature-enrollment' | 'survey-response' | 'activity-log'
export type HogFunctionSubTemplateIdType =
| 'early-access-feature-enrollment'
| 'survey-response'
| 'activity-log'
| 'errors'

export type HogFunctionConfigurationType = Omit<
HogFunctionType,
Expand Down

0 comments on commit ecb9092

Please sign in to comment.