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

Gh 3953 remove channel link duplicate (#4011)

This commit is contained in:
Scott Bishel 2022-10-17 15:45:51 -06:00 committed by GitHub
parent 2b984d45b2
commit 6f0c34ddd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -151,6 +151,7 @@ func (s *SQLStore) duplicateBoard(db sq.BaseRunner, boardID string, userID strin
board.Type = "P"
board.IsTemplate = asTemplate
board.CreatedBy = userID
board.ChannelID = ""
if toTeam != "" {
board.TeamID = toTeam

View File

@ -582,7 +582,7 @@ func testDuplicateBoard(t *testing.T, store store.Store) {
newBab := &model.BoardsAndBlocks{
Boards: []*model.Board{
{ID: "board-id-1", TeamID: teamID, Type: model.BoardTypeOpen},
{ID: "board-id-1", TeamID: teamID, Type: model.BoardTypeOpen, ChannelID: "test-channel"},
{ID: "board-id-2", TeamID: teamID, Type: model.BoardTypePrivate},
{ID: "board-id-3", TeamID: teamID, Type: model.BoardTypeOpen},
},
@ -606,6 +606,7 @@ func testDuplicateBoard(t *testing.T, store store.Store) {
require.Len(t, bab.Boards, 1)
require.Len(t, bab.Blocks, 1)
require.Equal(t, bab.Boards[0].IsTemplate, false)
require.Equal(t, "", bab.Boards[0].ChannelID)
})
t.Run("duplicate existing board as template", func(t *testing.T) {
@ -615,6 +616,7 @@ func testDuplicateBoard(t *testing.T, store store.Store) {
require.Len(t, bab.Boards, 1)
require.Len(t, bab.Blocks, 1)
require.Equal(t, bab.Boards[0].IsTemplate, true)
require.Equal(t, "", bab.Boards[0].ChannelID)
})
t.Run("duplicate not existing board", func(t *testing.T) {