Commit a3468265abcaecc97ec7a6d7df4e4be04bf32c23

Authored by Igor Kulikov
1 parent 42c52bfd

Fix UI budget

@@ -14,8 +14,7 @@ @@ -14,8 +14,7 @@
14 /// limitations under the License. 14 /// limitations under the License.
15 /// 15 ///
16 16
17 -import { JsonSchema, JsonSettingsSchema } from '@app/shared/public-api';  
18 - 17 +import { JsonSettingsSchema } from '@shared/models/widget.models';
19 18
20 export function initSchema(): JsonSettingsSchema { 19 export function initSchema(): JsonSettingsSchema {
21 return { 20 return {
@@ -63,7 +62,7 @@ export function mergeSchemes(schemes: JsonSettingsSchema[]): JsonSettingsSchema @@ -63,7 +62,7 @@ export function mergeSchemes(schemes: JsonSettingsSchema[]): JsonSettingsSchema
63 }, initSchema()); 62 }, initSchema());
64 } 63 }
65 64
66 -export function addCondition(schema: JsonSettingsSchema, condition: String): JsonSettingsSchema { 65 +export function addCondition(schema: JsonSettingsSchema, condition: string): JsonSettingsSchema {
67 schema.form = schema.form.map(element => { 66 schema.form = schema.form.map(element => {
68 if (typeof element === 'string') { 67 if (typeof element === 'string') {
69 return { 68 return {
@@ -71,7 +70,7 @@ export function addCondition(schema: JsonSettingsSchema, condition: String): Jso @@ -71,7 +70,7 @@ export function addCondition(schema: JsonSettingsSchema, condition: String): Jso
71 condition 70 condition
72 } 71 }
73 } 72 }
74 - if (typeof element == 'object') { 73 + if (typeof element === 'object') {
75 if (element.condition) { 74 if (element.condition) {
76 element.condition += ' && ' + condition 75 element.condition += ' && ' + condition
77 } 76 }
@@ -80,4 +79,4 @@ export function addCondition(schema: JsonSettingsSchema, condition: String): Jso @@ -80,4 +79,4 @@ export function addCondition(schema: JsonSettingsSchema, condition: String): Jso
80 return element; 79 return element;
81 }); 80 });
82 return schema; 81 return schema;
83 -}  
  82 +}
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 /// limitations under the License. 14 /// limitations under the License.
15 /// 15 ///
16 16
17 -import { JsonSettingsSchema } from '@app/shared/public-api'; 17 +import { JsonSettingsSchema } from '@shared/models/widget.models';
18 18
19 export interface MapWidgetInterface { 19 export interface MapWidgetInterface {
20 resize(), 20 resize(),
@@ -30,13 +30,15 @@ import { @@ -30,13 +30,15 @@ import {
30 } from './schemes'; 30 } from './schemes';
31 import { MapWidgetStaticInterface, MapWidgetInterface } from './map-widget.interface'; 31 import { MapWidgetStaticInterface, MapWidgetInterface } from './map-widget.interface';
32 import { OpenStreetMap, TencentMap, GoogleMap, HEREMap, ImageMap } from './providers'; 32 import { OpenStreetMap, TencentMap, GoogleMap, HEREMap, ImageMap } from './providers';
33 -import { parseFunction, parseArray, parseData } from '@app/core/utils';  
34 -import { initSchema, addToSchema, mergeSchemes, addCondition, addGroupInfo } from '@app/core/schema-utils';  
35 -import { AttributeScope, EntityId, JsonSettingsSchema } from '@app/shared/public-api'; 33 +import { parseFunction, parseArray, parseData } from '@core/utils';
  34 +import { initSchema, addToSchema, mergeSchemes, addCondition, addGroupInfo } from '@core/schema-utils';
36 import { forkJoin } from 'rxjs'; 35 import { forkJoin } from 'rxjs';
37 import { WidgetContext } from '@app/modules/home/models/widget-component.models'; 36 import { WidgetContext } from '@app/modules/home/models/widget-component.models';
38 -import { AttributeService } from '@app/core/public-api';  
39 import { getDefCenterPosition } from './maps-utils'; 37 import { getDefCenterPosition } from './maps-utils';
  38 +import { JsonSettingsSchema } from '@shared/models/widget.models';
  39 +import { EntityId } from '@shared/models/id/entity-id';
  40 +import { AttributeScope } from '@shared/models/telemetry/telemetry.models';
  41 +import { AttributeService } from '@core/http/attribute.service';
40 42
41 let providerSets; 43 let providerSets;
42 let defaultSettings; 44 let defaultSettings;
@@ -255,4 +257,4 @@ defaultSettings = { @@ -255,4 +257,4 @@ defaultSettings = {
255 credentials: '', 257 credentials: '',
256 markerClusteringSetting: null, 258 markerClusteringSetting: null,
257 draggableMarker: false 259 draggableMarker: false
258 -}  
  260 +}
@@ -26,12 +26,13 @@ import { parseArray, parseTemplate, safeExecute } from '@app/core/utils'; @@ -26,12 +26,13 @@ import { parseArray, parseTemplate, safeExecute } from '@app/core/utils';
26 import { initSchema, addToSchema, addGroupInfo } from '@app/core/schema-utils'; 26 import { initSchema, addToSchema, addGroupInfo } from '@app/core/schema-utils';
27 import { tripAnimationSchema } from '../lib/maps/schemes'; 27 import { tripAnimationSchema } from '../lib/maps/schemes';
28 import { DomSanitizer } from '@angular/platform-browser'; 28 import { DomSanitizer } from '@angular/platform-browser';
29 -import { WidgetConfig, JsonSchema, JsonSettingsSchema } from '@app/shared/public-api';  
30 import { WidgetContext } from '@app/modules/home/models/widget-component.models'; 29 import { WidgetContext } from '@app/modules/home/models/widget-component.models';
31 import { getRatio, findAngle } from '../lib/maps/maps-utils'; 30 import { getRatio, findAngle } from '../lib/maps/maps-utils';
  31 +import { JsonSettingsSchema, WidgetConfig } from '@shared/models/widget.models';
32 32
33 33
34 @Component({ 34 @Component({
  35 + // tslint:disable-next-line:component-selector
35 selector: 'trip-animation', 36 selector: 'trip-animation',
36 templateUrl: './trip-animation.component.html', 37 templateUrl: './trip-animation.component.html',
37 styleUrls: ['./trip-animation.component.scss'] 38 styleUrls: ['./trip-animation.component.scss']
@@ -128,7 +128,7 @@ import { LedLightComponent } from '@shared/components/led-light.component'; @@ -128,7 +128,7 @@ import { LedLightComponent } from '@shared/components/led-light.component';
128 import { TbJsonToStringDirective } from '@shared/components/directives/tb-json-to-string.directive'; 128 import { TbJsonToStringDirective } from '@shared/components/directives/tb-json-to-string.directive';
129 import { JsonObjectEditDialogComponent } from '@shared/components/dialog/json-object-edit-dialog.component'; 129 import { JsonObjectEditDialogComponent } from '@shared/components/dialog/json-object-edit-dialog.component';
130 import { HistorySelectorComponent } from './components/time/history-selector/history-selector.component'; 130 import { HistorySelectorComponent } from './components/time/history-selector/history-selector.component';
131 -import { TbTemplatePipe } from './pipe/public-api'; 131 +import { TbTemplatePipe } from '@shared/pipe/template.pipe';
132 132
133 @NgModule({ 133 @NgModule({
134 providers: [ 134 providers: [