From a3468265abcaecc97ec7a6d7df4e4be04bf32c23 Mon Sep 17 00:00:00 2001 From: Igor Kulikov Date: Fri, 20 Mar 2020 17:47:59 +0200 Subject: [PATCH] Fix UI budget --- ui-ngx/src/app/core/schema-utils.ts | 9 ++++----- .../widget/lib/maps/map-widget.interface.ts | 2 +- .../home/components/widget/lib/maps/map-widget2.ts | 12 +++++++----- .../trip-animation/trip-animation.component.ts | 3 ++- ui-ngx/src/app/shared/shared.module.ts | 2 +- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/ui-ngx/src/app/core/schema-utils.ts b/ui-ngx/src/app/core/schema-utils.ts index eb84fba92f..2a4672f456 100644 --- a/ui-ngx/src/app/core/schema-utils.ts +++ b/ui-ngx/src/app/core/schema-utils.ts @@ -14,8 +14,7 @@ /// limitations under the License. /// -import { JsonSchema, JsonSettingsSchema } from '@app/shared/public-api'; - +import { JsonSettingsSchema } from '@shared/models/widget.models'; export function initSchema(): JsonSettingsSchema { return { @@ -63,7 +62,7 @@ export function mergeSchemes(schemes: JsonSettingsSchema[]): JsonSettingsSchema }, initSchema()); } -export function addCondition(schema: JsonSettingsSchema, condition: String): JsonSettingsSchema { +export function addCondition(schema: JsonSettingsSchema, condition: string): JsonSettingsSchema { schema.form = schema.form.map(element => { if (typeof element === 'string') { return { @@ -71,7 +70,7 @@ export function addCondition(schema: JsonSettingsSchema, condition: String): Jso condition } } - if (typeof element == 'object') { + if (typeof element === 'object') { if (element.condition) { element.condition += ' && ' + condition } @@ -80,4 +79,4 @@ export function addCondition(schema: JsonSettingsSchema, condition: String): Jso return element; }); return schema; -} \ No newline at end of file +} diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/maps/map-widget.interface.ts b/ui-ngx/src/app/modules/home/components/widget/lib/maps/map-widget.interface.ts index 1547ea16c9..f9a176137e 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/maps/map-widget.interface.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/maps/map-widget.interface.ts @@ -14,7 +14,7 @@ /// limitations under the License. /// -import { JsonSettingsSchema } from '@app/shared/public-api'; +import { JsonSettingsSchema } from '@shared/models/widget.models'; export interface MapWidgetInterface { resize(), diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/maps/map-widget2.ts b/ui-ngx/src/app/modules/home/components/widget/lib/maps/map-widget2.ts index 049a985353..c1fc2a4264 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/maps/map-widget2.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/maps/map-widget2.ts @@ -30,13 +30,15 @@ import { } from './schemes'; import { MapWidgetStaticInterface, MapWidgetInterface } from './map-widget.interface'; import { OpenStreetMap, TencentMap, GoogleMap, HEREMap, ImageMap } from './providers'; -import { parseFunction, parseArray, parseData } from '@app/core/utils'; -import { initSchema, addToSchema, mergeSchemes, addCondition, addGroupInfo } from '@app/core/schema-utils'; -import { AttributeScope, EntityId, JsonSettingsSchema } from '@app/shared/public-api'; +import { parseFunction, parseArray, parseData } from '@core/utils'; +import { initSchema, addToSchema, mergeSchemes, addCondition, addGroupInfo } from '@core/schema-utils'; import { forkJoin } from 'rxjs'; import { WidgetContext } from '@app/modules/home/models/widget-component.models'; -import { AttributeService } from '@app/core/public-api'; import { getDefCenterPosition } from './maps-utils'; +import { JsonSettingsSchema } from '@shared/models/widget.models'; +import { EntityId } from '@shared/models/id/entity-id'; +import { AttributeScope } from '@shared/models/telemetry/telemetry.models'; +import { AttributeService } from '@core/http/attribute.service'; let providerSets; let defaultSettings; @@ -255,4 +257,4 @@ defaultSettings = { credentials: '', markerClusteringSetting: null, draggableMarker: false -} \ No newline at end of file +} diff --git a/ui-ngx/src/app/modules/home/components/widget/trip-animation/trip-animation.component.ts b/ui-ngx/src/app/modules/home/components/widget/trip-animation/trip-animation.component.ts index 07e2c2d697..21e3f87873 100644 --- a/ui-ngx/src/app/modules/home/components/widget/trip-animation/trip-animation.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/trip-animation/trip-animation.component.ts @@ -26,12 +26,13 @@ import { parseArray, parseTemplate, safeExecute } from '@app/core/utils'; import { initSchema, addToSchema, addGroupInfo } from '@app/core/schema-utils'; import { tripAnimationSchema } from '../lib/maps/schemes'; import { DomSanitizer } from '@angular/platform-browser'; -import { WidgetConfig, JsonSchema, JsonSettingsSchema } from '@app/shared/public-api'; import { WidgetContext } from '@app/modules/home/models/widget-component.models'; import { getRatio, findAngle } from '../lib/maps/maps-utils'; +import { JsonSettingsSchema, WidgetConfig } from '@shared/models/widget.models'; @Component({ + // tslint:disable-next-line:component-selector selector: 'trip-animation', templateUrl: './trip-animation.component.html', styleUrls: ['./trip-animation.component.scss'] diff --git a/ui-ngx/src/app/shared/shared.module.ts b/ui-ngx/src/app/shared/shared.module.ts index 2b714c61f7..472cd9f01a 100644 --- a/ui-ngx/src/app/shared/shared.module.ts +++ b/ui-ngx/src/app/shared/shared.module.ts @@ -128,7 +128,7 @@ import { LedLightComponent } from '@shared/components/led-light.component'; import { TbJsonToStringDirective } from '@shared/components/directives/tb-json-to-string.directive'; import { JsonObjectEditDialogComponent } from '@shared/components/dialog/json-object-edit-dialog.component'; import { HistorySelectorComponent } from './components/time/history-selector/history-selector.component'; -import { TbTemplatePipe } from './pipe/public-api'; +import { TbTemplatePipe } from '@shared/pipe/template.pipe'; @NgModule({ providers: [