From ffa6582e38e217d2a3dbe9bc5c6a37a3e49ea9ea Mon Sep 17 00:00:00 2001 From: tumms2021389 <97188066+tumms2021389@users.noreply.github.com> Date: Mon, 23 Dec 2024 23:00:02 +0530 Subject: [PATCH] fix: Heading not coming for details templates (#260) --- .../lib/_components/infra/view/view.component.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/packages/angular-sdk-components/src/lib/_components/infra/view/view.component.ts b/packages/angular-sdk-components/src/lib/_components/infra/view/view.component.ts index fd2e3176..a3b7db31 100644 --- a/packages/angular-sdk-components/src/lib/_components/infra/view/view.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/infra/view/view.component.ts @@ -8,6 +8,20 @@ import { ReferenceComponent } from '../reference/reference.component'; import { ComponentMapperComponent } from '../../../_bridge/component-mapper/component-mapper.component'; const NO_HEADER_TEMPLATES = ['SubTabs', 'SimpleTable', 'Confirmation', 'DynamicTabs', 'DetailsSubTabs']; +const DETAILS_TEMPLATES = [ + 'Details', + 'DetailsFields', + 'DetailsOneColumn', + 'DetailsSubTabs', + 'DetailsThreeColumn', + 'DetailsTwoColumn', + 'NarrowWideDetails', + 'WideNarrowDetails' +]; + +function isDetailsTemplate(template) { + return DETAILS_TEMPLATES.includes(template); +} /** * WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with @@ -146,7 +160,7 @@ export class ViewComponent implements OnInit, OnDestroy, OnChanges { this.templateName$ = this.configProps$.template || ''; this.title$ = this.configProps$.title || ''; this.label$ = this.configProps$.label || ''; - this.showLabel$ = this.configProps$.showLabel || this.showLabel$; + this.showLabel$ = this.configProps$.showLabel || isDetailsTemplate(this.templateName$) || this.showLabel$; // label & showLabel within inheritedProps takes precedence over configProps this.label$ = this.inheritedProps$.label || this.label$; this.showLabel$ = this.inheritedProps$.showLabel || this.showLabel$;