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
fbe226dc
Commit
fbe226dc
authored
Mar 11, 2021
by
Florie Guibert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Epic Boards - Drag & Drop epic between lists
Review feedback
parent
798e516f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
19 deletions
+15
-19
app/assets/javascripts/boards/stores/actions.js
app/assets/javascripts/boards/stores/actions.js
+1
-1
ee/app/assets/javascripts/boards/stores/actions.js
ee/app/assets/javascripts/boards/stores/actions.js
+2
-2
ee/spec/frontend/boards/stores/actions_spec.js
ee/spec/frontend/boards/stores/actions_spec.js
+12
-16
No files found.
app/assets/javascripts/boards/stores/actions.js
View file @
fbe226dc
...
@@ -356,7 +356,7 @@ export default {
...
@@ -356,7 +356,7 @@ export default {
})
})
.
then
(({
data
})
=>
{
.
then
(({
data
})
=>
{
if
(
data
?.
issueMoveList
?.
errors
.
length
)
{
if
(
data
?.
issueMoveList
?.
errors
.
length
)
{
commit
(
types
.
MOVE_ISSUE_FAILURE
,
{
originalIssue
,
fromListId
,
toListId
,
originalIndex
}
);
throw
new
Error
(
);
}
else
{
}
else
{
const
issue
=
data
.
issueMoveList
?.
issue
;
const
issue
=
data
.
issueMoveList
?.
issue
;
commit
(
types
.
MOVE_ISSUE_SUCCESS
,
{
issue
});
commit
(
types
.
MOVE_ISSUE_SUCCESS
,
{
issue
});
...
...
ee/app/assets/javascripts/boards/stores/actions.js
View file @
fbe226dc
...
@@ -528,7 +528,7 @@ export default {
...
@@ -528,7 +528,7 @@ export default {
})
})
.
then
(({
data
})
=>
{
.
then
(({
data
})
=>
{
if
(
data
?.
issueMoveList
?.
errors
.
length
)
{
if
(
data
?.
issueMoveList
?.
errors
.
length
)
{
commit
(
types
.
MOVE_ISSUE_FAILURE
,
{
originalIssue
,
fromListId
,
toListId
,
originalIndex
}
);
throw
new
Error
(
);
}
else
{
}
else
{
const
issue
=
data
.
issueMoveList
?.
issue
;
const
issue
=
data
.
issueMoveList
?.
issue
;
commit
(
types
.
MOVE_ISSUE_SUCCESS
,
{
issue
});
commit
(
types
.
MOVE_ISSUE_SUCCESS
,
{
issue
});
...
@@ -565,7 +565,7 @@ export default {
...
@@ -565,7 +565,7 @@ export default {
})
})
.
then
(({
data
})
=>
{
.
then
(({
data
})
=>
{
if
(
data
?.
epicMoveList
?.
errors
.
length
)
{
if
(
data
?.
epicMoveList
?.
errors
.
length
)
{
commit
(
types
.
MOVE_EPIC_FAILURE
,
{
originalEpic
,
fromListId
,
toListId
,
originalIndex
}
);
throw
new
Error
(
);
}
}
})
})
.
catch
(()
=>
.
catch
(()
=>
...
...
ee/spec/frontend/boards/stores/actions_spec.js
View file @
fbe226dc
...
@@ -1002,7 +1002,7 @@ describe('moveEpic', () => {
...
@@ -1002,7 +1002,7 @@ describe('moveEpic', () => {
issuableType
:
'
epic
'
,
issuableType
:
'
epic
'
,
};
};
it
(
'
should commit MOVE_EPIC mutation mutation when successful
'
,
(
done
)
=>
{
it
(
'
should commit MOVE_EPIC mutation mutation when successful
'
,
async
(
)
=>
{
jest
.
spyOn
(
gqlClient
,
'
mutate
'
).
mockResolvedValue
({
jest
.
spyOn
(
gqlClient
,
'
mutate
'
).
mockResolvedValue
({
data
:
{
data
:
{
epicMoveList
:
{
epicMoveList
:
{
...
@@ -1011,15 +1011,15 @@ describe('moveEpic', () => {
...
@@ -1011,15 +1011,15 @@ describe('moveEpic', () => {
},
},
});
});
testAction
(
await
testAction
({
actions
.
moveEpic
,
action
:
action
s
.
moveEpic
,
{
payload
:
{
itemId
:
'
41
'
,
itemId
:
'
41
'
,
fromListId
:
'
gid://gitlab/List/1
'
,
fromListId
:
'
gid://gitlab/List/1
'
,
toListId
:
'
gid://gitlab/List/2
'
,
toListId
:
'
gid://gitlab/List/2
'
,
},
},
state
,
state
,
[
expectedMutations
:
[
{
{
type
:
types
.
MOVE_EPIC
,
type
:
types
.
MOVE_EPIC
,
payload
:
{
payload
:
{
...
@@ -1029,12 +1029,10 @@ describe('moveEpic', () => {
...
@@ -1029,12 +1029,10 @@ describe('moveEpic', () => {
},
},
},
},
],
],
[],
});
done
,
);
});
});
it
(
'
should commit MOVE_EPIC mutation and MOVE_EPIC_FAILURE mutation when unsuccessful
'
,
(
done
)
=>
{
it
(
'
should commit MOVE_EPIC mutation and MOVE_EPIC_FAILURE mutation when unsuccessful
'
,
async
(
)
=>
{
jest
.
spyOn
(
gqlClient
,
'
mutate
'
).
mockResolvedValue
({
jest
.
spyOn
(
gqlClient
,
'
mutate
'
).
mockResolvedValue
({
data
:
{
data
:
{
epicMoveList
:
{
epicMoveList
:
{
...
@@ -1043,15 +1041,15 @@ describe('moveEpic', () => {
...
@@ -1043,15 +1041,15 @@ describe('moveEpic', () => {
},
},
});
});
testAction
(
await
testAction
({
actions
.
moveEpic
,
action
:
action
s
.
moveEpic
,
{
payload
:
{
itemId
:
'
41
'
,
itemId
:
'
41
'
,
fromListId
:
'
gid://gitlab/List/1
'
,
fromListId
:
'
gid://gitlab/List/1
'
,
toListId
:
'
gid://gitlab/List/2
'
,
toListId
:
'
gid://gitlab/List/2
'
,
},
},
state
,
state
,
[
expectedMutations
:
[
{
{
type
:
types
.
MOVE_EPIC
,
type
:
types
.
MOVE_EPIC
,
payload
:
{
payload
:
{
...
@@ -1070,9 +1068,7 @@ describe('moveEpic', () => {
...
@@ -1070,9 +1068,7 @@ describe('moveEpic', () => {
},
},
},
},
],
],
[],
});
done
,
);
});
});
});
});
...
...
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