Skip to content

Commit

Permalink
restore not necessary changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gigitux committed Dec 5, 2024
1 parent 5f74b0e commit 03e934b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/dataviews/src/normalize-form-fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
*/
import type { Form } from './types';

export type NormalizedFormField = {
interface NormalizedFormField {
id: string;
layout: 'regular' | 'panel';
labelPosition: 'side' | 'top' | 'none';
};
}

export default function normalizeFormFields(
form: Form
Expand All @@ -20,10 +20,10 @@ export default function normalizeFormFields(
const labelPosition =
form.labelPosition ?? ( layout === 'regular' ? 'top' : 'side' );

return Object.entries( form.fields ?? {} ).map( ( [ id, field ] ) => {
return ( form.fields ?? [] ).map( ( field ) => {
if ( typeof field === 'string' ) {
return {
id,
id: field,
layout,
labelPosition,
};
Expand All @@ -35,7 +35,6 @@ export default function normalizeFormFields(
( fieldLayout === 'regular' ? 'top' : 'side' );
return {
...field,
id,
layout: fieldLayout,
labelPosition: fieldLabelPosition,
};
Expand Down

0 comments on commit 03e934b

Please sign in to comment.