Skip to content

Commit

Permalink
chore: update ngx-formly to the version 6.3.2
Browse files Browse the repository at this point in the history
* Updates ngx-formly to the version 6.3.2.
* Removes patch for required field.
* Fixes hidden fields in label component.

Co-Authored-by: Johnny Mariéthoz <[email protected]>
Co-Authored-by: Bertrand Zuchuat <[email protected]>
  • Loading branch information
Garfield-fr and jma committed Jun 6, 2024
1 parent 9318476 commit 68c8ca8
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 24 deletions.
26 changes: 13 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.2",
"@ngx-formly/primeng": "6.3.2",
"@ngx-translate/core": "^15.0.0",
"@ngx-translate/http-loader": "^8.0.0",
"@types/marked": "^4.0.8",
Expand Down Expand Up @@ -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.2",
"@types/jasmine": "^5.1.4",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
Expand Down
4 changes: 2 additions & 2 deletions projects/rero/ng-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.2",
"@ngx-formly/core": "6.3.2",
"@ngx-translate/core": "^15.0.0",
"crypto-js": "^4.2.0",
"font-awesome": "^4.7.0",
Expand Down
7 changes: 3 additions & 4 deletions projects/rero/ng-core/src/lib/record/editor/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 && !('hide' in f?.expressions));
}

/**
Expand Down

0 comments on commit 68c8ca8

Please sign in to comment.