add reporting client aggregation

This commit is contained in:
Gregor Vostrak
2024-05-31 02:18:19 +02:00
parent 4c977b5bf8
commit 4943baa236
2 changed files with 17 additions and 1 deletions

View File

@@ -3,7 +3,11 @@ import { FolderIcon } from '@heroicons/vue/16/solid';
import SelectDropdown from '@/Components/Common/SelectDropdown.vue'; import SelectDropdown from '@/Components/Common/SelectDropdown.vue';
import Badge from '@/Components/Common/Badge.vue'; import Badge from '@/Components/Common/Badge.vue';
import { computed } from 'vue'; import { computed } from 'vue';
import { CheckCircleIcon, UserGroupIcon } from '@heroicons/vue/20/solid'; import {
CheckCircleIcon,
UserCircleIcon,
UserGroupIcon,
} from '@heroicons/vue/20/solid';
import BillableIcon from '@/Components/Common/Icons/BillableIcon.vue'; import BillableIcon from '@/Components/Common/Icons/BillableIcon.vue';
const groupByOptions = [ const groupByOptions = [
@@ -22,6 +26,11 @@ const groupByOptions = [
value: 'task', value: 'task',
icon: CheckCircleIcon, icon: CheckCircleIcon,
}, },
{
label: 'Clients',
value: 'client',
icon: UserCircleIcon,
},
{ {
label: 'Billable', label: 'Billable',
value: 'billable', value: 'billable',

View File

@@ -11,6 +11,7 @@ import { useNotificationsStore } from '@/utils/notification';
import { useProjectsStore } from '@/utils/useProjects'; import { useProjectsStore } from '@/utils/useProjects';
import { useMembersStore } from '@/utils/useMembers'; import { useMembersStore } from '@/utils/useMembers';
import { useTasksStore } from '@/utils/useTasks'; import { useTasksStore } from '@/utils/useTasks';
import { useClientsStore } from '@/utils/useClients';
export const useReportingStore = defineStore('reporting', () => { export const useReportingStore = defineStore('reporting', () => {
const reportingGraphResponse = ref<ReportingResponse | null>(null); const reportingGraphResponse = ref<ReportingResponse | null>(null);
@@ -75,6 +76,7 @@ export const useReportingStore = defineStore('reporting', () => {
project: 'No Project', project: 'No Project',
task: 'No Task', task: 'No Task',
billable: 'Non-Billable', billable: 'Non-Billable',
client: 'No Client',
}; };
return emptyPlaceholder[type as keyof typeof emptyPlaceholder]; return emptyPlaceholder[type as keyof typeof emptyPlaceholder];
@@ -95,6 +97,11 @@ export const useReportingStore = defineStore('reporting', () => {
const { tasks } = storeToRefs(taskStore); const { tasks } = storeToRefs(taskStore);
return tasks.value.find((task) => task.id === key)?.name; return tasks.value.find((task) => task.id === key)?.name;
} }
if (type === 'client') {
const clientsStore = useClientsStore();
const { clients } = storeToRefs(clientsStore);
return clients.value.find((client) => client.id === key)?.name;
}
if (type === 'billable') { if (type === 'billable') {
if (key === '0') { if (key === '0') {
return 'Non-Billable'; return 'Non-Billable';