mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-16 12:12:15 +01:00
add reporting client aggregation
This commit is contained in:
@@ -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',
|
||||||
|
|||||||
@@ -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';
|
||||||
|
|||||||
Reference in New Issue
Block a user