-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Fixed all agent tags should be visible when agent list is filtred #170850
Fixed all agent tags should be visible when agent list is filtred #170850
Conversation
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
💚 CLA has been signed |
Pinging @elastic/fleet (Team:Fleet) |
b6af933
to
de25867
Compare
const [agentsOnCurrentPage, setAgentsOnCurrentPage] = useState<Agent[]>([]); | ||
const [agentsStatus, setAgentsStatus] = useState< | ||
{ [key in SimplifiedAgentStatus]: number } | undefined | ||
>(); | ||
const [allTags, setAllTags] = useState<string[]>(); | ||
const [allAddRemoveTags, setAllAddRemoveTags] = useState<string[]>(); |
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.
Naming nit: should this be called allTags
and the existing allTags
renamed to e.g.filteredTags
?
I was looking at the other places where the current Here |
@@ -178,11 +178,17 @@ export const AgentListPage: React.FunctionComponent<{}> = () => { | |||
}); | |||
}, [search, selectedAgentPolicies, selectedStatus, selectedTags]); | |||
|
|||
// filters kuery for all tags |
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.
Nit: this is not for filters :) The variable name is clear, so feel free to even remove the comment.
@@ -269,6 +276,10 @@ export const AgentListPage: React.FunctionComponent<{}> = () => { | |||
kuery: kuery && kuery !== '' ? kuery : undefined, | |||
showInactive, | |||
}), | |||
sendGetAgentTags({ |
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.
I'm wondering: could it be possible to only fetch the tags once, i.e. all of them and then use filtering to set the filtered tags?
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.
I understand the point where you are aiming, it is possible to some extent. The filtered kuery still has to be created since it is used in the SearchBar, but it does not have to be sent as REST request to get the agent tags response, since we can use all the existing tags. Please review the changes.
Fixed this by using allTags. |
@elasticmachine merge upstream |
/ci |
💔 Build FailedFailed CI StepsTest Failures
Metrics [docs]Async chunks
HistoryTo update your PR or re-run it, just comment with: |
Since this has gone stale, I'm closing this PR. |
Summary
Closes #164674
There was an issue where the tags displayed in the 'Create/Add New Tag' popover on the agent interface were being filtered by the same query as the search. I resolved this by introducing a new query and creating a new variable dedicated to storing all the necessary tags. With this change, the tags are no longer filtered by the search query, ensuring that the list includes all existing.
For maintainers