diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/scada/scada-symbol.models.ts b/ui-ngx/src/app/modules/home/components/widget/lib/scada/scada-symbol.models.ts index bb6cc17869..733e7078dd 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/scada/scada-symbol.models.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/scada/scada-symbol.models.ts @@ -255,8 +255,17 @@ const parseScadaSymbolMetadataFromDom = (svgDoc: Document): ScadaSymbolMetadata if (elements.length) { return JSON.parse(elements[0].textContent); } else { - const viewBox = svgDoc.getElementsByTagName('svg')[0].viewBox.baseVal; - return emptyMetadata(viewBox.width, viewBox.height); + const svg = svgDoc.getElementsByTagName('svg')[0]; + let width = null; + let height = null; + if (svg.viewBox.baseVal.width && svg.viewBox.baseVal.height) { + width = svg.viewBox.baseVal.width; + height = svg.viewBox.baseVal.height; + } else if (svg.width.baseVal.value && svg.height.baseVal.value) { + width = svg.width.baseVal.value; + height = svg.height.baseVal.value; + } + return emptyMetadata(width, height); } } catch (_e) { console.error(_e); diff --git a/ui-ngx/src/app/modules/home/pages/admin/admin-routing.module.ts b/ui-ngx/src/app/modules/home/pages/admin/admin-routing.module.ts index b4a4d01326..7d3e9983f8 100644 --- a/ui-ngx/src/app/modules/home/pages/admin/admin-routing.module.ts +++ b/ui-ngx/src/app/modules/home/pages/admin/admin-routing.module.ts @@ -114,8 +114,7 @@ const routes: Routes = [ data: { auth: [Authority.TENANT_ADMIN, Authority.SYS_ADMIN], title: 'scada.symbols', - imageSubType: ResourceSubType.SCADA_SYMBOL, - editOnRowClick: true + imageSubType: ResourceSubType.SCADA_SYMBOL } }, { diff --git a/ui-ngx/src/app/shared/components/image/image-gallery.component.ts b/ui-ngx/src/app/shared/components/image/image-gallery.component.ts index 419e637f0c..ca24fb55b0 100644 --- a/ui-ngx/src/app/shared/components/image/image-gallery.component.ts +++ b/ui-ngx/src/app/shared/components/image/image-gallery.component.ts @@ -181,8 +181,6 @@ export class ImageGalleryComponent extends PageComponent implements OnInit, OnDe return this.imageSubType === ResourceSubType.SCADA_SYMBOL; } - private editOnRowClick = false; - private updateDataSubscription: Subscription; private widgetResize$: ResizeObserver; @@ -219,7 +217,6 @@ export class ImageGalleryComponent extends PageComponent implements OnInit, OnDe const routerQueryParams: PageQueryParam = this.route.snapshot.queryParams; if (this.pageMode) { this.imageSubType = this.route.snapshot.data.imageSubType || ResourceSubType.IMAGE; - this.editOnRowClick = this.route.snapshot.data.editOnRowClick || false; if (routerQueryParams.hasOwnProperty('direction') || routerQueryParams.hasOwnProperty('property')) { sortOrder = { @@ -642,9 +639,8 @@ export class ImageGalleryComponent extends PageComponent implements OnInit, OnDe } rowClick($event, image: ImageResourceInfo) { - if (this.editOnRowClick) { + if (this.isScada) { this.editImage($event, image); - } else { if (this.selectionMode) { this.selectImage($event, image);