-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more display output for security alerts
Show the information in summary to users looking at the SiteSummary report on screen. This includes the ability to see a tag notifying which modules have alerts issued for them, a form level warning alerting users that some modules have alerts (as they may not display on the first page), and the ability to expand an individual module's information to display the alerts that have been issued (in a summary of title, ID number and externa link)
- Loading branch information
Dylan Wagstaff
committed
May 29, 2018
1 parent
5701642
commit 7746d57
Showing
11 changed files
with
129 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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 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 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 @@ | ||
.package-summary__security-alerts { | ||
margin-top: 8px; | ||
} | ||
|
||
.security-alerts__list { | ||
display: none; | ||
} |
This file contains 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,29 @@ | ||
(function($) { | ||
$.entwine('ss', function($) { | ||
$('.package-summary__security-alerts').entwine({ | ||
IsShown: false, | ||
onclick: function(event) { | ||
if ($(event.target).is('strong, strong>span')) { | ||
this.toggleSecurityNotices(); | ||
} | ||
}, | ||
toggleSecurityNotices: function() { | ||
if (this.getIsShown()) { | ||
this.hideSecurityNotices(); | ||
} else { | ||
this.showSecurityNotices(); | ||
} | ||
}, | ||
showSecurityNotices: function() { | ||
this.children('dl').show(); | ||
this.find('strong>span').text('Hide'); | ||
this.setIsShown(true); | ||
}, | ||
hideSecurityNotices: function() { | ||
this.children('dl').hide(); | ||
this.find('strong>span').text('Show'); | ||
this.setIsShown(false); | ||
} | ||
}); | ||
}); | ||
})(jQuery) |
This file contains 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 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 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 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 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,13 +1,11 @@ | ||
<% loop $Me %> | ||
<% if $SecurityAlerts %> | ||
<div class="message bad"> | ||
<strong>$Name</strong> | ||
<dl> | ||
<% loop $SecurityAlerts %> | ||
<dt><a href="$ExternalLink">$CVE</a></dt> | ||
<dd>$Title</dd> | ||
<% end_loop %> | ||
</dl> | ||
</div> | ||
<% end_if %> | ||
<% end_loop %> | ||
<% if $SecurityAlerts %> | ||
<div class="package-summary__security-alerts"> | ||
<strong><span>View</span> security alert info</strong> | ||
<dl class="security-alerts__list"> | ||
<% loop $SecurityAlerts %> | ||
<dt><a href="$ExternalLink">$CVE</a></dt> | ||
<dd>$Title</dd> | ||
<% end_loop %> | ||
</dl> | ||
</div> | ||
<% end_if %> |
This file contains 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,4 @@ | ||
<p> | ||
<strong>Security alert</strong><br /> | ||
<% if Count > 1 %>Notices have<% else %>A notice has<% end_if %> been issued for <strong>$Count</strong> of your modules. Review and updating is recommended. | ||
</p> |
This file contains 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