mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-02 17:53:30 +00:00
fix: show sidenav shell when layout is sidenav even with no sections
Co-authored-by: eromano <1030050+eromano@users.noreply.github.com>
This commit is contained in:
co-authored by
eromano
parent
7aaaa5dd82
commit
3f8fb54976
@@ -1119,6 +1119,12 @@ describe('Form Renderer Component', () => {
|
|||||||
expect(form.hasSideNav()).toBeFalse();
|
expect(form.hasSideNav()).toBeFalse();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should report hasSideNav as true when layout is sidenav even with no sections', () => {
|
||||||
|
const form = new FormModel({ layout: 'sidenav', tabs: [], fields: [] });
|
||||||
|
formRendererComponent.formDefinition = form;
|
||||||
|
expect(form.hasSideNav()).toBeTrue();
|
||||||
|
});
|
||||||
|
|
||||||
it('should default the active section to the first visible leaf node', () => {
|
it('should default the active section to the first visible leaf node', () => {
|
||||||
formRendererComponent.formDefinition = buildSideNavForm();
|
formRendererComponent.formDefinition = buildSideNavForm();
|
||||||
expect(formRendererComponent.activeSideNavSectionId()).toBe('section-1');
|
expect(formRendererComponent.activeSideNavSectionId()).toBe('section-1');
|
||||||
|
|||||||
@@ -354,10 +354,10 @@ export class FormModel implements ProcessFormModel {
|
|||||||
* Indicates whether the form should be rendered using the hierarchical side navigation
|
* Indicates whether the form should be rendered using the hierarchical side navigation
|
||||||
* layout instead of the classic tabs layout.
|
* layout instead of the classic tabs layout.
|
||||||
*
|
*
|
||||||
* @returns true when the form has tabs and its layout is set to `sidenav`
|
* @returns true when the form layout is set to `sidenav`
|
||||||
*/
|
*/
|
||||||
hasSideNav(): boolean {
|
hasSideNav(): boolean {
|
||||||
return this.layout === 'sidenav' && this.hasTabs();
|
return this.layout === 'sidenav';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user