feat(web): las extensiones de cliente pueden ocultar campos y columnas y dejarlos de solo lectura (documentos y maestros)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f077a61d08
commit
8dc4a8eaab
20 files changed
+374
-38
No files matched your search
@@ -28,7 +28,7 @@ import {
|
||||
updatePayload,
|
||||
validateLayout,
|
||||
} from './document-model';
|
||||
import { type ComputedSource, PARTNER_COLUMNS, WAREHOUSE_LOOKUP, hasFolio, hasFreight, hasSeries, headerKeysOf, requiredHeaderOf } from './document-layouts';
|
||||
import { type ComputedSource, type HeaderField, PARTNER_COLUMNS, WAREHOUSE_LOOKUP, hasFolio, hasFreight, hasSeries, headerKeysOf, keysOfFields, requiredHeaderOf } from './document-layouts';
|
||||
import { type CopyOrigin, copyFromDocument, copySources, copyTargets } from './document-copy';
|
||||
import { DOCUMENT_SCREENS, type DocumentScreen, docNum, documentStatus, menuLabel } from './document-screens';
|
||||
import { OBJECT_TYPES } from './document-objects';
|
||||
@@ -330,6 +330,12 @@ export class DocumentFormPage {
|
||||
|
||||
protected str = text;
|
||||
|
||||
private readonly lockedKeys = new Set(this.layout.lockedKeys ?? []);
|
||||
/** El campo se ve pero no se edita (una extensión de cliente lo dejó de solo lectura). */
|
||||
protected locked(f: HeaderField): boolean {
|
||||
return this.lockedKeys.size > 0 && (keysOfFields([f]).some((k) => this.lockedKeys.has(k)) || (f.type === 'computed' && this.lockedKeys.has(f.source)));
|
||||
}
|
||||
|
||||
/** Valor de una fila de solo lectura (número del documento, datos del socio, totales). */
|
||||
protected computedValue(source: ComputedSource): string {
|
||||
switch (source) {
|
||||
|
||||
Reference in new issue
Block a user