Skip to content

Commit

Permalink
fix: resolve select caresite when use research mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Mehdi-BOUYAHIA committed Nov 13, 2023
1 parent 1fd0549 commit 2aea9cf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/ScopeTree/ScopeTreeSearch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { ScopeTreeRow } from 'types'
import { ScopeTreeSearchProps } from '../index'
import ScopeTreeHierarchy from '../ScopeTreeHierarchy'
import { IndeterminateCheckBoxOutlined } from '@mui/icons-material'
import { getCurrentScopeList } from 'utils/scopeTree'

const Index: React.FC<ScopeTreeSearchProps> = (props) => {
const {
Expand All @@ -39,7 +40,8 @@ const Index: React.FC<ScopeTreeSearchProps> = (props) => {
scopeState: state.scope || {}
}))

const { scopesList = [] } = scopeState
const isExecutiveUnit: boolean = !!executiveUnitType ?? false
const scopesList: ScopeTreeRow[] = getCurrentScopeList(scopeState.scopesList, isExecutiveUnit) ?? []
const [openPopulation, setOpenPopulations] = useState<number[]>(scopeState.openPopulation)
const [rootRows, setRootRows] = useState<ScopeTreeRow[]>([])
const controllerRef = useRef<AbortController | null>(null)
Expand Down Expand Up @@ -152,11 +154,12 @@ const Index: React.FC<ScopeTreeSearchProps> = (props) => {
row,
selectedItems,
searchSavedRootRows,
scopesList as ScopeTreeRow[],
scopesList,
isSelectionLoading,
setIsSelectionLoading,
setSelectedItems,
setSearchSavedRootRows
setSearchSavedRootRows,
isExecutiveUnit
)
}
isIndeterminate={(row: ScopeTreeRow) => isSearchIndeterminate(row, selectedItems)}
Expand Down

0 comments on commit 2aea9cf

Please sign in to comment.