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

View File

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