diff --git a/package-lock.json b/package-lock.json index ab92ba23..a42e3ef6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3462,9 +3462,9 @@ } }, "node_modules/@ngx-formly/core": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/@ngx-formly/core/-/core-6.3.1.tgz", - "integrity": "sha512-7uhrXT/GGM5miXB0N7Dnl2RkgCktnl7BhK3j8LTpxs7FbXWmUtvFo9NCsHkwFAkZ/P0mIsNgp2Lke+iOelWXTg==", + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/@ngx-formly/core/-/core-6.3.3.tgz", + "integrity": "sha512-Dlbxzxrq5J9oNghwJnljtt/rvIeyfqwPQcCkLfsIc04yyztHl8M5cfkQtqqj2VjyEOqQb/XGjt0eQhAXz3xnNg==", "dependencies": { "tslib": "^2.0.0" }, @@ -3474,21 +3474,21 @@ } }, "node_modules/@ngx-formly/primeng": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/@ngx-formly/primeng/-/primeng-6.3.1.tgz", - "integrity": "sha512-zLGHGFlNJKm7+FkVSnd2TrgJlFjOGVlwg6PDQF4UmQvmRLWH6BvuiPALH+57/mByISq+KM5m912no4GiVEMVzw==", + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/@ngx-formly/primeng/-/primeng-6.3.3.tgz", + "integrity": "sha512-f30KsmzX3OorruRU9p+E9UpDWiLLw65EIvMXWtJ3SIY9HLxT6nYje9YD5Fa0BEu0o1S6zMxQQzNla3F0A30mtw==", "dependencies": { "tslib": "^2.0.0" }, "peerDependencies": { - "@ngx-formly/core": "6.3.1", + "@ngx-formly/core": "6.3.3", "primeng": ">=13.0.0" } }, "node_modules/@ngx-formly/schematics": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/@ngx-formly/schematics/-/schematics-6.3.1.tgz", - "integrity": "sha512-hmjXN2CXG+x+RJ5Eu2OTuN3Qn43s81m1MC3FoPNm41+ZKW45kFYVk6957eQUxgFAO5rFgQmEcCkbJYQadtV2bg==", + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/@ngx-formly/schematics/-/schematics-6.3.3.tgz", + "integrity": "sha512-m8QMOw+bIeuPU6HNS5wlzFAi4kzTb3HRmLzzSNK1ksLXx4+GXF8MmrwHQSS7X6L5zTrWxcK2B5oaDXXuF6f/pg==", "dev": true, "dependencies": { "@angular-devkit/core": "^13.0.3", diff --git a/package.json b/package.json index 2e48f7dd..4cd7e4bb 100644 --- a/package.json +++ b/package.json @@ -24,8 +24,8 @@ "@angular/platform-browser-dynamic": "^17.1.0", "@angular/router": "^17.1.0", "@biesbjerg/ngx-translate-extract-marker": "^1.0.0", - "@ngx-formly/core": "^6.3.0", - "@ngx-formly/primeng": "^6.3.0", + "@ngx-formly/core": ">=6.3.3", + "@ngx-formly/primeng": ">=6.3.3", "@ngx-translate/core": "^15.0.0", "@ngx-translate/http-loader": "^8.0.0", "@types/marked": "^4.0.8", @@ -57,7 +57,7 @@ "@angular/cli": "^17.1.0", "@angular/compiler-cli": "^17.1.0", "@angular/language-service": "^17.1.0", - "@ngx-formly/schematics": "^6.3.0", + "@ngx-formly/schematics": ">=6.3.3", "@types/jasmine": "^5.1.4", "@typescript-eslint/eslint-plugin": "^6.19.1", "@typescript-eslint/parser": "^6.19.1", diff --git a/projects/rero/ng-core/package.json b/projects/rero/ng-core/package.json index 86aaa6a9..3b17547d 100644 --- a/projects/rero/ng-core/package.json +++ b/projects/rero/ng-core/package.json @@ -20,8 +20,8 @@ "@angular/common": "^17.1.0", "@angular/core": "^17.1.0", "@biesbjerg/ngx-translate-extract-marker": "^1.0.0", - "@ngx-formly/primeng": "^6.2.2", - "@ngx-formly/core": "^6.2.2", + "@ngx-formly/primeng": ">=6.3.3", + "@ngx-formly/core": ">=6.3.3", "@ngx-translate/core": "^15.0.0", "crypto-js": "^4.2.0", "font-awesome": "^4.7.0", diff --git a/projects/rero/ng-core/src/lib/record/editor/extensions.ts b/projects/rero/ng-core/src/lib/record/editor/extensions.ts index 2a4276bc..977b3162 100644 --- a/projects/rero/ng-core/src/lib/record/editor/extensions.ts +++ b/projects/rero/ng-core/src/lib/record/editor/extensions.ts @@ -68,10 +68,9 @@ export class NgCoreFormlyExtension { * @param field - FormlyFieldConfig */ onPopulate(field: FormlyFieldConfig): void { - // TODO: Patch for type array - // String fields in an array parent are automatically required. - // This should not be the case, so we change them to not required. - if (field.parent?.type === 'array' && field.props.required) { + // Path of Array + // Bug issue: https://github.com/ngx-formly/ngx-formly/issues/3914 + if (field?.parent?.type === 'array' && field.type !== 'object' && field.props.required) { field.props.required = false; } this._setWrappers(field); diff --git a/projects/rero/ng-core/src/lib/record/editor/widgets/label/label.component.ts b/projects/rero/ng-core/src/lib/record/editor/widgets/label/label.component.ts index 8b7b3636..4cfecb8a 100644 --- a/projects/rero/ng-core/src/lib/record/editor/widgets/label/label.component.ts +++ b/projects/rero/ng-core/src/lib/record/editor/widgets/label/label.component.ts @@ -107,8 +107,7 @@ export class LabelComponent implements OnInit { * @returns FormlyFieldConfig[], the filtered list */ hiddenFieldGroup(fieldGroup: FormlyFieldConfig[]): FormlyFieldConfig[] { - return fieldGroup.filter(f => f.hide && f?.expressions?.hide !== null); - // return fieldGroup.filter(f => f.hide && f.hideExpression == null); + return fieldGroup.filter(f => f.hide && f?.expressions?.hide === null); } /**