Merge pull request '[AURORA-894] - фикс удаления строк' (#51) from AURORA-894 into test
Reviewed-on: #51 Reviewed-by: PotapovaA <potapovaanna113@mail.ru>
This commit is contained in:
commit
95f9e1a0d9
@ -1,3 +1,5 @@
|
||||
import { getDataRowId } from "./rowUtils";
|
||||
|
||||
export function setNewValueToData(data, colId, rowId, value) {
|
||||
let targetObject = data;
|
||||
if (rowId && rowId.length) {
|
||||
@ -167,8 +169,9 @@ export function deleteRow(data, lineId) {
|
||||
function findAndDelete(rows) {
|
||||
for (let i = 0; i < rows.length; i++) {
|
||||
const row = rows[i];
|
||||
const rowId = getDataRowId(row.data);
|
||||
|
||||
if (row.data.line_id == lineId) {
|
||||
if (rowId == lineId) {
|
||||
rowDeleteSortOrder = row.sort_order;
|
||||
rows.splice(i, 1);
|
||||
i--;
|
||||
@ -179,7 +182,7 @@ export function deleteRow(data, lineId) {
|
||||
}
|
||||
|
||||
if (row.subRows && Array.isArray(row.subRows) && row.subRows.length > 0) {
|
||||
const found = findAndDelete(row.subRows);
|
||||
findAndDelete(row.subRows);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
export function getDataRowId(data) {
|
||||
return data?.id || data?.line_id;
|
||||
}
|
||||
|
||||
export function getRowId(row) {
|
||||
return row.original.data.id || row.original.data.line_id;
|
||||
return getDataRowId(row.original.data);
|
||||
}
|
||||
|
||||
export function isVspRow(row) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user