-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
oVirt - filter VMs by available dynamic enum list of hosts #1298
oVirt - filter VMs by available dynamic enum list of hosts #1298
Conversation
return { | ||
type: 'host', | ||
primary: true, | ||
placeholderLabel: t('Host'), | ||
dynamicFilter: (items: { hostName: string }[]) => ({ | ||
values: [ | ||
...Array.from(new Set(items.map((item) => item.hostName))) // at this point the list contains unique strings that can be used as ID | ||
.map((label: string): EnumValue => ({ id: label, label })), | ||
//.map((label: string): EnumValue => ({ id: label, label })), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forgot to remove the commented code ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, sorry.
.map( | ||
(label: string): EnumValue => | ||
label !== '' ? { id: label, label } : { id: label, label: 'Undefined' }, | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.map( | |
(label: string): EnumValue => | |
label !== '' ? { id: label, label } : { id: label, label: 'Undefined' }, | |
), | |
.map(labelToFilterItem), |
/* ...
*/
const labelToFilterItem = (label: string): EnumValue => label !== '' ? { id: label, label } : { id: label, label: 'Undefined' }
Reference: kubev2v#1275 This includes the following changes for the oVirt provider VMs list only: 1. Set the 'Host' filter to be a primary filter. 2. Display a dynamic list of hosts that the VMs run on as an enum filter to select. 3. All VMs that are not assigned to any host, will be filtered out by the "Undefined" option. 4. Enable selecting any number of hosts from the enum filter list. If none, all VMs are filtered. 5. Enable to type-ahead input for displaying a subset of the enum filter list of hosts. Signed-off-by: Sharon Gratch <[email protected]>
025fac6
to
092aa5e
Compare
Quality Gate passedIssues Measures |
Reference: #1275
This includes the following changes for the oVirt provider VMs list only:
Before:
After: