All notable changes to filament-kanban
will be documented in this file.
- Allow custom stub file to be used for board. by @Cybrarist in #58
- @Cybrarist made their first contribution in #58
Full Changelog: https://github.com/mokhosh/filament-kanban/compare/v2.8.0...v2.9.0
- Add edit modal slideover option by @ryanmortier in #31
- @ryanmortier made their first contribution in #31
Full Changelog: https://github.com/mokhosh/filament-kanban/compare/v2.7.0...v2.8.0
- Add Laravell 11 support by @mokhosh and @gnovaro in #24
- @gnovaro made their first contribution in #24
Full Changelog: https://github.com/mokhosh/filament-kanban/compare/v2.6.1...v2.7.0
- Fix the overflow hidden styling by @hussain4real in #21
- @hussain4real made their first contribution in #21
Full Changelog: https://github.com/mokhosh/filament-kanban/compare/v2.6.0...v2.6.1
- Update KanbanBoard to not require a status property by @brenjt in #20
- Add getEloquentQuery in queries by @aislandener in #19
Full Changelog: https://github.com/mokhosh/filament-kanban/compare/v2.5.0...v2.6.0
Save relationships too when saving a record.
- Allow int backed enums to be used as status enum
- Fixes #15
- Fixes #12
- fixes #14
- deprecate has recent update indication trait
- fix animations not working
- fix cursor while grabbing
the stub now reflects latest changes
- $model and $statusEnum cannot be
null
- add
HasRecentUpdateIndication
trait
- I've added tests. It was a challenge as there is very little resources on how to test FilamentPHP packages π
- We now pass the whole
Model
to the views. So, you don't need to define the data you need to use. Just use them. - You now tell us which
Model
you're managing on this Kanban board, and we do most things for you. You don't have to override any methods. This includes loading records, updating them, sorting them, editing them, etc. - We now include a text input for editing the title in the edit form by default.
Imagine if you had this:
<?php
namespace App\Filament\Pages;
use App\Enums\UserStatus;
use App\Models\User;
use Filament\Forms\Components\TextInput;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Collection;
use Mokhosh\FilamentKanban\Pages\KanbanBoard;
class UserDashboard extends KanbanBoard
{
protected function statuses(): Collection
{
return UserStatus::statuses();
}
protected function records(): Collection
{
return User::ordered()->get();
}
public function onStatusChanged(int $recordId, string $status, array $fromOrderedIds, array $toOrderedIds): void
{
User::find($recordId)->update(['status' => $status]);
User::setNewOrder($toOrderedIds);
}
public function onSortChanged(int $recordId, string $status, array $orderedIds): void
{
User::find($recordId)->touch('updated_at');
User::setNewOrder($orderedIds);
}
protected function getEditModalFormSchema(null|int $recordId): array
{
return [
TextInput::make('title'),
];
}
protected function getEditModalRecordData($recordId, $data): array
{
return User::find($recordId)->toArray();
}
protected function editRecord($recordId, array $data, array $state): void
{
User::find($recordId)->update([
'title' => $data['title']
]);
}
protected function additionalRecordData(Model $record): Collection
{
return collect([
'deficiencies' => $record->deficiencies,
]);
}
}
Now you can have just this:
use App\Enums\UserStatus;
use App\Models\User;
use Mokhosh\FilamentKanban\Pages\KanbanBoard;
class UserDashboard extends KanbanBoard
{
protected static ?string $model = User::class;
protected static ?string $statusEnum = UserStatus::class;
}
- I've added tests. It was a challenge as there is very little resources on how to test FilamentPHP packages π
- We now pass the whole
Model
to the views. So, you don't need to define the data you need to use. Just use them. - You now tell us which
Model
you're managing on this Kanban board, and we do most things for you. You don't have to override any methods. This includes loading records, updating them, sorting them, editing them, etc. - We now include a text input for editing the title in the edit form by default.
Imagine if you had this:
<?php
namespace App\Filament\Pages;
use App\Enums\UserStatus;
use App\Models\User;
use Filament\Forms\Components\TextInput;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Collection;
use Mokhosh\FilamentKanban\Pages\KanbanBoard;
class UserDashboard extends KanbanBoard
{
protected function statuses(): Collection
{
return UserStatus::statuses();
}
protected function records(): Collection
{
return User::ordered()->get();
}
public function onStatusChanged(int $recordId, string $status, array $fromOrderedIds, array $toOrderedIds): void
{
User::find($recordId)->update(['status' => $status]);
User::setNewOrder($toOrderedIds);
}
public function onSortChanged(int $recordId, string $status, array $orderedIds): void
{
User::find($recordId)->touch('updated_at');
User::setNewOrder($orderedIds);
}
protected function getEditModalFormSchema(null|int $recordId): array
{
return [
TextInput::make('title'),
];
}
protected function getEditModalRecordData($recordId, $data): array
{
return User::find($recordId)->toArray();
}
protected function editRecord($recordId, array $data, array $state): void
{
User::find($recordId)->update([
'title' => $data['title']
]);
}
protected function additionalRecordData(Model $record): Collection
{
return collect([
'deficiencies' => $record->deficiencies,
]);
}
}
Now you can have just this:
use App\Enums\UserStatus;
use App\Models\User;
use Mokhosh\FilamentKanban\Pages\KanbanBoard;
class UserDashboard extends KanbanBoard
{
protected static ?string $model = User::class;
protected static ?string $statusEnum = UserStatus::class;
}
now you can customize views per kanban board
- dark mode
- modernize the looks
- embellishments for status titles
- bottom padding for scrollbar
- make status columns full hight for easier drag and drop
- add visual feedback to records that "just updated"
the previous attempt at fixing the issue with form that have a rich editor in them wasn't addressing the actual issue.
the issue is that when you have a working rich editor in the form, sometimes the form schema is created before the click record action is handled, which makes the form use the obsolete $editModalRecordId
.
the form didn't have an issue before adding mount
with $form->fill()
only because the rich editor was broken.
and when you fix it by adding the mount
method, it starts messing up the flow. if you don't set the $editModalRecordId
to null you might feel like you're avoiding some issues, but the form is using old $editModalRecordId
for building schema.
here I've manually triggered a schema creation inside the click handler to fix the issue, but i don't like it.
would appreciate if you have better solutions.
fix edit modal not receving record id after updating another model if a richtext is present - 2024-01-19
this was a weird one.
if you have a RichText
in your form schema, and you update one of the records, the next time you click on a card the form won't receive the recordId
in getEditModalFormSchema
.
this fixes it.
hopefully not introducing any regression. i set the record id to null
as a safety measure anyway.
fix Livewire property ['editModalFormState...'] cannot be found on component: ['...']
Two fixes by https://github.com/Log1x π©Ή Fix nullable state property π©Ή Fix sorting when using SPA mode
only describe additional data if you dont want to override the defaults
use enum value as status if the property on model has been cast to an enum
use enum value for id to allow backed enum casts on models
make assets publishable
update stubs
add a way to disable edit modal
add sorting and ordering
- initial release