| # | @for (c of columns(); track c.key; let j = $index) { -{{ c.title }}@if (names.show()) { + | {{ c.title }}@if (names.show() && isSap(c.key)) { {{ c.key }} } | @if (hasDetails() && j === detailAt()) { diff --git a/apps/web/src/app/shared/grid/lines-grid.ts b/apps/web/src/app/shared/grid/lines-grid.ts index f5cd035..53cd636 100644 --- a/apps/web/src/app/shared/grid/lines-grid.ts +++ b/apps/web/src/app/shared/grid/lines-grid.ts @@ -12,7 +12,7 @@ import { output, signal, } from '@angular/core'; -import { FieldNames } from '../../core/field-names'; +import { FieldNames, isSapField } from '../../core/field-names'; import { formatNumber, parseDecimal } from '../../core/format'; import { SlLookupApi } from '../../core/sl/sl-lookup'; import type { ListRow } from '../list/list.types'; @@ -59,6 +59,7 @@ export class LinesGrid { private readonly host = inject|||
|---|---|---|---|---|---|
| # | @for (c of columns(); track c.key) { -{{ c.title }}@if (fieldNames.show()) { + | {{ c.title }}@if (fieldNames.show() && isSap(c.key)) { {{ c.key }} } | } @@ -186,6 +186,7 @@ export class RowsTable { }); protected readonly fieldNames = inject(FieldNames); + protected readonly isSap = isSapField; private readonly lookupApi = inject(SlLookupApi); private readonly http = inject(HttpClient); /** Nombres de los catálogos de las columnas `nameOf`, por recurso. */ diff --git a/apps/web/src/app/shared/list/data-table.html b/apps/web/src/app/shared/list/data-table.html index 85423c0..2e09881 100644 --- a/apps/web/src/app/shared/list/data-table.html +++ b/apps/web/src/app/shared/list/data-table.html @@ -19,11 +19,11 @@ [style.text-align]="align(c)" [class.pick]="searchable(c)" [class.active]="c.key === activeColumnKey()" - [attr.title]="(searchable(c) ? 'Buscar en esta columna · ' : '') + c.key" + [attr.title]="(searchable(c) ? 'Buscar en esta columna' : '') + (searchable(c) && isSap(c.key) ? ' · ' : '') + (isSap(c.key) ? c.key : '') || null" (click)="columnPicked.emit(c)" > {{ c.title }} - @if (names.show()) { + @if (names.show() && isSap(c.key)) { {{ c.key }} } diff --git a/apps/web/src/app/shared/list/data-table.ts b/apps/web/src/app/shared/list/data-table.ts index 6dbfa78..5c84889 100644 --- a/apps/web/src/app/shared/list/data-table.ts +++ b/apps/web/src/app/shared/list/data-table.ts @@ -1,5 +1,5 @@ import { ChangeDetectionStrategy, Component, computed, inject, input, output } from '@angular/core'; -import { FieldNames } from '../../core/field-names'; +import { FieldNames, isSapField } from '../../core/field-names'; import { ColResize } from '../table/col-resize'; import { Badge } from '../window/badge'; import { type ListColumn, type ListRow, alignOf, cellText, isSearchable, type Tone } from './list.types'; @@ -17,6 +17,7 @@ import { type ListColumn, type ListRow, alignOf, cellText, isSearchable, type To }) export class DataTable { protected readonly names = inject(FieldNames); + protected readonly isSap = isSapField; readonly columns = input.required