integration layer; merge work on indicators from forks with existing ingestion pipeline
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
import { CdkDrag, CdkDragDrop, DragDropModule } from '@angular/cdk/drag-drop';
|
||||
import { DecimalPipe } from '@angular/common';
|
||||
import { Component, inject, output } from '@angular/core';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
import { SourceTable } from '../../domain/data-source';
|
||||
import { ImportFlow } from '../../domain/import-flow';
|
||||
import { ConnectWorkspaceStore } from '../../state/connect-workspace.store';
|
||||
import { FlowStatusChip } from '../shared/flow-status';
|
||||
|
||||
/**
|
||||
* The composition canvas: one card per import flow (source table →
|
||||
* destination entity), the whole batch visible at once. Drop a table from
|
||||
* the connections pane anywhere on it to add a flow.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'app-flow-canvas',
|
||||
imports: [
|
||||
DecimalPipe,
|
||||
DragDropModule,
|
||||
FlowStatusChip,
|
||||
MatButtonModule,
|
||||
MatCardModule,
|
||||
MatIconModule,
|
||||
MatMenuModule,
|
||||
MatProgressBarModule,
|
||||
MatTooltipModule,
|
||||
],
|
||||
templateUrl: './flow-canvas.html',
|
||||
styleUrl: './flow-canvas.scss',
|
||||
})
|
||||
export class FlowCanvas {
|
||||
readonly store = inject(ConnectWorkspaceStore);
|
||||
|
||||
readonly tableDropped = output<SourceTable>();
|
||||
readonly addConnection = output<void>();
|
||||
|
||||
readonly onlyTables = (drag: CdkDrag) => drag.data instanceof SourceTable;
|
||||
|
||||
onDrop(event: CdkDragDrop<unknown>): void {
|
||||
if (event.item.data instanceof SourceTable) this.tableDropped.emit(event.item.data);
|
||||
}
|
||||
|
||||
mappedFields(flow: ImportFlow): number {
|
||||
return flow.mapping.size() + Object.keys(flow.activeDefaults()).length;
|
||||
}
|
||||
|
||||
coverage(flow: ImportFlow): number {
|
||||
const total = flow.target.fields.length;
|
||||
return total ? Math.round((this.mappedFields(flow) / total) * 100) : 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user