mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 17:05:39 +02:00
Update composer constraint, branch alias, namespace and add editorconfig
This commit is contained in:
parent
59f44984b8
commit
3cacb43934
26
.editorconfig
Normal file
26
.editorconfig
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# For more information about the properties used in
|
||||||
|
# this file, please see the EditorConfig documentation:
|
||||||
|
# http://editorconfig.org/
|
||||||
|
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
indent_size = 4
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
|
||||||
|
[*.yml]
|
||||||
|
indent_size = 2
|
||||||
|
indent_style = space
|
||||||
|
|
||||||
|
[{.travis.yml,package.json}]
|
||||||
|
# The indent size used in the `package.json` file cannot be changed
|
||||||
|
# https://github.com/npm/npm/pull/3180#issuecomment-16336516
|
||||||
|
indent_size = 2
|
||||||
|
indent_style = space
|
@ -19,12 +19,12 @@
|
|||||||
"issues": "http://github.com/silverstripe-australia/silverstripe-gridfieldextensions/issues"
|
"issues": "http://github.com/silverstripe-australia/silverstripe-gridfieldextensions/issues"
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"silverstripe/framework": "4.0.0-alpha3 as 3.4.1"
|
"silverstripe/framework": "~4.0"
|
||||||
},
|
},
|
||||||
"extra": {
|
"extra": {
|
||||||
"installer-name": "gridfieldextensions",
|
"installer-name": "gridfieldextensions",
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "1.4.x-dev"
|
"dev-master": "2.0.x-dev"
|
||||||
},
|
},
|
||||||
"screenshots": [
|
"screenshots": [
|
||||||
"docs/en/_images/editable-rows.png",
|
"docs/en/_images/editable-rows.png",
|
||||||
@ -35,7 +35,9 @@
|
|||||||
"ajshort/silverstripe-gridfieldextensions": "self.version"
|
"ajshort/silverstripe-gridfieldextensions": "self.version"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {"SilverStripe\\Forms\\GridField\\": "code/"}
|
"psr-4": {
|
||||||
|
"SilverStripe\\GridFieldExtensions\\": "src/"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"prefer-stable": true,
|
"prefer-stable": true,
|
||||||
"minimum-stability": "dev"
|
"minimum-stability": "dev"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace SilverStripe\Forms\GridField;
|
namespace SilverStripe\GridFieldExtensions;
|
||||||
|
|
||||||
use SilverStripe\Forms\GridField\GridField_HTMLProvider;
|
use SilverStripe\Forms\GridField\GridField_HTMLProvider;
|
||||||
use SilverStripe\Forms\GridField\GridField_URLHandler;
|
use SilverStripe\Forms\GridField\GridField_URLHandler;
|
||||||
@ -11,9 +11,7 @@ use SilverStripe\View\ArrayData;
|
|||||||
* A modal search dialog which uses search context to search for and add
|
* A modal search dialog which uses search context to search for and add
|
||||||
* existing records to a grid field.
|
* existing records to a grid field.
|
||||||
*/
|
*/
|
||||||
class GridFieldAddExistingSearchButton implements
|
class GridFieldAddExistingSearchButton implements GridField_HTMLProvider, GridField_URLHandler {
|
||||||
GridField_HTMLProvider,
|
|
||||||
GridField_URLHandler {
|
|
||||||
|
|
||||||
private static $allowed_actions = array(
|
private static $allowed_actions = array(
|
||||||
'handleSearch'
|
'handleSearch'
|
||||||
@ -90,7 +88,7 @@ class GridFieldAddExistingSearchButton implements
|
|||||||
));
|
));
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
$this->fragment => $data->renderWith('GridFieldAddExistingSearchButton'),
|
$this->fragment => $data->renderWith('SilverStripe\\GridFieldExtensions\\GridFieldAddExistingSearchButton'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace SilverStripe\Forms\GridField;
|
namespace SilverStripe\GridFieldExtensions;
|
||||||
|
|
||||||
use SilverStripe\Control\Controller;
|
use SilverStripe\Control\Controller;
|
||||||
use SilverStripe\Control\RequestHandler;
|
use SilverStripe\Control\RequestHandler;
|
||||||
@ -46,7 +46,7 @@ class GridFieldAddExistingSearchHandler extends RequestHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function index() {
|
public function index() {
|
||||||
return $this->renderWith('GridFieldAddExistingSearchHandler');
|
return $this->renderWith('SilverStripe\\GridFieldExtensions\\GridFieldAddExistingSearchHandler');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function add($request) {
|
public function add($request) {
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace SilverStripe\Forms\GridField;
|
namespace SilverStripe\GridFieldExtensions;
|
||||||
|
|
||||||
use SilverStripe\Core\Convert;
|
use SilverStripe\Core\Convert;
|
||||||
use SilverStripe\Core\Object;
|
use SilverStripe\Core\Object;
|
||||||
@ -139,7 +139,7 @@ class GridFieldAddNewInlineButton implements GridField_HTMLProvider, GridField_S
|
|||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $columns->renderWith('GridFieldAddNewInlineRow');
|
return $columns->renderWith('SilverStripe\\GridFieldExtensions\\GridFieldAddNewInlineRow');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleSave(GridField $grid, DataObjectInterface $record) {
|
public function handleSave(GridField $grid, DataObjectInterface $record) {
|
||||||
@ -152,9 +152,9 @@ class GridFieldAddNewInlineButton implements GridField_HTMLProvider, GridField_S
|
|||||||
|
|
||||||
$class = $grid->getModelClass();
|
$class = $grid->getModelClass();
|
||||||
/** @var GridFieldEditableColumns $editable */
|
/** @var GridFieldEditableColumns $editable */
|
||||||
$editable = $grid->getConfig()->getComponentByType('GridFieldEditableColumns');
|
$editable = $grid->getConfig()->getComponentByType('SilverStripe\\GridFieldExtensions\\GridFieldEditableColumns');
|
||||||
/** @var GridFieldOrderableRows $sortable */
|
/** @var GridFieldOrderableRows $sortable */
|
||||||
$sortable = $grid->getConfig()->getComponentByType('GridFieldOrderableRows');
|
$sortable = $grid->getConfig()->getComponentByType('SilverStripe\\GridFieldExtensions\\GridFieldOrderableRows');
|
||||||
$form = $editable->getForm($grid, $record);
|
$form = $editable->getForm($grid, $record);
|
||||||
|
|
||||||
if(!singleton($class)->canCreate()) {
|
if(!singleton($class)->canCreate()) {
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace SilverStripe\Forms\GridField;
|
namespace SilverStripe\GridFieldExtensions;
|
||||||
|
|
||||||
use SilverStripe\Control\Controller;
|
use SilverStripe\Control\Controller;
|
||||||
use SilverStripe\Control\HTTPResponse_Exception;
|
use SilverStripe\Control\HTTPResponse_Exception;
|
||||||
@ -204,7 +204,7 @@ class GridFieldAddNewMultiClass implements GridField_HTMLProvider, GridField_URL
|
|||||||
GridFieldExtensions::include_requirements();
|
GridFieldExtensions::include_requirements();
|
||||||
|
|
||||||
$field = new DropdownField(sprintf('%s[ClassName]', __CLASS__), '', $classes, $this->defaultClass);
|
$field = new DropdownField(sprintf('%s[ClassName]', __CLASS__), '', $classes, $this->defaultClass);
|
||||||
if (Config::inst()->get('GridFieldAddNewMultiClass', 'showEmptyString')) {
|
if (Config::inst()->get(__CLASS__, 'showEmptyString')) {
|
||||||
$field->setEmptyString(_t('GridFieldExtensions.SELECTTYPETOCREATE', '(Select type to create)'));
|
$field->setEmptyString(_t('GridFieldExtensions.SELECTTYPETOCREATE', '(Select type to create)'));
|
||||||
}
|
}
|
||||||
$field->addExtraClass('no-change-track');
|
$field->addExtraClass('no-change-track');
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace SilverStripe\Forms\GridField;
|
namespace SilverStripe\GridFieldExtensions;
|
||||||
|
|
||||||
use SilverStripe\Control\Controller;
|
use SilverStripe\Control\Controller;
|
||||||
use SilverStripe\Forms\GridField\GridFieldDetailForm_ItemRequest;
|
use SilverStripe\Forms\GridField\GridFieldDetailForm_ItemRequest;
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace SilverStripe\Forms\GridField;
|
namespace SilverStripe\GridFieldExtensions;
|
||||||
|
|
||||||
use SilverStripe\Control\Controller;
|
use SilverStripe\Control\Controller;
|
||||||
use SilverStripe\Control\HTTPResponse_Exception;
|
use SilverStripe\Control\HTTPResponse_Exception;
|
||||||
@ -111,7 +111,7 @@ class GridFieldEditableColumns extends GridFieldDataColumns implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** @var GridFieldOrderableRows $sortable */
|
/** @var GridFieldOrderableRows $sortable */
|
||||||
$sortable = $grid->getConfig()->getComponentByType('GridFieldOrderableRows');
|
$sortable = $grid->getConfig()->getComponentByType('SilverStripe\\GridFieldExtensions\\GridFieldOrderableRows');
|
||||||
|
|
||||||
$form = $this->getForm($grid, $record);
|
$form = $this->getForm($grid, $record);
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace SilverStripe\Forms\GridField;
|
namespace SilverStripe\GridFieldExtensions;
|
||||||
|
|
||||||
use SilverStripe\View\Requirements;
|
use SilverStripe\View\Requirements;
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace SilverStripe\Forms\GridField;
|
namespace SilverStripe\GridFieldExtensions;
|
||||||
|
|
||||||
use SilverStripe\Forms\GridField\GridFieldDataColumns;
|
use SilverStripe\Forms\GridField\GridFieldDataColumns;
|
||||||
use SilverStripe\View\ArrayData;
|
use SilverStripe\View\ArrayData;
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace SilverStripe\Forms\GridField;
|
namespace SilverStripe\GridFieldExtensions;
|
||||||
|
|
||||||
use SilverStripe\Control\Controller;
|
use SilverStripe\Control\Controller;
|
||||||
use SilverStripe\Control\RequestHandler;
|
use SilverStripe\Control\RequestHandler;
|
||||||
@ -233,7 +233,7 @@ class GridFieldOrderableRows extends RequestHandler implements
|
|||||||
|
|
||||||
return ViewableData::create()->customise(array(
|
return ViewableData::create()->customise(array(
|
||||||
'SortField' => $sortField
|
'SortField' => $sortField
|
||||||
))->renderWith('GridFieldOrderableRowsDragHandle');
|
))->renderWith('SilverStripe\\GridFieldExtensions\\GridFieldOrderableRowsDragHandle');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getColumnAttributes($grid, $record, $col) {
|
public function getColumnAttributes($grid, $record, $col) {
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace SilverStripe\Forms\GridField;
|
namespace SilverStripe\GridFieldExtensions;
|
||||||
|
|
||||||
use SilverStripe\Admin\LeftAndMain;
|
use SilverStripe\Admin\LeftAndMain;
|
||||||
use SilverStripe\Control\Controller;
|
use SilverStripe\Control\Controller;
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace SilverStripe\Forms\GridField;
|
namespace SilverStripe\GridFieldExtensions;
|
||||||
|
|
||||||
use SilverStripe\Forms\GridField\GridField_HTMLProvider;
|
use SilverStripe\Forms\GridField\GridField_HTMLProvider;
|
||||||
use SilverStripe\ORM\ArrayList;
|
use SilverStripe\ORM\ArrayList;
|
||||||
@ -24,7 +24,7 @@ class GridFieldTitleHeader implements GridField_HTMLProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'header' => $cols->renderWith('GridFieldTitleHeader'),
|
'header' => $cols->renderWith(__CLASS__)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
use SilverStripe\Dev\SapphireTest;
|
use SilverStripe\Dev\SapphireTest;
|
||||||
use SilverStripe\Dev\TestOnly;
|
use SilverStripe\Dev\TestOnly;
|
||||||
use SilverStripe\Forms\GridField\GridField;
|
use SilverStripe\GridFieldExtensions\GridField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for {@link GridFieldAddNewMultiClass}.
|
* Tests for {@link GridFieldAddNewMultiClass}.
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
use SilverStripe\Dev\SapphireTest;
|
use SilverStripe\Dev\SapphireTest;
|
||||||
use SilverStripe\Dev\TestOnly;
|
use SilverStripe\Dev\TestOnly;
|
||||||
use SilverStripe\Forms\GridField\GridField;
|
use SilverStripe\GridFieldExtensions\GridField;
|
||||||
use SilverStripe\Forms\GridField\GridFieldConfig_RelationEditor;
|
use SilverStripe\GridFieldExtensions\GridFieldConfig_RelationEditor;
|
||||||
use SilverStripe\ORM\DataObject;
|
use SilverStripe\ORM\DataObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user