Fix Editing Files

This commit is contained in:
notCharles 2025-06-24 19:12:24 -04:00
parent 4f3e07d4e4
commit 0c3baa5cd8
2 changed files with 9 additions and 13 deletions

View File

@ -118,16 +118,14 @@ class EditFiles extends Page
->icon('tabler-x')
->url(fn () => ListFiles::getUrl(['path' => dirname($this->path)])),
])
->footerActionsAlignment(Alignment::End)
->footerActionsAlignment(Alignment::End) //TODO MISSING PADDING
->schema([
Select::make('lang')
Select::make('lang') //TODO BROKEN
->label('Syntax Highlighting')
->searchable()
->native(false)
->live()
->options(EditorLanguages::class)
->selectablePlaceholder(false)
->afterStateUpdated(fn ($state) => $this->dispatch('setLanguage', lang: $state))
->default(fn () => EditorLanguages::fromWithAlias(pathinfo($this->path, PATHINFO_EXTENSION))),
CodeEditor::make('editor')
->hiddenLabel()
@ -165,7 +163,8 @@ class EditFiles extends Page
$this->redirect(ListFiles::getUrl(['path' => dirname($this->path)]));
}
}),
]),
])
->columnSpanFull(),
]);
}
@ -208,7 +207,7 @@ class EditFiles extends Page
{
return [
'form' => $this->form(static::getResource()::form(
$this->makeForm()
$this->makeSchema()
->statePath($this->getFormStatePath())
->columns($this->hasInlineLabels() ? 1 : 2)
->inlineLabel($this->hasInlineLabels()),

View File

@ -1,9 +1,6 @@
<x-filament-panels::page class="fi-resource-edit-file-page">
<x-filament-panels::form
id="form"
:wire:key="$this->getId() . '.forms.' . $this->getFormStatePath()"
wire:submit="save"
>
<form>
{{ $this->form }}
</form>
<x-filament-actions::modals />
</x-filament-panels::form>
</x-filament-panels::page>