Skip to content

Commit

Permalink
add description grouping to reporting page (fixes ST-399), persist gr…
Browse files Browse the repository at this point in the history
…ouping selection in local storage
  • Loading branch information
Onatcer committed Sep 17, 2024
1 parent 3dfcc66 commit dc33d10
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
5 changes: 3 additions & 2 deletions resources/js/Pages/Reporting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ 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';
const startDate = ref<string>(
getLocalizedDayJs(getDayJsInstance()().format()).subtract(14, 'd').format()
Expand All @@ -50,8 +51,8 @@ const selectedClients = ref<string[]>([]);
const billable = ref<'true' | 'false' | null>(null);
const group = ref<GroupingOption>('project');
const subGroup = ref<GroupingOption>('task');
const group = useStorage<GroupingOption>('reporting-group', 'project');
const subGroup = useStorage<GroupingOption>('reporting-sub-group', 'task');
const reportingStore = useReportingStore();
Expand Down
2 changes: 2 additions & 0 deletions resources/js/packages/api/src/openapi.json.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2430,6 +2430,7 @@ If the group parameters are all set to &#x60;null&#x60; or are all missing, the
'task',
'client',
'billable',
'description',
])
.optional(),
},
Expand All @@ -2447,6 +2448,7 @@ If the group parameters are all set to &#x60;null&#x60; or are all missing, the
'task',
'client',
'billable',
'description',
])
.optional(),
},
Expand Down
11 changes: 9 additions & 2 deletions resources/js/utils/useReporting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@ import {
UserCircleIcon,
UserGroupIcon,
} from '@heroicons/vue/20/solid';
import { FolderIcon } from '@heroicons/vue/16/solid';
import { DocumentTextIcon, FolderIcon } from '@heroicons/vue/16/solid';
import BillableIcon from '@/packages/ui/src/Icons/BillableIcon.vue';

export type GroupingOption =
| 'project'
| 'task'
| 'user'
| 'billable'
| 'client';
| 'client'
| 'description';

export const useReportingStore = defineStore('reporting', () => {
const reportingGraphResponse = ref<ReportingResponse | null>(null);
Expand Down Expand Up @@ -85,6 +86,7 @@ export const useReportingStore = defineStore('reporting', () => {
task: 'No Task',
billable: 'Non-Billable',
client: 'No Client',
description: 'No Description',
} as Record<string, string>;

function getNameForReportingRowEntry(
Expand Down Expand Up @@ -158,6 +160,11 @@ export const useReportingStore = defineStore('reporting', () => {
value: 'billable',
icon: BillableIcon,
},
{
label: 'Description',
value: 'description',
icon: DocumentTextIcon,
},
];

return {
Expand Down

0 comments on commit dc33d10

Please sign in to comment.