From 811ccc1baa2fe1fb9fcc8b5515c8c3f3b591e96a Mon Sep 17 00:00:00 2001 From: Dominik Pschenitschni Date: Wed, 17 Jul 2024 22:52:13 +0200 Subject: [PATCH] feat: improve ProjectSettingsViews (cherry picked from commit e8be657d9775a592987b684250809eb3d170a6f1) --- frontend/src/helpers/calculateItemPosition.ts | 7 ++- .../project/settings/ProjectSettingsViews.vue | 50 ++++++++++--------- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/frontend/src/helpers/calculateItemPosition.ts b/frontend/src/helpers/calculateItemPosition.ts index 9cea6e51f..6fa2c4e99 100644 --- a/frontend/src/helpers/calculateItemPosition.ts +++ b/frontend/src/helpers/calculateItemPosition.ts @@ -1,4 +1,7 @@ -export const calculateItemPosition = (positionBefore: number | null, positionAfter: number | null): number => { +export const calculateItemPosition = ( + positionBefore: number | null = null, + positionAfter: number | null = null, +): number => { if (positionBefore === null) { if (positionAfter === null) { return 0 @@ -13,6 +16,6 @@ export const calculateItemPosition = (positionBefore: number | null, positionAft return positionBefore + Math.pow(2, 16) } - // If we have both a task before and after it, we acually calculate the position + // If we have both a task before and after it, we actually calculate the position return positionBefore + (positionAfter - positionBefore) / 2 } \ No newline at end of file diff --git a/frontend/src/views/project/settings/ProjectSettingsViews.vue b/frontend/src/views/project/settings/ProjectSettingsViews.vue index 39a7ba626..71ef6da1e 100644 --- a/frontend/src/views/project/settings/ProjectSettingsViews.vue +++ b/frontend/src/views/project/settings/ProjectSettingsViews.vue @@ -1,6 +1,6 @@