...
|
...
|
@@ -28,6 +28,10 @@ import { |
28
|
28
|
ValidatorFn,
|
29
|
29
|
Validators
|
30
|
30
|
} from '@angular/forms';
|
|
31
|
+import {
|
|
32
|
+ WidgetConfigComponentData,
|
|
33
|
+ WidgetInfo
|
|
34
|
+} from '@home/models/widget-component.models';
|
31
|
35
|
import { Observable, of } from 'rxjs';
|
32
|
36
|
import { Router } from '@angular/router';
|
33
|
37
|
import { DialogComponent } from '@app/shared/components/dialog.component';
|
...
|
...
|
@@ -46,12 +50,14 @@ import { DashboardUtilsService } from '@core/services/dashboard-utils.service'; |
46
|
50
|
import { CustomActionEditorCompleter } from '@home/components/widget/action/custom-action.models';
|
47
|
51
|
import { isDefinedAndNotNull } from '@core/utils';
|
48
|
52
|
import { MobileActionEditorComponent } from '@home/components/widget/action/mobile-action-editor.component';
|
|
53
|
+import { widgetType } from '@shared/models/widget.models';
|
49
|
54
|
|
50
|
55
|
export interface WidgetActionDialogData {
|
51
|
56
|
isAdd: boolean;
|
52
|
57
|
callbacks: WidgetActionCallbacks;
|
53
|
58
|
actionsData: WidgetActionsData;
|
54
|
59
|
action?: WidgetActionDescriptorInfo;
|
|
60
|
+ modelValue: WidgetConfigComponentData;
|
55
|
61
|
}
|
56
|
62
|
|
57
|
63
|
@Component({
|
...
|
...
|
@@ -67,8 +73,10 @@ export class WidgetActionDialogComponent extends DialogComponent<WidgetActionDia |
67
|
73
|
|
68
|
74
|
@ViewChild('mobileActionEditor', {static: false}) mobileActionEditor: MobileActionEditorComponent;
|
69
|
75
|
|
|
76
|
+
|
70
|
77
|
widgetActionFormGroup: FormGroup;
|
71
|
78
|
actionTypeFormGroup: FormGroup;
|
|
79
|
+ widgetInfo: WidgetInfo;
|
72
|
80
|
|
73
|
81
|
isAdd: boolean;
|
74
|
82
|
action: WidgetActionDescriptorInfo;
|
...
|
...
|
@@ -84,6 +92,7 @@ export class WidgetActionDialogComponent extends DialogComponent<WidgetActionDia |
84
|
92
|
customActionEditorCompleter = CustomActionEditorCompleter;
|
85
|
93
|
|
86
|
94
|
submitted = false;
|
|
95
|
+ widgetType = widgetType;
|
87
|
96
|
|
88
|
97
|
constructor(protected store: Store<AppState>,
|
89
|
98
|
protected router: Router,
|
...
|
...
|
@@ -139,9 +148,10 @@ export class WidgetActionDialogComponent extends DialogComponent<WidgetActionDia |
139
|
148
|
this.fb.control(action ? action.targetDashboardStateId : null,
|
140
|
149
|
type === WidgetActionType.openDashboardState ? [Validators.required] : [])
|
141
|
150
|
);
|
|
151
|
+
|
142
|
152
|
this.actionTypeFormGroup.addControl(
|
143
|
153
|
'setEntityId',
|
144
|
|
- this.fb.control(action ? action.setEntityId : true, [])
|
|
154
|
+ this.fb.control(action ? action.setEntityId : this.data.modelValue.widgetType === widgetType.static ? false : true , [])
|
145
|
155
|
);
|
146
|
156
|
this.actionTypeFormGroup.addControl(
|
147
|
157
|
'stateEntityParamName',
|
...
|
...
|
|