Skip to content

Commit

Permalink
add detailed reporting page
Browse files Browse the repository at this point in the history
  • Loading branch information
Onatcer committed Sep 18, 2024
1 parent d5b35ef commit f81ecfb
Show file tree
Hide file tree
Showing 13 changed files with 445 additions and 22 deletions.
13 changes: 13 additions & 0 deletions app/Http/Requests/V1/TimeEntry/TimeEntryIndexRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,19 @@ public function rules(): array
return $builder->whereBelongsTo($this->organization, 'organization');
}),
],
// Filter by client IDs, client IDs are OR combined
'client_ids' => [
'array',
'min:1',
],
'client_ids.*' => [
'string',
'uuid',
new ExistsEloquent(Client::class, null, function (Builder $builder): Builder {

Check failure on line 60 in app/Http/Requests/V1/TimeEntry/TimeEntryIndexRequest.php

View workflow job for this annotation

GitHub Actions / phpstan

Class App\Http\Requests\V1\TimeEntry\Client not found.

Check failure on line 60 in app/Http/Requests/V1/TimeEntry/TimeEntryIndexRequest.php

View workflow job for this annotation

GitHub Actions / phpstan

Parameter #1 $model of class Korridor\LaravelModelValidationRules\Rules\ExistsEloquent constructor expects class-string<Illuminate\Database\Eloquent\Model>, string given.
/** @var Builder<Client> $builder */
return $builder->whereBelongsTo($this->organization, 'organization');

Check failure on line 62 in app/Http/Requests/V1/TimeEntry/TimeEntryIndexRequest.php

View workflow job for this annotation

GitHub Actions / phpstan

PHPDoc tag @var for variable $builder contains unknown class App\Http\Requests\V1\TimeEntry\Client.

Check failure on line 62 in app/Http/Requests/V1/TimeEntry/TimeEntryIndexRequest.php

View workflow job for this annotation

GitHub Actions / phpstan

Type App\Http\Requests\V1\TimeEntry\Client in generic type Illuminate\Database\Eloquent\Builder<App\Http\Requests\V1\TimeEntry\Client> in PHPDoc tag @var for variable $builder is not subtype of template type TModelClass of Illuminate\Database\Eloquent\Model of class Illuminate\Database\Eloquent\Builder.
}),
],
// Filter by project IDs, project IDs are OR combined
'project_ids' => [
'array',
Expand Down
5 changes: 4 additions & 1 deletion resources/js/Layouts/AppLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ const page = usePage<{
<NavigationSidebarItem
title="Reporting"
:icon="ChartBarIcon"
:current="route().current('reporting')"
:current="
route().current('reporting') ||
route().current('reporting.detailed')
"
:href="
route('reporting')
"></NavigationSidebarItem>
Expand Down
18 changes: 15 additions & 3 deletions resources/js/Pages/Reporting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,16 @@ import { getCurrentMembershipId, getCurrentRole } from '@/utils/useUser';
import ClientMultiselectDropdown from '@/Components/Common/Client/ClientMultiselectDropdown.vue';
import { useTagsStore } from '@/utils/useTags';
import { formatCents } from '@/packages/ui/src/utils/money';
import { useStorage } from '@vueuse/core';
import { useSessionStorage, useStorage } from '@vueuse/core';
import TabBar from '@/Components/Common/TabBar/TabBar.vue';
import TabBarItem from '@/Components/Common/TabBar/TabBarItem.vue';
import { router } from '@inertiajs/vue3';
const startDate = useStorage<string>(
const startDate = useSessionStorage<string>(
'reporting-start-date',
getLocalizedDayJs(getDayJsInstance()().format()).subtract(14, 'd').format()
);
const endDate = useStorage<string>(
const endDate = useSessionStorage<string>(
'reporting-end-date',
getLocalizedDayJs(getDayJsInstance()().format()).format()
);
Expand Down Expand Up @@ -157,6 +160,15 @@ async function createTag(tag: string) {
class="py-3 sm:py-5 border-b border-default-background-separator flex justify-between items-center">
<div class="flex items-center space-x-3 sm:space-x-6">
<PageTitle :icon="ChartBarIcon" title="Reporting"></PageTitle>
<TabBar>
<TabBarItem @click="router.visit(route('reporting'))" active
>Overview</TabBarItem
>
<TabBarItem
@click="router.visit(route('reporting.detailed'))"
>Detailed</TabBarItem
>
</TabBar>
</div>
</MainContainer>
<div class="p-3 w-full border-b border-default-background-separator">
Expand Down
Loading

0 comments on commit f81ecfb

Please sign in to comment.