DND support for category and boards in LHS (#3964)

* WIP

* WIP

* Removed unused webapp util

* Added server tests

* Lint fix

* Updating existing tests

* Updating existing tests

* Updating existing tests

* Fixing existing tests

* Fixing existing tests

* Fixing existing tests

* WIP

* Added category sort order migration

* Added logic to set new category on top

* Implemented api, WS listein logic remining

* finished webapp implementation

* Added category type and tests

* updated tests

* Fixed integration test

* type fix

* WIP

* implemented boards DND to other category and in same category

* removed seconds from boards name

* wip

* debugging cy test

* Enabled hiding views list while DNDing

* Removed some debug logs

* Fixed a bug preventing users from collapsing boards category

* WIP

* Debugging cypress test

* CI

* debugging cy test

* Testing a fix

* reverting test fix

* Handled personal server

* WIP

* WIP

* Adding support for building with esbuild

* Using different index.html templates for esbuild

* WIP

* WIP

* Fixed delete category and rename category

* WIP

* WIP

* Finally, its done.

* Adde suppor tot update board-category mapping in bulk

* Fixed a bug where create category option didn't show up on default category

* Fixed bug where new board was added as last board in Boards category instead of first board

* Minor cleanup

* WIP

* Added support to drab boards onto collapsed categories

* Fixed route order from specific to generic

* Fix linter

* Updated existin server tests

* fixed integration tests

* Fixed webapp test err

* Removed accidental dependencies

* Adding  new server tests

* Finished server tests

* added api to client.go

* Added API integration test

* Fixed existing webapp tests

* WIP

* WIP

* WIP

* WIP

* WIP

* Fixed missing paranthesis

* Some cleanup

* fixed server lint

* noopped down migration

* Fixed issue with DND not working great with newly added category

* Fixed a test

* Fixed a test

* Fixed a test

* Fixed console error while DNDing

* pakg lock restore

* Fixed missing react beautiful dnd in package.lock.json

* updated snapshots

* Fixed webapp test

* Review fixes

* Added API permission check

Co-authored-by: Jesús Espino <jespinog@gmail.com>
This commit is contained in:
Harshil Sharma 2022-11-24 15:31:32 +05:30 committed by GitHub
parent 300a2e573a
commit 9918a0b3f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
58 changed files with 4272 additions and 1886 deletions

View file

@ -589,27 +589,80 @@ func (ws *Server) BroadcastCategoryChange(category model.Category) {
}
}
func (ws *Server) BroadcastCategoryBoardChange(teamID, userID string, boardCategory model.BoardCategoryWebsocketData) {
message := UpdateCategoryMessage{
Action: websocketActionUpdateCategoryBoard,
TeamID: teamID,
BoardCategories: &boardCategory,
func (ws *Server) BroadcastCategoryReorder(teamID, userID string, categoryOrder []string) {
message := CategoryReorderMessage{
Action: websocketActionReorderCategories,
CategoryOrder: categoryOrder,
TeamID: teamID,
}
listeners := ws.getListenersForTeam(teamID)
ws.logger.Debug("listener(s) for teamID",
mlog.Int("listener_count", len(listeners)),
mlog.String("teamID", teamID),
mlog.String("categoryID", boardCategory.CategoryID),
mlog.String("blockID", boardCategory.BoardID),
)
for _, listener := range listeners {
ws.logger.Debug("Broadcast category order change",
mlog.Int("listener_count", len(listeners)),
mlog.String("teamID", teamID),
mlog.Stringer("remoteAddr", listener.conn.RemoteAddr()),
)
if err := listener.WriteJSON(message); err != nil {
ws.logger.Error("broadcast category order change error", mlog.Err(err))
listener.conn.Close()
}
}
}
func (ws *Server) BroadcastCategoryBoardsReorder(teamID, userID, categoryID string, boardOrder []string) {
message := CategoryBoardReorderMessage{
Action: websocketActionReorderCategoryBoards,
CategoryID: categoryID,
BoardOrder: boardOrder,
TeamID: teamID,
}
listeners := ws.getListenersForTeam(teamID)
ws.logger.Debug("listener(s) for teamID",
mlog.Int("listener_count", len(listeners)),
mlog.String("teamID", teamID),
)
for _, listener := range listeners {
ws.logger.Debug("Broadcast board category order change",
mlog.Int("listener_count", len(listeners)),
mlog.String("teamID", teamID),
mlog.Stringer("remoteAddr", listener.conn.RemoteAddr()),
)
if err := listener.WriteJSON(message); err != nil {
ws.logger.Error("broadcast category order change error", mlog.Err(err))
listener.conn.Close()
}
}
}
func (ws *Server) BroadcastCategoryBoardChange(teamID, userID string, boardCategories []*model.BoardCategoryWebsocketData) {
message := UpdateCategoryMessage{
Action: websocketActionUpdateCategoryBoard,
TeamID: teamID,
BoardCategories: boardCategories,
}
listeners := ws.getListenersForTeam(teamID)
ws.logger.Debug("listener(s) for teamID",
mlog.Int("listener_count", len(listeners)),
mlog.String("teamID", teamID),
mlog.Int("numEntries", len(boardCategories)),
)
for _, listener := range listeners {
ws.logger.Debug("Broadcast block change",
mlog.Int("listener_count", len(listeners)),
mlog.String("teamID", teamID),
mlog.String("categoryID", boardCategory.CategoryID),
mlog.String("blockID", boardCategory.BoardID),
mlog.Int("numEntries", len(boardCategories)),
mlog.Stringer("remoteAddr", listener.conn.RemoteAddr()),
)