Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/boards/components/board_list.vue')
-rw-r--r--app/assets/javascripts/boards/components/board_list.vue15
1 files changed, 12 insertions, 3 deletions
diff --git a/app/assets/javascripts/boards/components/board_list.vue b/app/assets/javascripts/boards/components/board_list.vue
index 5c7565234d8..3e610a4088c 100644
--- a/app/assets/javascripts/boards/components/board_list.vue
+++ b/app/assets/javascripts/boards/components/board_list.vue
@@ -112,12 +112,20 @@ export default {
if (e.target) {
const containerEl = e.target.closest('.js-board-list') || e.target.querySelector('.js-board-list');
const toBoardType = containerEl.dataset.boardType;
+ const cloneActions = {
+ label: ['milestone', 'assignee'],
+ assignee: ['milestone', 'label'],
+ milestone: ['label', 'assignee'],
+ };
if (toBoardType) {
const fromBoardType = this.list.type;
+ // For each list we check if the destination list is
+ // a the list were we should clone the issue
+ const shouldClone = Object.entries(cloneActions).some(entry => (
+ fromBoardType === entry[0] && entry[1].includes(toBoardType)));
- if ((fromBoardType === 'assignee' && toBoardType === 'label') ||
- (fromBoardType === 'label' && toBoardType === 'assignee')) {
+ if (shouldClone) {
return 'clone';
}
}
@@ -145,7 +153,8 @@ export default {
});
},
onUpdate: (e) => {
- const sortedArray = this.sortable.toArray().filter(id => id !== '-1');
+ const sortedArray = this.sortable.toArray()
+ .filter(id => id !== '-1');
gl.issueBoards.BoardsStore
.moveIssueInList(this.list, Store.moving.issue, e.oldIndex, e.newIndex, sortedArray);
},