From 7ac88d807ce121e554cdb98cb66760553a7246a3 Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Fri, 31 May 2024 16:19:00 +0300 Subject: [PATCH] UI: Optimize code to override overlay padding in widgets --- .../widget/lib/button/toggle-button-widget.component.html | 3 +-- .../widget/lib/button/toggle-button-widget.component.ts | 4 +--- .../lib/cards/aggregated-value-card-widget.component.html | 3 +-- .../lib/cards/aggregated-value-card-widget.component.ts | 4 +--- .../widget/lib/cards/progress-bar-widget.component.html | 3 +-- .../widget/lib/cards/progress-bar-widget.component.ts | 4 +--- .../widget/lib/cards/value-chart-card-widget.component.html | 3 +-- .../widget/lib/cards/value-chart-card-widget.component.ts | 4 +--- .../lib/chart/bar-chart-with-labels-widget.component.html | 3 +-- .../lib/chart/bar-chart-with-labels-widget.component.ts | 4 +--- .../components/widget/lib/chart/latest-chart.component.html | 3 +-- .../components/widget/lib/chart/latest-chart.component.ts | 4 +--- .../widget/lib/chart/range-chart-widget.component.html | 3 +-- .../widget/lib/chart/range-chart-widget.component.ts | 4 +--- .../widget/lib/chart/time-series-chart-widget.component.html | 3 +-- .../widget/lib/chart/time-series-chart-widget.component.scss | 4 +--- .../widget/lib/chart/time-series-chart-widget.component.ts | 4 +--- .../widget/lib/indicator/battery-level-widget.component.html | 4 ++-- .../widget/lib/indicator/battery-level-widget.component.ts | 4 +--- .../widget/lib/indicator/liquid-level-widget.component.html | 4 ++-- .../widget/lib/indicator/liquid-level-widget.component.ts | 4 +--- .../lib/indicator/signal-strength-widget.component.html | 4 ++-- .../widget/lib/indicator/signal-strength-widget.component.ts | 4 +--- .../widget/lib/rpc/power-button-widget.component.html | 3 +-- .../widget/lib/rpc/power-button-widget.component.ts | 4 +--- .../components/widget/lib/rpc/slider-widget.component.html | 3 +-- .../home/components/widget/lib/rpc/slider-widget.component.ts | 4 +--- 27 files changed, 30 insertions(+), 68 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/button/toggle-button-widget.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/button/toggle-button-widget.component.html index 3fe6d5c239..8fb2f5bf77 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/button/toggle-button-widget.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/button/toggle-button-widget.component.html @@ -15,8 +15,7 @@ limitations under the License. --> -
+
; overlayStyle: ComponentStyle = {}; - overlayEnabled: boolean; padding: string; value = false; @@ -70,8 +69,7 @@ export class ToggleButtonWidgetComponent extends this.backgroundStyle$ = backgroundStyle(this.settings.background, this.imagePipe, this.sanitizer); this.overlayStyle = overlayStyle(this.settings.background.overlay); - this.overlayEnabled = this.settings.background.overlay.enabled; - this.padding = this.overlayEnabled ? undefined : this.settings.padding; + this.padding = this.settings.background.overlay.enabled ? undefined : this.settings.padding; const getInitialStateSettings = {...this.settings.initialState, actionLabel: this.ctx.translate.instant('widgets.rpc-state.initial-state')}; diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/cards/aggregated-value-card-widget.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/cards/aggregated-value-card-widget.component.html index 390542d524..aa6aa6ee52 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/cards/aggregated-value-card-widget.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/cards/aggregated-value-card-widget.component.html @@ -15,8 +15,7 @@ limitations under the License. --> -
+
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/cards/aggregated-value-card-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/cards/aggregated-value-card-widget.component.ts index a82cd1631e..2d6525e6f7 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/cards/aggregated-value-card-widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/cards/aggregated-value-card-widget.component.ts @@ -106,7 +106,6 @@ export class AggregatedValueCardWidgetComponent implements OnInit, AfterViewInit backgroundStyle$: Observable; overlayStyle: ComponentStyle = {}; - overlayEnabled: boolean; padding: string; private lineChart: TbTimeSeriesChart; @@ -171,8 +170,7 @@ export class AggregatedValueCardWidgetComponent implements OnInit, AfterViewInit this.backgroundStyle$ = backgroundStyle(this.settings.background, this.imagePipe, this.sanitizer); this.overlayStyle = overlayStyle(this.settings.background.overlay); - this.overlayEnabled = this.settings.background.overlay.enabled; - this.padding = this.overlayEnabled ? undefined : this.settings.padding; + this.padding = this.settings.background.overlay.enabled ? undefined : this.settings.padding; } ngAfterViewInit(): void { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/cards/progress-bar-widget.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/cards/progress-bar-widget.component.html index 729b57e389..8262f016f6 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/cards/progress-bar-widget.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/cards/progress-bar-widget.component.html @@ -15,8 +15,7 @@ limitations under the License. --> -
+
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/cards/progress-bar-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/cards/progress-bar-widget.component.ts index 4f2515ed11..9b71a9979f 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/cards/progress-bar-widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/cards/progress-bar-widget.component.ts @@ -98,7 +98,6 @@ export class ProgressBarWidgetComponent implements OnInit, OnDestroy, AfterViewI backgroundStyle$: Observable; overlayStyle: ComponentStyle = {}; - overlayEnabled: boolean; padding: string; progressBarPanelResize$: ResizeObserver; @@ -153,8 +152,7 @@ export class ProgressBarWidgetComponent implements OnInit, OnDestroy, AfterViewI this.backgroundStyle$ = backgroundStyle(this.settings.background, this.imagePipe, this.sanitizer); this.overlayStyle = overlayStyle(this.settings.background.overlay); - this.overlayEnabled = this.settings.background.overlay.enabled; - this.padding = this.overlayEnabled ? undefined : this.settings.padding; + this.padding = this.settings.background.overlay.enabled ? undefined : this.settings.padding; } ngAfterViewInit() { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/cards/value-chart-card-widget.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/cards/value-chart-card-widget.component.html index cd932180f6..fac00578a7 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/cards/value-chart-card-widget.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/cards/value-chart-card-widget.component.html @@ -15,8 +15,7 @@ limitations under the License. --> -
+
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/cards/value-chart-card-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/cards/value-chart-card-widget.component.ts index 3b075f183c..8511944868 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/cards/value-chart-card-widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/cards/value-chart-card-widget.component.ts @@ -98,7 +98,6 @@ export class ValueChartCardWidgetComponent implements OnInit, AfterViewInit, OnD backgroundStyle$: Observable; overlayStyle: ComponentStyle = {}; - overlayEnabled: boolean; padding: string; private lineChart: TbTimeSeriesChart; @@ -148,8 +147,7 @@ export class ValueChartCardWidgetComponent implements OnInit, AfterViewInit, OnD this.backgroundStyle$ = backgroundStyle(this.settings.background, this.imagePipe, this.sanitizer); this.overlayStyle = overlayStyle(this.settings.background.overlay); - this.overlayEnabled = this.settings.background.overlay.enabled; - this.padding = this.overlayEnabled ? undefined : this.settings.padding; + this.padding = this.settings.background.overlay.enabled ? undefined : this.settings.padding; if (this.ctx.defaultSubscription.firstDatasource?.dataKeys?.length) { this.lineChartDataKey = this.ctx.defaultSubscription.firstDatasource?.dataKeys[0]; diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/chart/bar-chart-with-labels-widget.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/chart/bar-chart-with-labels-widget.component.html index f48b8def30..5070ad08a9 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/chart/bar-chart-with-labels-widget.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/chart/bar-chart-with-labels-widget.component.html @@ -15,8 +15,7 @@ limitations under the License. --> -
+
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/chart/bar-chart-with-labels-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/chart/bar-chart-with-labels-widget.component.ts index b840f49e3b..9762f8da34 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/chart/bar-chart-with-labels-widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/chart/bar-chart-with-labels-widget.component.ts @@ -65,7 +65,6 @@ export class BarChartWithLabelsWidgetComponent implements OnInit, OnDestroy, Aft backgroundStyle$: Observable; overlayStyle: ComponentStyle = {}; - overlayEnabled: boolean; padding: string; legendKeys: DataKey[]; @@ -86,8 +85,7 @@ export class BarChartWithLabelsWidgetComponent implements OnInit, OnDestroy, Aft this.backgroundStyle$ = backgroundStyle(this.settings.background, this.imagePipe, this.sanitizer); this.overlayStyle = overlayStyle(this.settings.background.overlay); - this.overlayEnabled = this.settings.background.overlay.enabled; - this.padding = this.overlayEnabled ? undefined : this.settings.padding; + this.padding = this.settings.background.overlay.enabled ? undefined : this.settings.padding; this.showLegend = this.settings.showLegend; diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/chart/latest-chart.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/chart/latest-chart.component.html index 7089cb27e9..9a25451d0f 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/chart/latest-chart.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/chart/latest-chart.component.html @@ -15,8 +15,7 @@ limitations under the License. --> -
+
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/chart/latest-chart.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/chart/latest-chart.component.ts index 7f8277b0e6..54d674d636 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/chart/latest-chart.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/chart/latest-chart.component.ts @@ -83,7 +83,6 @@ export class LatestChartComponent implements OnInit, OnDestroy, AfterViewInit { backgroundStyle$: Observable; overlayStyle: ComponentStyle = {}; - overlayEnabled: boolean; padding: string; get legendItems(): LatestChartLegendItem[] { @@ -113,8 +112,7 @@ export class LatestChartComponent implements OnInit, OnDestroy, AfterViewInit { this.backgroundStyle$ = backgroundStyle(this.settings.background, this.imagePipe, this.sanitizer); this.overlayStyle = overlayStyle(this.settings.background.overlay); - this.overlayEnabled = this.settings.background.overlay.enabled; - this.padding = this.overlayEnabled ? undefined : this.settings.padding; + this.padding = this.settings.background.overlay.enabled ? undefined : this.settings.padding; if (this.showLegend) { this.legendClass = `legend-${this.settings.legendPosition}`; diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/chart/range-chart-widget.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/chart/range-chart-widget.component.html index 63a549bb48..b5e09be857 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/chart/range-chart-widget.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/chart/range-chart-widget.component.html @@ -15,8 +15,7 @@ limitations under the License. --> -
+
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/chart/range-chart-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/chart/range-chart-widget.component.ts index 9d89154111..12a13a2fc4 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/chart/range-chart-widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/chart/range-chart-widget.component.ts @@ -73,7 +73,6 @@ export class RangeChartWidgetComponent implements OnInit, OnDestroy, AfterViewIn backgroundStyle$: Observable; overlayStyle: ComponentStyle = {}; - overlayEnabled: boolean; padding: string; legendLabelStyle: ComponentStyle; @@ -112,8 +111,7 @@ export class RangeChartWidgetComponent implements OnInit, OnDestroy, AfterViewIn this.backgroundStyle$ = backgroundStyle(this.settings.background, this.imagePipe, this.sanitizer); this.overlayStyle = overlayStyle(this.settings.background.overlay); - this.overlayEnabled = this.settings.background.overlay.enabled; - this.padding = this.overlayEnabled ? undefined : this.settings.padding; + this.padding = this.settings.background.overlay.enabled ? undefined : this.settings.padding; this.rangeItems = toRangeItems(this.settings.rangeColors); this.visibleRangeItems = this.rangeItems.filter(item => item.visible); diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart-widget.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart-widget.component.html index 147214c355..092b0c2783 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart-widget.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart-widget.component.html @@ -15,8 +15,7 @@ limitations under the License. --> -
+
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart-widget.component.scss b/ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart-widget.component.scss index 79a162a7ae..84f9d51e07 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart-widget.component.scss +++ b/ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart-widget.component.scss @@ -24,9 +24,7 @@ $maxLegendHeight: 35%; display: flex; flex-direction: column; gap: 8px; - &.overlay { - padding: 20px 24px 24px 24px; - } + padding: 20px 24px 24px 24px; > div:not(.tb-time-series-chart-overlay) { z-index: 1; } diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart-widget.component.ts index 48a328613e..0a242eba36 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart-widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart-widget.component.ts @@ -73,7 +73,6 @@ export class TimeSeriesChartWidgetComponent implements OnInit, OnDestroy, AfterV backgroundStyle$: Observable; overlayStyle: ComponentStyle = {}; - overlayEnabled: boolean; padding: string; legendColumnTitleStyle: ComponentStyle; @@ -97,8 +96,7 @@ export class TimeSeriesChartWidgetComponent implements OnInit, OnDestroy, AfterV this.backgroundStyle$ = backgroundStyle(this.settings.background, this.imagePipe, this.sanitizer); this.overlayStyle = overlayStyle(this.settings.background.overlay); - this.overlayEnabled = this.settings.background.overlay.enabled; - this.padding = this.overlayEnabled ? undefined : this.settings.padding; + this.padding = this.settings.background.overlay.enabled ? undefined : this.settings.padding; this.showLegend = this.settings.showLegend; if (this.showLegend) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/indicator/battery-level-widget.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/indicator/battery-level-widget.component.html index e3bd3c5746..5c284e8d77 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/indicator/battery-level-widget.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/indicator/battery-level-widget.component.html @@ -15,8 +15,8 @@ limitations under the License. --> -
+
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/indicator/battery-level-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/indicator/battery-level-widget.component.ts index 8640cf859a..263b6edbb1 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/indicator/battery-level-widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/indicator/battery-level-widget.component.ts @@ -132,7 +132,6 @@ export class BatteryLevelWidgetComponent implements OnInit, OnDestroy, AfterView backgroundStyle$: Observable; overlayStyle: ComponentStyle = {}; - overlayEnabled: boolean; padding: string; batteryBoxResize$: ResizeObserver; @@ -216,8 +215,7 @@ export class BatteryLevelWidgetComponent implements OnInit, OnDestroy, AfterView this.backgroundStyle$ = backgroundStyle(this.settings.background, this.imagePipe, this.sanitizer); this.overlayStyle = overlayStyle(this.settings.background.overlay); - this.overlayEnabled = this.settings.background.overlay.enabled; - this.padding = this.overlayEnabled ? undefined : this.settings.padding; + this.padding = this.settings.background.overlay.enabled ? undefined : this.settings.padding; this.hasCardClickAction = this.ctx.actionsApi.getActionDescriptors('cardClick').length > 0; diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/indicator/liquid-level-widget.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/indicator/liquid-level-widget.component.html index 5cbdb3007d..21d7c7a01b 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/indicator/liquid-level-widget.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/indicator/liquid-level-widget.component.html @@ -15,8 +15,8 @@ limitations under the License. --> -
+
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/indicator/liquid-level-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/indicator/liquid-level-widget.component.ts index 946ee201ee..37be6455f2 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/indicator/liquid-level-widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/indicator/liquid-level-widget.component.ts @@ -81,7 +81,6 @@ export class LiquidLevelWidgetComponent implements OnInit { backgroundStyle$: Observable; overlayStyle: ComponentStyle = {}; - overlayEnabled: boolean; padding: string; hasCardClickAction = false; @@ -126,8 +125,7 @@ export class LiquidLevelWidgetComponent implements OnInit { this.backgroundStyle$ = backgroundStyle(this.settings.background, this.imagePipe, this.sanitizer); this.overlayStyle = overlayStyle(this.settings.background.overlay); - this.overlayEnabled = this.settings.background.overlay.enabled; - this.padding = this.overlayEnabled ? undefined : this.settings.padding; + this.padding = this.settings.background.overlay.enabled ? undefined : this.settings.padding; this.hasCardClickAction = this.ctx.actionsApi.getActionDescriptors('cardClick').length > 0; diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/indicator/signal-strength-widget.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/indicator/signal-strength-widget.component.html index c76e137e39..a0b9c895d8 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/indicator/signal-strength-widget.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/indicator/signal-strength-widget.component.html @@ -15,8 +15,8 @@ limitations under the License. --> -
+
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/indicator/signal-strength-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/indicator/signal-strength-widget.component.ts index e681d3b24e..3a898f0f82 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/indicator/signal-strength-widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/indicator/signal-strength-widget.component.ts @@ -125,7 +125,6 @@ export class SignalStrengthWidgetComponent implements OnInit, OnDestroy, AfterVi backgroundStyle$: Observable; overlayStyle: ComponentStyle = {}; - overlayEnabled: boolean; padding: string; shapeResize$: ResizeObserver; @@ -210,8 +209,7 @@ export class SignalStrengthWidgetComponent implements OnInit, OnDestroy, AfterVi this.backgroundStyle$ = backgroundStyle(this.settings.background, this.imagePipe, this.sanitizer); this.overlayStyle = overlayStyle(this.settings.background.overlay); - this.overlayEnabled = this.settings.background.overlay.enabled; - this.padding = this.overlayEnabled ? undefined : this.settings.padding; + this.padding = this.settings.background.overlay.enabled ? undefined : this.settings.padding; this.hasCardClickAction = this.ctx.actionsApi.getActionDescriptors('cardClick').length > 0; } diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/rpc/power-button-widget.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/rpc/power-button-widget.component.html index 78bc0852bf..447c813777 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/rpc/power-button-widget.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/rpc/power-button-widget.component.html @@ -15,8 +15,7 @@ limitations under the License. --> -
+
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/rpc/power-button-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/rpc/power-button-widget.component.ts index 997fc16cb3..7c2250ce39 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/rpc/power-button-widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/rpc/power-button-widget.component.ts @@ -56,7 +56,6 @@ export class PowerButtonWidgetComponent extends backgroundStyle$: Observable; overlayStyle: ComponentStyle = {}; - overlayEnabled: boolean; padding: string; value = false; @@ -84,8 +83,7 @@ export class PowerButtonWidgetComponent extends this.backgroundStyle$ = backgroundStyle(this.settings.background, this.imagePipe, this.sanitizer); this.overlayStyle = overlayStyle(this.settings.background.overlay); - this.overlayEnabled = this.settings.background.overlay.enabled; - this.padding = this.overlayEnabled ? undefined : this.settings.padding; + this.padding = this.settings.background.overlay.enabled ? undefined : this.settings.padding; const getInitialStateSettings = {...this.settings.initialState, actionLabel: this.ctx.translate.instant('widgets.rpc-state.initial-state')}; diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/rpc/slider-widget.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/rpc/slider-widget.component.html index f92b688526..9fea4f7f07 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/rpc/slider-widget.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/rpc/slider-widget.component.html @@ -15,8 +15,7 @@ limitations under the License. --> -
+
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/rpc/slider-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/rpc/slider-widget.component.ts index 7ab378db69..a3d81bbe0d 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/rpc/slider-widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/rpc/slider-widget.component.ts @@ -94,7 +94,6 @@ export class SliderWidgetComponent extends backgroundStyle$: Observable; overlayStyle: ComponentStyle = {}; - overlayEnabled: boolean; padding: string; value: number = null; @@ -147,8 +146,7 @@ export class SliderWidgetComponent extends this.backgroundStyle$ = backgroundStyle(this.settings.background, this.imagePipe, this.sanitizer); this.overlayStyle = overlayStyle(this.settings.background.overlay); - this.overlayEnabled = this.settings.background.overlay.enabled; - this.padding = this.overlayEnabled ? undefined : this.settings.padding; + this.padding = this.settings.background.overlay.enabled ? undefined : this.settings.padding; this.layout = this.settings.layout;