diff --git a/frontend/src/components/Topics/Topic/Messages/Filters/Filters.styled.ts b/frontend/src/components/Topics/Topic/Messages/Filters/Filters.styled.ts index 3e609fb03..ad1fcf1b7 100644 --- a/frontend/src/components/Topics/Topic/Messages/Filters/Filters.styled.ts +++ b/frontend/src/components/Topics/Topic/Messages/Filters/Filters.styled.ts @@ -86,8 +86,16 @@ export const ListItem = styled.li` color: ${({ theme }) => theme.table.td.color.normal}; `; +export const InfoHeading = styled.div` + font-size: 16px; + font-weight: 500; + line-height: 1.5; + margin-bottom: 10px; + color: ${({ theme }) => theme.table.td.color.normal}; +`; + export const InfoParagraph = styled.div` - font-size: 12px; + font-size: 14px; font-weight: 400; line-height: 1.5; margin-bottom: 10px; diff --git a/frontend/src/components/Topics/Topic/Messages/Filters/InfoModal.tsx b/frontend/src/components/Topics/Topic/Messages/Filters/InfoModal.tsx index c97a960fc..bb134862f 100644 --- a/frontend/src/components/Topics/Topic/Messages/Filters/InfoModal.tsx +++ b/frontend/src/components/Topics/Topic/Messages/Filters/InfoModal.tsx @@ -10,55 +10,50 @@ interface InfoModalProps { const InfoModal: React.FC = ({ toggleIsOpen }) => { return ( + We use CEL syntax for smart message filters - Variables bound to groovy context: partition, timestampMs, - keyAsText, valueAsText, header, key (json if possible), value (json if - possible). + Variables bound to the context: +
    + key (json if possible) + value (json if possible) + keyAsText + valueAsText + header + partition + timestampMs +
JSON parsing logic: - Key and Value (if they can be parsed to JSON) they are bound as JSON - objects, otherwise bound as nulls. + Key and Value (if parsing to JSON is available) are bound as JSON + objects, otherwise as nulls. - Sample filters: + Filter examples:
    - - keyAsText != null && keyAsText ~"([Gg])roovy" - - regex for key as a string - - value.name == "iS.ListItemax" && value.age > 30 + has(record.keyAsText) && + record.keyAsText.matches(".*[Gg]roovy.*") {' '} - - in case value is json + - regex for key as a string - value == null && valueAsText != null - search for values - that are not nulls and are not json + + has(record.key.name.first) && record.key.name.first == + 'user1' + {' '} + - in case if the value is json - headers.sentBy == "some system" && - headers["sentAt"] == "2020-01-01" + record.headers.size() == 1 && !has(record.headers.k1) && + record.headers['k2'] == 'v2' - - multiline filters are also allowed: - -
    -              def name = value.name
    -              
    - def age = value.age -
    - name == "iliax" && age == 30 -
    -
    -
    -