From 17f97a588377babdbeae954e3862a1b743bc8e7e Mon Sep 17 00:00:00 2001 From: Arjunlal B Date: Wed, 6 Apr 2022 14:59:47 +0530 Subject: [PATCH 1/7] fix: define a service to provide global header height --- projects/common/src/constants/application-constants.ts | 4 ---- .../global-header-height-provider.service.ts | 10 ++++++++++ projects/common/src/public-api.ts | 3 +++ .../header/application/application-header.component.ts | 8 ++++---- .../src/overlay/sheet/sheet-overlay.component.ts | 7 ++++--- .../components/src/popover/popover-position-builder.ts | 8 ++++---- src/app/config.module.ts | 6 +----- 7 files changed, 26 insertions(+), 20 deletions(-) create mode 100644 projects/common/src/global-header-height/global-header-height-provider.service.ts diff --git a/projects/common/src/constants/application-constants.ts b/projects/common/src/constants/application-constants.ts index aa81c82c3..88baa2baf 100644 --- a/projects/common/src/constants/application-constants.ts +++ b/projects/common/src/constants/application-constants.ts @@ -1,7 +1,3 @@ -import { InjectionToken } from '@angular/core'; - -export const GLOBAL_HEADER_HEIGHT = new InjectionToken('Global Header Height'); - export const enum ApplicationFeature { PageTimeRange = 'ui.page-time-range' } diff --git a/projects/common/src/global-header-height/global-header-height-provider.service.ts b/projects/common/src/global-header-height/global-header-height-provider.service.ts new file mode 100644 index 000000000..cc21de454 --- /dev/null +++ b/projects/common/src/global-header-height/global-header-height-provider.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from '@angular/core'; + +@Injectable({ providedIn: 'root' }) +export class GlobalHeaderHeightProviderService { + protected headerHeight: string = '56px'; + + public get globalHeaderHeight(): string { + return this.headerHeight; + } +} diff --git a/projects/common/src/public-api.ts b/projects/common/src/public-api.ts index ebd7dd733..37026a34b 100644 --- a/projects/common/src/public-api.ts +++ b/projects/common/src/public-api.ts @@ -127,3 +127,6 @@ export * from './utilities/validators'; // Color Palette export * from './color/color-palette'; + +// Global header height provider +export * from './global-header-height/global-header-height-provider.service'; diff --git a/projects/components/src/header/application/application-header.component.ts b/projects/components/src/header/application/application-header.component.ts index e6fbef9b5..d5a136c1f 100644 --- a/projects/components/src/header/application/application-header.component.ts +++ b/projects/components/src/header/application/application-header.component.ts @@ -1,9 +1,9 @@ -import { ChangeDetectionStrategy, Component, Inject, Input } from '@angular/core'; +import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; import { ApplicationFeature, FeatureState, FeatureStateResolver, - GLOBAL_HEADER_HEIGHT, + GlobalHeaderHeightProviderService, NavigationService } from '@hypertrace/common'; import { Observable } from 'rxjs'; @@ -14,7 +14,7 @@ import { map } from 'rxjs/operators'; changeDetection: ChangeDetectionStrategy.OnPush, styleUrls: ['./application-header.component.scss'], template: ` -
+