Releases: mokhosh/filament-kanban
v2.1.0
Version 2.x 🎉
Big update with breaking changes
- 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;
}
Version 2.0.0
Big update with breaking changes
- 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.
v1.11.0
dark mode + other goodies
- 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"
hacky fix to the actual issue
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
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 rich editor not being filled in modal
fix Livewire property ['editModalFormState...'] cannot be found on component: ['...']
full height columns for a better ux on drag and drop
v1.9.0 make the status columns full height so you can drop items anywhere on…
v1.8.0
Two fixes by https://github.com/Log1x
🩹 Fix nullable state property
🩹 Fix sorting when using SPA mode