BETA version update log
v2.0.11-beta
Release date 2020/12/06
To upgrade, step-by-step execute the following command
composer remove dcat/laravel-admin
composer require dcat/laravel-admin: "2.0.11-beta"
php artisan admin:publish --assets --force
php artisan admin:publish --migrations --force # table structure changes
php artisan migrate
Bug fixes
- fix
Dcat.initlistener failure due to repeated page refreshes usingpjax - fix
admin:export-seed --userswhich generates redundant code - repair the problem of abnormal jumping after saving the form editing page
- repair the problem that
hasManywill add data repeatedly if you choose to continue editing on the form page - fix the problem that the original
select2 configis lost after linkingselectforms #779 - fix
mapform loading exception problem #764 - fix the problem that the page cannot be refreshed automatically after the data is deleted by the batch delete function
- fix the problem that
hasManyform editing page cannot displayrowandcolumnlayouts properly - fix the problem that
Dcat.initlistener will be unbound by asynchronous pop-up window - fix a bug that the table toolbar dropdown menu is blocked by the fixed list pane #728
- fix a problem where cached content is still read when
showColumnSelectoris disabled
Functional improvements
1. Add title parameter to Form::divider.
Add title parameter to display the title in the middle of the divider, usage
$form->divider('title');
2. Grid::footer and Grid::header adjusted to support multiple callbacks
$grid->header(...) ;
$grid->header(...) ;
$grid->header(...) ;
3. Optimize form specification filters and select form styles
v2.0.10-beta
Posted on 2020/11/29
To upgrade the method, execute the following step-by-step commands
composer remove dcat/laravel-admin
composer require dcat/laravel-admin:"2.0.10-beta"
php artisan admin:publish --assets --force
php artisan admin:publish --migrations --force # Table structure changed.
php artisan migrate
Functional improvements
1. Add a prompt window in the upper right corner of the form to display field validation error messages.
This feature is enabled by default and can be disabled by the validationErrorToastr method.
$form->validationErrorToastr(false);
2.Add Tree::maxDepth method to limit the maximum level of the model tree .
$tree->maxDepth(5);
3. Optimize the export function, support title settings associated with the relational fields and automatically read the title of the grid column .
In the current version, exported columns are the same as column columns by default, so you no longer need to set the exported column name and translation manually, and the associated relational fields are supported.
$grid->column('id');
$grid->column('name');
...
// Default is the same as the column above
$grid->export();
4. Add a resetButton and submitButton method to the tool form.
// Disable the Reset and Submit buttons
$form->resetButton(false);
$form->submitButton(false);
5. Add parameters to the disable and readOnly methods of the form fields to control whether they are enabled or not.
// pass false to disable
$form->text(...)->disable(false);
6. Adding withDeleteData to file uploads allows users to set request parameters and add primary key fields to the upload and delete interfaces.
The withDeleteData method allows you to pass custom parameters to the file delete interface.
$form->file(...)->withDeleteData(['key' => 'value]);
7. Add embeds form to disable display of titles.
The second parameter, passed as false, does not display the title.
$form->embeds('field', false, function ($form) {
...
});
8. Rewrite some of the unit test cases to support 2.x usage.
Bug fixes
- fix the problem that existing permissions cannot be selected on admin detail page.
- fix the problem of
admin:export-seedcommand exportingseederclass name exception. - fix the form deletion jump exception
- fix the problem of form jumping exception when continuing to edit.
- fix the problem that parent table fields cannot be saved when parent table and
hasManyhave the same field name. - fix the problem that the style of selected submenu is abnormal in dark mode #712
- fix the problem that form dynamic display function is invalid under form
blocklayout #723 - optimize the display of
selectOptionshierarchy and solve the problem of prefix rendering increasing with the hierarchy depth index #618 - fix the problem that
admin_viewdoes not return data. - fix the problem that links set by
selectform,ajaxandloadcannot take parameters #745 - fix the problem that the
handlemethod of the table row operationactioncan only getidof the last row of data. - fix the problem that
listform edit page cannot delete existing data #759 - Fix the error in the
embedsscope form'snameattribute.
v2.0.9-beta
Posted on 2020/11/18
To upgrade the method, execute the following step-by-step commands
composer remove dcat/laravel-admin
composer require dcat/laravel-admin:"2.0.9-beta"
php artisan admin:publish --assets --force
php artisan admin:publish --migrations --force # 表结构有变动
php artisan migrate
Bug Fix.
- fix the function failure of form
filter::selectform remote load/load/ajaxetc. - fix the front-end
moment-timezonecomponent path loading error #701 - fix the problem of not being able to set permissions due to
Form::treenot being able to save data. - fix the problem of filling default value exception when the
hasManyform has the same field name as the parent table. - repair the problem of adding new page report when form
tablayout is nested withrowlayout #648 - fix the problem of not being able to get all the values under
rangeafter submission when the form hasrangetype field. - fix the problem that select2 component is invalid when
Form::selectuses form linkage.
v2.0.8-beta
Posted on 2020/11/16
To upgrade the method, execute the following command step by step
composer remove dcat/laravel-admin
composer require dcat/laravel-admin:"2.0.8-beta"
php artisan admin:publish --assets --force
php artisan admin:publish --migrations --force # Table structure changed
php artisan migrate
As a supplement to 2.0.7-beta, the following issues are fixed in this release
- fix the problem of not being able to view permissions on the admin page
- fix the problem of form block layout failure
- fix the problem of abnormal initialization of file upload form.
- fix the problem that some form fields don't support rendering multiple fields on a single page at the same time.
v2.0.7-beta
Posted on 2020/11/15
To upgrade the method, execute the following command step by step
composer remove dcat/laravel-admin
composer require dcat/laravel-admin:"2.0.7-beta"
php artisan admin:publish --assets --force
php artisan admin:publish --migrations --force # Changes in table structure
php artisan migrate
Functional improvements
- Introduce the jquery.initialize component to listen to dynamically generated page elements and set a callback, the following is a simple example to demonstrate usage.
In older versions, if an element is dynamically generated by JS, and we need to bind a click event to that element, then we usually do this
<div class="selector">test</div>
<script>
Dcat.ready(function () {
// You need to be off first and then on, otherwise page refresh will cause double bind problem.
$(document).off('click', '.selector').on('click', '.selector', function () {
...
})
});
</script>
The above approach is troublesome, you need to off and then on; secondly, you can not do some special treatment for dynamically generated elements, for example, if you want to change the background color after .selector is generated, there is no way to do this.
In this version we can use the Dcat.init method to listen to the dynamically generated elements.
<div class="selector">test</div>
<script>
Dcat.ready(function () {
// $this is the jquery dom object of the current element.
// id is the id attribute of the current element, if the current element has no id, a random id will be generated automatically.
Dcat.init('.selector', function ($this, id) {
// Change the background color of the element.
$this.css({background: "#fff"});
// There's no need for off and then on again, because the anonymous function will only be executed once!
$this.on('click', function () {
...
});
});
});
</script>
Thanks to the introduction of the jquery.initialize component, in the current version we have optimized the front-end code of the form component to support the dynamically generated form type HasMany more easily. Significantly reduces the complexity of the code.
2.Form::hasMany and Form::array forms support column and row layout
If there are more fields, you can use column and row layout to save space.
$form->array('field', function (NestedForm $form) {
$form->column(6, function (NestedForm $form) {
$form->text('...');
...
});
$form->column(6, function (NestedForm $form) {
...
});
});
3.Routes configured with the admin.auth.except parameter do not require authentication privileges #673
- Add when method to Form, Grid and Show field classes
Usage examples, similar to Laravel QueryBuilders when method
in the table
// Closing code will be executed when the first parameter is true.
$grid->column('title')->when(true, function (Grid\Column $column, $value) {
$column->label();
});
form (document)
// Closing code will be executed when the first parameter is true.
$form->text('email')->when(true, function (Form\Field\Text $text, $value) {
$text->type('email');
});
- Administrator model add canSeeMenu method to control whether the menu is visible or not.
<?php
namespace App\Models;
use Dcat\Admin\Models\Administrator as Model;
class Administrator extends Model
{
/**
* :: Control whether the menu is visible or not, return true by default
*
* @param array|\Illuminate\Database\Eloquent\Model $menu menu node
* @return bool
*/
public function canSeeMenu($menu)
{
return true;
}
}
6.Add admin_script、admin_style、admin_js、admin_css and admin_require_assets functions
// Equivalent to Admin::script
admin_script('console.log(xxx)');
// Equivalent to Admin::style
admin_style('.my-class {color: red}');
// Equivalent to Admin::js()
admin_js(['@admin/xxx.js']);
// Equivalent to Admin::css()
admin_css(['@admin/xxx.css']);
// Equivalent to Admin::requireAssets()
admin_require_assets(['@select2']);
- simplify the action (Action) of the
JScode logic, to remove the memory of theselectorfunction
BUG FIX
- Fix anomaly in the orderable form #674
- fix the JsonResponse methodIf error.
- fix table, form, and data detail specifying
label#684 - fix the problem that the table
Grid::rowscallback doesn't work properly. - fix the problem of some types of statistical cards failing to load asynchronously due to exceptions in adding
JScode to widgets. - fix the getKey method exception for table row operations #691
- fix the problem of not being able to use the linkage function when there are multiple select forms in the page.
- Fix the problem of the table not being able to refresh automatically after deleting data.
v2.0.6-beta
Posted on 2020/11/7
To upgrade the method, execute the following command step by step
composer remove dcat/laravel-admin
composer require dcat/laravel-admin:"2.0.6-beta"
php artisan admin:publish --assets --force
php artisan admin:publish --migrations --force # 表结构有变动
php artisan migrate
Breaking Changes
1.Form::tags form is saved as array type by default
// You need to convert the format you save to the database yourself
$form->tags('tag')->saveAsJson();
2.The session middleware is disabled by default
3.Form\Tree::disableFilterParents renamed to Form\Tree::exceptParentNode
$form->tree('cate')->exceptParentNode(false);
- Adjust the method name of the file upload form part
// Enable chunked uploads, disableChunked changed to chunked $form->image('avatar')->chunked(true);
// Enable auto-save field values, disableAutoSave changed to autoSave $form->image('avatar')->autoSave(false);
// Enable the file deletion function, disableRemove changed to removeable $form->image('avatar')->removeable(false);
**Functional improvements**
1.Code generator add field dragging sorting function, this method is contributed by partner [@codingyu](https://github.com/codingyu).
2. menu table to add `show` and `extension` field, `show` field is used to control whether to display the menu; `extension` field is used to mark whether to expand the menu
3.`Form::table`、`Form::array`、`Form::embeds` supports relational fields
```php
$form->table('profile.options', function ($form) {
...
});
-
Add vertical display of
Form::checkboxandForm::radioform options.$form->checkbox('xxx')->inline(false)->options([...]); -
Configuration file skip login and permission authentication allows configuration of routing aliases.
'auth' => [ 'except' => [ ... 'user.login', ], ],
6.Form\Row adds getKey and model methods
-
Optimize the form filter select form selection effect, the default is not selected
-
Form tab layout optimization
BUG FIX
- fix
Form::checkboxproblem when check/uncheck all options. - fix the problem that the default menu TITLE can not be translated in Taiwan Traditional Chinese.
- fix the problem that the
numberfield inNestedFormis filtered when the input value is 0 #634 - fix the problem of getting primary key error when the model tree
RowActionasynchronously processes the interface. - Fix the problem of table filters failing to reset the search value of the associated table fields [#650] (https://github.com/jqhph/dcat-admin/issues/650)
- fix form filter multipleSelect form exception problem
v2.0.5-beta
Posted on 2020/10/29
BUG FIXES
- fix the problem of table search multiple related table fields sql error I232T7
- fix the problem of
Form::datetimeRangeform not being able to select logs. - Fix the problem of not being able to add multiple
Form::tableform fields #627 - fix the error in the form filter MultipleSelectTable.
- Fix the problem of abnormal style of table specification filter.
v2.0.4-beta
Posted on 2020/10/27
BUG FIXES
- fix the problem that the admin_javascript_json function will automatically empty-filter an array of null values.
- fix the error of using tab layout for data form #620
- fix the problem of abnormal permissions for temporary directories generated by extended local installation #625
- fix the error when using html method to set view with script tag #624.
- Fix the error of displaying data details using correlations (one-to-many) #623
- fix the dropdown menu calculation display position exception #I22S2N
v2.0.3-beta
Posted on 2020/10/27
BUG FIXES
- fix the problem of abnormal display of return information in form row editing
- Fix invalid setting of
admin.auth.member#613 - fix the abnormal Chinese translation problem of
editorform #611 - fix the problem that
Filter::scopecan't filter pagination parameters when selecting filter item. - fix issues related to form event interception
- Fix the problem of abnormal use of tree form #619
Functional improvements
- add the configuration of skip privileges and login authentication
- Extending the service provider to include middleware and route-checking registrations
- batch operation change event monitoring optimization
- Increase
RowSelectorrobustness to avoid errors due to unprocessedjsonarray type fields #609
v2.0.2-beta
Posted on 2020/10/21
BUG FIXES
- Fix naming space exception in controller file generated by code generator #600
- fix the problem of configuration file logo path error
- Fix the problem of invalid search for associated fields in tables
- fix the problem of duplicate selectors generated by model tree operation
- fix the problem of accessing permissionless page report
- Fix the problem that table filter multipleSelect cannot select the value of the associated table field #603
- Fix invalid form tab layout #605
Functional improvements
- Auth\Permission to move to Http directory
- Replace the json field in the data table with text
- add login password error translation
- add admin_javascript_json function, make most of the component configuration support passing JS code
- Admin::color Add dark mode color.
v2.0.1-beta
Posted on 2020/10/20
BUG FIXES
- Fix data table filter search bug #599
- Fix code generator error in generating controller base class namespace #600
Functional improvements
- Code Generator adds page TITLE and breadcrumb translation functionality.
- Exception handling optimization
- Add admin_setting_array function.