Implementing option to enforce the limit#5
Implementing option to enforce the limit#5spekulatius wants to merge 1 commit intopatricknelson:masterfrom spekulatius:enforce
Conversation
| public function enforceLimit() | ||
| { | ||
| // ensure we are removing the buttons if these are | ||
| $this->onAfterManipulate(function(GridField $grid, SS_List $list){ |
There was a problem hiding this comment.
For safety, probably best to set this to >=.
|
First of all: Thank you for your PR. The first one for this project 😎👍 I could be misinterpreting this but: Currently the functionality is such that this component is already limiting, by default -- as long as this component is added to your So here's my list of things I'd suggest:
Let me know your thoughts and if I'm mistaken on any assumptions here. Thanks again. |
|
Also, |
|
Also, moving that logic which calls the callback setter reinforces my point about using a |
|
Also, if you have time (pretty please) maybe be the first to add unit tests to this? Would only want coverage for what you write. If not, that's ok for now anyway (I've been slacking). See #1 |
|
Hello Patrick, thanks for coming back to me so quick :) Currently I'm quite busy because I'm going on leave soon. So this might need to wait a bit more - I'll address most of this as soon as I find time. Peter |
|
No worries, there's no rush. |
|
Ping @spekulatius -- any updates here? |
Hello @patricknelson
I have implemented an option to enforce limits in the CMS by removing the "add" and "link existing" options. Are you interested to merge this in?
Cheers,
Peter