feat(xo-web/iso-device): hide missing VDIs

Fixes #5222
This commit is contained in:
Julien Fontanet
2020-08-27 11:13:59 +02:00
parent fc3bc8468f
commit 15bc30a2d5
3 changed files with 8 additions and 2 deletions

View File

@@ -8,6 +8,7 @@
> Users must be able to say: “Nice enhancement, I'm eager to test it”
- [Health/Orphan VDIs] Improve heuristic and list both VDI snapshots and normal VDIs (PR [#5228](https://github.com/vatesfr/xen-orchestra/pull/5228))
- [VM/Console] Hide missing ISOs in selector [#5222](https://github.com/vatesfr/xen-orchestra/issues/5222)
### Bug fixes
@@ -30,4 +31,5 @@
>
> In case of conflict, the highest (lowest in previous list) `$version` wins.
- xo-server minor
- xo-web minor

View File

@@ -600,6 +600,7 @@ const TRANSFORMS = {
const vdi = {
type: 'VDI',
missing: obj.missing,
name_description: obj.name_description,
name_label: obj.name_label,
parent: obj.sm_config['vhd-parent'],

View File

@@ -18,6 +18,8 @@ import {
createSelector,
} from './selectors'
const vdiPredicate = vdi => !vdi.missing
@addSubscriptions({
resourceSets: subscribeResourceSets,
})
@@ -45,7 +47,7 @@ export default class IsoDevice extends Component {
vm: PropTypes.object.isRequired,
}
_getPredicate = createSelector(
_getSrPredicate = createSelector(
() => this.props.vm.$pool,
() => this.props.vm.$container,
(vmPool, vmContainer) => sr => {
@@ -96,8 +98,9 @@ export default class IsoDevice extends Component {
<div className='input-group'>
<SelectVdi_
onChange={this._handleInsert}
predicate={vdiPredicate}
resourceSet={useResourceSet ? resourceSet : undefined}
srPredicate={this._getPredicate()}
srPredicate={this._getSrPredicate()}
value={mountedIso}
/>
<span className='input-group-btn'>