Skip to content

Commit df09b96

Browse files
authored
Merge pull request #59 from mayanayza/feat/hub-and-spoke-group
fix: hub and spoke groups display services in group
2 parents 0039f5a + 711dc1a commit df09b96

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Thumbs.db
1313

1414
# Logs
1515
*.log
16+
/target
1617

1718
# Environment
1819
.env

ui/src/lib/features/groups/types/base.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { EntitySource } from '$lib/shared/types';
22

33
export type GroupType = 'RequestPath';
44

5-
export type Group = RequestPathGroup;
5+
export type Group = RequestPathGroup | HubAndSpokeGroup;
66

77
interface BaseGroup {
88
id: string;
@@ -19,3 +19,8 @@ export interface RequestPathGroup extends BaseGroup {
1919
group_type: 'RequestPath';
2020
service_bindings: string[]; // Binding IDs
2121
}
22+
23+
export interface HubAndSpokeGroup extends BaseGroup {
24+
group_type: 'HubAndSpoke';
25+
service_bindings: string[]; // Binding IDs
26+
}

ui/src/lib/features/services/store.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export function getServicesForGroup(group_id: string): Readable<Service[]> {
154154
const group = $groups.find((g) => g.id == group_id);
155155

156156
if (group) {
157-
if (group.group_type === 'RequestPath') {
157+
if (group.group_type === 'RequestPath' || group.group_type === 'HubAndSpoke') {
158158
const serviceMap = new Map($services.flatMap((s) => s.bindings.map((b) => [b.id, s])));
159159
return group.service_bindings
160160
.map((sb) => serviceMap.get(sb))

0 commit comments

Comments
 (0)