Skip to content

Commit

Permalink
don't add error if metadata selector is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
okauppinen committed Nov 27, 2024
1 parent 1678a94 commit 61c97aa
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions bundles/statistics/statsgrid/handler/SearchHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,12 +375,15 @@ class SearchController extends AsyncStateHandler {
const multiSelections = [];
Object.keys(selections).forEach(key => {
const metaSelector = metadata.selectors.find(selector => selector.id === key);
// use metadata for validity check. Params have combined selectors.
const checkAllowed = value => metaSelector.values.find(obj => obj.value === value);
if (!metaSelector) {
indSearchValues.error = 'indicatorMetadataError';
// Only allowed selections are used for get/add indicator
// multi indicator selections may have selection which is missing from single indicator selectors
// skip selection and don't add error
return;
}
// use metadata for validity check. Params have combined selectors.
const checkAllowed = value => metaSelector.values.find(obj => obj.value === value);

const values = selections[key];
// single
if (!Array.isArray(values)) {
Expand Down

0 comments on commit 61c97aa

Please sign in to comment.