Fix UI budget

This commit is contained in:
Igor Kulikov 2020-03-20 17:47:59 +02:00
parent 42c52bfdba
commit a3468265ab
5 changed files with 15 additions and 13 deletions

View File

@ -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
}

View File

@ -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(),

View File

@ -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;

View File

@ -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']

View File

@ -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: [