Created
September 8, 2022 07:18
-
-
Save ashwanth1109/cac8768907fe9778f681275e50b5b501 to your computer and use it in GitHub Desktop.
Message Filters
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
const schema = { | |
type: "object", | |
properties: { | |
type: "array", | |
items: { | |
type: "object", | |
properties: { | |
typeOfRow: { | |
type: "string", | |
}, | |
comparator: { | |
type: "string", | |
}, | |
value: { | |
type: "string", | |
}, | |
}, | |
}, | |
}, | |
}; | |
const baseRows = { | |
FromRow: { | |
name: "FromRow", | |
content: { | |
type: "Flex", | |
elements: [ | |
{ | |
type: "Select", | |
scope: "#/properties/attribute", | |
options: { | |
source: "attributeTypes", | |
}, | |
}, | |
{ | |
type: "Select", | |
scope: "#/properties/comparator", | |
options: { | |
selectList: [ | |
"Equals", | |
"Contains", | |
"Does not contain", | |
"Does not equal", | |
], | |
}, | |
}, | |
], | |
}, | |
}, | |
}; | |
const uiSchema = { | |
type: "DAF", | |
scope: "#/properties/conditions", | |
options: { | |
baseRows, | |
}, | |
}; | |
// Initial data from page fetch will contain: | |
const conditions = [ | |
{ | |
typeOfRow: "FromRow", // This will select the first field | |
comparator: "Equals", | |
value: "<--AuthorUsername-->", | |
}, | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment