Skip to content

Commit

Permalink
Merge pull request #17791 from jeclrsg/hpcc-30316-TargetGroupField-kind
Browse files Browse the repository at this point in the history
HPCC-30316 ECL Watch v9 TargetGroupField filter options by Kind

Reviewed-by: Gordon Smith <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Sep 21, 2023
2 parents 0cbd913 + 9fd05b7 commit f584765
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions esp/src/src-react/components/forms/Fields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -490,12 +490,18 @@ export const TargetGroupTextField: React.FunctionComponent<TargetGroupTextFieldP

React.useEffect(() => {
TpGroupQuery({}).then(({ TpGroupQueryResponse }) => {
setTargetGroups(TpGroupQueryResponse.TpGroups.TpGroup.map(n => {
return {
key: n.Name,
text: n.Name + (n.Name !== n.Kind ? ` (${n.Kind})` : "")
};
}));
setTargetGroups(TpGroupQueryResponse.TpGroups.TpGroup.map(group => {
switch (group?.Kind) {
case "Thor":
case "hthor":
case "Roxie":
case "Plane":
return {
key: group.Name,
text: group.Name + (group.Name !== group.Kind ? ` (${group.Kind})` : "")
};
}
}).filter(group => group));
}).catch(err => logger.error(err));
}, []);

Expand Down

0 comments on commit f584765

Please sign in to comment.