Skip to content

Commit

Permalink
Fix displaying filtering relation in old relations (datalens-tech#813)
Browse files Browse the repository at this point in the history
  • Loading branch information
Marginy605 authored Mar 26, 2024
1 parent dd77399 commit e280070
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/ui/units/dash/containers/Dialogs/Connections/Connections.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class Connections extends React.PureComponent {
processedItems.forEach((item) => {
const data = entriesDatasetsFields.find(({entryId}) => entryId === item.entryId);
if (data) {
const {type, datasetId, datasetName, datasetFields, enableFiltering} = data;
const {type, datasetId, datasetName, datasetFields} = data;
if (datasetFields) {
datasets[datasetId] = datasets[datasetId] || {};
datasets[datasetId].name = datasetName;
Expand All @@ -228,7 +228,7 @@ class Connections extends React.PureComponent {
usedParams: Object.keys(datasets[datasetId].fields),
datasetId,
type: type || metas[item.id].type,
enableFiltering,
enableFiltering: item.enableFiltering,
};
}
}
Expand Down Expand Up @@ -266,9 +266,10 @@ class Connections extends React.PureComponent {

// if selected current chart with enableFiltering setting
// then don't filter all other charts
if (currentItemWithEnabledFiltering || filteringChartsIds.includes(id)) {
filterChartsWidgetsCondition = type === ITEM_TYPE.WIDGET;
}
filterChartsWidgetsCondition = Boolean(
(currentItemWithEnabledFiltering && type === ITEM_TYPE.WIDGET) ||
(filteringChartsIds.includes(id) && item.type === ITEM_TYPE.WIDGET),
);

return (
id !== itemId &&
Expand Down

0 comments on commit e280070

Please sign in to comment.