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