Skip to content

Commit

Permalink
Update supports bulk setting name
Browse files Browse the repository at this point in the history
  • Loading branch information
louwie17 committed Dec 2, 2024
1 parent fdc7bf8 commit 4df0165
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions packages/dataviews/src/dataforms-layouts/data-form-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function doesCombinedFieldSupportBulkEdits< Item >(

return fieldDefinitions.find(
( fieldDefinition ) => fieldDefinition.id === fieldId
)?.supportsBulk;
)?.supportsBulkEditing;
} );
}

Expand Down Expand Up @@ -97,7 +97,8 @@ export function DataFormLayout< Item extends object >( {
formField,
fieldDefinitions
) ) ||
( fieldDefinition && ! fieldDefinition.supportsBulk ) )
( fieldDefinition &&
! fieldDefinition.supportsBulkEditing ) )
) {
return null;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/dataviews/src/normalize-fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ export function normalizeFields< Item >(

let supportsBulk = true;
// If custom Edit component is passed in we default to false for bulk edit support.
if ( typeof field.Edit === 'function' || field.supportsBulk ) {
supportsBulk = field.supportsBulk ?? false;
if ( typeof field.Edit === 'function' || field.supportsBulkEditing ) {
supportsBulk = field.supportsBulkEditing ?? false;
}

const render =
Expand Down
4 changes: 2 additions & 2 deletions packages/dataviews/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ export type Field< Item > = {
getValue?: ( args: { item: Item } ) => any;

/**
* Whether the action can be used as a bulk action.
* Whether the field supports bulk editing.
*/
supportsBulk?: boolean;
supportsBulkEditing?: boolean;
};

export type NormalizedField< Item > = Field< Item > & {
Expand Down

0 comments on commit 4df0165

Please sign in to comment.