Skip to content

Conversation

distantnative
Copy link
Member

@distantnative distantnative commented Aug 10, 2025

Description

Merge first:

Todo

  • Unit tests

Changelog

♻️ Refactored

  • Pages, files and users field use new picker dialog components

☠️ Deprecated

  • k-models-dialog, k-pages-dialog, k-files-dialog and k-users-dialog have been deprecated. Use k-models-picker-dialog, k-pages-picker-dialog, k-files-picker-dialog, k-users-picker-dialog instead.
  • Kirby\Cms\Picker, Kirby\Cms\PagePicker, Kirby\Cms\FilePicker and Kirby\Cms\UserPicker have been deprecated. Use Kirby\Panel\Controller\Dialog\ModelsPickerDialogController, Kirby\Panel\Controller\Dialog\PagesPickerDialogController, Kirby\Panel\Controller\Dialog\FilesPickerDialogController and Kirby\Panel\Controller\Dialog\UsersPickerDialogController instead.

🚨 Breaking changes

  • Pages, files and users field:
    • Backend sends only IDs to these fields and the fields only send IDs back (instead of full item objects with display data etc.)
    • Removed pagepicker, filepicker and userpicker field mixins

For review team

  • Add lab and/or sandbox examples (wherever helpful)
  • Add changes & docs to release notes draft in Notion

@distantnative distantnative self-assigned this Aug 10, 2025
@distantnative distantnative force-pushed the v6/refact/models-picker-dialogs-controllers branch 4 times, most recently from a4ed279 to 52a752a Compare August 12, 2025 18:24
@distantnative distantnative force-pushed the v6/refact/models-picker-dialogs-controllers branch from 52a752a to ad089d8 Compare August 13, 2025 08:50
@distantnative distantnative changed the base branch from v6/develop to v6/refact/models-picker-dialogs-controllers-classes August 13, 2025 08:51
Base automatically changed from v6/refact/models-picker-dialogs-controllers-classes to v6/develop August 13, 2025 10:55
@distantnative distantnative force-pushed the v6/refact/models-picker-dialogs-controllers branch 2 times, most recently from 1aa18cc to dfc5fcc Compare August 13, 2025 11:18
@distantnative distantnative changed the base branch from v6/develop to v6/refact/field-mixin-picker August 13, 2025 11:18
@distantnative distantnative changed the title feat: Models picker dialogs + Vue components feat: Models fields with new picker dialogs Aug 13, 2025
@distantnative distantnative changed the title feat: Models fields with new picker dialogs refact!: Models fields use models picker dialogs Aug 13, 2025
@distantnative distantnative force-pushed the v6/refact/models-picker-dialogs-controllers branch 9 times, most recently from 40cd2bc to e1d00b0 Compare August 13, 2025 13:32
Base automatically changed from v6/refact/field-mixin-picker to v6/develop August 18, 2025 13:51
@distantnative distantnative force-pushed the v6/refact/models-picker-dialogs-controllers branch from e1d00b0 to fe7633f Compare August 19, 2025 12:19
@distantnative distantnative force-pushed the v6/refact/models-picker-dialogs-controllers branch from fe7633f to beb5075 Compare August 19, 2025 17:32
@distantnative distantnative changed the base branch from v6/develop to v6/refact/models-picker-dialog-vue August 19, 2025 17:34
Base automatically changed from v6/refact/models-picker-dialog-vue to v6/develop August 22, 2025 17:53
@distantnative distantnative force-pushed the v6/refact/models-picker-dialogs-controllers branch from beb5075 to cbb78ce Compare August 22, 2025 17:53
@@ -48,9 +49,6 @@
'parent' => function () {
return $this->parentModel->apiUrl(true);
},
'query' => function () {
return $this->query ?? $this->parentModel::CLASS_ALIAS . '.files';
},
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explanation: Query default is handled by new FIlePickerDialogController class.

}
'pattern' => 'items',
'method' => 'GET',
'action' => fn () => $this->field()->itemsFromRequest()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't found a better way as api routes cannot be defined by a mixin as it seems.

}
}

return $items;
return $ids;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: Does it make sense that we always use IDs here and not UUIDs? Since we use ->toModel()->{$store) in the save callback, it should work consistently to always just communicate with the IDs. But wondering if conceptually we should also use $uuid?? $id here.

@distantnative distantnative force-pushed the v6/refact/models-picker-dialogs-controllers branch from cbb78ce to 225da0b Compare August 22, 2025 18:31
false => $file->filename()
};

return $file->id();

Check failure

Code scanning / Psalm

UnevaluatedCode Error

Expressions after return/throw/continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant