Skip to content

Commit

Permalink
fix(cdp): improve ux around test globals (#25449)
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusandra authored Oct 8, 2024
1 parent 5fc4e3a commit c598564
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions frontend/src/scenes/pipeline/hogfunctions/HogFunctionTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ export function HogFunctionTest(props: HogFunctionTestLogicProps): JSX.Element {
type="secondary"
onClick={loadSampleGlobals}
loading={sampleGlobalsLoading}
tooltip="Find the last event matching filters, and use it to populate the globals below."
>
Reload context
Refresh globals
</LemonButton>
<LemonField name="mock_async_functions">
{({ value, onChange }) => (
Expand Down Expand Up @@ -178,20 +179,15 @@ export function HogFunctionTest(props: HogFunctionTestLogicProps): JSX.Element {
</div>
) : (
<div className="space-y-2">
<LemonField name="globals" label="Test invocation context">
<LemonField name="globals">
{({ value, onChange }) => (
<>
<div>
<p className="flex-1">
The globals object is the context in which your function will be
tested. It should contain all the data that your function will need
to run
</p>
<div className="space-y-2">
<div>Here are all the global variables you can use in your code:</div>
{sampleGlobalsError ? (
<p className="text-warning">{sampleGlobalsError}</p>
<div className="text-warning">{sampleGlobalsError}</div>
) : null}
</div>

<HogFunctionTestEditor value={value} onChange={onChange} />
</>
)}
Expand Down

0 comments on commit c598564

Please sign in to comment.