139 Commits

Author SHA1 Message Date
Samuell
a68f3abf1c
Fix pagination reset if search input is filled (#4918)
Fixes #4914.
2020-02-12 07:52:09 -08:00
Rike-cz
495b0f085a Ignore user preferences for lists when setup modal is disabled (#4921) 2020-02-10 14:24:09 +08:00
Luke Towers
5f8a5454ee Narrow the scope of when Lists orderBy conditions are reset.
Credit to @bennothommo & @daftspunk
Replaces: 9f8d8ec9fa. Refs: #4439
2019-12-04 02:36:51 -06:00
empower-josh
4ab464cede Add public methods to access Lists widget's sort direction & column (#4746)
Credit to @empower-josh.
2019-12-04 02:29:24 -06:00
Ben Thomson
9f8d8ec9fa
Force ordering when list widget column is sorted
When ordering is applied externally, ie. by a relation config, the orderBy call in the List widget simply adds an additional field to the ordering clauses, which prevents lists in these scenarios from being re-ordered correctly. This changes the order clause so that the ordering is reset and only the specified column is ordered when the user sorts a column.

Developers can continue to use the `extendQuery` event to do specialised custom ordering if required.

Fixes #4439.
2019-12-02 09:27:25 +08:00
Tobias Kündig
61129b48ec Only put sortOptions to the session if the List query succeeded 2019-11-29 08:26:37 +01:00
Samuel Georges
49d68f0671 Cookies are no longer serialized
Based on update to library 09e859a13e we no longer serialize cookies, so the decrypter no longer needs to apply a serialization layer
2019-11-02 14:52:00 +11:00
Samuell
348040a4e4 Add permission support for fields, columns and filter scopes (#4520)
Credit to @Samuell1. Fixes #1837.
2019-10-09 16:41:53 -06:00
Dan Harrin
9521dd795c Minor Formatting Corrections in Usage Comments (#4541)
Credit to @DanHarrin
2019-08-15 09:14:54 -06:00
Luke Towers
7782e04ef8
Fix typo
Credit to @alxy for spotting it
2019-07-09 09:52:30 -06:00
Luke Towers
029a299816
Remove support for invalid relation type column
Fixes #4443.
2019-07-09 08:25:08 -06:00
Ben Thomson
be2a850787
Fix code quality errors in Lists widget 2019-07-07 14:49:56 +08:00
Ben Thomson
c1dcc62559
Increment column count when tree is shown
Fix centering of no record message in lists when tree is enabled.
2019-07-07 13:05:18 +08:00
Ben Thomson
6d283829c0
Store limited list widget configuration in user preferences (#4360)
Provides a new method of storing the list page count and visible column configs that survives a user logging out then logging back in to October. In addition, the users are provided with a "Reset to Default" button in the config modal allowing them to use the default list config if preferred.
2019-06-08 11:28:08 +08:00
SeriousKen
15bfcf8cfd Add support for morphOne relations in backend list columns (#4079)
Fixes #4078. Credit to @SeriousKen
2019-04-19 16:31:12 -06:00
Ben Thomson
ee003c416c Redirect user to last available page in list widget if current page is unavailable (#4020)
Credit to @bennothommo. Fixes #4008.
2018-12-30 12:49:42 -06:00
Ben Thomson
b6bd643e21 Rename prepareModel to prepareQuery, deprecate prepareModel 2018-12-30 16:25:01 +08:00
Woo
eb1d3fadbc Add format property to list columns (#3990)
Credit to @vicrly. Fixes #3967.
2018-12-19 20:52:07 -06:00
Jim Cottrell
34da61805b Replace URL parameters dynamically without needing a list in advance (#3361)
Fixes #3358. Credit to @jimcottrell
2018-12-18 10:03:03 -06:00
Nathan van der Werf
0f0d108da0
Remove unused imports 2018-08-24 19:51:59 +02:00
Nathan van der Werf
66fa03f17e
Revert "Remove unused imports"
This reverts commit 742a5f415bc45819b11c77402efc114fa2f4451e.
2018-08-24 19:40:40 +02:00
Nathan van der Werf
8b6f11e6ac Extract child instructions 2018-08-15 19:25:42 +02:00
Nathan van der Werf
62c59a4903 Refactor ternary operators to null coalescing operators 2018-08-15 19:15:13 +02:00
Nathan van der Werf
02bd38cfb1 Merge if constructs 2018-08-15 18:45:37 +02:00
Nathan van der Werf
742a5f415b Remove unused imports 2018-08-15 18:27:36 +02:00
Luke Towers
8cbfd6611a Finished documenting Lists widget's events:
backend.list.extendQueryBefore
backend.list.extendQuery
backend.list.extendRecords
backend.list.extendColumns
backend.list.overrideHeaderValue
backend.list.injectRowClass

Also improved:
backend.list.overrideColumnValue
backend.list.overrideColumnValueRaw
2018-08-13 08:11:35 -06:00
Steve Mortimer
5936107c07 Reset pagination on filter scope change (#3632)
Fixes #3610. Credit to @stevemortimer
2018-07-16 09:43:47 -04:00
Tobias Kündig
55d49cbf2b Cache the last visited page in the list widget (#3432)
Stores the last visited page of list widgets in the session to restore to on next page load. Does not apply when filters / searches are applied. Credit to @tobias-kuendig
2018-03-08 10:52:21 -06:00
Luke Towers
8cb57cf353
Add useRelationCount column property
Adds the `useRelationCount` property to tell the list controller to use the number of related records for the specified `relation` as the value for that column.
2018-01-25 16:54:06 -06:00
Flakerim Ismani
55ff460895 Added colorpicker column type (#3338)
Renders 30px by 30px square of the selected colour. `type: colorpicker` in the columns config. Credit to @flakerimi
2018-01-04 12:54:30 -06:00
Luke Towers
ac2e5937f0 Document list widget column value events
Documents `backend.list.overrideColumnValue` and adds and documents `backend.list.overrideColumnValueRaw`. See https://github.com/octobercms/october/issues/3180 for why this is necessary.
2017-10-18 10:57:17 -06:00
datune
4a0a488ff6 Account for NestedTree Trait setting (#3143)
* Account for NestedTree Trait setting

See https://github.com/rainlab/blog-plugin/issues/338. The Lists Widget did not account for the NestedTree setting.

* Update Lists.php
2017-10-04 14:04:12 -06:00
Luke Towers
9565565865 Add ignoreTimezone option to datepicker field and column types.
Adds the ability to specify an `ignoreTimezone: true` option on the config for a datepicker form widget or date column type. This will ignore both October's and the backend user's timezone settings to display the date exactly as it is stored.
2017-09-10 22:39:15 -06:00
Samuel Georges
8a1b060a29 Tidy up from #3084 2017-09-06 09:00:53 +10:00
Jofry S
2c97c55ea8 Allow simple pagination option on ListControllers 2017-09-05 13:33:51 +10:00
Samuel Georges
7e76f39e6c Add app.name config
Various other refittings
2017-05-16 18:50:41 +10:00
Quezler
cc17b679f1 Code dusting (#2826)
Code cleaning according to PSR-2 w/ exemptions (mostly dust).
2017-04-24 21:38:19 +10:00
Samuel Georges
b841f9e066 {@inheritDoc} -> @inheritDoc 2017-03-16 06:26:14 +11:00
Samuel Georges
d9a2b88852 Pass records by reference to overcome halting event issue
Refs https://github.com/octobercms/october/pull/1853
2017-02-15 05:58:44 +11:00
Luke Towers
9f3c2b8bf6 Switched backend.list.extendRecords event triggering
Made the event triggering for the new backend.list.extendRecords event triggering more consistent with the rest of the class.
2017-02-14 02:20:23 -06:00
Luke Towers
fd3fbf5e52 Merge pull request #1853 from leocavalcante/feature-list-extend-records
Make available to extends Lists records
2017-02-14 02:17:16 -06:00
Samuel Georges
c644f8b66d Fixes issue where nested columns forcibly hide
Eg: "myrelation[attribute]" as a column name would cause the list setup to hide these fields with no ability to bring them back
2016-12-14 19:14:41 +11:00
Samuel Georges
0a2b343047 Simplify system events
This pipes all event calls through a new EventEmitter trait, which substitutes the October Rain event emitter trait. The view event has been moved to this trait also.
Pass some variables by reference to allow multi-extension.
Fixes #2420
2016-12-10 09:02:06 +11:00
Samuel Georges
b39ebec812 Pass columns to search scope
This allows the default search to be applied and combined with any custom constraints
2016-11-29 06:46:52 +11:00
Samuel Georges
46c473e2f2 Fixes fetching multi tiered pivot relation values
Refs https://github.com/daftspunk/oc-crm-plugin/issues/3
Minor code clean on select.js
2016-11-08 07:02:31 +11:00
Samuel Georges
57b10704ce Support for overriding list views
For consistency, entry partial for controller behaviors should be called "container"
Added addViewPath() method to ViewMaker
Remove "fa" from icon docs (not necessary)
Fixes #2439
2016-10-29 14:10:21 +11:00
Samuel Georges
ee2dd78b3d Exception handling for type: relation
It would appear many plugins incorrectly use type: relation as a list column, when this does nothing. Previously it would fallback to the text type, now that invalid types fail hard, this adds a softer landing by spamming the trace log instead.
Refs #2438
2016-10-22 04:18:28 +11:00
Samuel Georges
91e7e8b950 List column number type was falling back to text
Since custom list column types an exception is thrown for unknowns. This makes number known.
Fixes #2438
2016-10-22 03:10:50 +11:00
Samuel Georges
f9dd5b2f57 Plugins can now define custom list column types 2016-10-21 07:15:08 +11:00
Samuel Georges
19c3c19a00 Added extended useList options, including raw output 2016-10-06 18:44:26 +11:00