refactor: update internal Filament navigation to use getUrl() methods and remove redundant getRedirectUrl() implementations.
This commit is contained in:
parent
38533fa246
commit
eb72bac3cb
@ -6,6 +6,8 @@
|
||||
use App\Enums\VerificationStatus;
|
||||
use App\Models\VerificationRequest;
|
||||
use App\Models\VerificationReview;
|
||||
use App\Filament\Resources\Manage\Partners\Pages\ViewPartner;
|
||||
use App\Filament\Resources\Manage\Journalists\Pages\ManageJournalists;
|
||||
use BackedEnum;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\Concerns\InteractsWithActions;
|
||||
@ -114,9 +116,9 @@ public function getDetailUrl(VerificationRequest $request): ?string
|
||||
}
|
||||
|
||||
return match ($type) {
|
||||
'Company' => route('filament.dashboard.resources.manage.partners.view', ['record' => $entity->user_id]),
|
||||
'PartnerMedia' => route('filament.dashboard.resources.manage.partners.view', ['record' => $entity->company?->user_id]),
|
||||
'Journalist' => route('filament.dashboard.resources.manage.journalists.view', ['record' => $entity->id]),
|
||||
'Company' => ViewPartner::getUrl(['record' => $entity->user_id]),
|
||||
'PartnerMedia' => ViewPartner::getUrl(['record' => $entity->company?->user_id]),
|
||||
'Journalist' => ManageJournalists::getUrl(),
|
||||
default => null,
|
||||
};
|
||||
}
|
||||
|
||||
@ -8,6 +8,9 @@
|
||||
use App\Models\Journalist;
|
||||
use App\Models\PartnerMedia;
|
||||
use App\Models\VerificationRequest;
|
||||
use App\Filament\Pages\CustomCompany;
|
||||
use App\Filament\Pages\CustomMedia;
|
||||
use App\Filament\Resources\Manage\Journalists\Pages\ManageJournalists;
|
||||
use BackedEnum;
|
||||
use BezhanSalleh\FilamentShield\Traits\HasPageShield;
|
||||
use Filament\Actions\Action;
|
||||
@ -200,7 +203,7 @@ public function companyProgress(): array
|
||||
'needsRevision' => $this->needsRevision($this->companyVerification),
|
||||
'latestNotes' => $this->getLatestReviewNotes($this->companyVerification),
|
||||
'reviewHistory' => $this->getReviewHistory($this->companyVerification),
|
||||
'editUrl' => route('filament.dashboard.pages.manage.company'),
|
||||
'editUrl' => CustomCompany::getUrl(),
|
||||
'steps' => [
|
||||
[
|
||||
'title' => 'Pengajuan',
|
||||
@ -244,7 +247,7 @@ public function mediaProgress(): array
|
||||
'needsRevision' => $this->needsRevision($this->mediaVerification),
|
||||
'latestNotes' => $this->getLatestReviewNotes($this->mediaVerification),
|
||||
'reviewHistory' => $this->getReviewHistory($this->mediaVerification),
|
||||
'editUrl' => route('filament.dashboard.pages.manage.media'),
|
||||
'editUrl' => CustomMedia::getUrl(),
|
||||
'steps' => [
|
||||
[
|
||||
'title' => 'Pengajuan',
|
||||
@ -288,7 +291,7 @@ public function journalistProgress(): array
|
||||
'needsRevision' => $this->needsRevision($this->journalistVerification),
|
||||
'latestNotes' => $this->getLatestReviewNotes($this->journalistVerification),
|
||||
'reviewHistory' => $this->getReviewHistory($this->journalistVerification),
|
||||
'editUrl' => route('filament.dashboard.resources.manage.journalists.index'),
|
||||
'editUrl' => ManageJournalists::getUrl(),
|
||||
'steps' => [
|
||||
[
|
||||
'title' => 'Pengajuan',
|
||||
|
||||
@ -12,17 +12,12 @@ class CreateCooperation extends CreateRecord
|
||||
|
||||
protected static ?string $title = 'Tambah Kerja Sama';
|
||||
|
||||
protected function getRedirectUrl(): string
|
||||
{
|
||||
return $this->getResource()::getUrl('index');
|
||||
}
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Action::make('back')
|
||||
->label('Kembali')
|
||||
->url(fn (): string => route('filament.dashboard.resources.manage.cooperations.index'))
|
||||
->url(ListCooperations::getUrl())
|
||||
->outlined()
|
||||
->color('secondary'),
|
||||
];
|
||||
|
||||
@ -10,17 +10,12 @@ class EditCooperation extends EditRecord
|
||||
{
|
||||
protected static string $resource = CooperationResource::class;
|
||||
|
||||
protected function getRedirectUrl(): string
|
||||
{
|
||||
return $this->getResource()::getUrl('index');
|
||||
}
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Action::make('back')
|
||||
->label('Kembali')
|
||||
->url(fn (): string => route('filament.dashboard.resources.manage.cooperations.index'))
|
||||
->url(ListCooperations::getUrl())
|
||||
->outlined()
|
||||
->color('secondary'),
|
||||
];
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
|
||||
use App\Filament\Columns\TimestampColumns;
|
||||
use App\Filament\Resources\Manage\Journalists\Pages\ManageJournalists;
|
||||
use App\Filament\Pages\CustomMedia;
|
||||
use App\Models\Journalist;
|
||||
use Asmit\FilamentUpload\Forms\Components\AdvancedFileUpload;
|
||||
use BackedEnum;
|
||||
@ -279,7 +280,7 @@ public static function table(Table $table): Table
|
||||
->emptyStateActions([
|
||||
Action::make('completeMedia')
|
||||
->label('Lengkapi Data Media')
|
||||
->url(route('filament.dashboard.pages.manage.media'))
|
||||
->url(CustomMedia::getUrl())
|
||||
->button(),
|
||||
]);
|
||||
});
|
||||
|
||||
@ -12,17 +12,12 @@ class CreateContentRecap extends CreateRecord
|
||||
|
||||
protected static ?string $title = 'Tambah Rekap Konten';
|
||||
|
||||
protected function getRedirectUrl(): string
|
||||
{
|
||||
return $this->getResource()::getUrl('index');
|
||||
}
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Action::make('back')
|
||||
->label('Kembali')
|
||||
->url(fn (): string => route('filament.dashboard.resources.monitoring.content-recaps.index'))
|
||||
->url(ListContentRecaps::getUrl())
|
||||
->outlined()
|
||||
->color('secondary'),
|
||||
];
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
namespace App\Filament\Resources\Monitoring\ContentRecaps\Pages;
|
||||
|
||||
use App\Filament\Resources\Monitoring\ContentRecaps\ContentRecapResource;
|
||||
use App\Filament\Resources\Monitoring\MediaMonitorings\Pages\ListMediaMonitorings;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
@ -15,14 +16,9 @@ protected function getHeaderActions(): array
|
||||
return [
|
||||
Action::make('back')
|
||||
->label('Kembali')
|
||||
->url(fn (): string => route('filament.dashboard.resources.monitoring.media-monitorings.index'))
|
||||
->url(ListMediaMonitorings::getUrl())
|
||||
->outlined()
|
||||
->color('secondary'),
|
||||
];
|
||||
}
|
||||
|
||||
protected function getRedirectUrl(): string
|
||||
{
|
||||
return $this->getResource()::getUrl('index');
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,17 +12,12 @@ class CreateIssueManagement extends CreateRecord
|
||||
|
||||
protected static ?string $title = 'Tambah Manajemen Isu';
|
||||
|
||||
protected function getRedirectUrl(): string
|
||||
{
|
||||
return $this->getResource()::getUrl('index');
|
||||
}
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Action::make('back')
|
||||
->label('Kembali')
|
||||
->url(fn (): string => route('filament.dashboard.resources.monitoring.issue-managements.index'))
|
||||
->url(ListIssueManagements::getUrl())
|
||||
->outlined()
|
||||
->color('secondary'),
|
||||
];
|
||||
|
||||
@ -15,14 +15,9 @@ protected function getHeaderActions(): array
|
||||
return [
|
||||
Action::make('back')
|
||||
->label('Kembali')
|
||||
->url(fn (): string => route('filament.dashboard.resources.monitoring.issue-managements.index'))
|
||||
->url(ListIssueManagements::getUrl())
|
||||
->outlined()
|
||||
->color('secondary'),
|
||||
];
|
||||
}
|
||||
|
||||
protected function getRedirectUrl(): string
|
||||
{
|
||||
return $this->getResource()::getUrl('index');
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,17 +13,12 @@ class CreateMediaMonitoring extends CreateRecord
|
||||
|
||||
protected static ?string $title = 'Tambah Monitoring Media';
|
||||
|
||||
protected function getRedirectUrl(): string
|
||||
{
|
||||
return $this->getResource()::getUrl('index');
|
||||
}
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Action::make('back')
|
||||
->label('Kembali')
|
||||
->url(fn (): string => route('filament.dashboard.resources.monitoring.media-monitorings.index'))
|
||||
->url(ListMediaMonitorings::getUrl())
|
||||
->outlined()
|
||||
->color('secondary'),
|
||||
];
|
||||
|
||||
@ -15,14 +15,9 @@ protected function getHeaderActions(): array
|
||||
return [
|
||||
Action::make('back')
|
||||
->label('Kembali')
|
||||
->url(fn (): string => route('filament.dashboard.resources.monitoring.media-monitorings.index'))
|
||||
->url(ListMediaMonitorings::getUrl())
|
||||
->outlined()
|
||||
->color('secondary'),
|
||||
];
|
||||
}
|
||||
|
||||
protected function getRedirectUrl(): string
|
||||
{
|
||||
return $this->getResource()::getUrl('index');
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,17 +13,12 @@ class CreateNews extends CreateRecord
|
||||
|
||||
protected static ?string $title = 'Tambah Berita';
|
||||
|
||||
protected function getRedirectUrl(): string
|
||||
{
|
||||
return $this->getResource()::getUrl('index');
|
||||
}
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Action::make('back')
|
||||
->label('Kembali')
|
||||
->url(fn (): string => route('filament.dashboard.resources.publication.news.index'))
|
||||
->url(ListNews::getUrl())
|
||||
->outlined()
|
||||
->color('secondary'),
|
||||
];
|
||||
|
||||
@ -15,14 +15,9 @@ protected function getHeaderActions(): array
|
||||
return [
|
||||
Action::make('back')
|
||||
->label('Kembali')
|
||||
->url(fn (): string => route('filament.dashboard.resources.publication.news.index'))
|
||||
->url(ListNews::getUrl())
|
||||
->outlined()
|
||||
->color('secondary'),
|
||||
];
|
||||
}
|
||||
|
||||
protected function getRedirectUrl(): string
|
||||
{
|
||||
return $this->getResource()::getUrl('index');
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user