File tree Expand file tree Collapse file tree 4 files changed +52
-0
lines changed
templates/audit_log/display Expand file tree Collapse file tree 4 files changed +52
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,12 @@ public function buildSingle(AuditRecord $record): AuditLogDisplayInterface
5353 $ record ->attributes ['repository_to ' ],
5454 $ this ->buildActor ($ record ->attributes ['actor ' ]),
5555 ),
56+ AuditRecordType::VersionCreated => new VersionCreatedDisplay (
57+ $ record ->datetime ,
58+ $ record ->attributes ['name ' ],
59+ $ record ->attributes ['version ' ],
60+ $ this ->buildActor ($ record ->attributes ['actor ' ]),
61+ ),
5662 AuditRecordType::VersionDeleted => new VersionDeletedDisplay (
5763 $ record ->datetime ,
5864 $ record ->attributes ['name ' ],
Original file line number Diff line number Diff line change 1+ <?php declare (strict_types=1 );
2+
3+ /*
4+ * This file is part of Packagist.
5+ *
6+ * (c) Jordi Boggiano <j.boggiano@seld.be>
7+ * Nils Adermann <naderman@naderman.de>
8+ *
9+ * For the full copyright and license information, please view the LICENSE
10+ * file that was distributed with this source code.
11+ */
12+
13+ namespace App \Audit \Display ;
14+
15+ use App \Audit \AuditRecordType ;
16+
17+ readonly class VersionCreatedDisplay extends AbstractAuditLogDisplay
18+ {
19+ public function __construct (
20+ \DateTimeImmutable $ datetime ,
21+ public string $ packageName ,
22+ public string $ version ,
23+ ActorDisplay $ actor ,
24+ ) {
25+ parent ::__construct ($ datetime , $ actor );
26+ }
27+
28+ public function getType (): AuditRecordType
29+ {
30+ return AuditRecordType::VersionCreated;
31+ }
32+
33+ public function getTemplateName (): string
34+ {
35+ return 'audit_log/display/version_created.html.twig ' ;
36+ }
37+ }
Original file line number Diff line number Diff line change 1+ <strong >
2+ {%- if display .packageName is existing_package -%}
3+ <a href =" {{ path(' view_package' , { ' name' : display .packageName }) }}" >{{ display .packageName }}</a >
4+ {%- else -%}
5+ {{ display .packageName }}
6+ {%- endif -%}
7+ </strong > {{ display .version }}<br >
8+ Created by: {{ display .actor .username }}
Original file line number Diff line number Diff line change @@ -190,5 +190,6 @@ audit_log:
190190 user_created : User created
191191 user_deleted : User deleted
192192 username_changed : Username changed
193+ version_created : Version created
193194 version_deleted : Version deleted
194195 version_reference_changed : Version reference changed
You can’t perform that action at this time.
0 commit comments