1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-12-21 13:38:56 +02:00

Fixed a bug causing undeleted board to not have original title (#3354)

This commit is contained in:
Harshil Sharma 2022-07-13 11:51:48 +05:30 committed by GitHub
parent 2f4f13cb56
commit cdf8fbc280
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 4 deletions

View File

@ -774,8 +774,8 @@ func (s *SQLStore) undeleteBoard(db sq.BaseRunner, boardID string, modifiedBy st
board.CreatedBy,
modifiedBy,
board.Type,
board.MinimumRole,
board.Title,
board.MinimumRole,
board.Description,
board.Icon,
board.ShowDescription,

View File

@ -803,9 +803,23 @@ func testUndeleteBoard(t *testing.T, store store.Store) {
boardID := utils.NewID(utils.IDTypeBoard)
board := &model.Board{
ID: boardID,
TeamID: testTeamID,
Type: model.BoardTypeOpen,
ID: boardID,
TeamID: testTeamID,
Type: model.BoardTypeOpen,
Title: "Dunder Mifflin Scranton",
MinimumRole: model.BoardRoleCommenter,
Description: "Bears, beets, Battlestar Gallectica",
Icon: "🐻",
ShowDescription: true,
IsTemplate: false,
Properties: map[string]interface{}{
"prop_1": "value_1",
},
CardProperties: []map[string]interface{}{
{
"prop_1": "value_1",
},
},
}
newBoard, err := store.InsertBoard(board, userID)
@ -828,6 +842,20 @@ func testUndeleteBoard(t *testing.T, store store.Store) {
board, err = store.GetBoard(boardID)
require.NoError(t, err)
require.NotNil(t, board)
// verifying the data after un-delete
require.Equal(t, "Dunder Mifflin Scranton", board.Title)
require.Equal(t, "user-id", board.CreatedBy)
require.Equal(t, "user-id", board.ModifiedBy)
require.Equal(t, model.BoardRoleCommenter, board.MinimumRole)
require.Equal(t, "Bears, beets, Battlestar Gallectica", board.Description)
require.Equal(t, "🐻", board.Icon)
require.True(t, board.ShowDescription)
require.False(t, board.IsTemplate)
require.Equal(t, board.Properties["prop_1"].(string), "value_1")
require.Equal(t, 1, len(board.CardProperties))
require.Equal(t, board.CardProperties[0]["prop_1"], "value_1")
require.Equal(t, board.CardProperties[0]["prop_1"], "value_1")
})
t.Run("existing id multiple times", func(t *testing.T) {