Skip to content
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

API refactor module to be more independent #34

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*{.yml,.js}]
indent_size = 2
indent_style = space

[{*.yml,package.json}]
indent_size = 2

Expand Down
13 changes: 3 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,10 @@ sudo: false

language: php

php:
- 5.6
- 7.0

env:
- DB=MYSQL CORE_RELEASE=3.1

matrix:
include:
- php: 5.6
env: DB=MYSQL CORE_RELEASE=3
- php: 5.6
env: DB=MYSQL CORE_RELEASE=3.1
- php: 5.6
env: DB=PGSQL CORE_RELEASE=3.2
- php: 5.6
Expand All @@ -27,8 +18,10 @@ matrix:
env: DB=MYSQL CORE_RELEASE=3.5
- php: 5.6
env: DB=MYSQL CORE_RELEASE=3.6
allow_failures:
- php: 7.0
env: DB=MYSQL CORE_RELEASE=3.6
- php: 7.1
env: DB=MYSQL CORE_RELEASE=3.6

before_script:
- composer self-update || true
Expand Down
15 changes: 15 additions & 0 deletions _config/packagerelations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
Name: packagerelations
after: '#updatecheckerextensions'
Only:
moduleexists: silverstripe-maintenance
---
Package:
extensions:
- PackageSecurityExtension
SecurityAlert:
extensions:
- SecurityAlertExtension
SiteSummary:
extensions:
- SiteSummaryExtension
60 changes: 0 additions & 60 deletions code/jobs/CheckComposerSecurityJob.php

This file was deleted.

44 changes: 0 additions & 44 deletions code/models/ComposerSecurityVulnerability.php

This file was deleted.

102 changes: 0 additions & 102 deletions code/tasks/CheckComposerSecurityTask.php

This file was deleted.

8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
],
"require": {
"php": ">=5.6.0",
"silverstripe/framework": "^3.0",
"sensiolabs/security-checker": "^3.0",
"symbiote/silverstripe-queuedjobs": "^2.8",
"friendsofsilverstripe/silverstripe-maintenance": "^0.3"
"silverstripe/framework": "^3.2",
"sensiolabs/security-checker": "^4",
"symbiote/silverstripe-queuedjobs": "^2"
},
"replace": {
"spekulatius/silverstripe-composer-security-checker": "self.version"
},
"suggest": {
"bringyourownideas/silverstripe-maintenance": "Display advisory information via Site Summary Report",
"roave/security-advisories": "Raises a conflict on attempt to install a vulnerable module"
},
"support": {
Expand Down
8 changes: 8 additions & 0 deletions css/securityalerts.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.security-alerts__list {
margin-top: 8px;
display: none;
}

.security-alerts__toggler {
cursor: pointer;
}
33 changes: 33 additions & 0 deletions javascript/summaryalerts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
(function($) {
$.entwine('ss', function($) {
$('.package-summary__security-alerts').entwine({
IsShown: false,
toggleSecurityNotices: function() {
if (this.getIsShown()) {
this.hideSecurityNotices();
} else {
this.showSecurityNotices();
}
},
showSecurityNotices: function() {
this.getAlertList().show();
this.setIsShown(true);
},
hideSecurityNotices: function() {
this.getAlertList().hide();
this.setIsShown(false);
},
getAlertList: function() {
return this.children('.security-alerts__list');
}
});
$('.security-alerts__toggler').entwine({
onclick: function(event) {
this.parent()
.nextAll('.package-summary__security-alerts')
.toggleSecurityNotices();
event.preventDefault();
}
});
});
})(jQuery)
7 changes: 7 additions & 0 deletions lang/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
en:
PackageSecurityExtension:
BADGE_SECURITY: 'RISK: Security'
SecurityAlertSummary:
TITLE: 'Security alert'
NOTICE_ONE: 'A notice has been issued for <strong>1</strong> of your modules. Review and updating is recommended.'
NOTICE_MANY: 'Notices have been issued for <strong>{count}</strong> of your modules. Review and updating is recommended.'
10 changes: 10 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="SilverStripe">
<description>CodeSniffer ruleset for SilverStripe coding conventions.</description>

<!-- base rules are PSR-2 -->
<rule ref="PSR2" >
<!-- Current exclusions -->
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace" />
</rule>
</ruleset>
Loading