Skip to content

Commit

Permalink
Add Link to Scan Results in Admin Notification
Browse files Browse the repository at this point in the history
  • Loading branch information
pykettk committed Apr 26, 2023
1 parent 5ffb26a commit 4b0ae0e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions Model/System/Message/PackageBelowThreshold.php
Original file line number Diff line number Diff line change
Expand Up @@ -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. <a href="%2">View scan results.</a>',
count($this->integrityResultsRegistry->getFailedMatches()),
$this->urlBuilder->getUrl('sansec_composer_integrity_checker/index/index')
);
}

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ series of email addresses that should be notified when packages fail to meet the
<br>

### 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)

<br>

Expand Down

0 comments on commit 4b0ae0e

Please sign in to comment.