Skip to content

Commit

Permalink
fix: Set rendering strategy to single if not relative period (#2703)
Browse files Browse the repository at this point in the history
  • Loading branch information
turban authored Jun 26, 2023
1 parent bd9237a commit 6de79b1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/components/edit/thematic/ThematicDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
DEFAULT_ORG_UNIT_LEVEL,
CLASSIFICATION_PREDEFINED,
CLASSIFICATION_EQUAL_INTERVALS,
RENDERING_STRATEGY_SINGLE,
} from '../../../constants/layers.js'
import {
RELATIVE_PERIODS,
Expand Down Expand Up @@ -175,12 +176,23 @@ class ThematicDialog extends Component {
componentDidUpdate(prev) {
const {
columns,
periodType,
renderingStrategy,
setClassification,
setLegendSet,
setRenderingStrategy,
validateLayer,
onLayerValidation,
} = this.props

// Set rendering strategy to single if not relative period
if (
periodType !== RELATIVE_PERIODS &&
renderingStrategy !== RENDERING_STRATEGY_SINGLE
) {
setRenderingStrategy(RENDERING_STRATEGY_SINGLE)
}

// Set the default classification/legend for selected data item without visiting the style tab
if (columns !== prev.columns) {
const dataItem = getDataItemFromColumns(columns)
Expand Down

0 comments on commit 6de79b1

Please sign in to comment.