Skip to content

Commit cf06a03

Browse files
committed
UP
1 parent dd9bc27 commit cf06a03

File tree

4 files changed

+6
-75
lines changed

4 files changed

+6
-75
lines changed
Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,7 @@
1313
use Relaticle\Flowforge\Concerns\FormHandlingTrait;
1414
use Relaticle\Flowforge\Concerns\QueryHandlingTrait;
1515

16-
/**
17-
* Abstract base class for Kanban adapters.
18-
*
19-
* This class has been refactored to use traits for better separation of concerns:
20-
* - QueryHandlingTrait: For database query operations
21-
* - CardFormattingTrait: For formatting models as cards
22-
* - CrudOperationsTrait: For card CRUD operations
23-
* - FormHandlingTrait: For form generation and handling
24-
*/
25-
abstract class AbstractKanbanAdapter implements KanbanAdapterInterface, Wireable
16+
class DefaultKanbanAdapter implements KanbanAdapterInterface, Wireable
2617
{
2718
use QueryHandlingTrait;
2819
use CardFormattingTrait;

src/Config/KanbanConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public static function getDefaultEditFormSchema(
178178
->rows(3);
179179
}
180180

181-
$schema[] = \Filament\Forms\Components\Select::make($columnField)
181+
$schema[] = Select::make($columnField)
182182
->options($columnValues)
183183
->required();
184184

src/Filament/Pages/KanbanBoardPage.php

Lines changed: 4 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Relaticle\Flowforge\Filament\Pages;
46

57
use Filament\Pages\Page;
6-
use Relaticle\Flowforge\Adapters\EloquentQueryAdapter;
8+
use Relaticle\Flowforge\Adapters\DefaultKanbanAdapter;
79
use Relaticle\Flowforge\Config\KanbanConfig;
810
use Relaticle\Flowforge\Contracts\KanbanAdapterInterface;
911

@@ -16,18 +18,6 @@ abstract class KanbanBoardPage extends Page
1618
*/
1719
protected KanbanConfig $config;
1820

19-
public array $createForm;
20-
21-
/**
22-
* The Kanban adapter instance.
23-
*/
24-
protected ?KanbanAdapterInterface $adapter = null;
25-
26-
/**
27-
* Custom adapter callback.
28-
*/
29-
protected mixed $adapterCallback = null;
30-
3121
/**
3222
* Constructor
3323
*/
@@ -142,62 +132,13 @@ public function cardLabel(string $label): static
142132
return $this;
143133
}
144134

145-
/**
146-
* Set a custom adapter for the Kanban board.
147-
*
148-
* @param KanbanAdapterInterface $adapter
149-
* @return KanbanBoardPage
150-
*/
151-
public function withCustomAdapter(KanbanAdapterInterface $adapter): static
152-
{
153-
$this->adapter = $adapter;
154-
155-
return $this;
156-
}
157-
158-
/**
159-
* Register a callback to modify the auto-created adapter.
160-
*
161-
* @param callable $callback
162-
* @return KanbanBoardPage
163-
*/
164-
public function withAdapterCallback(callable $callback): static
165-
{
166-
$this->adapterCallback = $callback;
167-
168-
return $this;
169-
}
170-
171-
/**
172-
* Set multiple configuration values at once.
173-
*
174-
* @param array<string, mixed> $config
175-
*/
176-
public function withConfiguration(array $config): static
177-
{
178-
$this->config = $this->config->with($config);
179-
180-
return $this;
181-
}
182-
183-
/**
184-
* Enable searchable for specific fields.
185-
*
186-
* @param array<int, string> $fields
187-
*/
188-
public function withSearchable(array $fields): static
189-
{
190-
// This method would be implemented in the component
191-
return $this;
192-
}
193-
194135
/**
195136
* Get the Kanban adapter.
196137
*
197138
* @throws \InvalidArgumentException If the subject is not set
198139
*/
199140
public function getAdapter(): KanbanAdapterInterface
200141
{
201-
return new EloquentQueryAdapter($this->getSubject(), $this->config);
142+
return new DefaultKanbanAdapter($this->getSubject(), $this->config);
202143
}
203144
}

src/Livewire/KanbanBoard.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Relaticle\Flowforge\Livewire;
66

7-
use App\Models\Task;
87
use Filament\Forms\Concerns\InteractsWithForms;
98
use Filament\Forms\Contracts\HasForms;
109
use Filament\Forms\Form;

0 commit comments

Comments
 (0)