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:
parent
2b984d45b2
commit
6f0c34ddd1
@ -151,6 +151,7 @@ func (s *SQLStore) duplicateBoard(db sq.BaseRunner, boardID string, userID strin
|
|||||||
board.Type = "P"
|
board.Type = "P"
|
||||||
board.IsTemplate = asTemplate
|
board.IsTemplate = asTemplate
|
||||||
board.CreatedBy = userID
|
board.CreatedBy = userID
|
||||||
|
board.ChannelID = ""
|
||||||
|
|
||||||
if toTeam != "" {
|
if toTeam != "" {
|
||||||
board.TeamID = toTeam
|
board.TeamID = toTeam
|
||||||
|
@ -582,7 +582,7 @@ func testDuplicateBoard(t *testing.T, store store.Store) {
|
|||||||
|
|
||||||
newBab := &model.BoardsAndBlocks{
|
newBab := &model.BoardsAndBlocks{
|
||||||
Boards: []*model.Board{
|
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-2", TeamID: teamID, Type: model.BoardTypePrivate},
|
||||||
{ID: "board-id-3", TeamID: teamID, Type: model.BoardTypeOpen},
|
{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.Boards, 1)
|
||||||
require.Len(t, bab.Blocks, 1)
|
require.Len(t, bab.Blocks, 1)
|
||||||
require.Equal(t, bab.Boards[0].IsTemplate, false)
|
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) {
|
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.Boards, 1)
|
||||||
require.Len(t, bab.Blocks, 1)
|
require.Len(t, bab.Blocks, 1)
|
||||||
require.Equal(t, bab.Boards[0].IsTemplate, true)
|
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) {
|
t.Run("duplicate not existing board", func(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user