Fix file manager navigation and bulk select
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
A modern web hosting control panel for WordPress and general PHP hosting. Built with Laravel 12, Filament v5, Livewire 4, and Tailwind CSS v4.
|
||||
|
||||
Version: 0.9-rc30 (release candidate)
|
||||
Version: 0.9-rc31 (release candidate)
|
||||
|
||||
This is a release candidate. Expect rapid iteration and breaking changes until 1.0.
|
||||
|
||||
@@ -156,6 +156,7 @@ php artisan test --compact
|
||||
|
||||
## Initial Release
|
||||
|
||||
- 0.9-rc31: File manager navigation uses Livewire actions; parent row excluded from bulk select.
|
||||
- 0.9-rc30: Avoid IncludeOptional in ModSecurity CRS includes.
|
||||
- 0.9-rc29: Ensure ModSecurity unicode mapping is installed automatically.
|
||||
- 0.9-rc28: ModSecurity unicode mapping setup fixes.
|
||||
|
||||
@@ -232,6 +232,7 @@ class Files extends Page implements HasActions, HasForms, HasTable
|
||||
try {
|
||||
$this->currentPath = $this->sanitizePath($path);
|
||||
$this->loadDirectory();
|
||||
$this->resetTable();
|
||||
} catch (Exception $e) {
|
||||
Notification::make()
|
||||
->title('Invalid path')
|
||||
@@ -280,7 +281,15 @@ class Files extends Page implements HasActions, HasForms, HasTable
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->records(fn () => $this->items)
|
||||
->records(function () {
|
||||
return collect($this->items)
|
||||
->mapWithKeys(function (array $item, int $index): array {
|
||||
$key = $item['path'] ?? $item['name'] ?? (string) $index;
|
||||
|
||||
return [$key => $item];
|
||||
})
|
||||
->all();
|
||||
})
|
||||
->columns([
|
||||
TextColumn::make('name')
|
||||
->label(__('Name'))
|
||||
@@ -294,10 +303,8 @@ class Files extends Page implements HasActions, HasForms, HasTable
|
||||
$record['is_dir'] => 'warning',
|
||||
default => 'info',
|
||||
})
|
||||
->url(fn (array $record): ?string => $record['is_dir']
|
||||
? route('filament.jabali.pages.files', ['path' => $record['path']])
|
||||
: null)
|
||||
->openUrlInNewTab(false)
|
||||
->action(fn (array $record) => $this->navigateTo($record['path']))
|
||||
->disabledClick(fn (array $record): bool => ! $record['is_dir'])
|
||||
->weight('medium')
|
||||
->searchable(),
|
||||
TextColumn::make('size')
|
||||
@@ -619,6 +626,7 @@ class Files extends Page implements HasActions, HasForms, HasTable
|
||||
$this->resetTable();
|
||||
}),
|
||||
])
|
||||
->checkIfRecordIsSelectableUsing(fn (array $record): bool => ! ($record['is_parent'] ?? false))
|
||||
->headerActions([
|
||||
$this->newFolderAction(),
|
||||
$this->newFileAction(),
|
||||
|
||||
Reference in New Issue
Block a user