mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-15 11:42:15 +01:00
Added the ability to disable group similar time entries (#1054)
* Added the ability to disable group similar time entries * Fix E2E test for Group similar time entries * Simplify `TimeEntryGroupedTable` by replacing ternary with early return logic * Refactor time entry grouping settings: rename storage key, move logic into a dedicated module * Replace fixed `waitForTimeout` calls in E2E tests with element-based waits and assertions * Run frontend linting and formatting for changes
This commit is contained in:
@@ -6,10 +6,15 @@ const props = withDefaults(
|
||||
defineProps<{
|
||||
expanded?: boolean;
|
||||
size?: string;
|
||||
/**
|
||||
* Test ID used for Playwright/E2E tests.
|
||||
*/
|
||||
testId?: string;
|
||||
}>(),
|
||||
{
|
||||
expanded: false,
|
||||
size: 'w-7 h-7',
|
||||
testId: 'grouped_items_count_button',
|
||||
}
|
||||
);
|
||||
|
||||
@@ -23,6 +28,7 @@ const expandedStatusClasses = computed(() => {
|
||||
|
||||
<template>
|
||||
<button
|
||||
:data-testid="props.testId"
|
||||
:class="
|
||||
twMerge(
|
||||
'font-medium text-base rounded flex items-center transition justify-center focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:border-transparent',
|
||||
|
||||
@@ -37,6 +37,7 @@ const props = defineProps<{
|
||||
organizationBillableRate: number | null;
|
||||
enableEstimatedTime: boolean;
|
||||
canCreateProject: boolean;
|
||||
groupSimilarTimeEntries: boolean;
|
||||
}>();
|
||||
|
||||
const groupedTimeEntries = computed(() => {
|
||||
@@ -58,6 +59,11 @@ const groupedTimeEntries = computed(() => {
|
||||
const newDailyEntries: TimeEntriesGroupedByType[] = [];
|
||||
|
||||
for (const entry of dailyEntries) {
|
||||
if (!props.groupSimilarTimeEntries) {
|
||||
newDailyEntries.push({ ...entry, timeEntries: [entry] });
|
||||
continue;
|
||||
}
|
||||
|
||||
// check if same entry already exists
|
||||
const oldEntriesIndex = newDailyEntries.findIndex(
|
||||
(e) =>
|
||||
|
||||
Reference in New Issue
Block a user