From a65af3774e4e69fb5a0252e61aa1087e3e801a46 Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Thu, 2 Dec 2021 11:24:47 +0200 Subject: [PATCH] UI: Fixed incorrect disable polygon-editor in trip animation widgets --- .../widget/trip-animation/trip-animation.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 dfa630b3ad..aeadf378d2 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 @@ -49,7 +49,7 @@ import { } from '@home/components/widget/lib/maps/common-maps-utils'; import { JsonSettingsSchema, WidgetConfig } from '@shared/models/widget.models'; import moment from 'moment'; -import { isDefined, isUndefined } from '@core/utils'; +import { deepClone, isDefined, isUndefined } from '@core/utils'; import { ResizeObserver } from '@juggle/resize-observer'; import { MapWidgetInterface } from '@home/components/widget/lib/maps/map-widget.interface'; @@ -100,7 +100,7 @@ export class TripAnimationComponent implements OnInit, AfterViewInit, OnDestroy addGroupInfo(schema, 'Path Settings'); addToSchema(schema, addCondition(pointSchema, 'model.showPoints === true', ['showPoints'])); addGroupInfo(schema, 'Path Points Settings'); - const mapPolygonSchemaWithoutEdit = mapPolygonSchema; + const mapPolygonSchemaWithoutEdit = deepClone(mapPolygonSchema); delete mapPolygonSchemaWithoutEdit.schema.properties.editablePolygon; mapPolygonSchemaWithoutEdit.form.splice(mapPolygonSchemaWithoutEdit.form.indexOf('editablePolygon'), 1); addToSchema(schema, addCondition(mapPolygonSchemaWithoutEdit, 'model.showPolygon === true', ['showPolygon']));