mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-17 20:52:14 +01:00
add description grouping to reporting page (fixes ST-399), persist grouping selection in local storage
This commit is contained in:
committed by
Constantin Graf
parent
5e4270e3f5
commit
b2ad4b3785
@@ -35,6 +35,7 @@ import { getCurrentMembershipId, getCurrentRole } from '@/utils/useUser';
|
|||||||
import ClientMultiselectDropdown from '@/Components/Common/Client/ClientMultiselectDropdown.vue';
|
import ClientMultiselectDropdown from '@/Components/Common/Client/ClientMultiselectDropdown.vue';
|
||||||
import { useTagsStore } from '@/utils/useTags';
|
import { useTagsStore } from '@/utils/useTags';
|
||||||
import { formatCents } from '@/packages/ui/src/utils/money';
|
import { formatCents } from '@/packages/ui/src/utils/money';
|
||||||
|
import { useStorage } from '@vueuse/core';
|
||||||
|
|
||||||
const startDate = ref<string>(
|
const startDate = ref<string>(
|
||||||
getLocalizedDayJs(getDayJsInstance()().format()).subtract(14, 'd').format()
|
getLocalizedDayJs(getDayJsInstance()().format()).subtract(14, 'd').format()
|
||||||
@@ -50,8 +51,8 @@ const selectedClients = ref<string[]>([]);
|
|||||||
|
|
||||||
const billable = ref<'true' | 'false' | null>(null);
|
const billable = ref<'true' | 'false' | null>(null);
|
||||||
|
|
||||||
const group = ref<GroupingOption>('project');
|
const group = useStorage<GroupingOption>('reporting-group', 'project');
|
||||||
const subGroup = ref<GroupingOption>('task');
|
const subGroup = useStorage<GroupingOption>('reporting-sub-group', 'task');
|
||||||
|
|
||||||
const reportingStore = useReportingStore();
|
const reportingStore = useReportingStore();
|
||||||
|
|
||||||
|
|||||||
@@ -2430,6 +2430,7 @@ If the group parameters are all set to `null` or are all missing, the
|
|||||||
'task',
|
'task',
|
||||||
'client',
|
'client',
|
||||||
'billable',
|
'billable',
|
||||||
|
'description',
|
||||||
])
|
])
|
||||||
.optional(),
|
.optional(),
|
||||||
},
|
},
|
||||||
@@ -2447,6 +2448,7 @@ If the group parameters are all set to `null` or are all missing, the
|
|||||||
'task',
|
'task',
|
||||||
'client',
|
'client',
|
||||||
'billable',
|
'billable',
|
||||||
|
'description',
|
||||||
])
|
])
|
||||||
.optional(),
|
.optional(),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import {
|
|||||||
UserCircleIcon,
|
UserCircleIcon,
|
||||||
UserGroupIcon,
|
UserGroupIcon,
|
||||||
} from '@heroicons/vue/20/solid';
|
} 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';
|
import BillableIcon from '@/packages/ui/src/Icons/BillableIcon.vue';
|
||||||
|
|
||||||
export type GroupingOption =
|
export type GroupingOption =
|
||||||
@@ -25,7 +25,8 @@ export type GroupingOption =
|
|||||||
| 'task'
|
| 'task'
|
||||||
| 'user'
|
| 'user'
|
||||||
| 'billable'
|
| 'billable'
|
||||||
| 'client';
|
| 'client'
|
||||||
|
| 'description';
|
||||||
|
|
||||||
export const useReportingStore = defineStore('reporting', () => {
|
export const useReportingStore = defineStore('reporting', () => {
|
||||||
const reportingGraphResponse = ref<ReportingResponse | null>(null);
|
const reportingGraphResponse = ref<ReportingResponse | null>(null);
|
||||||
@@ -85,6 +86,7 @@ export const useReportingStore = defineStore('reporting', () => {
|
|||||||
task: 'No Task',
|
task: 'No Task',
|
||||||
billable: 'Non-Billable',
|
billable: 'Non-Billable',
|
||||||
client: 'No Client',
|
client: 'No Client',
|
||||||
|
description: 'No Description',
|
||||||
} as Record<string, string>;
|
} as Record<string, string>;
|
||||||
|
|
||||||
function getNameForReportingRowEntry(
|
function getNameForReportingRowEntry(
|
||||||
@@ -158,6 +160,11 @@ export const useReportingStore = defineStore('reporting', () => {
|
|||||||
value: 'billable',
|
value: 'billable',
|
||||||
icon: BillableIcon,
|
icon: BillableIcon,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: 'Description',
|
||||||
|
value: 'description',
|
||||||
|
icon: DocumentTextIcon,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user