Skip to content

Commit

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

Co-Authored-by: Bertrand Zuchuat <[email protected]>
  • Loading branch information
Garfield-fr committed Jun 5, 2024
1 parent 9318476 commit c045093
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 21 deletions.
20 changes: 10 additions & 10 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.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",
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.3",
"@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.3",
"@ngx-formly/core": ">=6.3.3",
"@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 && f?.expressions?.hide === null);
}

/**
Expand Down

0 comments on commit c045093

Please sign in to comment.