fix daterange presets, fix e2e test

This commit is contained in:
Gregor Vostrak
2025-06-30 12:43:20 +02:00
parent af5e894c83
commit 326b76a07f
3 changed files with 27 additions and 28 deletions

View File

@@ -102,7 +102,7 @@ test('test that updating billable rate works with existing time entries', async
await page.getByRole('row').first().getByRole('button').click(); await page.getByRole('row').first().getByRole('button').click();
await page.getByRole('menuitem').getByText('Edit').first().click(); await page.getByRole('menuitem').getByText('Edit').first().click();
await page.getByText('Non-Billable').click(); await page.getByText('Non-Billable').click();
await page.getByText('Custom Rate').click(); await page.getByText('Custom Rate').click();
await page await page
.getByPlaceholder('Billable Rate') .getByPlaceholder('Billable Rate')
@@ -111,8 +111,8 @@ test('test that updating billable rate works with existing time entries', async
await Promise.all([ await Promise.all([
page page
.getByRole('button', { name: 'Yes, update existing time entries' }) .locator('button').filter({ hasText: 'Yes, update existing time' })
.click(), .click(),
page.waitForRequest( page.waitForRequest(
async (request) => async (request) =>
request.url().includes('/projects/') && request.url().includes('/projects/') &&

View File

@@ -33,14 +33,13 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
<div <div
:class=" :class="
cn( cn(
'fixed top-0 left-0 z-50 pointer-events-none w-screen h-screen flex items-start pt-6 md:pt-20 xl:pt-32 justify-center overflow-auto data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95', 'fixed top-0 left-0 z-50 pointer-events-none w-screen h-screen flex items-start pt-6 md:pt-20 xl:pt-32 justify-center overflow-auto',
)" )"
> >
<DialogContent <DialogContent
v-bind="forwarded" v-bind="forwarded"
:class="cn( :class="cn(
'bg-default-background grid w-full max-w-lg border border-border-tertiary shadow-lg duration-200 sm:rounded-lg', 'bg-default-background grid w-full max-w-lg border border-border-tertiary shadow-lg duration-200 sm:rounded-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',
props.class, props.class,
)" )"
> >

View File

@@ -73,18 +73,18 @@ const open = ref(false);
function setToday() { function setToday() {
emit( emit(
'update:start', 'update:start',
getLocalizedDayJs().startOf('day').format('YYYY-MM-DD') getLocalizedDayJs().startOf('day').format()
); );
emit('update:end', getLocalizedDayJs().endOf('day').format('YYYY-MM-DD')); emit('update:end', getLocalizedDayJs().endOf('day').format());
open.value = false; open.value = false;
} }
function setThisWeek() { function setThisWeek() {
emit( emit(
'update:start', 'update:start',
getLocalizedDayJs().startOf('week').format('YYYY-MM-DD') getLocalizedDayJs().startOf('week').format()
); );
emit('update:end', getLocalizedDayJs().endOf('week').format('YYYY-MM-DD')); emit('update:end', getLocalizedDayJs().endOf('week').format());
open.value = false; open.value = false;
} }
@@ -94,14 +94,14 @@ function setLastWeek() {
getLocalizedDayJs() getLocalizedDayJs()
.subtract(1, 'week') .subtract(1, 'week')
.startOf('week') .startOf('week')
.format('YYYY-MM-DD') .format()
); );
emit( emit(
'update:end', 'update:end',
getLocalizedDayJs() getLocalizedDayJs()
.subtract(1, 'week') .subtract(1, 'week')
.endOf('week') .endOf('week')
.format('YYYY-MM-DD') .format()
); );
open.value = false; open.value = false;
} }
@@ -109,18 +109,18 @@ function setLastWeek() {
function setLast14Days() { function setLast14Days() {
emit( emit(
'update:start', 'update:start',
getLocalizedDayJs().subtract(14, 'days').format('YYYY-MM-DD') getLocalizedDayJs().subtract(14, 'days').format()
); );
emit('update:end', getLocalizedDayJs().format('YYYY-MM-DD')); emit('update:end', getLocalizedDayJs().format());
open.value = false; open.value = false;
} }
function setThisMonth() { function setThisMonth() {
emit( emit(
'update:start', 'update:start',
getLocalizedDayJs().startOf('month').format('YYYY-MM-DD') getLocalizedDayJs().startOf('month').format()
); );
emit('update:end', getLocalizedDayJs().endOf('month').format('YYYY-MM-DD')); emit('update:end', getLocalizedDayJs().endOf('month').format());
open.value = false; open.value = false;
} }
@@ -130,14 +130,14 @@ function setLastMonth() {
getLocalizedDayJs() getLocalizedDayJs()
.subtract(1, 'month') .subtract(1, 'month')
.startOf('month') .startOf('month')
.format('YYYY-MM-DD') .format()
); );
emit( emit(
'update:end', 'update:end',
getLocalizedDayJs() getLocalizedDayJs()
.subtract(1, 'month') .subtract(1, 'month')
.endOf('month') .endOf('month')
.format('YYYY-MM-DD') .format()
); );
open.value = false; open.value = false;
} }
@@ -145,36 +145,36 @@ function setLastMonth() {
function setLast30Days() { function setLast30Days() {
emit( emit(
'update:start', 'update:start',
getLocalizedDayJs().subtract(30, 'days').format('YYYY-MM-DD') getLocalizedDayJs().subtract(30, 'days').format()
); );
emit('update:end', getLocalizedDayJs().format('YYYY-MM-DD')); emit('update:end', getLocalizedDayJs().format());
open.value = false; open.value = false;
} }
function setLast90Days() { function setLast90Days() {
emit( emit(
'update:start', 'update:start',
getDayJsInstance()().subtract(90, 'days').format('YYYY-MM-DD') getDayJsInstance()().subtract(90, 'days').format()
); );
emit('update:end', getDayJsInstance()().format('YYYY-MM-DD')); emit('update:end', getDayJsInstance()().format());
open.value = false; open.value = false;
} }
function setLast12Months() { function setLast12Months() {
emit( emit(
'update:start', 'update:start',
getLocalizedDayJs().subtract(12, 'months').format('YYYY-MM-DD') getLocalizedDayJs().subtract(12, 'months').format()
); );
emit('update:end', getLocalizedDayJs().format('YYYY-MM-DD')); emit('update:end', getLocalizedDayJs().format());
open.value = false; open.value = false;
} }
function setThisYear() { function setThisYear() {
emit( emit(
'update:start', 'update:start',
getLocalizedDayJs().startOf('year').format('YYYY-MM-DD') getLocalizedDayJs().startOf('year').format()
); );
emit('update:end', getLocalizedDayJs().endOf('year').format('YYYY-MM-DD')); emit('update:end', getLocalizedDayJs().endOf('year').format());
open.value = false; open.value = false;
} }
@@ -184,14 +184,14 @@ function setLastYear() {
getLocalizedDayJs() getLocalizedDayJs()
.subtract(1, 'year') .subtract(1, 'year')
.startOf('year') .startOf('year')
.format('YYYY-MM-DD') .format()
); );
emit( emit(
'update:end', 'update:end',
getLocalizedDayJs() getLocalizedDayJs()
.subtract(1, 'year') .subtract(1, 'year')
.endOf('year') .endOf('year')
.format('YYYY-MM-DD') .format()
); );
open.value = false; open.value = false;
} }