diff --git a/ui/package-lock.json b/ui/package-lock.json index 02851a581..4595deae4 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -10182,17 +10182,18 @@ } }, "ngx-schema-form": { - "version": "2.2.0-beta.1", - "resolved": "https://registry.npmjs.org/ngx-schema-form/-/ngx-schema-form-2.2.0-beta.1.tgz", - "integrity": "sha512-tNJR/rFEU2zHAOKOl47ujqM/7y08x8slPYyozgUgKt6aJa5JATqzf2Ee0WAF0fYrJzN4diF1fpNWHYqoA3qDGg==", + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/ngx-schema-form/-/ngx-schema-form-2.3.5.tgz", + "integrity": "sha512-MAenwMUhY/Mi4OuDOzeo+l5iBScIQ5e6q4V+pRanvlGWkNXrvVaDIzEUxs6XHiYSe1s3q9qJsEJQU++WUpVjgA==", "requires": { - "tslib": "^1.9.0" + "tslib": "^1.9.0", + "z-schema": "^3.17.0" }, "dependencies": { "tslib": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", - "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", + "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==" } } }, diff --git a/ui/package.json b/ui/package.json index b293be085..ced90da0f 100644 --- a/ui/package.json +++ b/ui/package.json @@ -44,7 +44,7 @@ "file-saver": "^1.3.3", "font-awesome": "^4.7.0", "ngx-infinite-scroll": "^7.2.0", - "ngx-schema-form": "^2.2.0-beta.1", + "ngx-schema-form": "2.3.5", "rxjs": "^6.5.1", "rxjs-compat": "^6.5.1", "xml-formatter": "^1.0.1", diff --git a/ui/src/app/metadata/metadata.module.ts b/ui/src/app/metadata/metadata.module.ts index 6867ed75c..b116d3d34 100644 --- a/ui/src/app/metadata/metadata.module.ts +++ b/ui/src/app/metadata/metadata.module.ts @@ -10,8 +10,7 @@ import { MetadataRoutingModule } from './metadata.routing'; import { ProviderModule } from './provider/provider.module'; import { I18nModule } from '../i18n/i18n.module'; import { CustomWidgetRegistry } from '../schema-form/registry'; -import { WidgetRegistry, SchemaValidatorFactory } from 'ngx-schema-form'; -import { CustomSchemaValidatorFactory } from '../schema-form/service/schema-validator'; +import { WidgetRegistry } from 'ngx-schema-form'; import { MetadataConfigurationModule } from './configuration/configuration.module'; import { NavigationService } from '../core/service/navigation.service'; import { MetadataResolver } from './domain/model'; @@ -32,11 +31,7 @@ import { Router } from '@angular/router'; I18nModule ], providers: [ - { provide: WidgetRegistry, useClass: CustomWidgetRegistry }, - { - provide: SchemaValidatorFactory, - useClass: CustomSchemaValidatorFactory - } + { provide: WidgetRegistry, useClass: CustomWidgetRegistry } ], declarations: [ MetadataPageComponent diff --git a/ui/src/app/schema-form/schema-form.module.ts b/ui/src/app/schema-form/schema-form.module.ts index 13aba1369..842e903dd 100644 --- a/ui/src/app/schema-form/schema-form.module.ts +++ b/ui/src/app/schema-form/schema-form.module.ts @@ -1,5 +1,5 @@ import { NgModule } from '@angular/core'; -import { SchemaFormModule, SchemaValidatorFactory } from 'ngx-schema-form'; +import { SchemaFormModule } from 'ngx-schema-form'; import { CommonModule } from '@angular/common'; import { ReactiveFormsModule } from '@angular/forms'; @@ -23,7 +23,6 @@ import { CustomObjectWidget } from './widget/object/object.component'; import { CustomRadioComponent } from './widget/radio/radio.component'; import { InlineObjectListComponent } from './widget/array/inline-obj-list.component'; import { InlineObjectComponent } from './widget/object/inline-obj.component'; -import { CustomSchemaValidatorFactory } from './service/schema-validator'; export const COMPONENTS = [ BooleanRadioComponent, diff --git a/ui/src/app/schema-form/service/schema-validator.ts b/ui/src/app/schema-form/service/schema-validator.ts deleted file mode 100644 index 075a78ec9..000000000 --- a/ui/src/app/schema-form/service/schema-validator.ts +++ /dev/null @@ -1,19 +0,0 @@ -import * as ZSchema from 'z-schema'; -import { ZSchemaValidatorFactory } from 'ngx-schema-form'; - -export class CustomSchemaValidatorFactory extends ZSchemaValidatorFactory { - - protected zschema; - - constructor() { - super(); - this.createSchemaValidator(); - } - - private createSchemaValidator() { - this.zschema = new ZSchema({ - breakOnFirstError: false - }); - } -} - diff --git a/ui/src/app/schema-form/widget/array/array.component.ts b/ui/src/app/schema-form/widget/array/array.component.ts index 44f5a90a8..18f93566e 100644 --- a/ui/src/app/schema-form/widget/array/array.component.ts +++ b/ui/src/app/schema-form/widget/array/array.component.ts @@ -1,4 +1,4 @@ -import { Component, AfterViewInit, OnDestroy } from '@angular/core'; +import { Component, AfterViewInit } from '@angular/core'; import { ArrayWidget } from 'ngx-schema-form'; import { map } from 'rxjs/operators'; @@ -40,7 +40,7 @@ export class CustomArrayComponent extends ArrayWidget implements AfterViewInit { this.hasErrors$ = this.errors$.pipe(map(errors => !!errors.length)); } - removeItem(index: number, item: FormProperty = null): void { + removeItem(item: FormProperty = null): void { this.formProperty.properties = (this.formProperty.properties).filter(i => i !== item); this.formProperty.updateValueAndValidity(false, true); } diff --git a/ui/src/app/schema-form/widget/array/inline-obj-list.component.ts b/ui/src/app/schema-form/widget/array/inline-obj-list.component.ts index 31a15068a..0062cd0f3 100644 --- a/ui/src/app/schema-form/widget/array/inline-obj-list.component.ts +++ b/ui/src/app/schema-form/widget/array/inline-obj-list.component.ts @@ -1,6 +1,5 @@ import { Component } from '@angular/core'; -import { ObjectWidget } from 'ngx-schema-form'; import { CustomArrayComponent } from './array.component'; /* tslint:disable */ diff --git a/ui/src/app/schema-form/widget/boolean-radio/boolean-radio.component.html b/ui/src/app/schema-form/widget/boolean-radio/boolean-radio.component.html index 9574c5e75..c3c090e19 100644 --- a/ui/src/app/schema-form/widget/boolean-radio/boolean-radio.component.html +++ b/ui/src/app/schema-form/widget/boolean-radio/boolean-radio.component.html @@ -9,7 +9,7 @@
@@ -21,8 +21,10 @@
- {{ schema.description }}