1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-09-16 08:56:19 +02:00

Replace Block references to use pointers throughout all application layers (#3934)

* Replace Block references to use pointers throughout all application layers

* lint fixes

* gofmt file, lint fix

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
This commit is contained in:
Miguel de la Cruz
2022-10-25 22:46:43 +02:00
committed by GitHub
parent e3ae682eea
commit 91f9f71bf7
49 changed files with 443 additions and 446 deletions

View File

@@ -28,7 +28,7 @@ type Store interface {
}
type Adapter interface {
BroadcastBlockChange(teamID string, block model.Block)
BroadcastBlockChange(teamID string, block *model.Block)
BroadcastBlockDelete(teamID, blockID, boardID string)
BroadcastBoardChange(teamID string, board *model.Board)
BroadcastBoardDelete(teamID, boardID string)

View File

@@ -14,9 +14,9 @@ type UpdateCategoryMessage struct {
// UpdateBlockMsg is sent on block updates.
type UpdateBlockMsg struct {
Action string `json:"action"`
TeamID string `json:"teamId"`
Block model.Block `json:"block"`
Action string `json:"action"`
TeamID string `json:"teamId"`
Block *model.Block `json:"block"`
}
// UpdateBoardMsg is sent on block updates.

View File

@@ -26,7 +26,7 @@ type PluginAdapterInterface interface {
OnWebSocketDisconnect(webConnID, userID string)
WebSocketMessageHasBeenPosted(webConnID, userID string, req *mmModel.WebSocketRequest)
BroadcastConfigChange(clientConfig model.ClientConfig)
BroadcastBlockChange(teamID string, block model.Block)
BroadcastBlockChange(teamID string, block *model.Block)
BroadcastBlockDelete(teamID, blockID, parentID string)
BroadcastSubscriptionChange(teamID string, subscription *model.Subscription)
BroadcastCardLimitTimestampChange(cardLimitTimestamp int64)
@@ -453,7 +453,7 @@ func (pa *PluginAdapter) sendBoardMessage(teamID, boardID string, payload map[st
pa.sendBoardMessageSkipCluster(teamID, boardID, payload, ensureUserIDs...)
}
func (pa *PluginAdapter) BroadcastBlockChange(teamID string, block model.Block) {
func (pa *PluginAdapter) BroadcastBlockChange(teamID string, block *model.Block) {
pa.logger.Debug("BroadcastingBlockChange",
mlog.String("teamID", teamID),
mlog.String("boardID", block.BoardID),
@@ -527,7 +527,7 @@ func (pa *PluginAdapter) BroadcastCategoryBoardChange(teamID, userID string, boa
func (pa *PluginAdapter) BroadcastBlockDelete(teamID, blockID, boardID string) {
now := utils.GetMillis()
block := model.Block{}
block := &model.Block{}
block.ID = blockID
block.BoardID = boardID
block.UpdateAt = now

View File

@@ -511,7 +511,7 @@ func (ws *Server) getListenersForTeamAndBoard(teamID, boardID string, ensureUser
// BroadcastBlockDelete broadcasts delete messages to clients.
func (ws *Server) BroadcastBlockDelete(teamID, blockID, boardID string) {
now := utils.GetMillis()
block := model.Block{}
block := &model.Block{}
block.ID = blockID
block.BoardID = boardID
block.UpdateAt = now
@@ -521,7 +521,7 @@ func (ws *Server) BroadcastBlockDelete(teamID, blockID, boardID string) {
}
// BroadcastBlockChange broadcasts update messages to clients.
func (ws *Server) BroadcastBlockChange(teamID string, block model.Block) {
func (ws *Server) BroadcastBlockChange(teamID string, block *model.Block) {
blockIDsToNotify := []string{block.ID, block.ParentID}
message := UpdateBlockMsg{