mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-16 12:12:15 +01:00
restrict group and subgroup so they are always different
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { defineStore, storeToRefs } from 'pinia';
|
||||
import { api } from '../../../openapi.json.client';
|
||||
import { computed, ref } from 'vue';
|
||||
import { type Component, computed, ref } from 'vue';
|
||||
import type {
|
||||
AggregatedTimeEntries,
|
||||
AggregatedTimeEntriesQueryParams,
|
||||
@@ -12,6 +12,20 @@ import { useProjectsStore } from '@/utils/useProjects';
|
||||
import { useMembersStore } from '@/utils/useMembers';
|
||||
import { useTasksStore } from '@/utils/useTasks';
|
||||
import { useClientsStore } from '@/utils/useClients';
|
||||
import {
|
||||
CheckCircleIcon,
|
||||
UserCircleIcon,
|
||||
UserGroupIcon,
|
||||
} from '@heroicons/vue/20/solid';
|
||||
import { FolderIcon } from '@heroicons/vue/16/solid';
|
||||
import BillableIcon from '@/Components/Common/Icons/BillableIcon.vue';
|
||||
|
||||
export type GroupingOption =
|
||||
| 'project'
|
||||
| 'task'
|
||||
| 'user'
|
||||
| 'billable'
|
||||
| 'client';
|
||||
|
||||
export const useReportingStore = defineStore('reporting', () => {
|
||||
const reportingGraphResponse = ref<ReportingResponse | null>(null);
|
||||
@@ -112,11 +126,44 @@ export const useReportingStore = defineStore('reporting', () => {
|
||||
return key;
|
||||
}
|
||||
|
||||
const groupByOptions: {
|
||||
label: string;
|
||||
value: GroupingOption;
|
||||
icon: Component;
|
||||
}[] = [
|
||||
{
|
||||
label: 'Members',
|
||||
value: 'user',
|
||||
icon: UserGroupIcon,
|
||||
},
|
||||
{
|
||||
label: 'Projects',
|
||||
value: 'project',
|
||||
icon: FolderIcon,
|
||||
},
|
||||
{
|
||||
label: 'Tasks',
|
||||
value: 'task',
|
||||
icon: CheckCircleIcon,
|
||||
},
|
||||
{
|
||||
label: 'Clients',
|
||||
value: 'client',
|
||||
icon: UserCircleIcon,
|
||||
},
|
||||
{
|
||||
label: 'Billable',
|
||||
value: 'billable',
|
||||
icon: BillableIcon,
|
||||
},
|
||||
];
|
||||
|
||||
return {
|
||||
aggregatedGraphTimeEntries,
|
||||
fetchGraphReporting,
|
||||
fetchTableReporting,
|
||||
aggregatedTableTimeEntries,
|
||||
getNameForReportingRowEntry,
|
||||
groupByOptions,
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user