Skip to content

Commit

Permalink
feat(topology): add target.Agent topology filter (#1339)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwangggg authored Sep 3, 2024
1 parent 1aff253 commit 318389e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app/Shared/Redux/Filters/TopologyFilterSlice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export interface TopologyFilters {
targetFilters: {
category: string;
filters: {
Agent: string[];
Alias: string[];
ConnectionUrl: string[];
JvmId: string[];
Expand All @@ -119,6 +120,8 @@ export const categoryToNodeField = (filterCategory: string): keyof EnvironmentNo
return 'name';
case 'Label':
return 'labels';
case 'Agent':
return 'agent';
case 'Annotation':
return 'annotations';
case 'JvmId':
Expand All @@ -139,6 +142,7 @@ export const defaultEmptyGroupFilters = {

export const defaultEmptyTargetFilters = {
// Below will be taken from node.target
Agent: [],
Alias: [],
ConnectionUrl: [],
JvmId: [],
Expand Down
3 changes: 3 additions & 0 deletions src/app/Topology/Shared/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ export const isTargetNodeFiltered = ({ target }: TargetNode, filters?: TopologyF
return true;
}
let matched = true;
if (filters.Agent && filters.Agent.length) {
matched = matched && filters.Agent.includes(target.agent.toString());
}
if (filters.Alias && filters.Alias.length) {
matched = matched && filters.Alias.includes(target.alias);
}
Expand Down

0 comments on commit 318389e

Please sign in to comment.