mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-24 10:49:00 +02:00
Allow to undo a change from event log.
This commit is contained in:
parent
15d25cf2b2
commit
5a5d7b24be
24 changed files with 659 additions and 30 deletions
|
@ -46,6 +46,7 @@ use App\DataTables\Column\IconLinkColumn;
|
|||
use App\DataTables\Column\LocaleDateTimeColumn;
|
||||
use App\DataTables\Column\LogEntryExtraColumn;
|
||||
use App\DataTables\Column\LogEntryTargetColumn;
|
||||
use App\DataTables\Column\RevertLogColumn;
|
||||
use App\Entity\Base\AbstractDBElement;
|
||||
use App\Entity\Contracts\TimeTravelInterface;
|
||||
use App\Entity\LogSystem\AbstractLogEntry;
|
||||
|
@ -218,8 +219,10 @@ class LogDataTable implements DataTableTypeInterface
|
|||
) {
|
||||
try {
|
||||
$target = $this->logRepo->getTargetElement($context);
|
||||
$str = $this->entityURLGenerator->timeTravelURL($target, $context->getTimestamp());
|
||||
return $str;
|
||||
if($target !== null) {
|
||||
$str = $this->entityURLGenerator->timeTravelURL($target, $context->getTimestamp());
|
||||
return $str;
|
||||
}
|
||||
} catch (EntityNotSupportedException $exception) {
|
||||
return null;
|
||||
}
|
||||
|
@ -228,6 +231,10 @@ class LogDataTable implements DataTableTypeInterface
|
|||
}
|
||||
]);
|
||||
|
||||
$dataTable->add('actionRevert', RevertLogColumn::class, [
|
||||
'label' => ''
|
||||
]);
|
||||
|
||||
$dataTable->addOrderBy('timestamp', DataTable::SORT_DESCENDING);
|
||||
|
||||
$dataTable->createAdapter(ORMAdapter::class, [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue