invaders-xx/filament-kanban-board

Please add some additions.

Closed this issue · 2 comments

  1. EditModalRecord.php
protected function getEditModalRecordForm(): array
{
    return [
        'editModalRecord' => $this->makeForm()
            ->model($this->record) //<-- add this
            ->schema(static::getEditModalRecordSchema())
            ->statePath('editModalRecordState'),
        ];
}

To build a form, it is desirable that there be a model with the entry.
This is necessary so that it would be easier to work with relational.


  1. edit-modal-record.blade.php

Please add a check to see if there is any model or record there.

@if($this->editModalRecord->getModel())
   {{ $this->editModalRecord }}
@endif

  1. FilamentKanbanBoard.php
public function onStatusChanged($recordId, $statusId, $fromOrderedIds, $toOrderedIds): void
{
     self::$resource::getModel()::find($recordId)->update(['status' => $statusId]);
}

 ...
 // line 51
public function onRecordClick($recordId, $data): void
{
     $this->record = self::$resource::getModel()::find($recordId);
     $this->editModalRecord->fill($data);
     $this->dispatchBrowserEvent('open-modal', id: 'kanban--edit-modal-record');
}

    **// add to class**
public function dispatchBrowserEvent($event, $id)
{
     $this->dispatch($event, id: $id);
}

dispatchBrowserEvent <- not exist method

These changes are for Filament v3

Thank you so much for the work done! This helped a lot!

I did a pull request that solves roughly the same issue, but it's not been merged yet: #26
In the meantime I created a package from scratch which is influenced by this package, but fixes some issues that I had including this one. You can check it out here if you still have this issue: https://github.com/mokhosh/filament-kanban

It would be really cool to control the headers so that the content could scroll with static headers. And also control “show more”.
Add tooltip control and it will be simply unrealistically cool!)))
Thank you so much for making my job easier)