2016-12-05 22:48:46 +00:00
|
|
|
export const targetFilter = (targetType) => {
|
2021-04-12 13:32:25 +00:00
|
|
|
if (targetType === "all") {
|
|
|
|
|
return { name: "All Hosts" };
|
2016-12-05 22:48:46 +00:00
|
|
|
}
|
2016-10-27 16:14:30 +00:00
|
|
|
|
2021-06-04 16:37:56 +00:00
|
|
|
if (targetType === "labels" || targetType === "teams") {
|
2016-12-05 22:48:46 +00:00
|
|
|
return (option) => {
|
2021-04-12 13:32:25 +00:00
|
|
|
return option.target_type === targetType && option.name !== "All Hosts";
|
2016-12-05 22:48:46 +00:00
|
|
|
};
|
|
|
|
|
}
|
2016-10-27 16:14:30 +00:00
|
|
|
|
2016-12-05 22:48:46 +00:00
|
|
|
return { target_type: targetType };
|
2016-10-27 16:14:30 +00:00
|
|
|
};
|
|
|
|
|
|
2016-12-05 22:48:46 +00:00
|
|
|
export default { targetFilter };
|