,
+ private fb: UntypedFormBuilder) {
+ super(store);
+ }
+
+ protected settingsForm(): UntypedFormGroup {
+ return this.actionButtonWidgetSettingsForm;
+ }
+
+ protected defaultSettings(): WidgetSettings {
+ return {...actionButtonDefaultSettings};
+ }
+
+ protected onSettingsSet(settings: WidgetSettings) {
+ this.actionButtonWidgetSettingsForm = this.fb.group({
+ activatedState: [settings.activatedState, []],
+ disabledState: [settings.disabledState, []],
+
+ appearance: [settings.appearance, []]
+ });
+ }
+}
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/get-value-action-settings-panel.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/get-value-action-settings-panel.component.html
index 9684be6fd3..faad403e9b 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/get-value-action-settings-panel.component.html
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/get-value-action-settings-panel.component.html
@@ -84,11 +84,6 @@
[attributeScope]="getValueSettingsFormGroup.get('getAttribute').get('scope').value">
-
-
- {{ 'widgets.value-action.subscribe-for-updates' | translate }}
-
-
@@ -106,11 +101,6 @@
[keyType]="dataKeyType.timeseries">
-
-
- {{ 'widgets.value-action.subscribe-for-updates' | translate }}
-
-
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/get-value-action-settings-panel.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/get-value-action-settings-panel.component.ts
index 4b9eb98ae2..f9202b982f 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/get-value-action-settings-panel.component.ts
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/get-value-action-settings-panel.component.ts
@@ -24,7 +24,7 @@ import { merge } from 'rxjs';
import {
DataToValueType,
GetValueAction,
- getValueActions, getValueActionsByWidgetType,
+ getValueActionsByWidgetType,
getValueActionTranslations,
GetValueSettings
} from '@shared/models/action-widget-settings.models';
@@ -117,12 +117,10 @@ export class GetValueActionSettingsPanelComponent extends PageComponent implemen
}),
getAttribute: this.fb.group({
scope: [this.getValueSettings?.getAttribute?.scope, []],
- key: [this.getValueSettings?.getAttribute?.key, [Validators.required]],
- subscribeForUpdates: [this.getValueSettings?.getAttribute?.subscribeForUpdates, []]
+ key: [this.getValueSettings?.getAttribute?.key, [Validators.required]]
}),
getTimeSeries: this.fb.group({
- key: [this.getValueSettings?.getTimeSeries?.key, [Validators.required]],
- subscribeForUpdates: [this.getValueSettings?.getTimeSeries?.subscribeForUpdates, []]
+ key: [this.getValueSettings?.getTimeSeries?.key, [Validators.required]]
}),
dataToValue: this.fb.group({
type: [this.getValueSettings?.dataToValue?.type, [Validators.required]],
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/led-indicator-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/led-indicator-widget-settings.component.ts
index 22af44f2b4..70f4846b78 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/led-indicator-widget-settings.component.ts
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/led-indicator-widget-settings.component.ts
@@ -32,7 +32,7 @@ export class LedIndicatorWidgetSettingsComponent extends WidgetSettingsComponent
functionScopeVariables = this.widgetService.getWidgetScopeVariables();
get targetDevice(): TargetDevice {
- return this.widget?.config?.targetDevice;
+ return this.widgetConfig?.config?.targetDevice;
}
dataKeyType = DataKeyType;
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/round-switch-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/round-switch-widget-settings.component.ts
index 8bf58a9b22..a8d4d70015 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/round-switch-widget-settings.component.ts
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/round-switch-widget-settings.component.ts
@@ -37,7 +37,7 @@ export class RoundSwitchWidgetSettingsComponent extends WidgetSettingsComponent
}
get targetDevice(): TargetDevice {
- return this.widget?.config?.targetDevice;
+ return this.widgetConfig?.config?.targetDevice;
}
protected settingsForm(): UntypedFormGroup {
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/single-switch-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/single-switch-widget-settings.component.ts
index f4bd08a20c..8c7282e32b 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/single-switch-widget-settings.component.ts
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/single-switch-widget-settings.component.ts
@@ -20,7 +20,8 @@ import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms
import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
import {
- singleSwitchDefaultSettings, singleSwitchLayoutImages,
+ singleSwitchDefaultSettings,
+ singleSwitchLayoutImages,
singleSwitchLayouts,
singleSwitchLayoutTranslations
} from '@home/components/widget/lib/rpc/single-switch-widget.models';
@@ -34,11 +35,11 @@ import { ValueType } from '@shared/models/constants';
export class SingleSwitchWidgetSettingsComponent extends WidgetSettingsComponent {
get targetDevice(): TargetDevice {
- return this.widget?.config?.targetDevice;
+ return this.widgetConfig?.config?.targetDevice;
}
get widgetType(): widgetType {
- return this.widget?.type;
+ return this.widgetConfig?.widgetType;
}
singleSwitchLayouts = singleSwitchLayouts;
@@ -156,6 +157,4 @@ export class SingleSwitchWidgetSettingsComponent extends WidgetSettingsComponent
this.singleSwitchWidgetSettingsForm.get('offLabelColor').disable();
}
}
-
- protected readonly ValueType = ValueType;
}
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/slide-toggle-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/slide-toggle-widget-settings.component.ts
index d14d0fd594..43098a011b 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/slide-toggle-widget-settings.component.ts
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/slide-toggle-widget-settings.component.ts
@@ -37,7 +37,7 @@ export class SlideToggleWidgetSettingsComponent extends WidgetSettingsComponent
}
get targetDevice(): TargetDevice {
- return this.widget?.config?.targetDevice;
+ return this.widgetConfig?.config?.targetDevice;
}
protected settingsForm(): UntypedFormGroup {
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/switch-control-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/switch-control-widget-settings.component.ts
index 197fc2d229..e74275b659 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/switch-control-widget-settings.component.ts
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/switch-control-widget-settings.component.ts
@@ -37,7 +37,7 @@ export class SwitchControlWidgetSettingsComponent extends WidgetSettingsComponen
}
get targetDevice(): TargetDevice {
- return this.widget?.config?.targetDevice;
+ return this.widgetConfig?.config?.targetDevice;
}
protected settingsForm(): UntypedFormGroup {
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/widget-settings.module.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/widget-settings.module.ts
index 30c1b748de..607cb91318 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/widget-settings.module.ts
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/widget-settings.module.ts
@@ -15,7 +15,9 @@
///
import { NgModule, Type } from '@angular/core';
-import { QrCodeWidgetSettingsComponent } from '@home/components/widget/lib/settings/cards/qrcode-widget-settings.component';
+import {
+ QrCodeWidgetSettingsComponent
+} from '@home/components/widget/lib/settings/cards/qrcode-widget-settings.component';
import { CommonModule } from '@angular/common';
import { SharedModule } from '@shared/shared.module';
import { SharedHomeComponentsModule } from '@home/components/shared-home-components.module';
@@ -33,7 +35,9 @@ import {
MarkdownWidgetSettingsComponent
} from '@home/components/widget/lib/settings/cards/markdown-widget-settings.component';
import { LabelWidgetLabelComponent } from '@home/components/widget/lib/settings/cards/label-widget-label.component';
-import { LabelWidgetSettingsComponent } from '@home/components/widget/lib/settings/cards/label-widget-settings.component';
+import {
+ LabelWidgetSettingsComponent
+} from '@home/components/widget/lib/settings/cards/label-widget-settings.component';
import {
SimpleCardWidgetSettingsComponent
} from '@home/components/widget/lib/settings/cards/simple-card-widget-settings.component';
@@ -311,6 +315,9 @@ import {
import {
SingleSwitchWidgetSettingsComponent
} from '@home/components/widget/lib/settings/control/single-switch-widget-settings.component';
+import {
+ ActionButtonWidgetSettingsComponent
+} from '@home/components/widget/lib/settings/button/action-button-widget-settings.component';
@NgModule({
declarations: [
@@ -424,7 +431,8 @@ import {
DoughnutWidgetSettingsComponent,
RangeChartWidgetSettingsComponent,
BarChartWithLabelsWidgetSettingsComponent,
- SingleSwitchWidgetSettingsComponent
+ SingleSwitchWidgetSettingsComponent,
+ ActionButtonWidgetSettingsComponent
],
imports: [
CommonModule,
@@ -543,7 +551,8 @@ import {
DoughnutWidgetSettingsComponent,
RangeChartWidgetSettingsComponent,
BarChartWithLabelsWidgetSettingsComponent,
- SingleSwitchWidgetSettingsComponent
+ SingleSwitchWidgetSettingsComponent,
+ ActionButtonWidgetSettingsComponent
]
})
export class WidgetSettingsModule {
@@ -629,5 +638,6 @@ export const widgetSettingsComponentsMap: {[key: string]: Type extends ValueActionSettings {
defaultValue: V;
executeRpc?: RpcSettings;
getAttribute: GetAttributeValueSettings;
- getTimeSeries: GetTelemetryValueSettings;
+ getTimeSeries: TelemetryValueSettings;
dataToValue: DataToValueSettings;
}
@@ -133,13 +129,3 @@ export interface SetValueSettings extends ValueActionSettings {
putTimeSeries: TelemetryValueSettings;
valueToData: ValueToDataSettings;
}
-
-/*export interface RpcStateBehaviourSettings {
- initialState: RpcInitialStateSettings;
- updateStateByValue: (value: V) => RpcUpdateStateSettings;
-}
-
-export interface RpcStateWidgetSettings {
- initialState: RpcInitialStateSettings;
- background: BackgroundSettings;
-}*/
diff --git a/ui-ngx/src/assets/locale/locale.constant-en_US.json b/ui-ngx/src/assets/locale/locale.constant-en_US.json
index fa9945dd50..c9108e9bac 100644
--- a/ui-ngx/src/assets/locale/locale.constant-en_US.json
+++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json
@@ -6561,8 +6561,6 @@
"attribute-key-required": "Attribute key is required.",
"time-series-key": "Time-series key",
"time-series-key-required": "Time-series key is required.",
- "subscribe-for-updates": "Subscribe for updates",
- "subscribe-for-updates-hint": "Subscribe for updates",
"action-result-converter": "Action result converter",
"converter-none": "None",
"converter-function": "Function",