fix(xo-web): fix selectors (#4807)
This commit is contained in:
parent
9ba77c9498
commit
32960332b9
@ -89,13 +89,13 @@ class PatchesCard extends Component {
|
||||
@injectIntl
|
||||
class DefaultCard extends Component {
|
||||
_getPoolWisePredicate = createSelector(
|
||||
() => map(this.state.pools, 'id'),
|
||||
createCollectionWrapper(() => map(this.state.pools, 'id')),
|
||||
poolsIds => item => isEmpty(poolsIds) || includes(poolsIds, item.$pool)
|
||||
)
|
||||
|
||||
_getPredicate = createSelector(
|
||||
this._getPoolWisePredicate,
|
||||
() => map(this.state.hosts, 'id'),
|
||||
createCollectionWrapper(() => map(this.state.hosts, 'id')),
|
||||
(poolWisePredicate, hostsIds) => item =>
|
||||
isEmpty(hostsIds)
|
||||
? poolWisePredicate(item)
|
||||
|
@ -18,6 +18,7 @@ import { Container, Row, Col } from 'grid'
|
||||
import { connectStore, formatSize, noop } from 'utils'
|
||||
import { concat, groupBy, isEmpty, map, mapValues, pick, some } from 'lodash'
|
||||
import {
|
||||
createCollectionWrapper,
|
||||
createGetObjectsOfType,
|
||||
createSelector,
|
||||
getCheckPermissions,
|
||||
@ -313,7 +314,7 @@ export default class SrDisks extends Component {
|
||||
_getIsVdiAttached = createSelector(
|
||||
createSelector(
|
||||
() => this.props.vbds,
|
||||
() => map(this.props.vdis, 'id'),
|
||||
createCollectionWrapper(() => map(this.props.vdis, 'id')),
|
||||
(vbds, vdis) => pick(groupBy(vbds, 'VDI'), vdis)
|
||||
),
|
||||
vbdsByVdi => mapValues(vbdsByVdi, vbds => some(vbds, 'attached'))
|
||||
|
Loading…
Reference in New Issue
Block a user