Skip to content

Instantly share code, notes, and snippets.

@ashwanth1109
Created September 8, 2022 07:18
Show Gist options
  • Save ashwanth1109/cac8768907fe9778f681275e50b5b501 to your computer and use it in GitHub Desktop.
Save ashwanth1109/cac8768907fe9778f681275e50b5b501 to your computer and use it in GitHub Desktop.
Message Filters
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