From 2cca1776949bf83408d160552ee257fe555e5b8f Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 27 Dec 2020 01:24:23 +0100 Subject: [PATCH 01/12] Make Backend Support Default Bords --- models/project_board.go | 91 +++++++++++++++++++++++++++++++--------- routers/repo/projects.go | 18 +++----- 2 files changed, 77 insertions(+), 32 deletions(-) diff --git a/models/project_board.go b/models/project_board.go index 260fc8304b22e..401dcc828c4cc 100644 --- a/models/project_board.go +++ b/models/project_board.go @@ -8,6 +8,7 @@ import ( "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/timeutil" + "xorm.io/builder" "xorm.io/xorm" ) @@ -164,22 +165,43 @@ func UpdateProjectBoard(board *ProjectBoard) error { func updateProjectBoard(e Engine, board *ProjectBoard) error { _, err := e.ID(board.ID).Cols( "title", - "default", ).Update(board) return err } // GetProjectBoards fetches all boards related to a project -func GetProjectBoards(projectID int64) ([]*ProjectBoard, error) { +// if no default board set, first board is a temporary "Uncategorized" board +func GetProjectBoards(projectID int64) (ProjectBoardList, error) { + return getProjectBoards(x, projectID) +} +func getProjectBoards(e Engine, projectID int64) ([]*ProjectBoard, error) { var boards = make([]*ProjectBoard, 0, 5) - sess := x.Where("project_id=?", projectID) - return boards, sess.Find(&boards) + if err := e.Where("project_id=? AND `default`=?", projectID, false).Find(&boards); err != nil { + return nil, err + } + + defaultB, err := getDefaultBoard(e, projectID) + if err != nil { + return nil, err + } + + return append([]*ProjectBoard{defaultB}, boards...), nil } -// GetUncategorizedBoard represents a board for issues not assigned to one -func GetUncategorizedBoard(projectID int64) (*ProjectBoard, error) { +// getDefaultBoard return default board and create a dummy if none exist +func getDefaultBoard(e Engine, projectID int64) (*ProjectBoard, error) { + var board ProjectBoard + exist, err := e.Where("project_id=? AND `default`=?", projectID, true).Get(&board) + if err != nil { + return nil, err + } + if exist { + return &board, nil + } + + // represents a board for issues not assigned to one return &ProjectBoard{ ProjectID: projectID, Title: "Uncategorized", @@ -187,22 +209,51 @@ func GetUncategorizedBoard(projectID int64) (*ProjectBoard, error) { }, nil } +// SetDefaultBoard represents a board for issues not assigned to one +// if boardID is 0 unset default +func SetDefaultBoard(projectID, boardID int64) error { + sess := x + + _, err := sess.Where(builder.Eq{"project_id": projectID}.And(builder.Eq{"`default`": true})).Cols("`default`").Update(&ProjectBoard{Default: false}) + if err != nil { + return err + } + + if boardID > 0 { + _, err = sess.ID(boardID).Where(builder.Eq{"project_id": projectID}).Cols("`default`").Update(&ProjectBoard{Default: true}) + } + + return err +} + // LoadIssues load issues assigned to this board func (b *ProjectBoard) LoadIssues() (IssueList, error) { - var boardID int64 - if !b.Default { - boardID = b.ID - - } else { - // Issues without ProjectBoardID - boardID = -1 - } - issues, err := Issues(&IssuesOptions{ - ProjectBoardID: boardID, - ProjectID: b.ProjectID, - }) - b.Issues = issues - return issues, err + issueList := make([]*Issue, 0, 10) + + if b.ID != 0 { + issues, err := Issues(&IssuesOptions{ + ProjectBoardID: b.ID, + ProjectID: b.ProjectID, + }) + if err != nil { + return nil, err + } + issueList = issues + } + + if b.Default { + issues, err := Issues(&IssuesOptions{ + ProjectBoardID: -1, // Issues without ProjectBoardID + ProjectID: b.ProjectID, + }) + if err != nil { + return nil, err + } + issueList = append(issueList, issues...) + } + + b.Issues = issueList + return issueList, nil } // LoadIssues load issues assigned to the boards diff --git a/routers/repo/projects.go b/routers/repo/projects.go index 07327df9eb06d..96033baf656d0 100644 --- a/routers/repo/projects.go +++ b/routers/repo/projects.go @@ -270,23 +270,17 @@ func ViewProject(ctx *context.Context) { return } - uncategorizedBoard, err := models.GetUncategorizedBoard(project.ID) - uncategorizedBoard.Title = ctx.Tr("repo.projects.type.uncategorized") - if err != nil { - ctx.ServerError("GetUncategorizedBoard", err) - return - } - boards, err := models.GetProjectBoards(project.ID) if err != nil { ctx.ServerError("GetProjectBoards", err) return } - allBoards := models.ProjectBoardList{uncategorizedBoard} - allBoards = append(allBoards, boards...) + if boards[0].ID == 0 { + boards[0].Title = ctx.Tr("repo.projects.type.uncategorized") + } - if ctx.Data["Issues"], err = allBoards.LoadIssues(); err != nil { + if ctx.Data["Issues"], err = boards.LoadIssues(); err != nil { ctx.ServerError("LoadIssuesOfBoards", err) return } @@ -295,7 +289,7 @@ func ViewProject(ctx *context.Context) { ctx.Data["CanWriteProjects"] = ctx.Repo.Permission.CanWrite(models.UnitTypeProjects) ctx.Data["Project"] = project - ctx.Data["Boards"] = allBoards + ctx.Data["Boards"] = boards ctx.Data["PageIsProjects"] = true ctx.Data["RequiresDraggable"] = true @@ -466,7 +460,7 @@ func EditProjectBoardTitle(ctx *context.Context, form auth.EditProjectBoardTitle board.Title = form.Title } - if err := models.UpdateProjectBoard(board); err != nil { + if err = models.UpdateProjectBoard(board); err != nil { ctx.ServerError("UpdateProjectBoard", err) return } From 5285b300981812320ff94f5d8daaac4e7448163e Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 27 Dec 2020 01:47:04 +0100 Subject: [PATCH 02/12] routers --- routers/repo/projects.go | 44 +++++++++++++++++++++++++++++++-------- routers/routes/macaron.go | 1 + 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/routers/repo/projects.go b/routers/repo/projects.go index 96033baf656d0..6c874b16c9c10 100644 --- a/routers/repo/projects.go +++ b/routers/repo/projects.go @@ -410,21 +410,19 @@ func AddBoardToProjectPost(ctx *context.Context, form auth.EditProjectBoardTitle }) } -// EditProjectBoardTitle allows a project board's title to be updated -func EditProjectBoardTitle(ctx *context.Context, form auth.EditProjectBoardTitleForm) { - +func checkProjectBoardChangePermissions(ctx *context.Context) (*models.Project, *models.ProjectBoard) { if ctx.User == nil { ctx.JSON(403, map[string]string{ "message": "Only signed in users are allowed to perform this action.", }) - return + return nil, nil } if !ctx.Repo.IsOwner() && !ctx.Repo.IsAdmin() && !ctx.Repo.CanAccess(models.AccessModeWrite, models.UnitTypeProjects) { ctx.JSON(403, map[string]string{ "message": "Only authorized users are allowed to perform this action.", }) - return + return nil, nil } project, err := models.GetProjectByID(ctx.ParamsInt64(":id")) @@ -434,25 +432,35 @@ func EditProjectBoardTitle(ctx *context.Context, form auth.EditProjectBoardTitle } else { ctx.ServerError("GetProjectByID", err) } - return + return nil, nil } board, err := models.GetProjectBoard(ctx.ParamsInt64(":boardID")) if err != nil { ctx.InternalServerError(err) - return + return nil, nil } if board.ProjectID != ctx.ParamsInt64(":id") { ctx.JSON(422, map[string]string{ "message": fmt.Sprintf("ProjectBoard[%d] is not in Project[%d] as expected", board.ID, project.ID), }) - return + return nil, nil } if project.RepoID != ctx.Repo.Repository.ID { ctx.JSON(422, map[string]string{ "message": fmt.Sprintf("ProjectBoard[%d] is not in Repository[%d] as expected", board.ID, ctx.Repo.Repository.ID), }) + return nil, nil + } + return project, board +} + +// EditProjectBoardTitle allows a project board's title to be updated +func EditProjectBoardTitle(ctx *context.Context, form auth.EditProjectBoardTitleForm) { + + _, board := checkProjectBoardChangePermissions(ctx) + if ctx.Written() { return } @@ -460,7 +468,7 @@ func EditProjectBoardTitle(ctx *context.Context, form auth.EditProjectBoardTitle board.Title = form.Title } - if err = models.UpdateProjectBoard(board); err != nil { + if err := models.UpdateProjectBoard(board); err != nil { ctx.ServerError("UpdateProjectBoard", err) return } @@ -470,6 +478,24 @@ func EditProjectBoardTitle(ctx *context.Context, form auth.EditProjectBoardTitle }) } +// SetDefaultProjectBoard set default board for uncategorized issues/pulls +func SetDefaultProjectBoard(ctx *context.Context) { + + project, board := checkProjectBoardChangePermissions(ctx) + if ctx.Written() { + return + } + + if err := models.SetDefaultBoard(project.ID, board.ID); err != nil { + ctx.InternalServerError(err) + return + } + + ctx.JSON(200, map[string]interface{}{ + "ok": true, + }) +} + // MoveIssueAcrossBoards move a card from one board to another in a project func MoveIssueAcrossBoards(ctx *context.Context) { diff --git a/routers/routes/macaron.go b/routers/routes/macaron.go index 16977b9470923..8f135c37006ad 100644 --- a/routers/routes/macaron.go +++ b/routers/routes/macaron.go @@ -790,6 +790,7 @@ func RegisterMacaronRoutes(m *macaron.Macaron) { m.Group("/:boardID", func() { m.Put("", bindIgnErr(auth.EditProjectBoardTitleForm{}), repo.EditProjectBoardTitle) m.Delete("", repo.DeleteProjectBoard) + m.Post("/default", repo.SetDefaultProjectBoard) m.Post("/:index", repo.MoveIssueAcrossBoards) }) From 0a4be1af5ac7b183a6e0ad4805287316f7c0211c Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 27 Dec 2020 02:04:25 +0100 Subject: [PATCH 03/12] Frontend --- options/locale/locale_en-US.ini | 2 ++ templates/repo/projects/view.tmpl | 32 +++++++++++++++++++++++++------ web_src/js/features/projects.js | 18 +++++++++++++++++ 3 files changed, 46 insertions(+), 6 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 6b772d2392544..07242950cba3a 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -941,6 +941,8 @@ projects.board.edit_title = "New Board Name" projects.board.new_title = "New Board Name" projects.board.new_submit = "Submit" projects.board.new = "New Board" +projects.board.set_default = "Set Default" +projects.board.set_default_desc = "Set this board as default for all uncategorized issues and pulls" projects.board.delete = "Delete Board" projects.board.deletion_desc = "Deleting a project board moves all related issues to 'Uncategorized'. Continue?" projects.open = Open diff --git a/templates/repo/projects/view.tmpl b/templates/repo/projects/view.tmpl index b27773f710b06..4840395141ae3 100644 --- a/templates/repo/projects/view.tmpl +++ b/templates/repo/projects/view.tmpl @@ -85,6 +85,12 @@ {{svg "octicon-pencil"}} {{$.i18n.Tr "repo.projects.board.edit"}} + {{if not .Default}} + + {{svg "octicon-pin"}} + {{$.i18n.Tr "repo.projects.board.set_default"}} + + {{end}} {{svg "octicon-trashcan"}} {{$.i18n.Tr "repo.projects.board.delete"}} @@ -109,17 +115,31 @@ + + + {{$.i18n.Tr "repo.projects.board.set_default"}} + + + + {{$.i18n.Tr "repo.projects.board.set_default_desc"}} + + + + + {{$.i18n.Tr "settings.cancel"}} + {{$.i18n.Tr "repo.projects.board.set_default"}} + + + + {{$.i18n.Tr "repo.projects.board.delete"}} - - - - {{$.i18n.Tr "repo.projects.board.deletion_desc"}} - - + + {{$.i18n.Tr "repo.projects.board.deletion_desc"}} + diff --git a/web_src/js/features/projects.js b/web_src/js/features/projects.js index 13318c9f89e56..d5edfeef9b093 100644 --- a/web_src/js/features/projects.js +++ b/web_src/js/features/projects.js @@ -59,6 +59,24 @@ export default async function initProject() { }); }); + $('.set-default-project-board').each(function () { + $(this).click(function (e) { + e.preventDefault(); + + $.ajax({ + url: $(this).data('url'), + headers: { + 'X-Csrf-Token': csrf, + 'X-Remote': true, + }, + contentType: 'application/json', + method: 'POST', + }).done(() => { + setTimeout(window.location.reload(true), 2000); + }); + }); + }); + $('.delete-project-board').each(function () { $(this).click(function (e) { e.preventDefault(); From ea1a87f40d364371d9cf5d97d43b2c95cf0f1f53 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 27 Dec 2020 02:08:49 +0100 Subject: [PATCH 04/12] refactor --- templates/repo/projects/view.tmpl | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/templates/repo/projects/view.tmpl b/templates/repo/projects/view.tmpl index 4840395141ae3..ae14c7de7ea80 100644 --- a/templates/repo/projects/view.tmpl +++ b/templates/repo/projects/view.tmpl @@ -124,12 +124,10 @@ {{$.i18n.Tr "repo.projects.board.set_default_desc"}} - - - {{$.i18n.Tr "settings.cancel"}} - {{$.i18n.Tr "repo.projects.board.set_default"}} - - + + {{$.i18n.Tr "settings.cancel"}} + {{$.i18n.Tr "repo.projects.board.set_default"}} + @@ -141,12 +139,10 @@ {{$.i18n.Tr "repo.projects.board.deletion_desc"}} - - - {{$.i18n.Tr "settings.cancel"}} - {{$.i18n.Tr "repo.projects.board.delete"}} - - + + {{$.i18n.Tr "settings.cancel"}} + {{$.i18n.Tr "repo.projects.board.delete"}} + From 99f0798d884a55a9287f159fbe2889b793e0e482 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 27 Dec 2020 14:04:50 +0000 Subject: [PATCH 05/12] Apply suggestions from code review Co-authored-by: silverwind --- options/locale/locale_en-US.ini | 2 +- web_src/js/features/projects.js | 27 ++++++++++++--------------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 07242950cba3a..baa86eb2aa96f 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -942,7 +942,7 @@ projects.board.new_title = "New Board Name" projects.board.new_submit = "Submit" projects.board.new = "New Board" projects.board.set_default = "Set Default" -projects.board.set_default_desc = "Set this board as default for all uncategorized issues and pulls" +projects.board.set_default_desc = "Set this board as default for uncategorized issues and pulls" projects.board.delete = "Delete Board" projects.board.deletion_desc = "Deleting a project board moves all related issues to 'Uncategorized'. Continue?" projects.open = Open diff --git a/web_src/js/features/projects.js b/web_src/js/features/projects.js index d5edfeef9b093..8fa0a6ead3079 100644 --- a/web_src/js/features/projects.js +++ b/web_src/js/features/projects.js @@ -59,24 +59,21 @@ export default async function initProject() { }); }); - $('.set-default-project-board').each(function () { - $(this).click(function (e) { - e.preventDefault(); + $(document).on('click', '.set-default-project-board', async function(e) { + e.preventDefault(); - $.ajax({ - url: $(this).data('url'), - headers: { - 'X-Csrf-Token': csrf, - 'X-Remote': true, - }, - contentType: 'application/json', - method: 'POST', - }).done(() => { - setTimeout(window.location.reload(true), 2000); - }); + await $.ajax({ + method: 'POST', + url: $(this).data('url'), + headers: { + 'X-Csrf-Token': csrf, + 'X-Remote': true, + }, + contentType: 'application/json', }); - }); + setTimeout(reload, 2000); + }); $('.delete-project-board').each(function () { $(this).click(function (e) { e.preventDefault(); From 3bea260a7136b63a250a8e13a4e82421db2634b7 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 27 Dec 2020 15:08:55 +0100 Subject: [PATCH 06/12] format xorm query code --- models/project_board.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/models/project_board.go b/models/project_board.go index 401dcc828c4cc..8ffa218377fc3 100644 --- a/models/project_board.go +++ b/models/project_board.go @@ -214,13 +214,17 @@ func getDefaultBoard(e Engine, projectID int64) (*ProjectBoard, error) { func SetDefaultBoard(projectID, boardID int64) error { sess := x - _, err := sess.Where(builder.Eq{"project_id": projectID}.And(builder.Eq{"`default`": true})).Cols("`default`").Update(&ProjectBoard{Default: false}) + _, err := sess.Where(builder.Eq{ + "project_id": projectID, + "`default`": true, + }).Cols("`default`").Update(&ProjectBoard{Default: false}) if err != nil { return err } if boardID > 0 { - _, err = sess.ID(boardID).Where(builder.Eq{"project_id": projectID}).Cols("`default`").Update(&ProjectBoard{Default: true}) + _, err = sess.ID(boardID).Where(builder.Eq{"project_id": projectID}). + Cols("`default`").Update(&ProjectBoard{Default: true}) } return err From bc3f5787718007dfa0f8e0c45a7b3d591f06ada6 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 27 Dec 2020 15:12:49 +0100 Subject: [PATCH 07/12] fix&lint frontend --- web_src/js/features/projects.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web_src/js/features/projects.js b/web_src/js/features/projects.js index 8fa0a6ead3079..6d61a036e52c8 100644 --- a/web_src/js/features/projects.js +++ b/web_src/js/features/projects.js @@ -27,14 +27,14 @@ export default async function initProject() { }, }); }, - } + }, ); } $('.edit-project-board').each(function () { const projectTitleLabel = $(this).closest('.board-column-header').find('.board-label'); const projectTitleInput = $(this).find( - '.content > .form > .field > .project-board-title' + '.content > .form > .field > .project-board-title', ); $(this) @@ -59,7 +59,7 @@ export default async function initProject() { }); }); - $(document).on('click', '.set-default-project-board', async function(e) { + $(document).on('click', '.set-default-project-board', async function (e) { e.preventDefault(); await $.ajax({ @@ -72,7 +72,7 @@ export default async function initProject() { contentType: 'application/json', }); - setTimeout(reload, 2000); + setTimeout(window.location.reload(true), 2000); }); $('.delete-project-board').each(function () { $(this).click(function (e) { From 78e4a2fff099dbc83fafc3d1989caaf21f8d2aa5 Mon Sep 17 00:00:00 2001 From: zeripath Date: Mon, 28 Dec 2020 13:54:34 +0000 Subject: [PATCH 08/12] indentation fixes --- templates/repo/projects/view.tmpl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/repo/projects/view.tmpl b/templates/repo/projects/view.tmpl index ae14c7de7ea80..a3606c169cdde 100644 --- a/templates/repo/projects/view.tmpl +++ b/templates/repo/projects/view.tmpl @@ -86,10 +86,10 @@ {{$.i18n.Tr "repo.projects.board.edit"}} {{if not .Default}} - - {{svg "octicon-pin"}} - {{$.i18n.Tr "repo.projects.board.set_default"}} - + + {{svg "octicon-pin"}} + {{$.i18n.Tr "repo.projects.board.set_default"}} + {{end}} {{svg "octicon-trashcan"}} From 21db43d3067cdda541292a9967c4ccb22685cbd5 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 29 Dec 2020 02:03:16 +0100 Subject: [PATCH 09/12] add test --- routers/repo/projects_test.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 routers/repo/projects_test.go diff --git a/routers/repo/projects_test.go b/routers/repo/projects_test.go new file mode 100644 index 0000000000000..c43cf6d952837 --- /dev/null +++ b/routers/repo/projects_test.go @@ -0,0 +1,28 @@ +// Copyright 2020 The Gitea Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package repo + +import ( + "testing" + + "code.gitea.io/gitea/models" + "code.gitea.io/gitea/modules/test" + + "github.com/stretchr/testify/assert" +) + +func TestCheckProjectBoardChangePermissions(t *testing.T) { + models.PrepareTestEnv(t) + ctx := test.MockContext(t, "user2/repo1/projects/1/2") + test.LoadUser(t, ctx, 2) + test.LoadRepo(t, ctx, 1) + ctx.SetParams(":id", "1") + ctx.SetParams(":boardID", "2") + + project, board := checkProjectBoardChangePermissions(ctx) + assert.NotNil(t, project) + assert.NotNil(t, board) + assert.False(t, ctx.Written()) +} From e012a59798d52e61787c7957705275cb66984693 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 3 Jan 2021 16:16:13 +0000 Subject: [PATCH 10/12] use "reload()" in web_src/js/features/projects.js Co-authored-by: silverwind --- web_src/js/features/projects.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/js/features/projects.js b/web_src/js/features/projects.js index 6d61a036e52c8..c5e27297fb36c 100644 --- a/web_src/js/features/projects.js +++ b/web_src/js/features/projects.js @@ -72,7 +72,7 @@ export default async function initProject() { contentType: 'application/json', }); - setTimeout(window.location.reload(true), 2000); + reload(); }); $('.delete-project-board').each(function () { $(this).click(function (e) { From 92ce94669bcc3b7ae526a2658311e8aa9ca1a062 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 4 Jan 2021 00:26:11 +0100 Subject: [PATCH 11/12] fix lint --- web_src/js/features/projects.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/js/features/projects.js b/web_src/js/features/projects.js index c5e27297fb36c..d82a5d11e6883 100644 --- a/web_src/js/features/projects.js +++ b/web_src/js/features/projects.js @@ -72,7 +72,7 @@ export default async function initProject() { contentType: 'application/json', }); - reload(); + window.location.reload(); }); $('.delete-project-board').each(function () { $(this).click(function (e) { From 0b108e3d153c3742efc32551057c7837dacb5dfa Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 4 Jan 2021 00:41:31 +0100 Subject: [PATCH 12/12] use "window.location.reload();" --- web_src/js/features/projects.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web_src/js/features/projects.js b/web_src/js/features/projects.js index d82a5d11e6883..b5f52f7443891 100644 --- a/web_src/js/features/projects.js +++ b/web_src/js/features/projects.js @@ -87,7 +87,7 @@ export default async function initProject() { contentType: 'application/json', method: 'DELETE', }).done(() => { - setTimeout(window.location.reload(true), 2000); + window.location.reload(); }); }); }); @@ -108,7 +108,7 @@ export default async function initProject() { method: 'POST', }).done(() => { boardTitle.closest('form').removeClass('dirty'); - setTimeout(window.location.reload(true), 2000); + window.location.reload(); }); }); }