CSV import, also from file, and more UX improvements
This commit is contained in:
@@ -188,16 +188,19 @@ class Changeset
|
||||
$row->_orig = [];
|
||||
}
|
||||
|
||||
if ($decorate) {
|
||||
$row->_orig = array_diff((array)$row, []);
|
||||
// remove junk
|
||||
unset($row->_orig['_id']);
|
||||
unset($row->_orig['_new']);
|
||||
unset($row->_orig['_remove']);
|
||||
unset($row->_orig['_changed']);
|
||||
unset($row->_orig['_orig']);
|
||||
}
|
||||
|
||||
if ($this->isNewRow($row->_id)) {
|
||||
if ($decorate) {
|
||||
$row->_new = true;
|
||||
$row->_orig = array_diff((array)$row, []);
|
||||
// remove junk
|
||||
unset($row->_orig['_id']);
|
||||
unset($row->_orig['_new']);
|
||||
unset($row->_orig['_remove']);
|
||||
unset($row->_orig['_changed']);
|
||||
unset($row->_orig['_orig']);
|
||||
}
|
||||
return $row;
|
||||
}
|
||||
@@ -235,6 +238,16 @@ class Changeset
|
||||
|
||||
unset($row->_row_pivot);
|
||||
|
||||
if ($decorate) {
|
||||
$row->_loadvals = array_diff((array)$row, []);
|
||||
// remove junk
|
||||
unset($row->_loadvals['_id']);
|
||||
unset($row->_loadvals['_new']);
|
||||
unset($row->_loadvals['_remove']);
|
||||
unset($row->_loadvals['_changed']);
|
||||
unset($row->_loadvals['_orig']);
|
||||
}
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
||||
@@ -582,6 +595,7 @@ class Changeset
|
||||
'type' => "string",
|
||||
'title' => "Column {$num}",
|
||||
'id' => $cid,
|
||||
'_new' => true,
|
||||
];
|
||||
|
||||
$this->newColumns[$cid] = $col;
|
||||
|
||||
Reference in New Issue
Block a user