From af52627fc6e770b818a7639b9e78c3fa64eb6b6c Mon Sep 17 00:00:00 2001 From: antoine Date: Mon, 13 Jan 2025 20:11:55 +0100 Subject: [PATCH 1/3] wip title normalization --- demo/app/Sharp/Posts/PostForm.php | 6 +-- demo/app/Sharp/Posts/PostShow.php | 2 +- resources/js/Pages/EntityList/EntityList.vue | 2 +- resources/js/Pages/Form/Form.vue | 2 +- resources/js/entity-list/EntityList.ts | 1 + resources/js/form/Form.ts | 1 + resources/js/show/Show.ts | 14 ++--- resources/js/types/generated.d.ts | 7 ++- src/Data/EntityList/EntityListData.php | 2 + src/Data/Form/FormConfigData.php | 2 - src/Data/Form/FormData.php | 2 + src/Data/Show/ShowData.php | 3 ++ src/Form/SharpForm.php | 22 ++++---- src/Http/Context/SharpBreadcrumb.php | 6 +++ src/Http/Controllers/EntityListController.php | 8 ++- src/Http/Controllers/FormController.php | 5 ++ src/Http/Controllers/ShowController.php | 9 ++-- src/Http/Controllers/SingleShowController.php | 1 + src/Show/SharpShow.php | 5 ++ src/Utils/Entities/BaseSharpEntity.php | 5 +- src/Utils/Entities/SharpDashboardEntity.php | 5 ++ src/Utils/Entities/SharpEntity.php | 7 ++- src/Utils/Entities/ValueObjects/EntityKey.php | 54 +++++++++++++++++++ 23 files changed, 130 insertions(+), 41 deletions(-) create mode 100644 src/Utils/Entities/ValueObjects/EntityKey.php diff --git a/demo/app/Sharp/Posts/PostForm.php b/demo/app/Sharp/Posts/PostForm.php index 547de697b..bd0c6538f 100644 --- a/demo/app/Sharp/Posts/PostForm.php +++ b/demo/app/Sharp/Posts/PostForm.php @@ -193,9 +193,9 @@ public function buildFormLayout(FormLayout $formLayout): void public function buildFormConfig(): void { - $this->configureDisplayShowPageAfterCreation(); - // TODO handle configureEditTitle('Edit post') - // TODO handle configureCreateTitle('New post') + $this->configureDisplayShowPageAfterCreation() + ->configureEditTitle('Edit post') + ->configureCreateTitle('New post'); } public function find($id): array diff --git a/demo/app/Sharp/Posts/PostShow.php b/demo/app/Sharp/Posts/PostShow.php index 0fb6c65cd..c7c6b4322 100644 --- a/demo/app/Sharp/Posts/PostShow.php +++ b/demo/app/Sharp/Posts/PostShow.php @@ -99,7 +99,7 @@ public function buildShowConfig(): void $this ->configureEntityState('state', PostStateHandler::class) ->configureBreadcrumbCustomLabelAttribute('breadcrumb') - ->configurePageTitleAttribute('title', localized: true) +// ->configurePageTitleAttribute('title', localized: true) ->configureDeleteConfirmationText('Are you sure you want to delete this post (this will permanently delete its data)?'); } diff --git a/resources/js/Pages/EntityList/EntityList.vue b/resources/js/Pages/EntityList/EntityList.vue index f90ebcec0..d815fb42f 100644 --- a/resources/js/Pages/EntityList/EntityList.vue +++ b/resources/js/Pages/EntityList/EntityList.vue @@ -89,7 +89,7 @@ > diff --git a/resources/js/Pages/Form/Form.vue b/resources/js/Pages/Form/Form.vue index 1b822b1bf..2c5f37eee 100644 --- a/resources/js/Pages/Form/Form.vue +++ b/resources/js/Pages/Form/Form.vue @@ -72,7 +72,7 @@ @submit="submit" >