From 636914bbe5d776d4c2a4d67e0be5bbc99db9791c Mon Sep 17 00:00:00 2001 From: Gregor Vostrak Date: Tue, 12 Nov 2024 15:30:39 +0100 Subject: [PATCH] improve time picker parsing, fix nested escape listeners, change project member select --- e2e/project-members.spec.ts | 1 + e2e/time.spec.ts | 11 +- .../Common/Member/MemberCombobox.vue | 153 +++--------------- .../Common/Member/MemberEditModal.vue | 1 + .../ProjectMember/ProjectMemberEditModal.vue | 1 + .../Common/TimeEntry/TimeEntryCreateModal.vue | 1 - .../Partials/OrganizationBillableRate.vue | 1 + .../ui/src/Input/BillableRateInput.vue | 2 +- .../js/packages/ui/src/Input/DatePicker.vue | 2 +- .../js/packages/ui/src/Input/Dropdown.vue | 27 +++- .../ui/src/Input/DurationHumanInput.vue | 44 ++--- .../packages/ui/src/Input/SelectDropdown.vue | 61 ++++--- .../ui/src/Input/SelectDropdownItem.vue | 24 +-- .../js/packages/ui/src/Input/TextInput.vue | 11 +- .../js/packages/ui/src/Input/TimePicker.vue | 54 ++++++- .../ui/src/Input/TimeRangeSelector.vue | 8 +- resources/js/packages/ui/src/Modal.vue | 23 ++- .../Project/ProjectEditBillableSection.vue | 2 +- .../src/TimeEntry/TimeEntryRangeSelector.vue | 15 +- .../TimeEntry/TimeEntryRowDurationInput.vue | 3 +- .../packages/ui/src/utils/dismissableLayer.ts | 7 + 21 files changed, 224 insertions(+), 228 deletions(-) create mode 100644 resources/js/packages/ui/src/utils/dismissableLayer.ts diff --git a/e2e/project-members.spec.ts b/e2e/project-members.spec.ts index d1d22dcb..656f5781 100644 --- a/e2e/project-members.spec.ts +++ b/e2e/project-members.spec.ts @@ -24,6 +24,7 @@ test('test that updating project member billable rate works for existing time en await page.getByRole('button', { name: 'Add Member' }).click(); await expect(page.getByText('Add Project Member').first()).toBeVisible(); + await page.getByRole('button', { name: 'Select a member' }).click(); await page.keyboard.press('Enter'); await page.getByRole('button', { name: 'Add Project Member' }).click(); diff --git a/e2e/time.spec.ts b/e2e/time.spec.ts index b65aab50..cc6ffb49 100644 --- a/e2e/time.spec.ts +++ b/e2e/time.spec.ts @@ -191,14 +191,7 @@ test('test that updating a the start of an existing time entry in the overview w 'time_entry_range_selector' ); await timeEntryRangeElement.click(); - await page - .getByTestId('time_entry_range_start') - .getByTestId('time_picker_hour') - .fill('1'); - await page - .getByTestId('time_entry_range_start') - .getByTestId('time_picker_minute') - .fill('1'); + await page.getByTestId('time_picker_input').first().fill('1'); await Promise.all([ page.waitForResponse(async (response) => { return ( @@ -213,7 +206,7 @@ test('test that updating a the start of an existing time entry in the overview w }), page .getByTestId('time_entry_range_end') - .getByTestId('time_picker_minute') + .getByTestId('time_picker_input') .press('Enter'), ]); }); diff --git a/resources/js/Components/Common/Member/MemberCombobox.vue b/resources/js/Components/Common/Member/MemberCombobox.vue index b324d720..8f059e8e 100644 --- a/resources/js/Components/Common/Member/MemberCombobox.vue +++ b/resources/js/Components/Common/Member/MemberCombobox.vue @@ -1,13 +1,12 @@