feat: enhance task assignment form with date pickers, numeric input, and textarea for improved user input
This commit is contained in:
parent
b85323e5b2
commit
a08a23ae25
@ -11,6 +11,9 @@
|
||||
use App\Filament\Support\CheerfulNotification;
|
||||
use Filament\Actions\BulkActionGroup;
|
||||
use Filament\Actions\DeleteBulkAction;
|
||||
use Filament\Forms\Components\DatePicker;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
@ -25,6 +28,11 @@ class TaskAssignmentRelationManager extends RelationManager
|
||||
|
||||
protected static bool $shouldSkipAuthorization = true;
|
||||
|
||||
public function isReadOnly(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function canViewForRecord(Model $ownerRecord, string $pageClass): bool
|
||||
{
|
||||
if (auth()->user()->hasRole(RoleEnum::PERUSAHAAN->value)) {
|
||||
@ -64,6 +72,35 @@ public function table(Table $table): Table
|
||||
->headerActions([
|
||||
CreateAction::make()
|
||||
->label('Buat Media Order')
|
||||
->modalWidth('md')
|
||||
->schema([
|
||||
DatePicker::make('start_date')
|
||||
->label('Tanggal Mulai')
|
||||
->native(false)
|
||||
->displayFormat('l, d F Y')
|
||||
->required(),
|
||||
|
||||
DatePicker::make('end_date')
|
||||
->label('Tanggal Selesai')
|
||||
->native(false)
|
||||
->displayFormat('l, d F Y')
|
||||
->required()
|
||||
->afterOrEqual('start_date'),
|
||||
|
||||
TextInput::make('report_amount')
|
||||
->label('Jumlah Bukti Tayang')
|
||||
->numeric()
|
||||
->minValue(1)
|
||||
->required()
|
||||
->autocomplete(false),
|
||||
|
||||
Textarea::make('task_description')
|
||||
->label('Deskripsi Tugas')
|
||||
->required()
|
||||
->rows(4)
|
||||
->placeholder('...')
|
||||
->autocomplete(false),
|
||||
])
|
||||
->visible(function (): bool {
|
||||
$user = auth()->user();
|
||||
|
||||
@ -93,6 +130,35 @@ public function table(Table $table): Table
|
||||
])
|
||||
->recordActions([
|
||||
EditAction::make()
|
||||
->modalWidth('md')
|
||||
->schema([
|
||||
DatePicker::make('start_date')
|
||||
->label('Tanggal Mulai')
|
||||
->native(false)
|
||||
->displayFormat('l, d F Y')
|
||||
->required(),
|
||||
|
||||
DatePicker::make('end_date')
|
||||
->label('Tanggal Selesai')
|
||||
->native(false)
|
||||
->displayFormat('l, d F Y')
|
||||
->required()
|
||||
->afterOrEqual('start_date'),
|
||||
|
||||
TextInput::make('report_amount')
|
||||
->label('Jumlah Bukti Tayang')
|
||||
->numeric()
|
||||
->minValue(1)
|
||||
->required()
|
||||
->autocomplete(false),
|
||||
|
||||
Textarea::make('task_description')
|
||||
->label('Deskripsi Tugas')
|
||||
->required()
|
||||
->rows(4)
|
||||
->placeholder('...')
|
||||
->autocomplete(false),
|
||||
])
|
||||
->successNotification(
|
||||
fn () => CheerfulNotification::success(
|
||||
CheerfulNotification::getByKey('cooperation.assignment_updated'),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user