-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(editor): implement filterNode configurator
- Loading branch information
1 parent
c40a2bf
commit b756476
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
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
30 changes: 30 additions & 0 deletions
30
src/main/frontend/sections/editor/types/FilterNodeStep.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,30 @@ | ||
import React, { FC } from 'react'; | ||
|
||
import { Hop } from '../../../model/hops'; | ||
import { StepEditor } from '../../../widgets/StepEditor'; | ||
|
||
import { shortDescription, title, Type } from '../../../model/hops/filterNode'; | ||
import { Help } from '../../../widgets/Help'; | ||
import { Input } from '../../../widgets/Input'; | ||
import { Pipeline } from '../Pipeline'; | ||
|
||
export const FilterNodeStep: FC<{ parentHops: Hop[]; hop: Type }> = ({ parentHops, hop }) => { | ||
return ( | ||
<StepEditor parentHops={parentHops} hop={hop} title={shortDescription(hop)} pipeline={<Pipeline hops={(hop.hops ??= [])} />}> | ||
<label> | ||
JEXL Expression:{' '} | ||
<Input value={hop.expression ?? ''} onChange={expression => (hop.expression = expression)} placeholder="[]" /> | ||
</label> | ||
<Help title={title}> | ||
<h5>Filter Expression</h5> | ||
<p> | ||
The expression that needs to evaluate to <code>true</code> to apply the sub-pipeline to the current node. | ||
</p> | ||
<p>This field expects an expression, thus surrounding the expression with {'${}'} is invalid.</p> | ||
<p> | ||
With the word <code className="code font--serif">node</code> you can reference the current node. | ||
</p> | ||
</Help> | ||
</StepEditor> | ||
); | ||
}; |