-
-
Notifications
You must be signed in to change notification settings - Fork 479
Transparency log: add missing display classes #1616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
stevenrombauts
wants to merge
4
commits into
main
Choose a base branch
from
package-transfered-display
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+175
−35
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
d9e0c76
Add display classes for maintainer added/removed records
stevenrombauts ca95f51
Add display class for package transferred records
stevenrombauts 57e279d
Create a packageLink macro for audit log specifically
stevenrombauts b9a0fcf
Update templates/audit_log/display/package_transferred.html.twig
stevenrombauts File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| <?php declare(strict_types=1); | ||
|
|
||
| /* | ||
| * This file is part of Packagist. | ||
| * | ||
| * (c) Jordi Boggiano <[email protected]> | ||
| * Nils Adermann <[email protected]> | ||
| * | ||
| * For the full copyright and license information, please view the LICENSE | ||
| * file that was distributed with this source code. | ||
| */ | ||
|
|
||
| namespace App\Audit\Display; | ||
|
|
||
| use App\Audit\AuditRecordType; | ||
|
|
||
| readonly class MaintainerAddedDisplay extends AbstractAuditLogDisplay | ||
| { | ||
| public function __construct( | ||
| \DateTimeImmutable $datetime, | ||
| public string $packageName, | ||
| public ActorDisplay $maintainer, | ||
| ActorDisplay $actor, | ||
| ) { | ||
| parent::__construct($datetime, $actor); | ||
| } | ||
|
|
||
| public function getType(): AuditRecordType | ||
| { | ||
| return AuditRecordType::MaintainerAdded; | ||
| } | ||
|
|
||
| public function getTemplateName(): string | ||
| { | ||
| return 'audit_log/display/maintainer_added.html.twig'; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| <?php declare(strict_types=1); | ||
|
|
||
| /* | ||
| * This file is part of Packagist. | ||
| * | ||
| * (c) Jordi Boggiano <[email protected]> | ||
| * Nils Adermann <[email protected]> | ||
| * | ||
| * For the full copyright and license information, please view the LICENSE | ||
| * file that was distributed with this source code. | ||
| */ | ||
|
|
||
| namespace App\Audit\Display; | ||
|
|
||
| use App\Audit\AuditRecordType; | ||
|
|
||
| readonly class MaintainerRemovedDisplay extends AbstractAuditLogDisplay | ||
| { | ||
| public function __construct( | ||
| \DateTimeImmutable $datetime, | ||
| public string $packageName, | ||
| public ActorDisplay $maintainer, | ||
| ActorDisplay $actor, | ||
| ) { | ||
| parent::__construct($datetime, $actor); | ||
| } | ||
|
|
||
| public function getType(): AuditRecordType | ||
| { | ||
| return AuditRecordType::MaintainerRemoved; | ||
| } | ||
|
|
||
| public function getTemplateName(): string | ||
| { | ||
| return 'audit_log/display/maintainer_removed.html.twig'; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| <?php declare(strict_types=1); | ||
|
|
||
| /* | ||
| * This file is part of Packagist. | ||
| * | ||
| * (c) Jordi Boggiano <[email protected]> | ||
| * Nils Adermann <[email protected]> | ||
| * | ||
| * For the full copyright and license information, please view the LICENSE | ||
| * file that was distributed with this source code. | ||
| */ | ||
|
|
||
| namespace App\Audit\Display; | ||
|
|
||
| use App\Audit\AuditRecordType; | ||
|
|
||
| readonly class PackageTransferredDisplay extends AbstractAuditLogDisplay | ||
| { | ||
| /** | ||
| * @param array<ActorDisplay> $previousMaintainers | ||
| * @param array<ActorDisplay> $currentMaintainers | ||
| */ | ||
| public function __construct( | ||
| \DateTimeImmutable $datetime, | ||
| public string $packageName, | ||
| /** @var array<string> $previousMaintainers */ | ||
| public array $previousMaintainers, | ||
| /** @var array<string> $currentMaintainers */ | ||
| public array $currentMaintainers, | ||
| ActorDisplay $actor, | ||
| ) { | ||
| parent::__construct($datetime, $actor); | ||
| } | ||
|
|
||
| public function getType(): AuditRecordType | ||
| { | ||
| return AuditRecordType::PackageTransferred; | ||
| } | ||
|
|
||
| public function getTemplateName(): string | ||
| { | ||
| return 'audit_log/display/package_transferred.html.twig'; | ||
| } | ||
| } |
10 changes: 3 additions & 7 deletions
10
templates/audit_log/display/canonical_url_changed.html.twig
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,6 @@ | ||
| <strong> | ||
| {%- if display.packageName is existing_package -%} | ||
| <a href="{{ path('view_package', { 'name': display.packageName }) }}">{{ display.packageName }}</a> | ||
| {%- else -%} | ||
| {{ display.packageName }} | ||
| {%- endif -%} | ||
| </strong><br> | ||
| {% import 'audit_log/macros.html.twig' as auditLog %} | ||
|
|
||
| <strong>{{ auditLog.packageLink(display.packageName) }}</strong><br> | ||
| From: {{ display.repositoryFrom }}<br> | ||
| To: {{ display.repositoryTo }}<br> | ||
| Changed by: {{ display.actor.username }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| {% import 'audit_log/macros.html.twig' as auditLog %} | ||
|
|
||
| <strong>{{ auditLog.packageLink(display.packageName) }}</strong><br> | ||
| Maintainer: {{ display.maintainer.username }}<br> | ||
| Added by: {{ display.actor.username }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| {% import 'audit_log/macros.html.twig' as auditLog %} | ||
|
|
||
| <strong>{{ auditLog.packageLink(display.packageName) }}</strong><br> | ||
| Maintainer: {{ display.maintainer.username }}<br> | ||
| Removed by: {{ display.actor.username }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,5 @@ | ||
| <strong> | ||
| {%- if display.packageName is existing_package -%} | ||
| <a href="{{ path('view_package', { 'name': display.packageName }) }}">{{ display.packageName }}</a> | ||
| {%- else -%} | ||
| {{ display.packageName }} | ||
| {%- endif -%} | ||
| </strong><br> | ||
| {% import 'audit_log/macros.html.twig' as auditLog %} | ||
|
|
||
| <strong>{{ auditLog.packageLink(display.packageName) }}</strong><br> | ||
| Repository: {{ display.repository }}<br> | ||
| Created by: {{ display.actor.username }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,5 @@ | ||
| <strong> | ||
| {%- if display.packageName is existing_package -%} | ||
| <a href="{{ path('view_package', { 'name': display.packageName }) }}">{{ display.packageName }}</a> | ||
| {%- else -%} | ||
| {{ display.packageName }} | ||
| {%- endif -%} | ||
| </strong><br> | ||
| {% import 'audit_log/macros.html.twig' as auditLog %} | ||
|
|
||
| <strong>{{ auditLog.packageLink(display.packageName) }}</strong><br> | ||
| Repository: {{ display.repository }}<br> | ||
| Deleted by: {{ display.actor.username }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| {% import 'audit_log/macros.html.twig' as auditLog %} | ||
|
|
||
| <strong>{{ auditLog.packageLink(display.packageName) }}</strong><br> | ||
| Previous maintainers: {{ display.previousMaintainers|column('username')|join(', ') }}<br> | ||
| Current maintainers: {{ display.currentMaintainers|column('username')|join(', ') }}<br> | ||
| Transferred by: {{ display.actor.username }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,4 @@ | ||
| <strong> | ||
| {%- if display.packageName is existing_package -%} | ||
| <a href="{{ path('view_package', { 'name': display.packageName }) }}">{{ display.packageName }}</a> | ||
| {%- else -%} | ||
| {{ display.packageName }} | ||
| {%- endif -%} | ||
| </strong> {{ display.version }}<br> | ||
| {% import 'audit_log/macros.html.twig' as auditLog %} | ||
|
|
||
| <strong>{{ auditLog.packageLink(display.packageName) }}</strong> {{ display.version }}<br> | ||
| Deleted by: {{ display.actor.username }} |
10 changes: 3 additions & 7 deletions
10
templates/audit_log/display/version_reference_changed.html.twig
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| {% macro packageLink(packageName) %} | ||
stevenrombauts marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| {%- if packageName is existing_package -%} | ||
| <a href="{{ path('view_package', { 'name': packageName }) }}">{{ packageName }}</a> | ||
| {%- else -%} | ||
| {{ packageName }} | ||
| {%- endif -%} | ||
| {% endmacro %} | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.