fix(xo-web/dashboard/overview): missing patches not fetched (#2772)
Fixes #2768
This commit is contained in:
parent
ca51d59815
commit
89e25c9b81
@ -1,6 +1,6 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Portal } from 'react-overlays'
|
import { Portal } from 'react-overlays'
|
||||||
import { forEach, isEmpty, keys, map, noop } from 'lodash'
|
import { forEach, isEmpty, keys, map } from 'lodash'
|
||||||
|
|
||||||
import _ from './intl'
|
import _ from './intl'
|
||||||
import ActionButton from './action-button'
|
import ActionButton from './action-button'
|
||||||
@ -76,9 +76,6 @@ const ActionButton_ = ({ children, labelId, ...props }) => (
|
|||||||
|
|
||||||
// ===================================================================
|
// ===================================================================
|
||||||
|
|
||||||
@connectStore({
|
|
||||||
hostsById: createGetObjectsOfType('host').groupBy('id'),
|
|
||||||
})
|
|
||||||
class HostsPatchesTable extends Component {
|
class HostsPatchesTable extends Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
super(props)
|
super(props)
|
||||||
@ -94,13 +91,8 @@ class HostsPatchesTable extends Component {
|
|||||||
)
|
)
|
||||||
|
|
||||||
_subscribeMissingPatches = (hosts = this.props.hosts) => {
|
_subscribeMissingPatches = (hosts = this.props.hosts) => {
|
||||||
const { hostsById } = this.props
|
const unsubs = map(hosts, host =>
|
||||||
|
subscribeHostMissingPatches(host, patches =>
|
||||||
const unsubs = map(
|
|
||||||
hosts,
|
|
||||||
host =>
|
|
||||||
hostsById
|
|
||||||
? subscribeHostMissingPatches(hostsById[host.id][0], patches =>
|
|
||||||
this.setState({
|
this.setState({
|
||||||
missingPatches: {
|
missingPatches: {
|
||||||
...this.state.missingPatches,
|
...this.state.missingPatches,
|
||||||
@ -108,7 +100,6 @@ class HostsPatchesTable extends Component {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
: noop
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if (this.unsubscribeMissingPatches !== undefined) {
|
if (this.unsubscribeMissingPatches !== undefined) {
|
||||||
|
Loading…
Reference in New Issue
Block a user