Skip to content

Commit

Permalink
fix: merge fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Zorkin committed Dec 18, 2024
1 parent 6deb494 commit 45a6322
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions frontend/src/components/BCDataGrid/BCGridEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)
}
}
}
Expand All @@ -217,7 +205,6 @@ export const BCGridEditor = ({
setAnchorEl(null)
}

<<<<<<< HEAD
const handleAddRowsInternal = useCallback(
async (numRows) => {
let newRows = []
Expand Down Expand Up @@ -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 = () => {
Expand Down

0 comments on commit 45a6322

Please sign in to comment.