ocket8888 commented on code in PR #7243:
URL: https://github.com/apache/trafficcontrol/pull/7243#discussion_r1050238466
##########
experimental/traffic-portal/src/app/core/cache-groups/divisions/table/divisions-table.component.ts:
##########
@@ -129,7 +131,12 @@ export class DivisionsTableComponent implements OnInit {
await this.router.navigate(["/core/division",
data.id]);
break;
case "viewRegions":
- await this.router.navigate(["/core/regions"]);
+ const region = (await
this.regions).find(regionDiv => regionDiv.division === data.id);
+ if (region === undefined) {
+ await
this.router.navigate(["/core/regions"]);
+ } else {
+ await
this.router.navigate(["/core/region", region.id]);
Review Comment:
So the way this is written, it will take you to a view of some region that
belongs to the division, if one exists. If not, it shows you all regions.
But what it _should_ do is take the user to a view of regions that has been
filtered to contain only those regions that belong to the division. You
shouldn't need to make any API calls in this file to do that.
I'm not sure that the generic table component in tpv2 has been set up with
query string parameter filtering yet, so this may not even be possible without
extensive work in the generic table component. Therefore, I strongly suggest
you don't even try. We can just add an issue to fix it later.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]