chore: simplify calculateItemPosition #2623

Open
dpschen wants to merge 1 commits from dpschen/vikunja:feat/simplify-calculateItemPosition into main
Member
No description provided.
dpschen added 1 commit 2024-07-17 21:29:12 +00:00
chore: simplify calculateItemPosition
Some checks failed
continuous-integration/drone/pr Build is failing
05e591164c
dpschen force-pushed feat/simplify-calculateItemPosition from 05e591164c to ab3a6bc2a3 2024-07-18 10:42:16 +00:00 Compare
Member

Hi dpschen!

Thank you for creating a PR!

I've deployed the frontend changes of this PR on a preview environment under this URL: https://2623-feat-simplify-calculateitemposit--vikunja-frontend-preview.netlify.app

You can use this url to view the changes live and test them out.
You will need to manually connect this to an api running somewhere. The easiest to use is https://try.vikunja.io/.

This preview does not contain any changes made to the api, only the frontend.

Have a nice day!

Beep boop, I'm a bot.

Hi dpschen! Thank you for creating a PR! I've deployed the frontend changes of this PR on a preview environment under this URL: https://2623-feat-simplify-calculateitemposit--vikunja-frontend-preview.netlify.app You can use this url to view the changes live and test them out. You will need to manually connect this to an api running somewhere. The easiest to use is https://try.vikunja.io/. This preview does not contain any changes made to the api, only the frontend. Have a nice day! > Beep boop, I'm a bot.
dpschen changed title from WIP: chore: simplify calculateItemPosition to chore: simplify calculateItemPosition 2024-07-18 11:24:09 +00:00
konrad reviewed 2024-07-19 07:42:35 +00:00
@ -1,4 +1,7 @@
export const calculateItemPosition = (positionBefore: number | null, positionAfter: number | null): number => {
export const calculateItemPosition = (
positionBefore: number | null = null,
Owner

Shouldn't this be undefined instead of null, since the callers are now maybe passing undefined?

Shouldn't this be `undefined` instead of `null`, since the callers are now maybe passing `undefined`?
Author
Member

Because of the fallback positionBefore will never be undefined, so the type should be correct — but checking given the error below ;)

Because of the fallback `positionBefore` will never be `undefined`, so the type should be correct — but checking given the error below ;)
konrad requested changes 2024-07-19 07:43:48 +00:00
konrad left a comment
Owner

Looks like this causes foo is undefined errors when dragging tasks across kanban buckets.

Looks like this causes `foo is undefined` errors when dragging tasks across kanban buckets.
All checks were successful
continuous-integration/drone/pr Build is passing
Required
Details
This pull request doesn't have enough required approvals yet. 0 of 1 approvals granted from users or teams on the allowlist.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u feat/simplify-calculateItemPosition:dpschen-feat/simplify-calculateItemPosition
git checkout dpschen-feat/simplify-calculateItemPosition
Sign in to join this conversation.
No Reviewers
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vikunja/vikunja#2623
No description provided.