feat: add default names for action classes to improve readability and consistency
This commit is contained in:
parent
1cdbaaaacc
commit
968af2c1c7
@ -12,6 +12,11 @@
|
||||
|
||||
class ReplyAction extends Action
|
||||
{
|
||||
public static function getDefaultName(): ?string
|
||||
{
|
||||
return 'reply';
|
||||
}
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -68,7 +68,7 @@ public static function configure(Table $table): Table
|
||||
ViewAction::make()
|
||||
->label('Lihat'),
|
||||
|
||||
ReplyAction::make('reply'),
|
||||
ReplyAction::make(),
|
||||
|
||||
DeleteAction::make()
|
||||
->label('Hapus'),
|
||||
|
||||
@ -15,6 +15,11 @@
|
||||
|
||||
class AcceptAction extends Action
|
||||
{
|
||||
public static function getDefaultName(): ?string
|
||||
{
|
||||
return 'accept';
|
||||
}
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -11,6 +11,11 @@
|
||||
|
||||
class CompleteCooperationAction extends Action
|
||||
{
|
||||
public static function getDefaultName(): ?string
|
||||
{
|
||||
return 'completeCooperation';
|
||||
}
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -18,6 +18,11 @@
|
||||
|
||||
class CreateTaskAssignmentAction extends Action
|
||||
{
|
||||
public static function getDefaultName(): ?string
|
||||
{
|
||||
return 'createTaskAssignment';
|
||||
}
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -12,6 +12,11 @@
|
||||
|
||||
class ProceedToPaymentAction extends Action
|
||||
{
|
||||
public static function getDefaultName(): ?string
|
||||
{
|
||||
return 'proceedToPayment';
|
||||
}
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -13,6 +13,11 @@
|
||||
|
||||
class RejectAction extends Action
|
||||
{
|
||||
public static function getDefaultName(): ?string
|
||||
{
|
||||
return 'reject';
|
||||
}
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -20,6 +20,11 @@
|
||||
|
||||
class SendProposalAction extends Action
|
||||
{
|
||||
public static function getDefaultName(): ?string
|
||||
{
|
||||
return 'sendProposal';
|
||||
}
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -18,6 +18,11 @@
|
||||
|
||||
class PayAction extends Action
|
||||
{
|
||||
public static function getDefaultName(): ?string
|
||||
{
|
||||
return 'pay';
|
||||
}
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -14,6 +14,11 @@
|
||||
|
||||
class AcceptAction extends Action
|
||||
{
|
||||
public static function getDefaultName(): ?string
|
||||
{
|
||||
return 'accept';
|
||||
}
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -16,6 +16,11 @@
|
||||
|
||||
class RejectAction extends Action
|
||||
{
|
||||
public static function getDefaultName(): ?string
|
||||
{
|
||||
return 'reject';
|
||||
}
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -14,6 +14,11 @@
|
||||
|
||||
class AcceptAction extends Action
|
||||
{
|
||||
public static function getDefaultName(): ?string
|
||||
{
|
||||
return 'accept';
|
||||
}
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -16,6 +16,11 @@
|
||||
|
||||
class RejectAction extends Action
|
||||
{
|
||||
public static function getDefaultName(): ?string
|
||||
{
|
||||
return 'reject';
|
||||
}
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -55,7 +55,7 @@ public function table(Table $table): Table
|
||||
->badge(),
|
||||
])
|
||||
->recordActions([
|
||||
PayAction::make('pay'),
|
||||
PayAction::make(),
|
||||
|
||||
ViewAction::make()
|
||||
->visible(fn (CooperationMedia $record): bool => $record->status === ApprovalStatus::ACCEPTED && $record->payment()->exists()),
|
||||
|
||||
@ -93,9 +93,9 @@ public function table(Table $table): Table
|
||||
->recordActions([
|
||||
ViewAction::make(),
|
||||
|
||||
AcceptAction::make('accept'),
|
||||
AcceptAction::make(),
|
||||
|
||||
RejectAction::make('reject'),
|
||||
RejectAction::make(),
|
||||
])
|
||||
->toolbarActions([
|
||||
BulkActionGroup::make([
|
||||
|
||||
@ -145,9 +145,9 @@ public function table(Table $table): Table
|
||||
->searchable(),
|
||||
])
|
||||
->recordActions([
|
||||
AcceptAction::make('accept'),
|
||||
AcceptAction::make(),
|
||||
|
||||
RejectAction::make('reject'),
|
||||
RejectAction::make(),
|
||||
])
|
||||
->headerActions([
|
||||
CreateAction::make()
|
||||
|
||||
@ -252,17 +252,17 @@ public static function configure(Table $table): Table
|
||||
->recordActions([
|
||||
ViewAction::make(),
|
||||
|
||||
AcceptAction::make('accept'),
|
||||
AcceptAction::make(),
|
||||
|
||||
RejectAction::make('reject'),
|
||||
RejectAction::make(),
|
||||
|
||||
SendProposalAction::make('sendProposal'),
|
||||
SendProposalAction::make(),
|
||||
|
||||
CreateTaskAssignmentAction::make('createTaskAssignment'),
|
||||
CreateTaskAssignmentAction::make(),
|
||||
|
||||
ProceedToPaymentAction::make('proceedToPayment'),
|
||||
ProceedToPaymentAction::make(),
|
||||
|
||||
CompleteCooperationAction::make('completeCooperation'),
|
||||
CompleteCooperationAction::make(),
|
||||
|
||||
EditAction::make(),
|
||||
|
||||
|
||||
@ -16,6 +16,11 @@
|
||||
|
||||
class AcceptAction extends Action
|
||||
{
|
||||
public static function getDefaultName(): ?string
|
||||
{
|
||||
return 'accept';
|
||||
}
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -16,6 +16,11 @@
|
||||
|
||||
class RejectAction extends Action
|
||||
{
|
||||
public static function getDefaultName(): ?string
|
||||
{
|
||||
return 'reject';
|
||||
}
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -95,8 +95,8 @@ public static function configure(Table $table): Table
|
||||
])
|
||||
->recordActions([
|
||||
ViewAction::make(),
|
||||
AcceptAction::make('accept'),
|
||||
RejectAction::make('reject'),
|
||||
AcceptAction::make(),
|
||||
RejectAction::make(),
|
||||
])
|
||||
->toolbarActions([
|
||||
BulkActionGroup::make([
|
||||
|
||||
@ -17,6 +17,11 @@
|
||||
|
||||
class DeleteJournalistAction extends DeleteAction
|
||||
{
|
||||
public static function getDefaultName(): ?string
|
||||
{
|
||||
return 'delete';
|
||||
}
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -18,6 +18,11 @@
|
||||
|
||||
class EditJournalistAction extends EditAction
|
||||
{
|
||||
public static function getDefaultName(): ?string
|
||||
{
|
||||
return 'edit';
|
||||
}
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -71,10 +71,10 @@ public static function configure(Table $table): Table
|
||||
)
|
||||
)
|
||||
->recordActions([
|
||||
EditJournalistAction::make('edit')
|
||||
EditJournalistAction::make()
|
||||
->visible(fn () => ! (in_array(auth()->user()->company?->verificationRequest?->status, [VerificationStatus::PENDING, VerificationStatus::REJECTED]) || auth()->user()->company?->verificationRequest()->pending()->exists())),
|
||||
|
||||
DeleteJournalistAction::make('delete')
|
||||
DeleteJournalistAction::make()
|
||||
->visible(fn () => ! (in_array(auth()->user()->company?->verificationRequest?->status, [VerificationStatus::PENDING, VerificationStatus::REJECTED]) || auth()->user()->company?->verificationRequest()->pending()->exists())),
|
||||
|
||||
ForceDeleteAction::make()
|
||||
|
||||
@ -12,6 +12,11 @@
|
||||
|
||||
class ChangePasswordAction extends Action
|
||||
{
|
||||
public static function getDefaultName(): ?string
|
||||
{
|
||||
return 'changePassword';
|
||||
}
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -106,7 +106,7 @@ public static function configure(Table $table): Table
|
||||
|
||||
RestoreAction::make(),
|
||||
|
||||
ChangePasswordAction::make('changePassword'),
|
||||
ChangePasswordAction::make(),
|
||||
])
|
||||
->toolbarActions([
|
||||
BulkActionGroup::make([
|
||||
|
||||
@ -12,6 +12,11 @@
|
||||
|
||||
class CrawlNewsAction extends Action
|
||||
{
|
||||
public static function getDefaultName(): ?string
|
||||
{
|
||||
return 'crawlNews';
|
||||
}
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -21,7 +21,7 @@ protected function getHeaderActions(): array
|
||||
CreateAction::make()
|
||||
->label('Tambah'),
|
||||
|
||||
CrawlNewsAction::make('crawlNews'),
|
||||
CrawlNewsAction::make(),
|
||||
|
||||
ExportAction::make()
|
||||
->exports([
|
||||
|
||||
Loading…
Reference in New Issue
Block a user