Conectar: Configuración and Avanzado tabs, rows instead of JSON, field titles as keys, captions that fit their nodes
This commit is contained in:
@@ -73,10 +73,6 @@
|
||||
</button>
|
||||
</div>
|
||||
<p class="help">{{ help[d.kind ?? 'source'] }}</p>
|
||||
<mat-form-field appearance="outline" subscriptSizing="dynamic" class="full">
|
||||
<mat-label>Id</mat-label>
|
||||
<input matInput [value]="d.id" (change)="rename($any($event.target).value)" />
|
||||
</mat-form-field>
|
||||
@if (d.inputs?.length) {
|
||||
<div class="inputs">
|
||||
Entradas:
|
||||
@@ -87,40 +83,71 @@
|
||||
}
|
||||
</div>
|
||||
} @else if (d.kind !== 'source') {
|
||||
<p class="muted">Una flecha desde otro nodo le da su entrada.</p>
|
||||
<p class="muted">Conecte una flecha desde otro nodo para darle entrada.</p>
|
||||
}
|
||||
@if (guided(d); as g) {
|
||||
<div class="source-summary">
|
||||
<p>
|
||||
<mat-icon>check_circle</mat-icon>
|
||||
{{ d.label || d.id }}
|
||||
<mat-tab-group class="panel-tabs" animationDuration="0ms" mat-stretch-tabs="false">
|
||||
<mat-tab label="Configuración">
|
||||
@if (d.kind === 'source') {
|
||||
@if (guided(d)) {
|
||||
<div class="source-summary">
|
||||
<p>
|
||||
<mat-icon>check_circle</mat-icon>
|
||||
{{ d.label || d.id }}
|
||||
</p>
|
||||
<button mat-flat-button (click)="connectSource(d.id)">
|
||||
<mat-icon>edit</mat-icon> Editar conexión
|
||||
</button>
|
||||
</div>
|
||||
} @else {
|
||||
<p class="muted">
|
||||
Esta fuente no corresponde a ningún tipo del asistente. Edítela en «Avanzado» o
|
||||
vuelva a conectarla con el asistente.
|
||||
</p>
|
||||
<button mat-stroked-button (click)="connectSource(d.id)">
|
||||
<mat-icon>cable</mat-icon> Conectar con el asistente
|
||||
</button>
|
||||
}
|
||||
}
|
||||
<formly-form
|
||||
[form]="form"
|
||||
[fields]="fields()"
|
||||
[model]="model"
|
||||
[options]="formOptions"
|
||||
(modelChange)="edited($event)"
|
||||
/>
|
||||
@if (conceptMap(d); as cm) {
|
||||
<app-concept-map-editor [id]="cm" />
|
||||
}
|
||||
</mat-tab>
|
||||
<mat-tab label="Avanzado">
|
||||
<p class="hint">
|
||||
Para personal técnico: el nodo completo como lo guarda la plataforma.
|
||||
@if (guided(d)) {
|
||||
Si cambia su fuente aquí, deja de editarse con el asistente.
|
||||
}
|
||||
</p>
|
||||
<button mat-flat-button (click)="connectSource(d.id)">
|
||||
<mat-icon>edit</mat-icon> Editar conexión
|
||||
<mat-form-field appearance="outline" subscriptSizing="dynamic" class="full">
|
||||
<mat-label>Id</mat-label>
|
||||
<input matInput [value]="d.id" (change)="rename($any($event.target).value)" />
|
||||
<mat-hint>Nombre interno: minúsculas, números y _.</mat-hint>
|
||||
</mat-form-field>
|
||||
<mat-form-field appearance="outline" subscriptSizing="dynamic" class="full raw">
|
||||
<mat-label>Nodo (JSON)</mat-label>
|
||||
<textarea
|
||||
matInput
|
||||
rows="16"
|
||||
[value]="raw(d)"
|
||||
(input)="rawDraft.set($any($event.target).value)"
|
||||
></textarea>
|
||||
</mat-form-field>
|
||||
@if (rawError()) {
|
||||
<p class="error" role="alert">{{ rawError() }}</p>
|
||||
}
|
||||
<button mat-stroked-button [disabled]="rawDraft() === undefined" (click)="applyRaw()">
|
||||
Aplicar
|
||||
</button>
|
||||
</div>
|
||||
<mat-slide-toggle [checked]="advanced()" (change)="advanced.set($event.checked)">
|
||||
Avanzado (para personal técnico)
|
||||
</mat-slide-toggle>
|
||||
} @else if (d.kind === 'source') {
|
||||
<button mat-stroked-button (click)="connectSource(d.id)">
|
||||
<mat-icon>cable</mat-icon> Conectar con ayuda
|
||||
</button>
|
||||
}
|
||||
@if (!guided(d) || advanced()) {
|
||||
@if (guided(d)) {
|
||||
<p class="muted">Si cambia algo aquí, la fuente deja de editarse con ayuda.</p>
|
||||
}
|
||||
<formly-form
|
||||
[form]="form"
|
||||
[fields]="fields()"
|
||||
[model]="model"
|
||||
(modelChange)="edited($event)"
|
||||
/>
|
||||
}
|
||||
@if (conceptMap(d); as cm) {
|
||||
<app-concept-map-editor [id]="cm" />
|
||||
}
|
||||
</mat-tab>
|
||||
</mat-tab-group>
|
||||
<button mat-stroked-button (click)="show()">Vista previa</button>
|
||||
@if (preview(); as rows) {
|
||||
<div class="preview">
|
||||
|
||||
Reference in New Issue
Block a user