Skip to content

Commit

Permalink
chore(formly): fix hide field on extension
Browse files Browse the repository at this point in the history
Co-Authored-by: Bertrand Zuchuat <[email protected]>
  • Loading branch information
Garfield-fr committed Nov 5, 2024
1 parent e5f8d0d commit fb5112e
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions projects/rero/ng-core/src/lib/record/editor/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ export class NgCoreFormlyExtension {
protected recordService: RecordService = inject(RecordService);

// Types to apply horizontal wrapper on
private _horizontalWrapperTypes = [
'enum',
'string',
'integer',
'textarea',
'datepicker',
'multi-checkbox',
'multi-select',
'remoteAutoComplete',
'tree-select',
];
// private _horizontalWrapperTypes = [
// 'enum',
// 'string',
// 'integer',
// 'textarea',
// 'datepicker',
// 'multi-checkbox',
// 'multi-select',
// 'remoteAutoComplete',
// 'tree-select',
// ];

// Types to apply field wrapper on
private _fieldWrapperTypes = ['boolean', 'datepicker', 'passwordGenerator'];
Expand Down Expand Up @@ -106,9 +106,8 @@ export class NgCoreFormlyExtension {
if (field?.props?.editorConfig?.longMode) {
// add automatically a card wrapper for the first level fields
const { parent } = field;
if (parent && parent.props && parent.props.isRoot === true && !field.wrappers.includes('card')) {
if (parent && parent.props && parent.props.isRoot === true && !field.wrappers.includes('card') && !field.wrappers.includes('hide')) {
field.wrappers.unshift('card');
// field.wrappers.push('card');
}
// Add an horizontal wrapper for all given field types
// if (this._horizontalWrapperTypes.some((elem) => elem === field.type)) {
Expand Down

0 comments on commit fb5112e

Please sign in to comment.