From 4b0ae0e210a77a1479e00bfd96e0d78ddb721efd Mon Sep 17 00:00:00 2001 From: pykettk Date: Wed, 26 Apr 2023 01:13:10 +0100 Subject: [PATCH] Add Link to Scan Results in Admin Notification --- Model/System/Message/PackageBelowThreshold.php | 11 ++++++++--- README.md | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Model/System/Message/PackageBelowThreshold.php b/Model/System/Message/PackageBelowThreshold.php index 0576665..3c63bc9 100644 --- a/Model/System/Message/PackageBelowThreshold.php +++ b/Model/System/Message/PackageBelowThreshold.php @@ -10,16 +10,21 @@ use Element119\SansecComposerIntegrityChecker\Model\IntegrityResultsRegistry; use Magento\Framework\Notification\MessageInterface; use Magento\Framework\Phrase; +use Magento\Framework\UrlInterface; class PackageBelowThreshold implements MessageInterface { - public function __construct(private readonly IntegrityResultsRegistry $integrityResultsRegistry) {} + public function __construct( + private readonly IntegrityResultsRegistry $integrityResultsRegistry, + private readonly UrlInterface $urlBuilder + ) {} public function getText(): Phrase { return __( - 'Sansec Composer Integrity checker found %1 package(s) that did not meet the match threshold.', - count($this->integrityResultsRegistry->getFailedMatches()) + 'Sansec Composer Integrity checker found %1 package(s) that did not meet the match threshold. View scan results.', + count($this->integrityResultsRegistry->getFailedMatches()), + $this->urlBuilder->getUrl('sansec_composer_integrity_checker/index/index') ); } diff --git a/README.md b/README.md index 5e530c0..1d9dd46 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ series of email addresses that should be notified when packages fail to meet the
### Admin Notification -![admin-notification](https://user-images.githubusercontent.com/40261741/234433383-c30d133c-bcde-480f-8faa-20b1ae13a523.png) +![admin-notification](https://user-images.githubusercontent.com/40261741/234434736-0e187e19-f474-47cd-804b-7f4d150ba31b.png)