From 9cd62f39ea6298e05946c81b542f64dc2145857c Mon Sep 17 00:00:00 2001 From: Igor Kulikov Date: Fri, 3 Jan 2025 19:51:40 +0200 Subject: [PATCH] UI: Fix map widget default config. Fix import dialog validation. --- application/src/main/data/json/system/widget_types/map.json | 2 +- .../home/components/widget/lib/maps/map-widget.models.ts | 2 +- ui-ngx/src/app/shared/import-export/import-dialog.component.ts | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/application/src/main/data/json/system/widget_types/map.json b/application/src/main/data/json/system/widget_types/map.json index 1d3443c55d..8019b104fb 100644 --- a/application/src/main/data/json/system/widget_types/map.json +++ b/application/src/main/data/json/system/widget_types/map.json @@ -17,7 +17,7 @@ "settingsDirective": "tb-map-widget-settings", "hasBasicMode": true, "basicModeDirective": "tb-map-basic-config", - "defaultConfig": "{\"datasources\":[],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":true,\"backgroundColor\":\"rgba(0, 0, 0, 0)\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"0px\",\"settings\":{\"mapType\":\"geoMap\",\"layers\":[{\"provider\":\"openstreet-map\",\"layerType\":\"openStreetMapnik\"},{\"provider\":\"openstreet-map\",\"layerType\":\"openStreetHot\"},{\"provider\":\"openstreet-map\",\"layerType\":\"esriWorldStreetMap\"},{\"provider\":\"openstreet-map\",\"layerType\":\"esriWorldTopoMap\"},{\"provider\":\"openstreet-map\",\"layerType\":\"esriWorldImagery\"},{\"provider\":\"openstreet-map\",\"layerType\":\"cartoDbPositron\"},{\"provider\":\"openstreet-map\",\"layerType\":\"cartoDbDarkMatter\"},{\"provider\":\"google-map\",\"layerType\":\"roadmap\",\"apiKey\":\"AIzaSyDoEx2kaGz3PxwbI9T7ccTSg5xjdw8Nw8Q\"},{\"provider\":\"google-map\",\"layerType\":\"satellite\",\"apiKey\":\"AIzaSyDoEx2kaGz3PxwbI9T7ccTSg5xjdw8Nw8Q\"},{\"provider\":\"google-map\",\"layerType\":\"hybrid\",\"apiKey\":\"AIzaSyDoEx2kaGz3PxwbI9T7ccTSg5xjdw8Nw8Q\"},{\"provider\":\"google-map\",\"layerType\":\"terrain\",\"apiKey\":\"AIzaSyDoEx2kaGz3PxwbI9T7ccTSg5xjdw8Nw8Q\"},{\"provider\":\"tencent-map\",\"layerType\":\"tencentNormal\"},{\"provider\":\"tencent-map\",\"layerType\":\"tencentSatellite\"},{\"provider\":\"tencent-map\",\"layerType\":\"tencentTerrain\"},{\"provider\":\"here\",\"layerType\":\"hereNormalDay\",\"apiKey\":\"kVXykxAfZ6LS4EbCTO02soFVfjA7HoBzNVVH9u7nzoE\"},{\"provider\":\"here\",\"layerType\":\"hereNormalNight\",\"apiKey\":\"kVXykxAfZ6LS4EbCTO02soFVfjA7HoBzNVVH9u7nzoE\"},{\"provider\":\"here\",\"layerType\":\"hereHybridDay\",\"apiKey\":\"kVXykxAfZ6LS4EbCTO02soFVfjA7HoBzNVVH9u7nzoE\"},{\"provider\":\"here\",\"layerType\":\"hereTerrainDay\",\"apiKey\":\"kVXykxAfZ6LS4EbCTO02soFVfjA7HoBzNVVH9u7nzoE\"},{\"provider\":\"custom\",\"tileUrl\":\"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png\",\"label\":\"Custom 1\"},{\"provider\":\"custom\",\"tileUrl\":\"http://a.tile2.opencyclemap.org/transport/{z}/{x}/{y}.png\",\"label\":\"Custom 2\"},{\"provider\":\"custom\",\"tileUrl\":\"http://b.tile2.opencyclemap.org/transport/{z}/{x}/{y}.png\",\"label\":\"Custom 3\"}],\"markers\":[],\"polygons\":[],\"circles\":[],\"additionalDataSources\":[],\"controlsPosition\":\"topleft\",\"zoomActions\":[\"scroll\",\"doubleClick\",\"controlButtons\"],\"fitMapBounds\":true,\"useDefaultCenterPosition\":false,\"defaultCenterPosition\":\"0,0\",\"defaultZoomLevel\":null,\"mapPageSize\":16384,\"background\":{\"type\":\"color\",\"color\":\"#fff\",\"overlay\":{\"enabled\":false,\"color\":\"rgba(255,255,255,0.72)\",\"blur\":3}},\"padding\":\"12px\"},\"title\":\"Map\",\"useDashboardTimewindow\":true,\"displayTimewindow\":true,\"showTitleIcon\":false,\"titleTooltip\":\"\",\"dropShadow\":true,\"enableFullscreen\":true,\"widgetStyle\":{},\"widgetCss\":\"\",\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400},\"pageSize\":1024,\"noDataDisplayMessage\":\"\",\"configMode\":\"basic\",\"titleFont\":null,\"titleColor\":null,\"margin\":\"0px\",\"borderRadius\":\"0px\",\"iconSize\":\"24px\",\"titleIcon\":\"map\",\"iconColor\":\"#1F6BDD\",\"actions\":{}}" + "defaultConfig": "{\"datasources\":[],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":true,\"backgroundColor\":\"rgba(0, 0, 0, 0)\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"0px\",\"settings\":{},\"title\":\"Map\",\"useDashboardTimewindow\":true,\"displayTimewindow\":true,\"showTitleIcon\":false,\"titleTooltip\":\"\",\"dropShadow\":true,\"enableFullscreen\":true,\"widgetStyle\":{},\"widgetCss\":\"\",\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400},\"pageSize\":1024,\"noDataDisplayMessage\":\"\",\"configMode\":\"basic\",\"titleFont\":null,\"titleColor\":null,\"margin\":\"0px\",\"borderRadius\":\"0px\",\"iconSize\":\"24px\",\"titleIcon\":\"map\",\"iconColor\":\"#1F6BDD\",\"actions\":{}}" }, "resources": [], "scada": false, diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/maps/map-widget.models.ts b/ui-ngx/src/app/modules/home/components/widget/lib/maps/map-widget.models.ts index e023b9557c..bc0d790036 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/maps/map-widget.models.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/maps/map-widget.models.ts @@ -34,5 +34,5 @@ export const mapWidgetDefaultSettings: MapWidgetSettings = blur: 3 } }, - padding: '6px' + padding: '8px' } as MapWidgetSettings); diff --git a/ui-ngx/src/app/shared/import-export/import-dialog.component.ts b/ui-ngx/src/app/shared/import-export/import-dialog.component.ts index e4256229c4..16800ceadc 100644 --- a/ui-ngx/src/app/shared/import-export/import-dialog.component.ts +++ b/ui-ngx/src/app/shared/import-export/import-dialog.component.ts @@ -78,6 +78,7 @@ export class ImportDialogComponent extends DialogComponent { this.importTypeChanged(); }); + this.importTypeChanged(); } isErrorState(control: UntypedFormControl | null, form: FormGroupDirective | NgForm | null): boolean {