From 0bd32dee39df6e2a3865908421edad515fb2f02d Mon Sep 17 00:00:00 2001 From: Gregor Vostrak Date: Tue, 20 May 2025 12:53:51 +0200 Subject: [PATCH 1/7] add new datepicker to time entry picker, add am/pm support --- resources/js/Pages/Time.vue | 4 +- .../js/packages/ui/src/Input/DatePicker.vue | 126 ++++++++++-------- .../ui/src/Input/TimePickerSimple.vue | 115 +++++++++++----- .../ui/src/Input/TimeRangeSelector.vue | 41 +++--- .../ui/src/TimeEntry/TimeEntryCreateModal.vue | 40 +++--- 5 files changed, 189 insertions(+), 137 deletions(-) diff --git a/resources/js/Pages/Time.vue b/resources/js/Pages/Time.vue index 1d011e6f..7d02016f 100644 --- a/resources/js/Pages/Time.vue +++ b/resources/js/Pages/Time.vue @@ -119,7 +119,8 @@ function deleteSelected() { diff --git a/resources/js/packages/ui/src/Input/TimeRangeSelector.vue b/resources/js/packages/ui/src/Input/TimeRangeSelector.vue index a6e4ffce..4e0f2bd8 100644 --- a/resources/js/packages/ui/src/Input/TimeRangeSelector.vue +++ b/resources/js/packages/ui/src/Input/TimeRangeSelector.vue @@ -84,6 +84,7 @@ watch(focused, (newValue, oldValue) => {
@@ -91,6 +92,7 @@ watch(focused, (newValue, oldValue) => { diff --git a/resources/js/packages/ui/src/TimeEntry/TimeEntryCreateModal.vue b/resources/js/packages/ui/src/TimeEntry/TimeEntryCreateModal.vue index ecce0a0e..4a9d61d1 100644 --- a/resources/js/packages/ui/src/TimeEntry/TimeEntryCreateModal.vue +++ b/resources/js/packages/ui/src/TimeEntry/TimeEntryCreateModal.vue @@ -257,9 +257,11 @@ type BillableOption = { From 4635fec016706e989f0dd7c164eb858c9d732e21 Mon Sep 17 00:00:00 2001 From: Gregor Vostrak Date: Tue, 20 May 2025 14:59:44 +0200 Subject: [PATCH 4/7] adapt test to respect new formatting for hours-minutes-colon-seperated --- e2e/organization.spec.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/e2e/organization.spec.ts b/e2e/organization.spec.ts index ebb4a539..3b1e046e 100644 --- a/e2e/organization.spec.ts +++ b/e2e/organization.spec.ts @@ -230,7 +230,9 @@ test('test that format settings are reflected in the dashboard', async ({ await expect(page.getByText('0.00€')).toBeVisible(); // check that 00:00 is displayed - await expect(page.getByText('0:00', { exact: true }).nth(0)).toBeVisible(); + await expect( + page.getByText('0:00 h', { exact: true }).nth(0) + ).toBeVisible(); // check that 0h 00min is not displayed await expect( page.getByText('0h 00min', { exact: true }).nth(0) From 915204f7a696c4ee0ff9325de49e7bcc910ef316 Mon Sep 17 00:00:00 2001 From: Gregor Vostrak Date: Tue, 20 May 2025 16:06:00 +0200 Subject: [PATCH 5/7] fix that timetracker duration popover instantly closes on click if another element was focused before --- .../ui/src/TimeTracker/TimeTrackerRangeSelector.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/resources/js/packages/ui/src/TimeTracker/TimeTrackerRangeSelector.vue b/resources/js/packages/ui/src/TimeTracker/TimeTrackerRangeSelector.vue index c241e3da..acbb26b3 100644 --- a/resources/js/packages/ui/src/TimeTracker/TimeTrackerRangeSelector.vue +++ b/resources/js/packages/ui/src/TimeTracker/TimeTrackerRangeSelector.vue @@ -101,15 +101,19 @@ const startTime = computed(() => { const inputField = ref(null); const timeRangeSelector = ref(null); +const isMouseDown = ref(false); function openModalOnTab(e: FocusEvent) { // check if the source is inside the dropdown + + console.log(e.target); const source = e.relatedTarget as HTMLElement; if ( source && window.document.body .querySelector('#app') - ?.contains(source) + ?.contains(source) && + !isMouseDown.value ) { open.value = true; } @@ -153,6 +157,8 @@ function closeAndFocusInput() { @keydown.exact.tab="focusNextElement" @keydown.exact.shift.tab="open = false" @blur="updateTimerAndStartLiveTimerUpdate" + @mousedown="isMouseDown = true" + @mouseup="isMouseDown = false" @keydown.enter="onTimeEntryEnterPress" />