add autogenerated ID to route and processors

This commit is contained in:
Joel Wetzell
2026-08-19 10:00:40 -05:00
parent eee372b337
commit e0f686b08b
4 changed files with 10 additions and 4 deletions
@@ -17,7 +17,7 @@
(cdkDropListDropped)="drop($event)" (cdkDropListDropped)="drop($event)"
[cdkDropListData]="routes()" [cdkDropListData]="routes()"
> >
@for (route of routes(); track $index + (route.input || ''); let i = $index) { @for (route of routes(); track route.id; let i = $index) {
<div class="m-2" cdkDrag> <div class="m-2" cdkDrag>
<app-route <app-route
[id]="listService.pathToId(`routes/${i}`)" [id]="listService.pathToId(`routes/${i}`)"
+2 -2
View File
@@ -81,7 +81,7 @@
(cdkDropListDropped)="drop($event)" (cdkDropListDropped)="drop($event)"
[cdkDropListData]="route()?.processors" [cdkDropListData]="route()?.processors"
> >
@for (processor of processors(); track $index + processor.type; let i = $index) { @for (processor of processors(); track processor.id; let i = $index) {
<div cdkDrag> <div cdkDrag>
<app-processor <app-processor
[path]="path() + '/processors/' + i" [path]="path() + '/processors/' + i"
@@ -237,7 +237,7 @@
(cdkDropListDropped)="drop($event)" (cdkDropListDropped)="drop($event)"
[cdkDropListData]="route()?.processors" [cdkDropListData]="route()?.processors"
> >
@for (processor of processors(); track $index + processor.type; let i = $index) { @for (processor of processors(); track processor.id; let i = $index) {
<div cdkDrag> <div cdkDrag>
<app-processor <app-processor
[path]="path() + '/processors/' + i" [path]="path() + '/processors/' + i"
+2
View File
@@ -22,11 +22,13 @@ export type ModuleConfig = {
}; };
export type RouteConfig = { export type RouteConfig = {
id: string;
input?: string; input?: string;
processors?: ProcessorConfig[]; processors?: ProcessorConfig[];
}; };
export type ProcessorConfig = { export type ProcessorConfig = {
id: string;
type: string; type: string;
params?: Record<string, any>; params?: Record<string, any>;
}; };
+5 -1
View File
@@ -139,12 +139,16 @@ export class SchemaService {
} }
getSkeletonForRoute(): RouteConfig { getSkeletonForRoute(): RouteConfig {
const template: RouteConfig = {}; const template: RouteConfig = {
id: crypto.randomUUID(),
processors: [],
};
return template; return template;
} }
getSkeletonForProcessor(processorType: string): ProcessorConfig { getSkeletonForProcessor(processorType: string): ProcessorConfig {
const template: ProcessorConfig = { const template: ProcessorConfig = {
id: crypto.randomUUID(),
type: processorType, type: processorType,
}; };
const itemInfo = this.processorTypes.find((itemInfo) => itemInfo.type === processorType); const itemInfo = this.processorTypes.find((itemInfo) => itemInfo.type === processorType);