mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-16 04:02:15 +01:00
add aggregation/grouping of time entries with same attributes in time view
This commit is contained in:
@@ -87,3 +87,11 @@ export function formatHumanReadableDate(date: string) {
|
||||
}
|
||||
return dayjs(date).fromNow();
|
||||
}
|
||||
|
||||
export function formatStartEnd(start: string, end: string | null) {
|
||||
if (end) {
|
||||
return `${formatTime(start)} - ${formatTime(end)}`;
|
||||
} else {
|
||||
return `${formatTime(start)} - ...`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,9 +24,29 @@ export const useMembersStore = defineStore('members', () => {
|
||||
}
|
||||
}
|
||||
|
||||
async function removeMember(membershipId: string) {
|
||||
const organization = getCurrentOrganizationId();
|
||||
if (organization) {
|
||||
await handleApiRequestNotifications(
|
||||
api.removeMember(
|
||||
{},
|
||||
{
|
||||
params: {
|
||||
organization: organization,
|
||||
membership: membershipId,
|
||||
},
|
||||
}
|
||||
),
|
||||
'Member deleted successfully',
|
||||
'Failed to delete member'
|
||||
);
|
||||
await fetchMembers();
|
||||
}
|
||||
}
|
||||
|
||||
const members = computed<Member[]>(() => {
|
||||
return membersResponse.value?.data || [];
|
||||
});
|
||||
|
||||
return { members, fetchMembers };
|
||||
return { members, fetchMembers, removeMember };
|
||||
});
|
||||
|
||||
@@ -5,6 +5,7 @@ import { reactive, ref } from 'vue';
|
||||
import type { CreateTimeEntryBody, TimeEntry } from '@/utils/api';
|
||||
import dayjs from 'dayjs';
|
||||
import { useNotificationsStore } from '@/utils/notification';
|
||||
export type TimeEntriesGroupedByType = TimeEntry & { timeEntries: TimeEntry[] };
|
||||
|
||||
export const useTimeEntriesStore = defineStore('timeEntries', () => {
|
||||
const timeEntries = ref<TimeEntry[]>(reactive([]));
|
||||
|
||||
Reference in New Issue
Block a user