diff --git a/ui-ngx/src/app/core/utils.ts b/ui-ngx/src/app/core/utils.ts index 7be030bf54..6291438a58 100644 --- a/ui-ngx/src/app/core/utils.ts +++ b/ui-ngx/src/app/core/utils.ts @@ -438,6 +438,6 @@ export function generateSecret(length?: number): string { return str.concat(generateSecret(length - str.length)); } -export function validateEntityId(entityId: EntityId): boolean { - return isDefinedAndNotNull(entityId.id) && entityId.id !== NULL_UUID && isDefinedAndNotNull(entityId.entityType); +export function validateEntityId(entityId: EntityId | null): boolean { + return isDefinedAndNotNull(entityId?.id) && entityId.id !== NULL_UUID && isDefinedAndNotNull(entityId?.entityType); } diff --git a/ui-ngx/src/app/modules/home/components/widget/action/manage-widget-actions.component.ts b/ui-ngx/src/app/modules/home/components/widget/action/manage-widget-actions.component.ts index 0367cf3ce5..d3fdd47bba 100644 --- a/ui-ngx/src/app/modules/home/components/widget/action/manage-widget-actions.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/action/manage-widget-actions.component.ts @@ -42,6 +42,7 @@ import { WidgetActionDialogData } from '@home/components/widget/action/widget-action-dialog.component'; import { deepClone } from '@core/utils'; +import { widgetType } from '@shared/models/widget.models'; @Component({ selector: 'tb-manage-widget-actions', @@ -59,6 +60,8 @@ export class ManageWidgetActionsComponent extends PageComponent implements OnIni @Input() disabled: boolean; + @Input() widgetType: widgetType; + @Input() callbacks: WidgetActionCallbacks; innerValue: WidgetActionsData; @@ -180,7 +183,8 @@ export class ManageWidgetActionsComponent extends PageComponent implements OnIni isAdd, callbacks: this.callbacks, actionsData, - action: deepClone(action) + action: deepClone(action), + widgetType: this.widgetType } }).afterClosed().subscribe( (res) => { diff --git a/ui-ngx/src/app/modules/home/components/widget/action/widget-action-dialog.component.html b/ui-ngx/src/app/modules/home/components/widget/action/widget-action-dialog.component.html index 44bfe44e1e..2c7b826200 100644 --- a/ui-ngx/src/app/modules/home/components/widget/action/widget-action-dialog.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/action/widget-action-dialog.component.html @@ -120,7 +120,7 @@ widgetActionFormGroup.get('type').value === widgetActionType.updateDashboardState || widgetActionFormGroup.get('type').value === widgetActionType.openDashboard ? widgetActionFormGroup.get('type').value : ''"> - + {{ 'widget-action.set-entity-from-widget' | translate }} , protected router: Router, @@ -141,7 +144,7 @@ export class WidgetActionDialogComponent extends DialogComponent