Skip to content

Commit bed4b32

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(quickbooks): clarify webhook setup
1 parent 9db087d commit bed4b32

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

apps/sim/triggers/quickbooks/quickbooks.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ describe('QuickBooks triggers', () => {
3838
} else {
3939
expect(eventTypes?.options?.map((option) => option.id)).toEqual(definition.actions)
4040
}
41+
const instructions = trigger.subBlocks.find((subBlock) =>
42+
subBlock.id.startsWith('triggerInstructions')
43+
)?.defaultValue
44+
expect(instructions).toContain('enable webhook notifications')
45+
if (definition.id === 'quickbooks_preferences_updated') {
46+
expect(instructions).not.toContain('Select the <strong>Preferences Updated</strong>')
47+
}
4148
expect(trigger.outputs).toEqual(getTrigger('quickbooks_invoice_events').outputs)
4249
}
4350
})

apps/sim/triggers/quickbooks/utils.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,13 @@ export function isQuickBooksEventMatch(
292292
return Array.isArray(selectedActions) && selectedActions.includes(parsed.action)
293293
}
294294

295-
function quickBooksSetupInstructions(entityLabel: string): string {
295+
function quickBooksSetupInstructions(entityLabel: string, includeActionSelection = true): string {
296296
const instructions = [
297-
'<strong>App setup:</strong> A Sim operator must register <code>https://&lt;your-sim-domain&gt;/api/webhooks/quickbooks</code> as the app-level endpoint in the Intuit Developer Portal and configure the server-only <code>QUICKBOOKS_WEBHOOK_VERIFIER_TOKEN</code>.',
297+
'<strong>App setup:</strong> A Sim operator must register <code>https://&lt;your-sim-domain&gt;/api/webhooks/quickbooks</code> as the app-level endpoint, enable webhook notifications for the supported QuickBooks entities and actions in the Intuit Developer Portal, and configure the server-only <code>QUICKBOOKS_WEBHOOK_VERIFIER_TOKEN</code>.',
298298
'Connect the <strong>QuickBooks account</strong> whose company should receive these events.',
299-
`Select the <strong>${entityLabel}</strong> actions this workflow should handle.`,
299+
...(includeActionSelection
300+
? [`Select the <strong>${entityLabel}</strong> actions this workflow should handle.`]
301+
: []),
300302
'<strong>Deploy</strong> the workflow to activate the trigger.',
301303
]
302304

@@ -368,7 +370,7 @@ export function buildQuickBooksSingleEventTriggerSubBlocks(triggerId: string): S
368370
title: 'Setup Instructions',
369371
hideFromPreview: true,
370372
type: 'text',
371-
defaultValue: quickBooksSetupInstructions(definition.label),
373+
defaultValue: quickBooksSetupInstructions(definition.label, false),
372374
mode: 'trigger',
373375
condition: { field: 'selectedTriggerId', value: triggerId },
374376
},

0 commit comments

Comments
 (0)