Merge pull request #274 from pelican-dev/issue/267 and fix #267

This commit is contained in:
Lance Pioch 2024-05-24 21:15:14 -04:00 committed by GitHub
commit 73babfa2b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -344,7 +344,12 @@ class CreateServer extends CreateRecord
])) ]))
->schema([ ->schema([
Forms\Components\Placeholder::make('Select an egg first to show its variables!') Forms\Components\Placeholder::make('Select an egg first to show its variables!')
->hidden(fn (Forms\Get $get) => !empty($get('server_variables'))), ->hidden(fn (Forms\Get $get) => $get('egg_id')),
Forms\Components\Placeholder::make('The selected egg has no variables!')
->hidden(fn (Forms\Get $get) => !$get('egg_id') ||
Egg::query()->find($get('egg_id'))?->variables()?->count()
),
Forms\Components\Repeater::make('server_variables') Forms\Components\Repeater::make('server_variables')
->relationship('serverVariables') ->relationship('serverVariables')