feat: added board ordering in project using dnd#409
Conversation
| @@ -0,0 +1,90 @@ | |||
| DO $$ BEGIN | |||
There was a problem hiding this comment.
Not sure why these schema changes are being picked up. Did you run pnpm drizzle-kit generate? @kotserge
| visibility: boardVisibilityEnum("visibility").notNull().default("private"), | ||
| type: boardTypeEnum("type").notNull().default("regular"), | ||
| sourceBoardId: bigint("sourceBoardId", { mode: "number" }), | ||
| position: integer("position").notNull(), |
There was a problem hiding this comment.
This will update the position for all workspace members. Ideally we want to allow each user to customise the order of their boards so we'll need to do something similar to user_board_favourites.
In fact we should probably merge user_board_favourites into user_board and store position and isFavourite on there. That'll give us greater flexibility in future.
We'll need to:
- Create
board_usertable withuserId,boardId,position,isFavourite - Create migration to create a
board_userrecord for each board a user belongs (all in every workspace they belong to) and check against theboard_user_favouritestable to setisFavourite - Adding a new board should create a
board_userrecord - Updating the
positionshould reorder theboard_userrecords - Deleting a board should remove any
board_userrecords for that board - Favouriting/unfavouriting a board should update the
board_userrecord - Boards should be ordered by their position/isFavourite for a given user
Sorry for the dump - there's quite a lot to do here so I'm very happy to help. Just give me a shout if you've got any questions
7f38e40 to
d0eb657
Compare
|
Hey @hjball. My bad, I let this drag on for so long. While I am not using this anymore (as I do not need multi-tenant features and a local file is enough for me) I do not want to let our time go to waste. I have incorporated your suggestions and this should now work on a per-user basis. The changes introduce:
|
This pull request contains feature for reordering boards by drag-and-drop through the UI:
on error