Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ece8b1eb
Commit
ece8b1eb
authored
Feb 10, 2020
by
Marvin Karegyeya
Committed by
Kushal Pandya
Feb 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove addMultipleIssues function logic from list model
parent
4b8834ea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
44 deletions
+53
-44
app/assets/javascripts/boards/models/list.js
app/assets/javascripts/boards/models/list.js
+1
-44
app/assets/javascripts/boards/stores/boards_store.js
app/assets/javascripts/boards/stores/boards_store.js
+47
-0
changelogs/unreleased/Remove-addMultipleIssues-function-logic-from-list-js.yml
.../Remove-addMultipleIssues-function-logic-from-list-js.yml
+5
-0
No files found.
app/assets/javascripts/boards/models/list.js
View file @
ece8b1eb
...
...
@@ -161,50 +161,7 @@ class List {
}
addMultipleIssues
(
issues
,
listFrom
,
newIndex
)
{
let
moveBeforeId
=
null
;
let
moveAfterId
=
null
;
const
listHasIssues
=
issues
.
every
(
issue
=>
this
.
findIssue
(
issue
.
id
));
if
(
!
listHasIssues
)
{
if
(
newIndex
!==
undefined
)
{
if
(
this
.
issues
[
newIndex
-
1
])
{
moveBeforeId
=
this
.
issues
[
newIndex
-
1
].
id
;
}
if
(
this
.
issues
[
newIndex
])
{
moveAfterId
=
this
.
issues
[
newIndex
].
id
;
}
this
.
issues
.
splice
(
newIndex
,
0
,
...
issues
);
}
else
{
this
.
issues
.
push
(...
issues
);
}
if
(
this
.
label
)
{
issues
.
forEach
(
issue
=>
issue
.
addLabel
(
this
.
label
));
}
if
(
this
.
assignee
)
{
if
(
listFrom
&&
listFrom
.
type
===
'
assignee
'
)
{
issues
.
forEach
(
issue
=>
issue
.
removeAssignee
(
listFrom
.
assignee
));
}
issues
.
forEach
(
issue
=>
issue
.
addAssignee
(
this
.
assignee
));
}
if
(
IS_EE
&&
this
.
milestone
)
{
if
(
listFrom
&&
listFrom
.
type
===
'
milestone
'
)
{
issues
.
forEach
(
issue
=>
issue
.
removeMilestone
(
listFrom
.
milestone
));
}
issues
.
forEach
(
issue
=>
issue
.
addMilestone
(
this
.
milestone
));
}
if
(
listFrom
)
{
this
.
issuesSize
+=
issues
.
length
;
this
.
updateMultipleIssues
(
issues
,
listFrom
,
moveBeforeId
,
moveAfterId
);
}
}
boardsStore
.
addMultipleListIssues
(
this
,
issues
,
listFrom
,
newIndex
);
}
addIssue
(
issue
,
listFrom
,
newIndex
)
{
...
...
app/assets/javascripts/boards/stores/boards_store.js
View file @
ece8b1eb
...
...
@@ -131,6 +131,53 @@ const boardsStore = {
listFrom
.
update
();
},
addMultipleListIssues
(
list
,
issues
,
listFrom
,
newIndex
)
{
let
moveBeforeId
=
null
;
let
moveAfterId
=
null
;
const
listHasIssues
=
issues
.
every
(
issue
=>
list
.
findIssue
(
issue
.
id
));
if
(
!
listHasIssues
)
{
if
(
newIndex
!==
undefined
)
{
if
(
list
.
issues
[
newIndex
-
1
])
{
moveBeforeId
=
list
.
issues
[
newIndex
-
1
].
id
;
}
if
(
list
.
issues
[
newIndex
])
{
moveAfterId
=
list
.
issues
[
newIndex
].
id
;
}
list
.
issues
.
splice
(
newIndex
,
0
,
...
issues
);
}
else
{
list
.
issues
.
push
(...
issues
);
}
if
(
list
.
label
)
{
issues
.
forEach
(
issue
=>
issue
.
addLabel
(
list
.
label
));
}
if
(
list
.
assignee
)
{
if
(
listFrom
&&
listFrom
.
type
===
'
assignee
'
)
{
issues
.
forEach
(
issue
=>
issue
.
removeAssignee
(
listFrom
.
assignee
));
}
issues
.
forEach
(
issue
=>
issue
.
addAssignee
(
list
.
assignee
));
}
if
(
IS_EE
&&
list
.
milestone
)
{
if
(
listFrom
&&
listFrom
.
type
===
'
milestone
'
)
{
issues
.
forEach
(
issue
=>
issue
.
removeMilestone
(
listFrom
.
milestone
));
}
issues
.
forEach
(
issue
=>
issue
.
addMilestone
(
list
.
milestone
));
}
if
(
listFrom
)
{
list
.
issuesSize
+=
issues
.
length
;
list
.
updateMultipleIssues
(
issues
,
listFrom
,
moveBeforeId
,
moveAfterId
);
}
}
},
startMoving
(
list
,
issue
)
{
Object
.
assign
(
this
.
moving
,
{
list
,
issue
});
},
...
...
changelogs/unreleased/Remove-addMultipleIssues-function-logic-from-list-js.yml
0 → 100644
View file @
ece8b1eb
---
title
:
removes store logic from issue board models
merge_request
:
21404
author
:
nuwe1
type
:
other
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment