From b77d15eef4de274ce0a03925a09c87a013f78d63 Mon Sep 17 00:00:00 2001 From: Bjorn Sandvik Date: Mon, 7 Aug 2023 15:16:12 +0200 Subject: [PATCH] fix: set rendering strategy to single if not relative period (#2909) Co-authored-by: Jen Jones Arnesen --- src/components/edit/thematic/ThematicDialog.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/components/edit/thematic/ThematicDialog.js b/src/components/edit/thematic/ThematicDialog.js index b324eb4d3..5a7e53fb7 100644 --- a/src/components/edit/thematic/ThematicDialog.js +++ b/src/components/edit/thematic/ThematicDialog.js @@ -39,6 +39,7 @@ import { DEFAULT_ORG_UNIT_LEVEL, CLASSIFICATION_PREDEFINED, CLASSIFICATION_EQUAL_INTERVALS, + RENDERING_STRATEGY_SINGLE, } from '../../../constants/layers'; import { RELATIVE_PERIODS, START_END_DATES } from '../../../constants/periods'; @@ -182,13 +183,24 @@ export class ThematicDialog extends Component { const { rows, columns, + periodType, + renderingStrategy, setClassification, setLegendSet, + setRenderingStrategy, loadOrgUnitPath, 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); + } + if (rows !== prev.rows) { const orgUnits = getOrgUnitNodesFromRows(rows);