83 lines
3.5 KiB
HTML
83 lines
3.5 KiB
HTML
@let f = flow();
|
|
<section class="editor" [attr.aria-label]="'Flujo ' + f.label">
|
|
<header class="editor__header">
|
|
<div class="editor__route">
|
|
<mat-icon aria-hidden="true">{{ f.table.icon }}</mat-icon>
|
|
<span class="editor__source" [title]="f.label">{{ f.label }}</span>
|
|
<mat-icon class="editor__arrow" aria-hidden="true">arrow_right_alt</mat-icon>
|
|
<mat-icon class="editor__target-icon" aria-hidden="true">table_chart</mat-icon>
|
|
<span class="editor__target">{{ f.target.domain.toUpperCase() }} · {{ f.target.table }}</span>
|
|
<app-flow-status [status]="f.status()"></app-flow-status>
|
|
</div>
|
|
<div class="editor__actions">
|
|
@if (f.totalRows() !== null) {
|
|
<span class="editor__rows">{{ f.totalRows() | number }} filas en la fuente</span>
|
|
}
|
|
@if (documentTable()) {
|
|
<button mat-stroked-button type="button" [disabled]="f.loading()" (click)="reviewExtraction()">
|
|
<mat-icon aria-hidden="true">rule</mat-icon>Revisar extracción
|
|
</button>
|
|
}
|
|
<button mat-stroked-button type="button" (click)="store.reloadFlow(f)" matTooltip="Volver a leer la fuente">
|
|
<mat-icon aria-hidden="true">refresh</mat-icon>Actualizar
|
|
</button>
|
|
<button mat-flat-button type="button" [disabled]="!f.canSubmit || f.validating()" (click)="validate()">
|
|
<mat-icon aria-hidden="true">fact_check</mat-icon>Validar
|
|
</button>
|
|
</div>
|
|
</header>
|
|
|
|
@if (f.loading()) {
|
|
<mat-progress-bar mode="indeterminate" aria-label="Leyendo la fuente"></mat-progress-bar>
|
|
}
|
|
@if (f.error(); as error) {
|
|
<p class="editor__error" role="alert">
|
|
<mat-icon aria-hidden="true">error</mat-icon>{{ error }}
|
|
<button mat-button type="button" (click)="store.reloadFlow(f)">Reintentar</button>
|
|
</p>
|
|
}
|
|
|
|
@if (f.preview()) {
|
|
<mat-tab-group
|
|
[selectedIndex]="tab()"
|
|
(selectedIndexChange)="tab.set($event)"
|
|
animationDuration="0ms"
|
|
mat-stretch-tabs="false"
|
|
mat-align-tabs="start"
|
|
class="editor__tabs"
|
|
>
|
|
<mat-tab>
|
|
<ng-template mat-tab-label>
|
|
<mat-icon aria-hidden="true">account_tree</mat-icon>Mapeo
|
|
@if (f.missingRequired().length) {
|
|
<span class="tab-count tab-count--warn">{{ f.missingRequired().length }}</span>
|
|
}
|
|
</ng-template>
|
|
<div class="editor__panel"><app-column-mapper [flow]="f"></app-column-mapper></div>
|
|
</mat-tab>
|
|
<mat-tab>
|
|
<ng-template mat-tab-label>
|
|
<mat-icon aria-hidden="true">functions</mat-icon>Reglas
|
|
@if (f.documents() || (f.derived() | keyvalue).length) {
|
|
<span class="tab-count">{{ (f.derived() | keyvalue).length + (f.documents() ? 1 : 0) }}</span>
|
|
}
|
|
</ng-template>
|
|
<div class="editor__panel"><app-mapping-rules [flow]="f"></app-mapping-rules></div>
|
|
</mat-tab>
|
|
<mat-tab>
|
|
<ng-template mat-tab-label><mat-icon aria-hidden="true">table_view</mat-icon>Datos</ng-template>
|
|
<div class="editor__panel"><app-data-grid [flow]="f"></app-data-grid></div>
|
|
</mat-tab>
|
|
<mat-tab>
|
|
<ng-template mat-tab-label>
|
|
<mat-icon aria-hidden="true">fact_check</mat-icon>Validación
|
|
@if (f.validation(); as validation) {
|
|
<span class="tab-count" [class.tab-count--warn]="validation.error_count > 0">{{ validation.error_count | number }}</span>
|
|
}
|
|
</ng-template>
|
|
<div class="editor__panel"><app-validation-report [flow]="f" (validate)="validate()"></app-validation-report></div>
|
|
</mat-tab>
|
|
</mat-tab-group>
|
|
}
|
|
</section>
|