|
|
@ -47,7 +47,7 @@ import { |
|
|
} from '@app/shared/models/dashboard.models'; |
|
|
} from '@app/shared/models/dashboard.models'; |
|
|
import { WINDOW } from '@core/services/window.service'; |
|
|
import { WINDOW } from '@core/services/window.service'; |
|
|
import { WindowMessage } from '@shared/models/window-message.model'; |
|
|
import { WindowMessage } from '@shared/models/window-message.model'; |
|
|
import { deepClone, isDefined } from '@app/core/utils'; |
|
|
import { deepClone, isDefined, isDefinedAndNotNull } from '@app/core/utils'; |
|
|
import { |
|
|
import { |
|
|
DashboardContext, |
|
|
DashboardContext, |
|
|
DashboardPageLayout, |
|
|
DashboardPageLayout, |
|
|
@ -62,6 +62,7 @@ import { MediaBreakpoints } from '@shared/models/constants'; |
|
|
import { AuthUser } from '@shared/models/user.model'; |
|
|
import { AuthUser } from '@shared/models/user.model'; |
|
|
import { getCurrentAuthState } from '@core/auth/auth.selectors'; |
|
|
import { getCurrentAuthState } from '@core/auth/auth.selectors'; |
|
|
import { |
|
|
import { |
|
|
|
|
|
DatasourceType, |
|
|
Widget, |
|
|
Widget, |
|
|
WidgetConfig, |
|
|
WidgetConfig, |
|
|
WidgetInfo, |
|
|
WidgetInfo, |
|
|
@ -891,6 +892,12 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC |
|
|
const config: WidgetConfig = JSON.parse(widgetTypeInfo.defaultConfig); |
|
|
const config: WidgetConfig = JSON.parse(widgetTypeInfo.defaultConfig); |
|
|
config.title = 'New ' + widgetTypeInfo.widgetName; |
|
|
config.title = 'New ' + widgetTypeInfo.widgetName; |
|
|
config.datasources = []; |
|
|
config.datasources = []; |
|
|
|
|
|
if (isDefinedAndNotNull(config.alarmSource)) { |
|
|
|
|
|
config.alarmSource = { |
|
|
|
|
|
type: DatasourceType.entity, |
|
|
|
|
|
dataKeys: config.alarmSource.dataKeys || [] |
|
|
|
|
|
}; |
|
|
|
|
|
} |
|
|
const newWidget: Widget = { |
|
|
const newWidget: Widget = { |
|
|
isSystemType: widget.isSystemType, |
|
|
isSystemType: widget.isSystemType, |
|
|
bundleAlias: widget.bundleAlias, |
|
|
bundleAlias: widget.bundleAlias, |
|
|
|