Updated import buttons size and grouped all available export buttons #1582
@@ -31,7 +31,6 @@ use Filament\Notifications\Notification;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Support\Enums\ActionSize;
|
||||
use Filament\Tables;
|
||||
use Filament\Tables\Actions\Action;
|
||||
use Filament\Tables\Actions\ActionGroup;
|
||||
use Filament\Tables\Actions\ExportAction;
|
||||
use Filament\Tables\Actions\ImportAction;
|
||||
@@ -382,17 +381,6 @@ class InvoiceValidationResource extends Resource
|
||||
])
|
||||
|
||||
->headerActions([
|
||||
// Action::make('plant_id')
|
||||
// ->label('Select Plant')
|
||||
// ->form([
|
||||
// Select::make('plant_id')
|
||||
// ->options(Plant::pluck('name', 'id')->toArray()) // Fetch plant names and IDs
|
||||
// ->label('Select Plant')
|
||||
// ->required()
|
||||
// ->reactive()
|
||||
// ]),
|
||||
// ActionGroup::make([
|
||||
|
||||
Tables\Actions\Action::make('Import Serial Number')
|
||||
->label('Import Serial Invoice')
|
||||
->form([
|
||||
@@ -740,7 +728,6 @@ class InvoiceValidationResource extends Resource
|
||||
}
|
||||
}
|
||||
})
|
||||
->size(ActionSize::ExtraSmall)
|
||||
->visible(function () {
|
||||
return Filament::auth()->user()->can('view import serial invoice');
|
||||
}),
|
||||
@@ -1141,7 +1128,6 @@ class InvoiceValidationResource extends Resource
|
||||
}
|
||||
}
|
||||
})
|
||||
->size(ActionSize::ExtraSmall)
|
||||
->visible(function () {
|
||||
return Filament::auth()->user()->can('view import panel serial invoice');
|
||||
}),
|
||||
@@ -1554,15 +1540,12 @@ class InvoiceValidationResource extends Resource
|
||||
|
||||
}
|
||||
})
|
||||
->size(ActionSize::ExtraSmall)
|
||||
->visible(function () {
|
||||
return Filament::auth()->user()->can('view import material invoice');
|
||||
}),
|
||||
|
||||
ImportAction::make('invoice_import')
|
||||
->label('Import Invoices')
|
||||
->color('warning')
|
||||
->size(ActionSize::ExtraSmall)
|
||||
->importer(InvoiceValidationImporter::class)
|
||||
->visible(function () {
|
||||
return Filament::auth()->user()->can('view import invoice');
|
||||
@@ -1570,43 +1553,38 @@ class InvoiceValidationResource extends Resource
|
||||
ImportAction::make('sap_invoice_import')
|
||||
->label('Import SAP Invoices')
|
||||
->color('warning')
|
||||
->size(ActionSize::ExtraSmall)
|
||||
->importer(SapInvoiceValidationImporter::class)
|
||||
->visible(function () {
|
||||
return Filament::auth()->user()->can('view import sap invoice');
|
||||
}),
|
||||
|
||||
// ])
|
||||
// ->label('Imports')
|
||||
// ->icon('heroicon-m-document-text')
|
||||
// ->button(),
|
||||
ExportAction::make('serial_invoice_export')
|
||||
->label('Export Serial Invoices')
|
||||
->color('warning')
|
||||
->size(ActionSize::ExtraSmall)
|
||||
// ->extraAttributes([
|
||||
// 'class' => 'w-56 h-12',
|
||||
// ])
|
||||
->exporter(InvoiceValidationExporter::class)
|
||||
->visible(function () {
|
||||
return Filament::auth()->user()->can('view export serial invoice');
|
||||
}),
|
||||
ExportAction::make('material_invoice_export')
|
||||
->label('Export Material Invoices')
|
||||
->color('warning')
|
||||
->size(ActionSize::ExtraSmall)
|
||||
->exporter(MaterialInvoiceValidationExporter::class)
|
||||
->visible(function () {
|
||||
return Filament::auth()->user()->can('view export material invoice');
|
||||
}),
|
||||
ExportAction::make('axn_export')
|
||||
->label('Export Asn')
|
||||
->color('warning')
|
||||
->size(ActionSize::ExtraSmall)
|
||||
->exporter(AxnExporter::class)
|
||||
->visible(function () {
|
||||
return Filament::auth()->user()->can('view export asn invoice');
|
||||
}),
|
||||
ActionGroup::make([
|
||||
ExportAction::make('serial_invoice_export')
|
||||
->label('Export Serial Invoices')
|
||||
->color('warning')
|
||||
->exporter(InvoiceValidationExporter::class)
|
||||
->visible(function () {
|
||||
return Filament::auth()->user()->can('view export serial invoice');
|
||||
}),
|
||||
ExportAction::make('material_invoice_export')
|
||||
->label('Export Material Invoices')
|
||||
->color('warning')
|
||||
->exporter(MaterialInvoiceValidationExporter::class)
|
||||
->visible(function () {
|
||||
return Filament::auth()->user()->can('view export material invoice');
|
||||
}),
|
||||
ExportAction::make('axn_export')
|
||||
->label('Export Asn')
|
||||
->color('warning')
|
||||
->size(ActionSize::ExtraSmall)
|
||||
->exporter(AxnExporter::class)
|
||||
->visible(function () {
|
||||
return Filament::auth()->user()->can('view export asn invoice');
|
||||
}),
|
||||
// remaining import/export actions
|
||||
])
|
||||
->label('More Actions')
|
||||
->button()
|
||||
->color('gray'),
|
||||
])
|
||||
|
||||
->filters([
|
||||
|
||||
Reference in New Issue
Block a user