Skip to content

Commit

Permalink
solve issue
Browse files Browse the repository at this point in the history
  • Loading branch information
barbalex committed Jul 11, 2024
1 parent 817efc0 commit a5ab664
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 32 deletions.
6 changes: 0 additions & 6 deletions src/components/Projekte/Daten/TpopFilter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import Tab from '@mui/material/Tab'
import styled from '@emotion/styled'
import { observer } from 'mobx-react-lite'
import { useQuery } from '@apollo/client'
import { getSnapshot } from 'mobx-state-tree'

import FilterTitle from '../../../shared/FilterTitle.jsx'
import queryTpops from './queryTpops.js'
Expand Down Expand Up @@ -46,11 +45,6 @@ export const TpopFilter = observer(() => {

const { dataFilter, tpopGqlFilter, dataFilterSetValue } = store.tree

console.log('TpopFilter', {
dataFilter: getSnapshot(dataFilter),
tpopGqlFilter,
})

const [tab, setTab] = useSearchParamsState('tpopTab', 'tpop')
const onChangeTab = useCallback((event, value) => setTab(value), [setTab])

Expand Down
60 changes: 34 additions & 26 deletions src/store/Tree/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ export default types
}
const filterArray = []
for (const filter of filterArrayInStore) {
// add hiearchy filter
// add hierarchy filter
const singleFilter = { ...singleFilterByHierarchy }
// add apFilter
if (setApFilter) {
Expand Down Expand Up @@ -426,7 +426,7 @@ export default types
}
const filterArray = []
for (const filter of filterArrayInStore) {
// add hiearchy filter
// add hierarchy filter
const singleFilter = {}
// add apFilter
if (setApFilter) {
Expand Down Expand Up @@ -530,11 +530,13 @@ export default types
// 3. build data filter
const filterArray = []
for (const filter of filterArrayInStore) {
// add hiearchy filter
const singleFilter = merge(
singleFilterByHierarchy,
singleFilterByParentFiltersForFiltered,
)
// add hierarchy filter
const singleFilter = {
...merge(
singleFilterByHierarchy,
singleFilterByParentFiltersForFiltered,
),
}
// add data filter
const dataFilterPop = { ...filter }
const popFilterValues = Object.entries(dataFilterPop).filter(
Expand Down Expand Up @@ -607,7 +609,7 @@ export default types
// 2. build data filter
const filterArray = []
for (const filter of filterArrayInStore) {
// add hiearchy filter
// add hierarchy filter
const singleFilter = {}
// add data filter
const dataFilterPop = { ...filter }
Expand Down Expand Up @@ -708,7 +710,7 @@ export default types
// 3. build data filter
const filterArray = []
for (const filter of filterArrayInStore) {
// add hiearchy filter
// add hierarchy filter
// BEWARE: merge without spreading leads to the same object being used during the for loop!
const singleFilter = {
...merge(
Expand Down Expand Up @@ -789,7 +791,7 @@ export default types
// 2. build data filter
const filterArray = []
for (const filter of filterArrayInStore) {
// add hiearchy filter
// add hierarchy filter
const singleFilter = {}
// add data filter
const dataFilterTpop = { ...filter }
Expand Down Expand Up @@ -898,11 +900,13 @@ export default types
// 3. build data filter
const filterArray = []
for (const filter of filterArrayInStore) {
// add hiearchy filter
const singleFilter = merge(
singleFilterByHierarchy,
singleFilterByParentFiltersForFiltered,
)
// add hierarchy filter
const singleFilter = {
...merge(
singleFilterByHierarchy,
singleFilterByParentFiltersForFiltered,
),
}
// add data filter
const dataFilterTpopmassn = { ...filter }
const tpopmassnFilterValues = Object.entries(
Expand Down Expand Up @@ -980,7 +984,7 @@ export default types
// 2. build data filter
const filterArray = []
for (const filter of filterArrayInStore) {
// add hiearchy filter
// add hierarchy filter
const singleFilter = {}
// add data filter
const dataFilterTpopmassn = { ...filter }
Expand Down Expand Up @@ -1102,11 +1106,13 @@ export default types
// 3. build data filter
const filterArray = []
for (const filter of filterArrayInStore) {
// add hiearchy filter
const singleFilter = merge(
singleFilterByHierarchy,
singleFilterByParentFiltersForFiltered,
)
// add hierarchy filter
const singleFilter = {
...merge(
singleFilterByHierarchy,
singleFilterByParentFiltersForFiltered,
),
}
// add data filter
const dataFilter = { ...filter }
const filterValues = Object.entries(dataFilter).filter(
Expand Down Expand Up @@ -1291,11 +1297,13 @@ export default types
// 3. build data filter
const filterArray = []
for (const filter of filterArrayInStore) {
// add hiearchy filter
const singleFilter = merge(
singleFilterByHierarchy,
singleFilterByParentFiltersForFiltered,
)
// add hierarchy filter
const singleFilter = {
...merge(
singleFilterByHierarchy,
singleFilterByParentFiltersForFiltered,
),
}
// add data filter
const dataFilter = { ...filter }
const filterValues = Object.entries(dataFilter).filter(
Expand Down

0 comments on commit a5ab664

Please sign in to comment.