Skip to content

Commit 92ec5a5

Browse files
committed
Prevent dropping onto project column 0
Fixes: go-gitea#29853 Fixes: go-gitea#29870
1 parent 34290a0 commit 92ec5a5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

web_src/js/features/repo-projects.js

+5
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ async function initRepoProjectSortable() {
6363
ghostClass: 'card-ghost',
6464
delayOnTouchOnly: true,
6565
delay: 500,
66+
onMove: (e) => {
67+
// prevent dropping onto column 0 because it currently can not be moved and doing
68+
// so would raise a 500 "project board does not exist" error on backend.
69+
if (e.related.getAttribute('data-id') === '0') return false;
70+
},
6671
onSort: async () => {
6772
boardColumns = mainBoard.getElementsByClassName('project-column');
6873
for (let i = 0; i < boardColumns.length; i++) {

0 commit comments

Comments
 (0)