Oops broke the buttons

This commit is contained in:
shamoon
2026-02-06 22:26:05 -08:00
parent 1ac52d1d68
commit 47a4868ddd
2 changed files with 13 additions and 19 deletions

View File

@@ -68,11 +68,13 @@
<a ngbNavLink>
<i-bs class="me-2" [name]="section.icon"></i-bs>{{ section.label }}
</a>
<ng-template ngbNavContent>
<ng-container [ngComponentOutlet]="section.component"></ng-container>
</ng-template>
</li>
}
</ul>
<div [ngbNavOutlet]="nav" class="border-start border-end border-bottom p-3 mb-3 shadow-sm"></div>
<div class="border-start border-end border-bottom p-3 mb-3 shadow-sm">
<ng-container
[ngComponentOutlet]="activeSection?.component"
#activeOutlet="ngComponentOutlet"
></ng-container>
</div>

View File

@@ -4,10 +4,8 @@ import {
inject,
OnDestroy,
OnInit,
QueryList,
Type,
ViewChild,
ViewChildren,
} from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
import {
@@ -129,10 +127,8 @@ export class DocumentAttributesComponent implements OnInit, OnDestroy {
},
]
@ViewChildren(ManagementListComponent)
private attributeLists?: QueryList<ManagementListComponent<any>>
@ViewChild(CustomFieldsComponent) private customFields?: CustomFieldsComponent
@ViewChild('activeOutlet', { read: NgComponentOutlet })
private activeOutlet?: NgComponentOutlet
activeNavID: number = null
@@ -154,18 +150,14 @@ export class DocumentAttributesComponent implements OnInit, OnDestroy {
get activeAttributeList(): ManagementListComponent<any> | null {
if (this.activeSection?.kind !== 'attributeList') return null
const permissionType = this.activeSection.permissionType
return (
this.attributeLists?.find(
(list) => list.permissionType === permissionType
) ?? null
)
const instance = this.activeOutlet?.componentInstance
return instance instanceof ManagementListComponent ? instance : null
}
get activeCustomFields(): CustomFieldsComponent | null {
return this.activeSection?.kind === 'customFields'
? (this.customFields ?? null)
: null
if (this.activeSection?.kind !== 'customFields') return null
const instance = this.activeOutlet?.componentInstance
return instance instanceof CustomFieldsComponent ? instance : null
}
get activeTabLabel(): string {