Skip to content

Commit

Permalink
small optimization in makeEventSourceLink
Browse files Browse the repository at this point in the history
  • Loading branch information
joshri committed Sep 14, 2022
1 parent 70a9cc2 commit de20f11
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ui/components/AlertsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ export const makeEventSourceLink = (obj: CrossNamespaceObjectRef) => {
obj.kind === Kind.Kustomization || obj.kind === Kind.HelmRelease
? V2Routes.Automations
: V2Routes.Sources;
let filters = "";
let filters = `type${filterSeparator}${obj.kind}_`;
if (obj.name !== "*") filters += `name${filterSeparator}${obj.name}_`;
if (obj.namespace !== "*")
filters += `namespace${filterSeparator}${obj.namespace}_`;
filters += `type${filterSeparator}${obj.kind}_`;
if (filters) return url + `?${qs.stringify({ filters: filters })}`;
return url;
return url + `?${qs.stringify({ filters: filters })}`;
};

function AlertsTable({ className, rows = [] }: Props) {
Expand Down

0 comments on commit de20f11

Please sign in to comment.