From 5706041f468c0c445288a34c596bbdc9d87f9c34 Mon Sep 17 00:00:00 2001 From: kalutkaz Date: Mon, 18 Apr 2022 11:50:26 +0300 Subject: [PATCH] Changed validation logic for JSON editor --- .../src/app/shared/components/json-object-edit.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui-ngx/src/app/shared/components/json-object-edit.component.ts b/ui-ngx/src/app/shared/components/json-object-edit.component.ts index e7a1b97cad..35f9e1e623 100644 --- a/ui-ngx/src/app/shared/components/json-object-edit.component.ts +++ b/ui-ngx/src/app/shared/components/json-object-edit.component.ts @@ -22,7 +22,7 @@ import { ActionNotificationHide, ActionNotificationShow } from '@core/notificati import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; import { CancelAnimationFrame, RafService } from '@core/services/raf.service'; -import { guid, isDefinedAndNotNull, isLiteralObject, isUndefined } from '@core/utils'; +import { guid, isDefinedAndNotNull, isUndefined } from '@core/utils'; import { ResizeObserver } from '@juggle/resize-observer'; import { getAce } from '@shared/models/ace/ace.models'; @@ -259,7 +259,7 @@ export class JsonObjectEditComponent implements OnInit, ControlValueAccessor, Va if (this.contentValue && this.contentValue.length > 0) { try { data = JSON.parse(this.contentValue); - if (!isLiteralObject(data)) { + if (typeof data !== 'object') { throw new TypeError(`Value is not a valid JSON`); } this.objectValid = true;