Skip to content

Commit

Permalink
V3 Develop to V3 Master (#1382)
Browse files Browse the repository at this point in the history
* Beta Fixes - Publishing Views/Localizations.  Beta Improvements - Search Options (#1324)

* Update setSearchDebounce, add setSearchThrottle/setSearchBlur

* Remove Lazy Test

* Remove Lazy Tests - Update Docs

* Update Views Publish Path

* Add Translations Publish Option

* Update ChangeLog

* Add Reusable Columns

* Add Tests for Prepend/Append Cols

---------

Co-authored-by: lrljoe <[email protected]>

* Bulk Actions Fix - v3 (#1326)

* Update setSearchDebounce, add setSearchThrottle/setSearchBlur

* Remove Lazy Test

* Remove Lazy Tests - Update Docs

* Update Views Publish Path

* Add Translations Publish Option

* Update ChangeLog

* Add Reusable Columns

* Add Tests for Prepend/Append Cols

* Column Select Fixes

* Fix test

* Add docs for setSearchPlaceholder

* Move Filter Specific Docs ino Filter-Types

* Fix styling

* Remove extraneous space

* Adjusting Selectable Test

* Fix For BulkActions Dropdown

* Fixes for ColumnSelect

* Update ChangeLog

* Test Fix for Selectable Columns

* Remove Faulty Test

---------

Co-authored-by: lrljoe <[email protected]>

* Fix Column Select - Select All state (#1333)

* Fix Column Select - All

* Update ChangeLog

* Add NonArray setAdditionalSelects Test (#1337)

* Test Additions (#1339)

* Add NonArray setAdditionalSelects Test

* Update for FrontendAssets Test

* Fix styling

---------

Co-authored-by: lrljoe <[email protected]>

* Add Third Party Tests (#1340)

* Add NonArray setAdditionalSelects Test

* Update for FrontendAssets Test

* Add ThirdPartyScripts/Styles to Test

* Fix styling

---------

Co-authored-by: lrljoe <[email protected]>

* Third Party Asset Tests (#1341)

* Add NonArray setAdditionalSelects Test

* Update for FrontendAssets Test

* Add ThirdPartyScripts/Styles to Test

* Add ThirdParty Tests

* Fix AutoInjection Issue

* Fix 3rd party test

* Set default back to remote 3rd party assets

* Add CodeCov YML

* Update CodeCov - 80% minimum

* Add Filter Custom Pills Blade Test

* Fix styling

* Add formatted column test

* Column - Get Formatted Contents Test

* Fix styling

---------

Co-authored-by: lrljoe <[email protected]>

* Lazy Loading Fix (#1355)

* Add fix for lazy loading

* Fix styling

---------

Co-authored-by: lrljoe <[email protected]>

* Spacing fixes

* v3 - Missing Tests - Pagination Related Tests (#1363)

* Add missing pagination helper tests


---------

Co-authored-by: lrljoe <[email protected]>

* v3 - Missing Tests - Broken Tables (Missing Primary Key/Builder) (#1362)

* Add missing component visuals tests & failed tables

* Update Exception Expectation

* Temporary test swapping to check Exception throwing

---------

Co-authored-by: lrljoe <[email protected]>

* v3 - Add setSearchFieldAttribute Options (#1361)

* Add setSearchFieldAttribute Options


---------

Co-authored-by: lrljoe <[email protected]>

* v3 - Column Select Fixes & Tweaks (#1360)

* ColumnSelect Fixes - Phase 1

* Update "Select All" to use counts

* Missing closing bracket

* All Are Selected -> Move to method in Helpers

* ColSelectFixes

* Ensure event fires

* Update ColumnsSelectedTest

* Fix superfluous empty array return

* Remove superfluous default return

* Adjust Tests - Include Coverage For ExcludeDeselectedCols

* Add Tests For AllColsSelected

* Fix styling

* Fixes for Deselected Cols

* Fix styling

* Updates to Changelog

* Removing ColumnSelected Event Test - Temporary

* Add default true to replace removed test

* Add improved test

---------

Co-authored-by: lrljoe <[email protected]>

* Fix ServiceProvider Fault (#1366)

* V3 Frontend Asset Tweaks (#1371)

* Check for "original" property

* Adjusting order of request validations

* Updates to Asset Injection Methods

* Fix assertViewIs is not working (#67)
Contribs By: Jackson Tong <[email protected]

* Tweaks for Auto Injection Options

* Test Updates - Frontend Assets

* Add ThirdParty Basic Header Tests

* Add Initial Debuggable DTO Test

* V3 - Reordering Fixes (#1373)

* Reordering Fixes - Performance & Toggling

* Fix styling

---------

Co-authored-by: lrljoe <[email protected]>

* Bundler Import Options (#1377)

* Add All Option

* Update Import Paths

* Add minified CSS Versions

* V3 Restore setTrAttributes (#1378)

* Add setTrAttributes back into use

* Fix styling

---------

Co-authored-by: lrljoe <[email protected]>

* Update Reorder Documentation (#1381)

* Update Reorder Documentation

* Update ChangeLog - Merge Unreleased

---------

Co-authored-by: lrljoe <[email protected]>
Co-authored-by: Anthony Rappa <[email protected]>
  • Loading branch information
3 people authored Oct 3, 2023
1 parent 003ab4a commit 04aa7bd
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 25 deletions.
28 changes: 9 additions & 19 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,29 @@

All notable changes to `laravel-livewire-tables` will be documented in this file

## [Unreleased] - 3.x setTrAttributes
## [Unreleased] - 3.x Amends
- Amending Documentation for Reordering
- Adding capabilities & tests for setTrAttributes

## [Unreleased] - 3.x Fixes for reordering striping
- Force calculation of even/odd only once in reorder mode
- Call internal method for reordering, and pass to configured method to process

## [Unreleased] - 3.x - Updates to Injection Methods
- Amend AutoInjection/FrontendAsset to ensure it returns the original content correctly
- Remove errant disabling of Blade Directives when disabling auto-injection
- Amended in-line config documentation

## [Unreleased] - 3.x - setSearchFieldAttributes
- Add setSearchFieldAttributes() and getSearchFieldAttributes()

## [Unreleased] - 3.x - Missing Tests

## [Unreleased] - 3.x - Missing pagination tests
- Add missing pagination tests

## [Unreleased] - 3.x - Beta Fixes (beta-1)
- Removal of setSearchLazy
- Fix for setSearchDebounce
- Fix publishing of views
- Fix for Bulk Actions dropdown not working in Bootstrap
- Fix for Column Select "Select All" not consistently updating
- Fix for lazy loading of table
- Fix for ColumnSelect falling out of sync, displaying unselectable colums, or persisting cols in query that are not selected
- Add setSearchBlur()
- Add setSearchThrottle()
- Fix publishing of views
- Add publish translations
- Add prependColumns() and appendColumns() functions
- Add documentation for setSearchPlaceholder()
- Fix for Bulk Actions dropdown not working in Bootstrap
- Fix for Column Select "Select All" not consistently updating
- Add fix for lazy loading of table
- Fix for ColumnSelect falling out of sync, displaying unselectable colums, or persisting cols in query that are not selected

- Add setExcludeDeselectedColumnsFromQueryEnabled and setExcludeDeselectedColumnsFromQueryDisabled methods to configure()

## [Unreleased] - 3.x (beta-0)
Expand Down Expand Up @@ -1000,4 +990,4 @@ Ground Up Rebuild
[0.1.4]: https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.3...v0.1.4
[0.1.3]: https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.2...v0.1.3
[0.1.2]: https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.1...v0.1.2
[0.1.1]: https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.0...v0.1.1
[0.1.1]: https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.0...v0.1.1
2 changes: 1 addition & 1 deletion docs/reordering/available-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function configure(): void

## setReorderMethod

Set the method that will be called when a row is moved. (Default is `reorder`.)
Set the method that will be called when the "Save" button is clicked. (Default is `reorder`.)

```php
public function configure(): void
Expand Down
6 changes: 4 additions & 2 deletions docs/reordering/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ The previous iteration utilised third-party Sortable plugins, which are not requ

## An update about reordering

Version 2.0 returned all rows for sorting. In version 3.0, you will be able to sort with the items on the currently visible page, which allows for sorting on larger tables.

If you have a large data set to sort, then it is recommended that you create a minimal table instance with only the required columns for performance reasons.

The field keys used in the reorder() function have been updated, and allow for easier upserting/reuse of reorder code.

The reorder will not be saved until you click the "Save" button.
21 changes: 19 additions & 2 deletions docs/reordering/saving.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,27 @@ You will receive a multi-dimensional array, containing an array item per record,
It is recommended that you perform some validation before bulk updating data, but it is in the correct format to perform upserts.

```php
public function reorder($items): void
public function reorder(array $items): void
{
// $item[$this->getPrimaryKey()] ensures that the Primary Key is used to find the User
// 'sort' is the name of your "sort" field in your database
// $item[$this->getDefaultReorderColumn()] retrieves the field, as defined in setDefaultReorderSort('FIELD', 'ORDER')

foreach ($items as $item) {
User::find((int)$item['value'])->update(['sort' => (int)$item['order']]);
User::find($item[$this->getPrimaryKey()])->update(['sort' => (int)$item[$this->getDefaultReorderColumn()]]);
}
}

```

If you have defined both the Primary Key, and the Order Column, and the fields match your database, then you could use an upsert(). Keep in mind that an upsert does not go through validation, and you should exercise caution with this approach
```php
public function reorder(array $items): void
{
// First value is the array of items
// Second value should be the unique id (set in setPrimaryKey())
// Third value should be the field set in setDefaultReorderSort('FIELD', 'ORDER')
User::upsert($items, [$this->getPrimaryKey()], [$this->getDefaultReorderColumn()]);
}

```
2 changes: 1 addition & 1 deletion docs/reordering/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function configure(): void

## Specify your reorder method

By default the method that will be called when a row is moved is `reorder`.
By default the method that will be called when the save button is clicked is `reorder`.

If you want to change that:

Expand Down

0 comments on commit 04aa7bd

Please sign in to comment.