Browse Source
Merge pull request #12336 from vvlladd28/bug/scada-symbol/merge-setting-array
Fixed incorrect merging of default SCADA symbol settings with user-defined settings
pull/12347/head
Igor Kulikov
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
4 additions and
3 deletions
-
ui-ngx/src/app/modules/home/components/widget/lib/scada/scada-symbol.models.ts
-
ui-ngx/src/app/modules/home/components/widget/lib/settings/common/scada/scada-symbol-object-settings.component.ts
|
|
|
@ -52,6 +52,7 @@ import { |
|
|
|
isUndefined, |
|
|
|
isUndefinedOrNull, |
|
|
|
mergeDeep, |
|
|
|
mergeDeepIgnoreArray, |
|
|
|
parseFunction |
|
|
|
} from '@core/utils'; |
|
|
|
import { BehaviorSubject, forkJoin, Observable, Observer, of, Subject } from 'rxjs'; |
|
|
|
@ -564,7 +565,7 @@ export class ScadaSymbolObject { |
|
|
|
const doc: XMLDocument = new DOMParser().parseFromString(this.svgContent, 'image/svg+xml'); |
|
|
|
this.metadata = parseScadaSymbolMetadataFromDom(doc); |
|
|
|
const defaults = defaultScadaSymbolObjectSettings(this.metadata); |
|
|
|
this.settings = mergeDeep<ScadaSymbolObjectSettings>({} as ScadaSymbolObjectSettings, |
|
|
|
this.settings = mergeDeepIgnoreArray<ScadaSymbolObjectSettings>({} as ScadaSymbolObjectSettings, |
|
|
|
defaults, this.inputSettings || {} as ScadaSymbolObjectSettings); |
|
|
|
this.prepareMetadata(); |
|
|
|
this.prepareSvgShape(doc); |
|
|
|
|
|
|
|
@ -48,7 +48,7 @@ import { |
|
|
|
} from '@home/components/widget/lib/scada/scada-symbol.models'; |
|
|
|
import { IAliasController } from '@core/api/widget-api.models'; |
|
|
|
import { TargetDevice, widgetType } from '@shared/models/widget.models'; |
|
|
|
import { isDefinedAndNotNull, mergeDeep } from '@core/utils'; |
|
|
|
import { isDefinedAndNotNull, mergeDeepIgnoreArray } from '@core/utils'; |
|
|
|
import { |
|
|
|
ScadaSymbolBehaviorGroup, |
|
|
|
ScadaSymbolPropertyRow, |
|
|
|
@ -288,7 +288,7 @@ export class ScadaSymbolObjectSettingsComponent implements OnInit, OnChanges, Co |
|
|
|
private setupValue() { |
|
|
|
if (this.metadata) { |
|
|
|
const defaults = defaultScadaSymbolObjectSettings(this.metadata); |
|
|
|
this.modelValue = mergeDeep<ScadaSymbolObjectSettings>(defaults, this.modelValue); |
|
|
|
this.modelValue = mergeDeepIgnoreArray<ScadaSymbolObjectSettings>(defaults, this.modelValue); |
|
|
|
this.scadaSymbolObjectSettingsFormGroup.patchValue( |
|
|
|
this.modelValue, {emitEvent: false} |
|
|
|
); |
|
|
|
|