Browse Source

UI: fixed initial value for targetDashboardId valueChanges pipe

pull/9869/head
Dmitriymush 3 years ago
parent
commit
1fdbba6fc6
  1. 10
      ui-ngx/src/app/modules/home/components/widget/action/widget-action-dialog.component.ts

10
ui-ngx/src/app/modules/home/components/widget/action/widget-action-dialog.component.ts

@ -225,7 +225,7 @@ export class WidgetActionDialogComponent extends DialogComponent<WidgetActionDia
this.fb.control(action ? action.targetDashboardId : null,
[Validators.required])
);
this.setupSelectedDashboardStateIds(action ? action.targetDashboardId : null);
this.setupSelectedDashboardStateIds();
} else {
if (type === WidgetActionType.openDashboardState) {
const displayType = this.getStateDisplayType(action);
@ -339,10 +339,12 @@ export class WidgetActionDialogComponent extends DialogComponent<WidgetActionDia
return res;
}
private setupSelectedDashboardStateIds(targetDashboardId?: string) {
private setupSelectedDashboardStateIds() {
const dashboardControl = this.actionTypeFormGroup.get('targetDashboardId');
this.selectedDashboardStateIds =
this.actionTypeFormGroup.get('targetDashboardId').valueChanges.pipe(
// startWith<string>(targetDashboardId),
dashboardControl.valueChanges.pipe(
startWith(dashboardControl.value),
tap(() => {
this.targetDashboardStateSearchText = '';
}),

Loading…
Cancel
Save