From 4397c5349405ffaf55d6e518c06af927facf1627 Mon Sep 17 00:00:00 2001 From: vasukapil Date: Mon, 31 Jul 2023 18:43:25 +0530 Subject: [PATCH] fix : Hide limit param in list view of traces #3173 (#3187) * fix : Hide limit param in list view of traces #3173 * Hide Limit blue text also removed * changes made such that LIMIT is only hidden for Traces List and not for Logs * code refactored and filterConfigs used * minor change * unnecessary filter code removed * lint issue fixed and develop branch merged * minor change * eslint fix --------- Co-authored-by: Palash Gupta Co-authored-by: Vishal Sharma --- .../QueryBuilder/components/Query/Query.tsx | 25 +++++++++++-------- .../TracesExplorer/QuerySection/index.tsx | 1 + .../hooks/queryBuilder/useQueryOperations.ts | 1 - 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/frontend/src/container/QueryBuilder/components/Query/Query.tsx b/frontend/src/container/QueryBuilder/components/Query/Query.tsx index 7f8b4c1cdc..9f4fca9b12 100644 --- a/frontend/src/container/QueryBuilder/components/Query/Query.tsx +++ b/frontend/src/container/QueryBuilder/components/Query/Query.tsx @@ -210,16 +210,19 @@ export const Query = memo(function Query({ default: { return ( <> - - - - - - - - - - + {!filterConfigs?.limit?.isHidden && ( + + + + + + + + + + + )} + {!filterConfigs?.having?.isHidden && ( @@ -232,7 +235,6 @@ export const Query = memo(function Query({ )} - @@ -251,6 +253,7 @@ export const Query = memo(function Query({ panelType, isMetricsDataSource, query, + filterConfigs?.limit?.isHidden, filterConfigs?.having?.isHidden, handleChangeLimit, handleChangeHavingFilter, diff --git a/frontend/src/container/TracesExplorer/QuerySection/index.tsx b/frontend/src/container/TracesExplorer/QuerySection/index.tsx index 80f2925b37..279f57b5df 100644 --- a/frontend/src/container/TracesExplorer/QuerySection/index.tsx +++ b/frontend/src/container/TracesExplorer/QuerySection/index.tsx @@ -20,6 +20,7 @@ function QuerySection(): JSX.Element { const isList = panelTypes === PANEL_TYPES.LIST; const config: QueryBuilderProps['filterConfigs'] = { stepInterval: { isHidden: false, isDisabled: true }, + limit: { isHidden: isList, isDisabled: true }, having: { isHidden: isList, isDisabled: true }, }; diff --git a/frontend/src/hooks/queryBuilder/useQueryOperations.ts b/frontend/src/hooks/queryBuilder/useQueryOperations.ts index 8e0251d0b5..0d2f8f0cf2 100644 --- a/frontend/src/hooks/queryBuilder/useQueryOperations.ts +++ b/frontend/src/hooks/queryBuilder/useQueryOperations.ts @@ -152,7 +152,6 @@ export const useQueryOperations: UseQueryOperations = ({ () => query.dataSource === DataSource.METRICS, [query.dataSource], ); - const isTracePanelType = useMemo(() => panelType === PANEL_TYPES.TRACE, [ panelType, ]);