Skip to content

Commit

Permalink
fix: show tag/tooltip only when a filter other than ou/pe is used (#2941
Browse files Browse the repository at this point in the history
)
  • Loading branch information
edoardo committed Mar 21, 2024
1 parent 854a653 commit b6b8850
Showing 1 changed file with 13 additions and 2 deletions.
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

0 comments on commit b6b8850

Please sign in to comment.