feat(xo-web/home/pool): show # of *unique* available patches (#3483)

Fixes #3321
This commit is contained in:
Pierre Donias 2018-10-03 09:17:35 +02:00 committed by GitHub
parent fc1dd3ce09
commit efdbc18a0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -6,6 +6,7 @@
- [Host/Networks] Remove "Add network" button [#3386](https://github.com/vatesfr/xen-orchestra/issues/3386) (PR [#3478](https://github.com/vatesfr/xen-orchestra/pull/3478))
- [Host/networks] Private networks table [#3387](https://github.com/vatesfr/xen-orchestra/issues/3387) (PR [#3481](https://github.com/vatesfr/xen-orchestra/pull/3481))
- [Home/pool] Patch count pill now shows the number of unique patches in the pool [#3321](https://github.com/vatesfr/xen-orchestra/issues/3321) (PR [#3483](https://github.com/vatesfr/xen-orchestra/pull/3483))
### Bug fixes

View File

@ -1,12 +1,9 @@
import _ from 'intl'
import Component from 'base-component'
import Ellipsis, { EllipsisContainer } from 'ellipsis'
import flatMap from 'lodash/flatMap'
import Icon from 'icon'
import map from 'lodash/map'
import React from 'react'
import SingleLineRow from 'single-line-row'
import size from 'lodash/size'
import HomeTags from 'home-tags'
import Tooltip from 'tooltip'
import Link, { BlockLink } from 'link'
@ -14,6 +11,7 @@ import { Col } from 'grid'
import { Text } from 'editable'
import { addTag, editPool, getHostMissingPatches, removeTag } from 'xo'
import { connectStore, formatSizeShort } from 'utils'
import { flatten, map, size, uniq } from 'lodash'
import {
createGetObjectsOfType,
createGetHostMetrics,
@ -32,7 +30,7 @@ import styles from './index.css'
const getMissingPatches = createSelector(getPoolHosts, hosts => {
return Promise.all(map(hosts, host => getHostMissingPatches(host))).then(
patches => flatMap(patches)
patches => uniq(map(flatten(patches), 'name'))
)
})