From 4534679e651f68596402cff1d2bd4cceb807e7b8 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Tue, 1 Aug 2023 17:26:45 +0200 Subject: [PATCH] Hide application filter for queries that do not support it, fixes #1643 --- .../QueryEditor/ProblemsQueryEditor.tsx | 24 +++++++++++-------- .../QueryEditor/TriggersQueryEditor.tsx | 20 +++++++++------- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/src/datasource/components/QueryEditor/ProblemsQueryEditor.tsx b/src/datasource/components/QueryEditor/ProblemsQueryEditor.tsx index 1a2c2ec..a7c4a56 100644 --- a/src/datasource/components/QueryEditor/ProblemsQueryEditor.tsx +++ b/src/datasource/components/QueryEditor/ProblemsQueryEditor.tsx @@ -154,6 +154,8 @@ export const ProblemsQueryEditor = ({ query, datasource, onChange }: Props) => { } }; + const supportsApplications = datasource.zabbix.supportsApplications(); + return ( <> @@ -186,15 +188,17 @@ export const ProblemsQueryEditor = ({ query, datasource, onChange }: Props) => { - - - + {supportsApplications && ( + + + + )} { { )} - {(supportsApplications || query.countTriggersBy !== 'items') && ( + {supportsApplications && ( { onBlur={onTextFilterChange('trigger')} /> - - - )} {query.countTriggersBy === 'items' && ( @@ -313,6 +305,16 @@ export const TriggersQueryEditor = ({ query, datasource, onChange }: Props) => { /> )} + {!supportsApplications && ( + + + + )}