Skip to content

Commit

Permalink
Use tabs instead
Browse files Browse the repository at this point in the history
  • Loading branch information
lancepioch committed Apr 5, 2024
1 parent a96c53f commit 9557072
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
3 changes: 2 additions & 1 deletion app/Filament/Resources/NodeResource/Pages/CreateNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,15 @@ public function form(Forms\Form $form): Forms\Form
->hidden()
->columnSpanFull()
->rows(5),

Forms\Components\Hidden::make('skipValidation')->default(true),
]);
}

protected function getRedirectUrlParameters(): array
{
return [
'step' => 'configuration',
'tab' => '-configuration-tab',
];
}
}
37 changes: 21 additions & 16 deletions app/Filament/Resources/NodeResource/Pages/EditNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use App\Models\Node;
use Filament\Actions;
use Filament\Forms;
use Filament\Forms\Components\Tabs;
use Filament\Forms\Components\Wizard;
use Filament\Resources\Pages\EditRecord;
use Illuminate\Support\HtmlString;
Expand All @@ -17,19 +18,25 @@ class EditNode extends EditRecord

public function form(Forms\Form $form): Forms\Form
{
return $form
->schema([
Wizard::make([
Forms\Components\Wizard\Step::make('Basic')
->description('')
return $form->schema([
Tabs::make('Tabs')
->columns(4)
->persistTabInQueryString()
->columnSpanFull()
->tabs([
Tabs\Tab::make('Basic Settings')
->icon('tabler-server')
->schema((new CreateNode())->form($form)->getComponents()),
Forms\Components\Wizard\Step::make('Configuration')
->description('')
Tabs\Tab::make('Advanced Settings')
->icon('tabler-server-cog'),
Tabs\Tab::make('Configuration')
->icon('tabler-code')
->schema([
Forms\Components\Placeholder::make('instructions')
->columnSpanFull()
->content(new HtmlString('
This file should be placed in your daemon\'s root directory (usually <code>/etc/pelican</code>) in a file called <code>config.yml</code>.
This file should be placed in your daemon\'s root directory
(usually <code>/etc/pelican</code>) in a file called <code>config.yml</code>.
')),
Forms\Components\Textarea::make('config')
->label('Configuration File')
Expand All @@ -38,15 +45,13 @@ public function form(Forms\Form $form): Forms\Form
->hintAction(CopyAction::make())
->columnSpanFull(),
]),
Tabs\Tab::make('Allocations')
->icon('tabler-plug-connected')
->schema([
// ...
]),
])
->columns(4)
->persistStepInQueryString()
->columnSpanFull()
// ->startOnStep($this->getStartStep())
// ->cancelAction($this->getCancelFormAction())
// ->submitAction($this->getSubmitFormAction())
// ->skippable($this->hasSkippableSteps()),
]);
]);
}

protected function mutateFormDataBeforeFill(array $data): array
Expand Down

0 comments on commit 9557072

Please sign in to comment.