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