Commit Graph

65 Commits

Author SHA1 Message Date
Guy Sartorelli 142a318fa8
ENH Return PJAX responses from gridfield edit forms (#11206)
undefined
2024-04-26 17:13:27 +12:00
Guy Sartorelli 343c8ff787
Merge branch '5.1' into 5 2024-02-13 13:55:30 +13:00
Thomas Portelange b56e771ed5
FIX add missing rawurlencode (#11105) 2024-02-13 10:08:28 +13:00
Guy Sartorelli 357ed7ad7e
ENH Add generic types (#11108)
There are also a few general corrections to PHPDocs that I noticed along
the way (e.g. adding `|null` when the method is returning a null value.

There are some cases where either the return type or the whole PHPDoc
was duplicated from the parent class - in those cases I've simply
removed the duplication.
2024-01-17 17:08:26 +13:00
Maxime Rainville 6c69d32367
Merge pull request #11049 from creative-commoners/pulls/5/gridfield-with-viewabledata
Make GridField components work with ViewableData where possible
2023-12-19 19:55:29 +13:00
Guy Sartorelli 3d64eac129
NEW Make most GridField components work with arbitrary data 2023-12-18 12:41:42 +13:00
Guy Sartorelli c405ed6cf3
NEW Allow a single has_one to manage multiple reciprocal has_many (#11084) 2023-12-12 10:18:25 +13:00
github-actions fe9b7699a2 Merge branch '4' into 5.1 2023-11-13 04:42:00 +00:00
Sabina Talipova d883719c16 FIX ModelAdmin toast elements 2023-11-09 09:39:52 +13:00
Sabina Talipova 56511c8618 MNT Remove TODO comments 2023-10-30 13:21:09 +13:00
Bernard Hamlin e98f0d45af
Use ::create instead of new in GridFieldDetailForm_ItemRequest (#10791)
Updates instances of `new X` to `X::create` so that Silverstripe classes will respect dependency injection
2023-05-25 11:42:43 +12:00
Michal Kleiner 725497a485 MNT Use null safe operator and default to 1 page 2023-02-20 22:40:16 +13:00
Steve Boyd e455aa5c5e FIX Handle null returns in GridFieldDetailForm_ItemRequest::getNumPages() 2023-02-20 14:37:48 +13:00
Florian Thoma bb8e3b8386
fix: optional return value for paginator state
`$state->getData()->getData('GridFieldPaginator')' (line 598) returns null by default.
2023-01-02 15:32:16 +11:00
Sabina Talipova c0b38fc411 ENH Update page number in the state on reaching the first or the last element in a list 2022-08-22 12:44:11 +12:00
Sabina Talipova 7a9bc7f577 ENH Keep Request in URL 2022-07-28 10:14:43 +12:00
Guy Sartorelli 5436df57e4 FIX Add polymorphic class on new records for use in forms. 2022-05-11 14:04:52 +12:00
Steve Boyd 511b3bb060 ENH PHP 8.1 compatibility 2022-04-14 13:12:59 +12:00
Sam Minnee 8883413ba7 NEW: Add GridFieldDetailForm::setRedirectMissingRecords()
This new opt-in setting will let grid field detail forms redirect to the
“Correct” URL of a GridField if it’s not found in the current list.

This works by:
 * Looking for the item in the database
 * If it exists, check for a CMSEditLink() method that returns a value
 * If so, redirect to that

This is useful if you have a number of grid fields that each show a
partial list of records, and it’s possible for the user to make changes
such the item no longer appears in the list, but does appear in another
list.

It’s an opt-in feature as I think all changes like this should be
opt-in, based on previous experiences improving GridField and in turn
breaking SecurityAdmin and slowing versioned-data-browsing down. ;-)
2021-05-21 13:16:00 +12:00
Tom Yrjas 00ee8d8abf BUGFIX: Re-declare $items to be an ArrayList if it's null
getBackLink() modified to tolerate empty ArrayList
2020-06-29 16:07:24 +03:00
Tom Yrjas 824b5e0b67 BUGFIX: Ensure $items isn't null in GridFieldDetailForm_ItemRequest->Breadcrumbs() prior to performing operations on it. 2020-06-29 14:13:49 +03:00
Guy Marriott 1a6e2da995
Merge pull request #9543 from jakxnz/pulls/4.6/undeclared-private-statics 2020-06-15 23:16:57 -07:00
Jackson Darlow dadac00c19
Added array declaration to `GridFieldDetailForm_ItemRequest::$formActions`
Co-authored-by: Robbie Averill <robbie@averill.co.nz>
2020-06-15 11:45:33 +12:00
Steve Boyd 4daccfab67 Merge branch '4.5' into 4.6 2020-06-12 11:20:13 +12:00
Jackson Darlow 84235c6518 Adjusted missing definitions to only include definitions referenced by framework 2020-06-11 14:28:47 +12:00
Adrian Humphreys d320026375
Remove recursive write until its fixed 2020-05-28 14:34:55 +12:00
Andre Kiste ec51f98adb
Merge pull request #8870 from jinjie/4
Fix: Allow editing of relation if item is created.
2020-05-01 15:37:52 +12:00
Daniel Hensby 237b2d5f74
Convert array delcarations to short array syntax 2020-04-20 18:58:09 +01:00
Robbie Averill d3b19069b3
Apply suggestions from code review
Add double quotes around object title
2020-04-02 12:51:13 -07:00
Dan Hensby d1075f29b8
Remove empty parameter as per feedback 2020-04-02 12:11:35 +01:00
Dan Hensby 9e0ed0a50a
Fix spaces around concatenation operator 2020-04-02 12:09:22 +01:00
mattclegg 24bc80ed35
[DOCS] Better debug text for errors generated by GridFieldDetailForm_ItemRequest 2020-03-31 12:09:16 +05:45
Serge Latyntcev 7873efde9c Merge branch '4.4' into 4 2019-10-18 10:58:19 +13:00
Damian Mooyman d7752b7945
Run PSR2 Lint cleaner 2019-10-04 13:26:31 +13:00
Damian Mooyman f1594fd991 BUG Ensure that canCreate() context matches that respected by GridFieldAddNewButton 2019-10-04 11:24:34 +13:00
Maxime Rainville dd40d53e6b Merge branch '4.4' into 4 2019-09-04 09:46:33 +12:00
Robbie Averill ef49dcf726
Merge pull request #9164 from sminnee/fix-9162
FIX: Write relations when saving in grid-field item edit form
2019-09-01 20:44:13 -07:00
bergice 2f8d847a10 FIX make the grid field actions consistent to what they look like on pages
Resolves https://github.com/silverstripe/silverstripe-admin/issues/904
2019-09-02 12:22:32 +12:00
Aaron Carlino b3093b7a1a BUGFIX: Allow state to be shared across nested GridFields 2019-08-07 23:09:51 +12:00
Sam Minnee d088354f46 FIX: Write relations when saving in grid-field item edit form
Fixes https://github.com/silverstripe/silverstripe-framework/issues/9162
2019-08-02 16:17:42 +12:00
Rafael Marins de Sousa f7c1be7ac1 Including canCreate in if statement so that button gets removed if user isn't to be able to create new records 2019-05-28 12:28:00 +12:00
Guy Marriott 856e841955 FIX Ensuring pagination buttons have a consistent state to work off of (#8957) 2019-05-06 14:42:25 +12:00
Robbie Averill 5337e6d048 API Replace FormActions with anchors to enable panel-based loading in GridField navigation buttons (#8953)
* FIX Add accessibility labels and titles to previous, next, and add new buttons in GridFields

* API Replace FormActions with anchors to enable panel-based loading in GridField navigation buttons

* FIX Previous and Next links are now correctly disabled when end of lists are reached

* Add English translations
2019-05-03 15:03:59 +12:00
Guy Marriott ecfe039e72
FIX Don't add "better buttons" previous and next without a paginator 2019-05-01 15:48:03 +12:00
Kong Jin Jie 1d406c64b9 Fix: Allow editing of relation if item is created. 2019-03-20 12:51:49 +08:00
Loz Calver 441d079647
Merge pull request #8637 from creative-commoners/pulls/4.4/falsy-detail-component
FIX getComponentByType can return null - prevent null pointer errors
2018-11-26 18:28:26 +01:00
Robbie Averill f22a4b980b FIX getComponentByType can return null - prevent null pointer errors 2018-11-26 16:01:46 +01:00
Robbie Averill efa427fc45 FIX Remove redundant "rightGroup" logic and increase getRightGroupField to protected 2018-11-26 12:42:47 +01:00
Andre Kiste 1d9e40ba26 Use new plus icon (#8619)
* Use new plus icon and refactor

* MINOR: Add ability to customise the visibility of the `Previous`, `Next` and `Add` buttons at a `GridField` level

* - Merge `showPrevious` and `showNext` to `showPagination` for grid fields
- Update documentation
- Improve performance for next/previous buttons by not fetching all list records
- Refactoring

* Refactor to fail gracefully on GridFieldPaginator

* Fix merge
2018-11-23 12:40:18 +13:00
Andre Kiste cc712892a9 NEW Port betterbuttons to framework (#8569)
* MINOR: Add `Previous`, `Next` and `Create New` actions in edit form

If the form is opened via a grid field, the filters will be retained so the previous/next record opened will be correct

* MINOR: Add ability to customise the visibility of the `Previous`, `Next` and `Add` buttons at a `GridField` level

* Fix invalid action when pressing the `New` button in an edit form unless `betterbuttons` module was installed

* - Merge `showPrevious` and `showNext` to `showPagination` for grid fields
- Update documentation
- Improve performance for next/previous buttons by not fetching all list records
- Refactoring

* Refactor to fail gracefully on GridFieldPaginator
2018-11-19 11:06:47 +13:00