mod optimalized UI spaces

This commit is contained in:
E98Developer 2026-03-20 06:15:24 +01:00
parent a4a3f33082
commit 87722fdb87
2 changed files with 145 additions and 131 deletions

View File

@ -19,20 +19,10 @@ protected function getHeaderActions(): array
]; ];
} }
public function getHeading(): string
{
return "Árlista fájl: " . $this->record->filename;
}
protected function getHeaderWidgets(): array protected function getHeaderWidgets(): array
{ {
return [ return [
// Később ide jöhetnek widgetek, pl. statisztika a feldolgozásról // Később ide jöhetnek widgetek, pl. statisztika a feldolgozásról
]; ];
} }
public function getSubheading(): ?string
{
return "Beszállító: " . $this->record->supplier?->name;
}
} }

View File

@ -28,149 +28,173 @@ public static function configure(Schema $schema): Schema
->columnSpanFull() ->columnSpanFull()
->maxWidth(Width::Full) ->maxWidth(Width::Full)
->schema([ ->schema([
Section::make('Fájl információk') // BAL OSZLOP
Grid::make(1)
->columnSpan(1)
->schema([ ->schema([
Grid::make(3) Section::make('Fájl információk')
->schema([ ->schema([
TextEntry::make('filename') Grid::make(3)
->label('Fájlnév') ->schema([
->icon('heroicon-o-document-text') TextEntry::make('filename')
->color('primary'), ->label('Fájlnév')
TextEntry::make('supplier.name') ->icon('heroicon-o-document-text')
->label('Beszállító') ->color('primary'),
->icon('heroicon-o-user'), TextEntry::make('supplier.name')
TextEntry::make('status') ->label('Beszállító')
->label('Státusz') ->icon('heroicon-o-user'),
->badge() TextEntry::make('status')
->formatStateUsing(fn (PricelistFileStatusEnum $state): string => $state->label()) ->label('Státusz')
->color(fn (PricelistFileStatusEnum $state): string => match ($state) { ->badge()
PricelistFileStatusEnum::todo => 'gray', ->formatStateUsing(fn (PricelistFileStatusEnum $state): string => $state->label())
PricelistFileStatusEnum::inprogress => 'info', ->color(fn (PricelistFileStatusEnum $state): string => match ($state) {
PricelistFileStatusEnum::done => 'success', PricelistFileStatusEnum::todo => 'gray',
PricelistFileStatusEnum::fail => 'danger', PricelistFileStatusEnum::inprogress => 'info',
PricelistFileStatusEnum::waiting_for_approval => 'primary', PricelistFileStatusEnum::done => 'success',
PricelistFileStatusEnum::closed => 'warning', PricelistFileStatusEnum::fail => 'danger',
}), PricelistFileStatusEnum::waiting_for_approval => 'primary',
]), PricelistFileStatusEnum::closed => 'warning',
Grid::make(3) }),
->schema([ ]),
TextEntry::make('available_date') Grid::make(3)
->label('Életbelépés dátuma') ->schema([
->date('Y.m.d'), TextEntry::make('available_date')
TextEntry::make('created_at') ->label('Életbelépés')
->label('Feltöltés időpontja') ->date('Y.m.d'),
->dateTime('Y.m.d H:i'), TextEntry::make('created_at')
->label('Feltöltés')
->dateTime('Y.m.d H:i'),
]),
// SÁRGA NÉGYZET JAVÍTÁSA: Teljes szélességben alul, csak hiba esetén
TextEntry::make('processing_current_step') TextEntry::make('processing_current_step')
->label('Aktuális folyamat') ->label('Validációs hiba')
->weight('bold') ->weight('bold')
->color(fn ($record) => $record->status === PricelistFileStatusEnum::fail ? 'danger' : 'info') ->color('danger')
->columnSpanFull()
->visible(fn ($record) => $record->status === PricelistFileStatusEnum::fail)
->formatStateUsing(fn ($state, $record) => str_contains((string)$state, 'hibás') ? $state : "Hiba történt a folyamat során: $state"),
// Folyamatban lévő állapot kijelzése (nem hiba, de hasznos)
TextEntry::make('processing_current_step_inprogress')
->label('Aktuális folyamat')
->getStateUsing(fn ($record) => $record->processing_current_step)
->weight('bold')
->color('info')
->columnSpanFull()
->visible(fn ($record) => $record->status === PricelistFileStatusEnum::inprogress)
->formatStateUsing(fn ($state, $record) => "$state ({$record->processing_current_step_percentage}%)"), ->formatStateUsing(fn ($state, $record) => "$state ({$record->processing_current_step_percentage}%)"),
TextEntry::make('note')
->label('Megjegyzés')
->placeholder('Nincs megjegyzés')
->columnSpanFull(),
]), ]),
TextEntry::make('note')
->label('Megjegyzés')
->placeholder('Nincs megjegyzés')
->columnSpanFull(),
]), ]),
Section::make('Validáció statisztika') // JOBB OSZLOP
Grid::make(1)
->columnSpan(1)
->schema([ ->schema([
Grid::make(5)->schema([ Section::make('Fájl statisztika') // KÉK NÉGYZETEK JAVÍTÁSA: Összevont szekció
TextEntry::make('lines_count') ->schema([
->label('Összes sor') Grid::make(5)->schema([
->icon('heroicon-o-list-bullet') TextEntry::make('lines_count')
->getStateUsing(fn ($record) => $record->lines()->count()), ->label('Sorok')
TextEntry::make('error_lines_count') ->icon('heroicon-o-list-bullet')
->label('Hibás sorok') ->getStateUsing(fn ($record) => $record->lines()->count()),
->icon('heroicon-o-x-circle') TextEntry::make('error_lines_count')
->color('danger') ->label('Hibás')
->getStateUsing(fn ($record) => $record->lines()->where('status', 'error')->count()), ->icon('heroicon-o-x-circle')
TextEntry::make('warning_lines_count') ->color('danger')
->label('Figyelmeztetések') ->getStateUsing(fn ($record) => $record->lines()->where('status', 'error')->count()),
->icon('heroicon-o-exclamation-triangle') TextEntry::make('warning_lines_count')
->color('warning') ->label('Figyelm.')
->getStateUsing(fn ($record) => $record->lines()->where('status', 'warning')->count()), ->icon('heroicon-o-exclamation-triangle')
TextEntry::make('new_lines_count') ->color('warning')
->label('Új termékek') ->getStateUsing(fn ($record) => $record->lines()->where('status', 'warning')->count()),
->icon('heroicon-o-sparkles') TextEntry::make('new_lines_count')
->color('info') ->label('Új')
->getStateUsing(fn ($record) => $record->lines()->where('status', 'new_product')->count()), ->icon('heroicon-o-sparkles')
TextEntry::make('updated_lines_count') ->color('info')
->label('Módosult termékek') ->getStateUsing(fn ($record) => $record->lines()->where('status', 'new_product')->count()),
->icon('heroicon-o-pencil-square') TextEntry::make('updated_lines_count')
->color('primary') ->label('Módosult')
->getStateUsing(fn ($record) => $record->lines()->where('status', 'updated')->count()), ->icon('heroicon-o-pencil-square')
]), ->color('primary')
]) ->getStateUsing(fn ($record) => $record->lines()->where('status', 'updated')->count()),
->visible(fn ($record) => $record->lines()->exists()), ]),
Grid::make(4)->schema([
TextEntry::make('file_meta.preprocess.statistics.data_rows')
->label('Adatsorok')
->icon('heroicon-o-table-cells'),
TextEntry::make('file_meta.preprocess.statistics.column_count')
->label('Oszlopok'),
TextEntry::make('file_meta.preprocess.file_info.file_size_human')
->label('Fájlméret'),
TextEntry::make('file_meta.preprocess.duration_seconds')
->label('Idő')
->suffix(' mp'),
])
->extraAttributes(['class' => 'mt-4 border-t pt-4']),
])
->visible(fn ($record) => $record->lines()->exists() || !empty($record->file_meta['preprocess'] ?? [])),
Section::make('Feldolgozási folyamat (Workflow)')
->collapsible()
->collapsed(fn ($record) => $record->status !== PricelistFileStatusEnum::inprogress)
->schema([
RepeatableEntry::make('workflow_steps')
->label(false)
->schema([
TextEntry::make('label')
->label('Lépés')
->weight('bold')
->inlineLabel(),
TextEntry::make('status')
->label('Állapot')
->badge()
->inlineLabel()
->formatStateUsing(fn (string $state): string => match ($state) {
'pending' => 'várakozik',
'inprogress' => 'folyamatban',
'completed' => 'kész',
'failed' => 'hiba',
default => $state,
})
->color(fn (string $state): string => match ($state) {
'pending' => 'gray',
'inprogress' => 'info',
'completed' => 'success',
'failed' => 'danger',
default => 'gray',
})
->icon(fn (string $state): string => match ($state) {
'pending' => 'heroicon-o-clock',
'inprogress' => 'heroicon-o-arrow-path',
'completed' => 'heroicon-o-check-circle',
'failed' => 'heroicon-o-x-circle',
default => 'heroicon-o-question-mark-circle',
}),
])
->columns(2)
->columnSpanFull(),
]),
Section::make('Előfeldolgozás eredménye')
->schema([
Grid::make(4)->schema([
TextEntry::make('file_meta.preprocess.statistics.data_rows')
->label('Adatsorok')
->icon('heroicon-o-table-cells'),
TextEntry::make('file_meta.preprocess.statistics.column_count')
->label('Oszlopok száma'),
TextEntry::make('file_meta.preprocess.file_info.file_size_human')
->label('Fájlméret'),
TextEntry::make('file_meta.preprocess.duration_seconds')
->label('Feldolgozási idő')
->suffix(' mp'),
]),
RepeatableEntry::make('file_meta.preprocess.warnings') RepeatableEntry::make('file_meta.preprocess.warnings')
->label('Figyelmeztetések') ->label('Előfeldolgozási figyelmeztetések')
->schema([ ->schema([
TextEntry::make('message')->label('Leírás')->color('warning'), TextEntry::make('message')->label('Leírás')->color('warning'),
TextEntry::make('severity')->label('Súlyosság')->badge()->color('warning'), TextEntry::make('severity')->label('Súlyosság')->badge()->color('warning'),
]) ])
->visible(fn ($record) => !empty($record->file_meta['preprocess']['warnings'] ?? [])), ->visible(fn ($record) => !empty($record->file_meta['preprocess']['warnings'] ?? [])),
RepeatableEntry::make('file_meta.preprocess.errors') RepeatableEntry::make('file_meta.preprocess.errors')
->label('Hibák') ->label('Előfeldolgozási hibák')
->schema([ ->schema([
TextEntry::make('message')->label('Leírás')->color('danger'), TextEntry::make('message')->label('Leírás')->color('danger'),
TextEntry::make('severity')->label('Súlyosság')->badge()->color('danger'), TextEntry::make('severity')->label('Súlyosság')->badge()->color('danger'),
]) ])
->visible(fn ($record) => !empty($record->file_meta['preprocess']['errors'] ?? [])), ->visible(fn ($record) => !empty($record->file_meta['preprocess']['errors'] ?? [])),
])
->visible(fn ($record) => !empty($record->file_meta['preprocess'] ?? [])),
Section::make('Feldolgozási folyamat (Workflow)')
->schema([
RepeatableEntry::make('workflow_steps')
->label(false)
->schema([
TextEntry::make('label')
->label('Lépés')
->weight('bold')
->inlineLabel(),
TextEntry::make('status')
->label('Állapot')
->badge()
->inlineLabel()
->formatStateUsing(fn (string $state): string => match ($state) {
'pending' => 'várakozik',
'inprogress' => 'folyamatban',
'completed' => 'kész',
'failed' => 'hiba',
default => $state,
})
->color(fn (string $state): string => match ($state) {
'pending' => 'gray',
'inprogress' => 'info',
'completed' => 'success',
'failed' => 'danger',
default => 'gray',
})
->icon(fn (string $state): string => match ($state) {
'pending' => 'heroicon-o-clock',
'inprogress' => 'heroicon-o-arrow-path',
'completed' => 'heroicon-o-check-circle',
'failed' => 'heroicon-o-x-circle',
default => 'heroicon-o-question-mark-circle',
}),
])
->columns(2)
->columnSpanFull(),
]), ]),
]), ]),
]), ]),