diff --git a/app/Http/Controllers/Api/V1/ChartController.php b/app/Http/Controllers/Api/V1/ChartController.php index caafdd2c..4ceb6acc 100644 --- a/app/Http/Controllers/Api/V1/ChartController.php +++ b/app/Http/Controllers/Api/V1/ChartController.php @@ -15,6 +15,10 @@ class ChartController extends Controller { /** * @throws AuthorizationException + * + * @operationId weeklyProjectOverview + * + * @response array */ public function weeklyProjectOverview(Organization $organization, DashboardService $dashboardService): JsonResponse { @@ -28,6 +32,10 @@ class ChartController extends Controller /** * @throws AuthorizationException + * + * @operationId latestTasks + * + * @response array */ public function latestTasks(Organization $organization, DashboardService $dashboardService): JsonResponse { @@ -41,6 +49,10 @@ class ChartController extends Controller /** * @throws AuthorizationException + * + * @operationId lastSevenDays + * + * @response array }> */ public function lastSevenDays(Organization $organization, DashboardService $dashboardService): JsonResponse { @@ -54,6 +66,10 @@ class ChartController extends Controller /** * @throws AuthorizationException + * + * @operationId latestTeamActivity + * + * @response array */ public function latestTeamActivity(Organization $organization, DashboardService $dashboardService, PermissionStore $permissionStore): JsonResponse { @@ -66,6 +82,10 @@ class ChartController extends Controller /** * @throws AuthorizationException + * + * @operationId dailyTrackedHours + * + * @response array */ public function dailyTrackedHours(Organization $organization, DashboardService $dashboardService): JsonResponse { @@ -79,6 +99,10 @@ class ChartController extends Controller /** * @throws AuthorizationException + * + * @operationId totalWeeklyTime + * + * @response int */ public function totalWeeklyTime(Organization $organization, DashboardService $dashboardService): JsonResponse { @@ -92,6 +116,10 @@ class ChartController extends Controller /** * @throws AuthorizationException + * + * @operationId totalWeeklyBillableTime + * + * @response int */ public function totalWeeklyBillableTime(Organization $organization, DashboardService $dashboardService): JsonResponse { @@ -105,6 +133,10 @@ class ChartController extends Controller /** * @throws AuthorizationException + * + * @operationId totalWeeklyBillableAmount + * + * @response array{value: int, currency: string} */ public function totalWeeklyBillableAmount(Organization $organization, DashboardService $dashboardService): JsonResponse { @@ -123,6 +155,10 @@ class ChartController extends Controller /** * @throws AuthorizationException + * + * @operationId weeklyHistory + * + * @response array */ public function weeklyHistory(Organization $organization, DashboardService $dashboardService): JsonResponse { diff --git a/app/Http/Controllers/Web/DashboardController.php b/app/Http/Controllers/Web/DashboardController.php index 01751c04..ccb4c15a 100644 --- a/app/Http/Controllers/Web/DashboardController.php +++ b/app/Http/Controllers/Web/DashboardController.php @@ -20,14 +20,6 @@ class DashboardController extends Controller { $user = $this->user(); $organization = $this->currentOrganization(); - $dailyTrackedHours = $dashboardService->getDailyTrackedHours($user, $organization, 60); - $weeklyHistory = $dashboardService->getWeeklyHistory($user, $organization); - $totalWeeklyTime = $dashboardService->totalWeeklyTime($user, $organization); - $totalWeeklyBillableTime = $dashboardService->totalWeeklyBillableTime($user, $organization); - $totalWeeklyBillableAmount = $dashboardService->totalWeeklyBillableAmount($user, $organization); - $weeklyProjectOverview = $dashboardService->weeklyProjectOverview($user, $organization); - $latestTasks = $dashboardService->latestTasks($user, $organization); - $lastSevenDays = $dashboardService->lastSevenDays($user, $organization); $latestTeamActivity = null; if ($permissionStore->has($organization, 'time-entries:view:all')) { @@ -36,16 +28,6 @@ class DashboardController extends Controller $showBillableRate = $this->member($organization)->role !== Role::Employee->value || $organization->employees_can_see_billable_rates; - return Inertia::render('Dashboard', [ - 'weeklyProjectOverview' => $weeklyProjectOverview, - 'latestTasks' => $latestTasks, - 'lastSevenDays' => $lastSevenDays, - 'latestTeamActivity' => $latestTeamActivity, - 'dailyTrackedHours' => $dailyTrackedHours, - 'totalWeeklyTime' => $totalWeeklyTime, - 'totalWeeklyBillableTime' => $totalWeeklyBillableTime, - 'totalWeeklyBillableAmount' => $showBillableRate ? $totalWeeklyBillableAmount : null, - 'weeklyHistory' => $weeklyHistory, - ]); + return Inertia::render('Dashboard'); } } diff --git a/e2e/timetracker.spec.ts b/e2e/timetracker.spec.ts index ac716249..df4a210f 100644 --- a/e2e/timetracker.spec.ts +++ b/e2e/timetracker.spec.ts @@ -136,6 +136,7 @@ test('test that starting and updating the time while running works', async ({ await Promise.all([ page.waitForResponse(async (response) => { return ( + response.url().includes('/time-entries') && response.status() === 200 && (await response.headerValue('Content-Type')) === 'application/json' && diff --git a/e2e/utils/currentTimeEntry.ts b/e2e/utils/currentTimeEntry.ts index 0d8ce070..720fddde 100644 --- a/e2e/utils/currentTimeEntry.ts +++ b/e2e/utils/currentTimeEntry.ts @@ -18,6 +18,7 @@ export function newTimeEntryResponse( ) { return page.waitForResponse(async (response) => { return ( + response.url().includes('/time-entries') && response.status() === status && (await response.headerValue('Content-Type')) === 'application/json' && diff --git a/resources/js/Components/Dashboard/ActivityGraphCard.vue b/resources/js/Components/Dashboard/ActivityGraphCard.vue index 6df2ae3b..1ea89f07 100644 --- a/resources/js/Components/Dashboard/ActivityGraphCard.vue +++ b/resources/js/Components/Dashboard/ActivityGraphCard.vue @@ -1,29 +1,45 @@ diff --git a/resources/js/Components/Dashboard/LastSevenDaysCard.vue b/resources/js/Components/Dashboard/LastSevenDaysCard.vue index 9da3c9f7..02a03f5b 100644 --- a/resources/js/Components/Dashboard/LastSevenDaysCard.vue +++ b/resources/js/Components/Dashboard/LastSevenDaysCard.vue @@ -1,24 +1,53 @@ diff --git a/resources/js/Components/Dashboard/RecentlyTrackedTasksCard.vue b/resources/js/Components/Dashboard/RecentlyTrackedTasksCard.vue index 052710e6..2ee3bd76 100644 --- a/resources/js/Components/Dashboard/RecentlyTrackedTasksCard.vue +++ b/resources/js/Components/Dashboard/RecentlyTrackedTasksCard.vue @@ -1,32 +1,83 @@