Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: show tag/tooltip only when a filter other than ou/pe is used #2941

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/components/Item/VisualizationItem/Item.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { VIS_TYPE_OUTLIER_TABLE } from '@dhis2/analytics'
import {
VIS_TYPE_OUTLIER_TABLE,
DIMENSION_ID_PERIOD,
DIMENSION_ID_ORGUNIT,
} from '@dhis2/analytics'
import i18n from '@dhis2/d2-i18n'
import { Tag, Tooltip } from '@dhis2/ui'
import PropTypes from 'prop-types'
Expand Down Expand Up @@ -225,7 +229,14 @@ class Item extends Component {
case CHART:
case VISUALIZATION: {
return item.visualization.type ===
VIS_TYPE_OUTLIER_TABLE ? (
VIS_TYPE_OUTLIER_TABLE &&
Object.keys(itemFilters).some(
(filter) =>
![
DIMENSION_ID_ORGUNIT,
DIMENSION_ID_PERIOD,
].includes(filter)
) ? (
<Tooltip
content={i18n.t(
'Only Period and Organisation unit filters can be applied to this item'
Expand Down
Loading