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:
GeorgeandClaude Sonnet 5.5 committed 2026-10-16 11:14:52 -05:00
1 parent f077a61d08
commit 8dc4a8eaab
20 files changed
+374 -38

No files matched your search

@@ -441,3 +441,26 @@ describe('LinesGrid: ancho de la tabla', () => {
expect(parseFloat(table.style.minWidth)).toBe(100 + 60 + 220 + 34 + 30);
});
});
describe('LinesGrid: columnas bloqueadas', () => {
it('una columna bloqueada se ve con su valor pero no se puede editar', async () => {
await TestBed.configureTestingModule({
imports: [Host],
providers: [provideHttpClient(), provideHttpClientTesting()],
}).compileComponents();
const fixture = TestBed.createComponent(Host);
fixture.componentInstance.columns = [
{ key: 'ItemCode', title: 'Artículo' },
{ key: 'CostingCode', title: 'Dim. 1', locked: true },
];
fixture.componentInstance.lines.set([{ ItemCode: 'A', CostingCode: 'CC1' }]);
fixture.detectChanges();
await fixture.whenStable();
fixture.detectChanges();
const el = fixture.nativeElement as HTMLElement;
const locked = el.querySelector<HTMLInputElement>('input[data-r="0"][data-c="1"]')!;
expect(locked.value).toBe('CC1');
expect(locked.readOnly).toBe(true);
expect(el.querySelector<HTMLInputElement>('input[data-r="0"][data-c="0"]')!.readOnly).toBe(false);
});
});