mirror of
https://github.com/mattermost/focalboard.git
synced 2024-12-21 13:38:56 +02:00
parent
2255856895
commit
2840275ce6
@ -241,6 +241,15 @@ func (a *App) ImportBoardJSONL(r io.Reader, opt model.ImportArchiveOptions) (str
|
|||||||
|
|
||||||
// add users to all the new boards (if not the fake system user).
|
// add users to all the new boards (if not the fake system user).
|
||||||
for _, board := range boardsAndBlocks.Boards {
|
for _, board := range boardsAndBlocks.Boards {
|
||||||
|
// make sure an admin user gets added
|
||||||
|
adminMember := &model.BoardMember{
|
||||||
|
BoardID: board.ID,
|
||||||
|
UserID: opt.ModifiedBy,
|
||||||
|
SchemeAdmin: true,
|
||||||
|
}
|
||||||
|
if _, err2 := a.AddMemberToBoard(adminMember); err2 != nil {
|
||||||
|
return "", fmt.Errorf("cannot add adminMember to board: %w", err2)
|
||||||
|
}
|
||||||
for _, boardMember := range boardMembers {
|
for _, boardMember := range boardMembers {
|
||||||
bm := &model.BoardMember{
|
bm := &model.BoardMember{
|
||||||
BoardID: board.ID,
|
BoardID: board.ID,
|
||||||
|
@ -47,9 +47,8 @@ func TestApp_ImportArchive(t *testing.T) {
|
|||||||
|
|
||||||
th.Store.EXPECT().CreateBoardsAndBlocks(gomock.AssignableToTypeOf(&model.BoardsAndBlocks{}), "user").Return(babs, nil)
|
th.Store.EXPECT().CreateBoardsAndBlocks(gomock.AssignableToTypeOf(&model.BoardsAndBlocks{}), "user").Return(babs, nil)
|
||||||
th.Store.EXPECT().GetMembersForBoard(board.ID).AnyTimes().Return([]*model.BoardMember{boardMember}, nil)
|
th.Store.EXPECT().GetMembersForBoard(board.ID).AnyTimes().Return([]*model.BoardMember{boardMember}, nil)
|
||||||
// th.Store.EXPECT().GetBoard(board.ID).Return(board, nil)
|
th.Store.EXPECT().GetBoard(board.ID).Return(board, nil)
|
||||||
// th.Store.EXPECT().GetMemberForBoard(board.ID, "user").Return(boardMember, nil)
|
th.Store.EXPECT().GetMemberForBoard(board.ID, "user").Return(boardMember, nil)
|
||||||
// th.Store.EXPECT().GetUserCategoryBoards("user", "test-team").Return([]model.CategoryBoards{}, nil)
|
|
||||||
th.Store.EXPECT().GetUserCategoryBoards("user", "test-team").Return([]model.CategoryBoards{
|
th.Store.EXPECT().GetUserCategoryBoards("user", "test-team").Return([]model.CategoryBoards{
|
||||||
{
|
{
|
||||||
Category: model.Category{
|
Category: model.Category{
|
||||||
|
Loading…
Reference in New Issue
Block a user