-
-
Notifications
You must be signed in to change notification settings - Fork 181
feat: Models picker dialogs classes #7527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Models picker dialogs classes #7527
Conversation
68141f7
to
08ae026
Compare
08ae026
to
3f0b56d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like the refactoring. The props in the constructor make me wonder though if this is something that we should do for other controllers as well, where we often go directly through request params instead.
@bastianallgeier I can't quite follow your thought - what is it what you are suggesting? 😅 |
@distantnative 😆 sorry for the confusion. Let's take the PageChangeTitleDialogController. It maybe not be the best example, but the first one I found where we use the request in the load method to get the 'preselect' prop. We normally mostly just pass the Model to the constructor and search for the model in the factory method of the controller. Additional options are then coming from the request object. Would it be better to set those options properties in the constructor as well and then hand them over from the request in the factory method instead? |
But this discussion is basically not something that we have to decide for this PR. It's more a general conceptual decision that we can still leave open or change later. |
Now understood you. Yes, maybe in the long term they should already be passed to the constructor - I think we need to test out what works best for the most cases once we have done a bit more refactoring (e.g. #7466). |
Description
#7522 for seeing the larger context how they should be used.
Merge first
::pickerData()
for models #7510Changelog
🎉 Features
Kirby\Panel\Controller\Dialog\ModelsPickerDialogController
classes (Kirby\Panel\Controller\Dialog\PagesPickerDialogController
,Kirby\Panel\Controller\Dialog\FilesPickerDialogController
,Kirby\Panel\Controller\Dialog\UsersPickerDialogController
)For review team