From 6bf02c355cdb9afec1ba3c05788099439cf729fe Mon Sep 17 00:00:00 2001 From: ht3aa Date: Sat, 4 Apr 2026 17:18:27 +0300 Subject: [PATCH 1/4] Add Gitea repository URL to remote work dashboard table Append gitea_repository_url for each job on the dashboard index and show it as a full external link. Align CompanyJob viewAny with verified job owners so the listing is authorized for the same users who can manage posts. Made-with: Cursor --- .../Dashboard/RemoteWorkController.php | 4 ++++ app/Policies/CompanyJobPolicy.php | 3 ++- .../js/pages/Dashboard/RemoteWork/Index.vue | 16 +++++++++++++- tests/Feature/RemoteWorkTest.php | 22 +++++++++++++++++++ 4 files changed, 43 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Dashboard/RemoteWorkController.php b/app/Http/Controllers/Dashboard/RemoteWorkController.php index f903b4fb..4eab2798 100644 --- a/app/Http/Controllers/Dashboard/RemoteWorkController.php +++ b/app/Http/Controllers/Dashboard/RemoteWorkController.php @@ -30,6 +30,10 @@ public function index(): Response ->latest() ->paginate(15); + $jobs->getCollection()->transform( + fn (CompanyJob $job): CompanyJob => $job->append('gitea_repository_url'), + ); + return Inertia::render('Dashboard/RemoteWork/Index', [ 'jobs' => $jobs, ]); diff --git a/app/Policies/CompanyJobPolicy.php b/app/Policies/CompanyJobPolicy.php index 0e341bbe..9459d083 100644 --- a/app/Policies/CompanyJobPolicy.php +++ b/app/Policies/CompanyJobPolicy.php @@ -14,7 +14,8 @@ class CompanyJobPolicy public function viewAny(User $user): bool { return $user->isSuperAdmin() - || $user->can('ViewAny:Jobs'); + || $user->can('ViewAny:Jobs') + || $user->hasVerifiedEmail(); } /** diff --git a/resources/js/pages/Dashboard/RemoteWork/Index.vue b/resources/js/pages/Dashboard/RemoteWork/Index.vue index 24dccc0d..4cf0b718 100644 --- a/resources/js/pages/Dashboard/RemoteWork/Index.vue +++ b/resources/js/pages/Dashboard/RemoteWork/Index.vue @@ -23,6 +23,7 @@ type JobRow = { slug: string; status: string; created_at: string | null; + gitea_repository_url: string | null; }; type Paginated = { @@ -97,6 +98,7 @@ function statusVariant( Title Status + Gitea repository Actions @@ -108,6 +110,18 @@ function statusVariant( {{ job.status }} + + + {{ job.gitea_repository_url }} + + +