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 <palashgdev@gmail.com>
Co-authored-by: Vishal Sharma <makeavish786@gmail.com>
This commit is contained in:
vasukapil 2023-07-31 18:43:25 +05:30 committed by GitHub
parent fabdf87ed1
commit 4397c53494
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 12 deletions

View File

@ -210,16 +210,19 @@ export const Query = memo(function Query({
default: {
return (
<>
<Col span={11}>
<Row gutter={[11, 5]}>
<Col flex="5.93rem">
<FilterLabel label="Limit" />
</Col>
<Col flex="1 1 12.5rem">
<LimitFilter query={query} onChange={handleChangeLimit} />
</Col>
</Row>
</Col>
{!filterConfigs?.limit?.isHidden && (
<Col span={11}>
<Row gutter={[11, 5]}>
<Col flex="5.93rem">
<FilterLabel label="Limit" />
</Col>
<Col flex="1 1 12.5rem">
<LimitFilter query={query} onChange={handleChangeLimit} />
</Col>
</Row>
</Col>
)}
{!filterConfigs?.having?.isHidden && (
<Col span={11}>
<Row gutter={[11, 5]}>
@ -232,7 +235,6 @@ export const Query = memo(function Query({
</Row>
</Col>
)}
<Col span={11}>
<Row gutter={[11, 5]}>
<Col flex="5.93rem">
@ -251,6 +253,7 @@ export const Query = memo(function Query({
panelType,
isMetricsDataSource,
query,
filterConfigs?.limit?.isHidden,
filterConfigs?.having?.isHidden,
handleChangeLimit,
handleChangeHavingFilter,

View File

@ -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 },
};

View File

@ -152,7 +152,6 @@ export const useQueryOperations: UseQueryOperations = ({
() => query.dataSource === DataSource.METRICS,
[query.dataSource],
);
const isTracePanelType = useMemo(() => panelType === PANEL_TYPES.TRACE, [
panelType,
]);