Skip to content

Commit 5aa1d12

Browse files
committed
Merge branch 'main' into fix-mobile-date
# Conflicts: # resources/js/form/components/fields/Date.vue
2 parents d13e432 + 64b2ad1 commit 5aa1d12

36 files changed

+807
-756
lines changed

demo/app/Sharp/Categories/CategoryForm.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ public function buildFormFields(FieldsContainer $formFields): void
2121
->addField(
2222
SharpFormTextField::make('name')
2323
->setLabel('Name')
24-
->setMaxLength(150),
24+
->setMaxLength(150)
2525
)
2626
->addField(
2727
SharpFormTextareaField::make('description')
2828
->setLabel('Description')
2929
->setRowCount(4)
3030
->setLocalized()
31-
->setMaxLength(500),
31+
->setMaxLength(500)
3232
);
3333
}
3434

@@ -46,11 +46,6 @@ public function buildFormConfig(): void
4646
$this->configureDisplayShowPageAfterCreation();
4747
}
4848

49-
public function getDataLocalizations(): array
50-
{
51-
return ['fr', 'en'];
52-
}
53-
5449
public function find($id): array
5550
{
5651
return $this->transform(Category::findOrFail($id));
@@ -72,4 +67,9 @@ public function update($id, array $data)
7267

7368
return $category->id;
7469
}
70+
71+
public function getDataLocalizations(): array
72+
{
73+
return ['fr', 'en'];
74+
}
7575
}

demo/app/Sharp/Categories/CategoryList.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ protected function buildList(EntityListFieldsContainer $fields): void
1818
$fields
1919
->addField(
2020
EntityListField::make('name')
21-
->setLabel('Name'),
21+
->setLabel('Name')
2222
)
2323
->addField(
2424
EntityListField::make('posts_count')
25-
->setLabel('# posts'),
25+
->setLabel('# posts')
2626
);
2727
}
2828

demo/app/Sharp/Categories/CategoryShow.php

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,6 @@
1515

1616
class CategoryShow extends SharpShow
1717
{
18-
public function buildShowConfig(): void
19-
{
20-
$this->configureBreadcrumbCustomLabelAttribute('name');
21-
}
22-
23-
public function find(mixed $id): array
24-
{
25-
return $this->transform(Category::findOrFail($id));
26-
}
27-
2818
protected function buildShowFields(FieldsContainer $showFields): void
2919
{
3020
$showFields
@@ -48,16 +38,25 @@ protected function buildShowFields(FieldsContainer $showFields): void
4838
protected function buildShowLayout(ShowLayout $showLayout): void
4939
{
5040
$showLayout
51-
->addSection('', function (ShowLayoutSection $section) {
52-
$section
53-
->addColumn(6, function (ShowLayoutColumn $column) {
54-
$column->withField('name')
55-
->withField('description');
56-
});
57-
})
41+
->addSection(fn (ShowLayoutSection $section) => $section
42+
->addColumn(6, fn (ShowLayoutColumn $column) => $column
43+
->withField('name')
44+
->withField('description')
45+
)
46+
)
5847
->addEntityListSection(PostEntity::class);
5948
}
6049

50+
public function buildShowConfig(): void
51+
{
52+
$this->configureBreadcrumbCustomLabelAttribute('name');
53+
}
54+
55+
public function find(mixed $id): array
56+
{
57+
return $this->transform(Category::findOrFail($id));
58+
}
59+
6160
public function delete($id): void
6261
{
6362
Category::findOrFail($id)->delete();

demo/app/Sharp/Categories/Commands/CleanUnusedCategoriesCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function label(): ?string
1515

1616
public function buildCommandConfig(): void
1717
{
18-
$this->configureConfirmationText('Delete all categories with 0 post attached?', title: 'Are you sure?')
18+
$this->configureConfirmationText('Delete all categories without post attached?', title: 'Are you sure?')
1919
->configureDescription('This action will remove all orphan categories');
2020
}
2121

demo/app/Sharp/Posts/PostList.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ public function buildListConfig(): void
8080

8181
protected function buildPageAlert(PageAlert $pageAlert): void
8282
{
83+
if (sharp()->context()->isShow()) {
84+
return;
85+
}
86+
8387
if (auth()->user()->isAdmin() && ($count = Post::where('state', 'draft')->count()) > 0) {
8488
$pageAlert
8589
->setMessage(sprintf('%d posts are still in draft', $count))

dist/assets/CardDescription.vue_vue_type_script_setup_true_lang-DasqFFhz.js renamed to dist/assets/CardDescription.vue_vue_type_script_setup_true_lang-DC5OSXye.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/assets/DropdownChevronDown.vue_vue_type_script_setup_true_lang-DKUJx6JE.js renamed to dist/assets/DropdownChevronDown.vue_vue_type_script_setup_true_lang-DuCv11Rb.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)