Skip to content

MGMT-17092: Changes in hosts' "Status" filter in host inventory make the filter useless [BACKPORT 2.9] #2510

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libs/ui-lib/lib/cim/components/Agent/tableUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ export const useAgentsFilter = ({
}: UseAgentsFilterArgs) => {
const [hostnameFilter, setHostnameFilter] = React.useState<string>();
const [statusFilter, setStatusFilter] = React.useState<string[]>([]);
const statusCount = Object.keys(agentStatus).reduce((acc, curr) => {
const statusCount = Object.keys(agentStatuses).reduce((acc, curr) => {
acc[agentStatuses[curr].title] = 0;
return acc;
}, {} as StatusCount);
Expand Down
10 changes: 5 additions & 5 deletions libs/ui-lib/lib/cim/components/InfraEnv/InfraTableToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ const getStatusesForFilter = (statuses: HostStatus<string>) => {
);

sortedStatuses.forEach((status) => {
const { category, key } = statuses[status];
const { category, title } = statuses[status];
if (filterStatuses[category]) {
if (filterStatuses[category][key]) {
filterStatuses[category][key].push(status);
if (filterStatuses[category][title]) {
filterStatuses[category][title].push(status);
} else {
filterStatuses[category] = {
...filterStatuses[category],
[key]: [status],
[title]: [status],
};
}
} else {
filterStatuses[category] = {
[key]: [status],
[title]: [status],
};
}
});
Expand Down