- {{ computedTimezoneStyle.icon }}
- {{timezoneInfo}}
+ {{displayValue()}}
- {{ computedTimezoneStyle.icon }}
diff --git a/ui-ngx/src/app/shared/components/time/timezone.component.ts b/ui-ngx/src/app/shared/components/time/timezone.component.ts
index 8f0f2eee40..f662b4c452 100644
--- a/ui-ngx/src/app/shared/components/time/timezone.component.ts
+++ b/ui-ngx/src/app/shared/components/time/timezone.component.ts
@@ -20,10 +20,8 @@ import {
forwardRef,
HostBinding,
Input,
- OnChanges,
OnInit,
Renderer2,
- SimpleChanges,
ViewContainerRef
} from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
@@ -31,13 +29,6 @@ import { TranslateService } from '@ngx-translate/core';
import { TooltipPosition } from '@angular/material/tooltip';
import { coerceBooleanProperty } from '@angular/cdk/coercion';
import { coerceBoolean } from '@shared/decorators/coercion';
-import {
- ComponentStyle,
- defaultTimezoneStyle,
- iconStyle,
- textStyle,
- TimezoneStyle
-} from '@shared/models/widget-settings.models';
import { TimezonePanelComponent, TimezoneSelectionResult } from '@shared/components/time/timezone-panel.component';
import { TbPopoverService } from '@shared/components/popover.service';
import { getTimezoneInfo, TimezoneInfo } from '@shared/models/time/time.models';
@@ -56,7 +47,7 @@ import { TimeService } from '@core/services/time.service';
}
]
})
-export class TimezoneComponent implements ControlValueAccessor, OnInit, OnChanges {
+export class TimezoneComponent implements ControlValueAccessor, OnInit {
@HostBinding('class.no-margin')
@Input()
@@ -91,24 +82,9 @@ export class TimezoneComponent implements ControlValueAccessor, OnInit, OnChange
@coerceBoolean()
hideLabel = false;
- isEditValue = false;
-
- @Input()
- set isEdit(val) {
- this.isEditValue = coerceBooleanProperty(val);
- this.timezoneDisabled = this.isTimezoneDisabled();
- }
-
- get isEdit() {
- return this.isEditValue;
- }
-
@Input()
tooltipPosition: TooltipPosition = 'above';
- @Input()
- timezoneStyle: TimezoneStyle;
-
@Input()
@coerceBoolean()
disabled: boolean;
@@ -155,10 +131,6 @@ export class TimezoneComponent implements ControlValueAccessor, OnInit, OnChange
timezoneDisabled: boolean;
- computedTimezoneStyle: TimezoneStyle;
- timezoneComponentStyle: ComponentStyle;
- timezoneIconStyle: ComponentStyle;
-
private propagateChange = (_: any) => {};
constructor(private translate: TranslateService,
@@ -170,19 +142,6 @@ export class TimezoneComponent implements ControlValueAccessor, OnInit, OnChange
}
ngOnInit() {
- this.updateTimezoneStyle();
- }
-
- ngOnChanges(changes: SimpleChanges): void {
- for (const propName of Object.keys(changes)) {
- const change = changes[propName];
- if (!change.firstChange && change.currentValue !== change.previousValue) {
- if (propName === 'timezoneStyle') {
- this.updateTimezoneStyle();
- this.updateDisplayValue();
- }
- }
- }
}
toggleTimezone($event: Event) {
@@ -221,17 +180,6 @@ export class TimezoneComponent implements ControlValueAccessor, OnInit, OnChange
this.cd.detectChanges();
}
- private updateTimezoneStyle() {
- if (!this.asButton) {
- this.computedTimezoneStyle = {...defaultTimezoneStyle, ...(this.timezoneStyle || {})};
- this.timezoneComponentStyle = textStyle(this.computedTimezoneStyle.font);
- if (this.computedTimezoneStyle.color) {
- this.timezoneComponentStyle.color = this.computedTimezoneStyle.color;
- }
- this.timezoneIconStyle = this.computedTimezoneStyle.iconSize ? iconStyle(this.computedTimezoneStyle.iconSize) : {};
- }
- }
-
registerOnChange(fn: any): void {
this.propagateChange = fn;
}
diff --git a/ui-ngx/src/app/shared/models/widget-settings.models.ts b/ui-ngx/src/app/shared/models/widget-settings.models.ts
index dbe75a5b36..5124458ff0 100644
--- a/ui-ngx/src/app/shared/models/widget-settings.models.ts
+++ b/ui-ngx/src/app/shared/models/widget-settings.models.ts
@@ -262,19 +262,6 @@ export const defaultTimewindowStyle: TimewindowStyle = {
displayTypePrefix: true
};
-export interface TimezoneStyle {
- showIcon: boolean;
- icon?: string;
- iconSize?: string;
- iconPosition?: 'left' | 'right';
- font?: Font;
- color?: string;
-}
-
-export const defaultTimezoneStyle: TimezoneStyle = {
- showIcon: false
-};
-
export const constantColor = (color: string): ColorSettings => ({
type: ColorType.constant,
color,