FIX Update Requirements references to new build paths

This commit is contained in:
Raissa North 2018-01-29 11:50:39 +13:00
parent 7ef456a1e6
commit bf13d522a3
6 changed files with 12 additions and 12 deletions

View File

@ -21,7 +21,10 @@
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "3.0.x-dev" "dev-master": "3.0.x-dev"
} },
"expose": [
"client/dist"
]
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {

View File

@ -159,7 +159,7 @@ class GridFieldAddByDBField implements GridField_ActionProvider, GridField_HTMLP
*/ */
public function getHTMLFragments($gridField) public function getHTMLFragments($gridField)
{ {
Requirements::javascript(ModuleLoader::getModule('silverstripe/blog')->getRelativeResourcePath('js/gridfieldaddbydbfield.js')); Requirements::javascript('silverstripe/blog:client/dist/js/main.bundle.js');
/** /**
* @var DataList $dataList * @var DataList $dataList

View File

@ -21,7 +21,7 @@ class GridFieldBlogPostState extends GridFieldSiteTreeState
public function getColumnContent($gridField, $record, $columnName) public function getColumnContent($gridField, $record, $columnName)
{ {
if ($columnName == 'State') { if ($columnName == 'State') {
Requirements::css('silverstripe/blog:css/cms.css'); Requirements::css('silverstripe/blog:client/dist/styles/main.css');
if ($record instanceof BlogPost) { if ($record instanceof BlogPost) {
$modifiedLabel = ''; $modifiedLabel = '';

View File

@ -189,9 +189,8 @@ class Blog extends Page implements PermissionProvider
*/ */
protected function addCMSRequirements() protected function addCMSRequirements()
{ {
$module = ModuleLoader::getModule('silverstripe/blog'); Requirements::css('silverstripe/blog:client/dist/styles/main.css');
Requirements::css($module->getRelativeResourcePath('css/cms.css')); Requirements::javascript('silverstripe/blog:client/dist/js/main.bundle.js');
Requirements::javascript($module->getRelativeResourcePath('js/cms.js'));
} }
/** /**
* {@inheritdoc} * {@inheritdoc}

View File

@ -113,9 +113,8 @@ class BlogMemberExtension extends DataExtension
$fields->removeFieldFromTab('Root', 'BlogPosts'); $fields->removeFieldFromTab('Root', 'BlogPosts');
// Construct a better posts tab. // Construct a better posts tab.
$module = ModuleLoader::getModule('silverstripe/blog'); Requirements::css('silverstripe/blog:client/dist/styles/main.css');
Requirements::css($module->getRelativeResourcePath('css/cms.css')); Requirements::javascript('silverstripe/blog:client/dist/js/main.bundle.js');
Requirements::javascript($module->getRelativeResourcePath('js/cms.js'));
$tab = Tab::create('BlogPosts', _t(__CLASS__ . '.TABBLOGPOSTS', 'Blog Posts')); $tab = Tab::create('BlogPosts', _t(__CLASS__ . '.TABBLOGPOSTS', 'Blog Posts'));

View File

@ -211,9 +211,8 @@ class BlogPost extends Page
*/ */
public function getCMSFields() public function getCMSFields()
{ {
$module = ModuleLoader::getModule('silverstripe/blog'); Requirements::css('silverstripe/blog:client/dist/styles/main.css');
Requirements::css($module->getRelativeResourcePath('css/cms.css')); Requirements::javascript('silverstripe/blog:client/dist/js/main.bundle.js');
Requirements::javascript($module->getRelativeResourcePath('js/cms.js'));
$this->beforeUpdateCMSFields(function ($fields) { $this->beforeUpdateCMSFields(function ($fields) {
$uploadField = UploadField::create('FeaturedImage', _t(__CLASS__ . '.FeaturedImage', 'Featured Image')); $uploadField = UploadField::create('FeaturedImage', _t(__CLASS__ . '.FeaturedImage', 'Featured Image'));