mirror of https://github.com/hashicorp/consul
ui: Don't show duplicate services in the intentions form dropdown (#8133)
* Add uniq-by helper * Pass unique services through to intentions form * Add acceptance testpull/8136/head
parent
d31691dc87
commit
61433fabb4
@ -0,0 +1,13 @@
|
||||
import { helper } from '@ember/component/helper';
|
||||
import { isEmpty } from '@ember/utils';
|
||||
import { A as emberArray } from '@ember/array';
|
||||
|
||||
export function uniqBy([byPath, array]) {
|
||||
if (isEmpty(byPath)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return emberArray(array).uniqBy(byPath);
|
||||
}
|
||||
|
||||
export default helper(uniqBy);
|
Loading…
Reference in new issue