From 45a632247bef3c5d4cd423036d006f91f293b83b Mon Sep 17 00:00:00 2001 From: Alex Zorkin Date: Wed, 18 Dec 2024 11:05:04 -0800 Subject: [PATCH] fix: merge fix --- .../components/BCDataGrid/BCGridEditor.jsx | 40 ------------------- 1 file changed, 40 deletions(-) diff --git a/frontend/src/components/BCDataGrid/BCGridEditor.jsx b/frontend/src/components/BCDataGrid/BCGridEditor.jsx index 2c54f7183..03c9b4649 100644 --- a/frontend/src/components/BCDataGrid/BCGridEditor.jsx +++ b/frontend/src/components/BCDataGrid/BCGridEditor.jsx @@ -181,7 +181,6 @@ export const BCGridEditor = ({ params.event.target.dataset.action && onAction ) { -<<<<<<< HEAD const action = params.event.target.dataset.action const transaction = await onAction(action, params) @@ -194,17 +193,6 @@ export const BCGridEditor = ({ const firstNewRow = res.add[0] startEditingFirstEditableCell(firstNewRow.rowIndex) } -======= - alertRef.current.clearAlert() - const transaction = await onAction( - params.event.target.dataset.action, - params - ) - // Focus and edit the first editable column of the duplicated row - if (transaction?.add.length > 0) { - const duplicatedRowNode = transaction.add[0] - startEditingFirstEditableCell(duplicatedRowNode.rowIndex) ->>>>>>> ce726f71 (feat: clear alert on action) } } } @@ -217,7 +205,6 @@ export const BCGridEditor = ({ setAnchorEl(null) } -<<<<<<< HEAD const handleAddRowsInternal = useCallback( async (numRows) => { let newRows = [] @@ -256,33 +243,6 @@ export const BCGridEditor = ({ setAnchorEl(null) }, [onAction, startEditingFirstEditableCell] -======= - const handleAddRows = useCallback( - (numRows) => { - alertRef.current.clearAlert() - let newRows = [] - if (props.onAddRows) { - newRows = props.onAddRows(numRows) - } else { - newRows = Array(numRows) - .fill() - .map(() => ({ id: uuid() })) - } - - // Add the new rows - ref.current.api.applyTransaction({ - add: newRows, - addIndex: ref.current.api.getDisplayedRowCount() - }) - - // Focus and start editing the first new row - const firstNewRowIndex = ref.current.api.getDisplayedRowCount() - numRows - startEditingFirstEditableCell(firstNewRowIndex) - - setAnchorEl(null) - }, - [props.onAddRows, startEditingFirstEditableCell] ->>>>>>> ce726f71 (feat: clear alert on action) ) const isGridValid = () => {