Skip to content

Commit

Permalink
fix function/variables name
Browse files Browse the repository at this point in the history
  • Loading branch information
Grace committed Mar 19, 2021
1 parent 110ef3b commit 2b74465
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { flatMap, isEmpty } from 'lodash';
import { CHART_TYPE, TAB_TYPE } from './componentTypes';
import { getChartIdAndColumnFromFilterKey } from './getDashboardFilterKey';

function getChartIdsFromTabsNotInScope({ tabs = [], tabsInScope = [] }) {
function getImmuneChartIdsFromTabsNotInScope({ tabs = [], tabsInScope = [] }) {
const chartsNotInScope = [];
tabs.forEach(({ value: tab, children: tabChildren }) => {
if (tabChildren && !tabsInScope.includes(tab)) {
Expand Down Expand Up @@ -57,18 +57,20 @@ function getTabChildrenScope({
))
) {
// get all charts from tabChildren that is not in scope
const immuneChartIdsFromTabsNotInScope = getChartIdsFromTabsNotInScope({
tabs: tabChildren,
tabsInScope: flatMap(tabScopes, ({ scope }) => scope),
});
const immuneChartsFromTabsInScope = flatMap(
const immuneChartIdsFromTabsNotInScope = getImmuneChartIdsFromTabsNotInScope(
{
tabs: tabChildren,
tabsInScope: flatMap(tabScopes, ({ scope }) => scope),
},
);
const immuneChartIdsFromTabsInScope = flatMap(
Object.values(tabScopes),
({ immune }) => immune,
);
const immuneCharts = [
...new Set([
...immuneChartIdsFromTabsNotInScope,
...immuneChartsFromTabsInScope,
...immuneChartIdsFromTabsInScope,
]),
];
return {
Expand Down

0 comments on commit 2b74465

Please sign in to comment.