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
ca3b7038
Commit
ca3b7038
authored
Feb 09, 2021
by
Ezekiel Kigbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address minor review comments
parent
b128e665
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
25 deletions
+16
-25
ee/app/assets/javascripts/analytics/cycle_analytics/store/actions.js
...ts/javascripts/analytics/cycle_analytics/store/actions.js
+4
-6
ee/spec/frontend/analytics/cycle_analytics/store/actions_spec.js
.../frontend/analytics/cycle_analytics/store/actions_spec.js
+12
-19
No files found.
ee/app/assets/javascripts/analytics/cycle_analytics/store/actions.js
View file @
ca3b7038
...
...
@@ -354,11 +354,6 @@ export const createValueStream = ({ commit, dispatch, getters }, data) => {
});
};
export
const
receiveUpdateValueStreamSuccess
=
({
commit
,
dispatch
},
valueStream
=
{})
=>
{
commit
(
types
.
RECEIVE_UPDATE_VALUE_STREAM_SUCCESS
,
valueStream
);
return
dispatch
(
'
fetchCycleAnalyticsData
'
);
};
export
const
updateValueStream
=
(
{
commit
,
dispatch
,
getters
},
{
id
:
valueStreamId
,
...
data
},
...
...
@@ -367,7 +362,10 @@ export const updateValueStream = (
commit
(
types
.
REQUEST_UPDATE_VALUE_STREAM
);
return
Api
.
cycleAnalyticsUpdateValueStream
({
groupId
:
currentGroupPath
,
valueStreamId
,
data
})
.
then
(({
data
:
newValueStream
})
=>
dispatch
(
'
receiveUpdateValueStreamSuccess
'
,
newValueStream
))
.
then
(({
data
:
newValueStream
})
=>
{
commit
(
types
.
RECEIVE_UPDATE_VALUE_STREAM_SUCCESS
,
newValueStream
);
return
dispatch
(
'
fetchCycleAnalyticsData
'
);
})
.
catch
(({
response
}
=
{})
=>
{
const
{
data
:
{
message
,
payload
:
{
errors
}
}
=
null
}
=
response
;
commit
(
types
.
RECEIVE_UPDATE_VALUE_STREAM_ERROR
,
{
message
,
errors
,
data
});
...
...
ee/spec/frontend/analytics/cycle_analytics/store/actions_spec.js
View file @
ca3b7038
...
...
@@ -987,7 +987,7 @@ describe('Value Stream Analytics actions', () => {
{
...
hiddenStage
,
...
mockEvents
},
],
};
const
cre
ateResp
=
{
id
:
'
new value stream
'
,
is_custom
:
true
,
...
payload
};
const
upd
ateResp
=
{
id
:
'
new value stream
'
,
is_custom
:
true
,
...
payload
};
beforeEach
(()
=>
{
state
=
{
currentGroup
};
...
...
@@ -995,7 +995,7 @@ describe('Value Stream Analytics actions', () => {
describe
(
'
with no errors
'
,
()
=>
{
beforeEach
(()
=>
{
mock
.
onPut
(
endpoints
.
valueStreamData
).
replyOnce
(
httpStatusCodes
.
OK
,
cre
ateResp
);
mock
.
onPut
(
endpoints
.
valueStreamData
).
replyOnce
(
httpStatusCodes
.
OK
,
upd
ateResp
);
});
it
(
`commits the
${
types
.
REQUEST_UPDATE_VALUE_STREAM
}
and
${
types
.
RECEIVE_UPDATE_VALUE_STREAM_SUCCESS
}
actions`
,
()
=>
{
...
...
@@ -1004,11 +1004,10 @@ describe('Value Stream Analytics actions', () => {
payload
,
state
,
[
{
type
:
types
.
REQUEST_UPDATE_VALUE_STREAM
,
},
{
type
:
types
.
REQUEST_UPDATE_VALUE_STREAM
},
{
type
:
types
.
RECEIVE_UPDATE_VALUE_STREAM_SUCCESS
,
payload
:
updateResp
},
],
[{
type
:
'
receiveUpdateValueStreamSuccess
'
,
payload
:
createResp
}],
[{
type
:
'
fetchCycleAnalyticsData
'
}],
);
});
});
...
...
@@ -1022,19 +1021,13 @@ describe('Value Stream Analytics actions', () => {
});
it
(
`commits the
${
types
.
REQUEST_UPDATE_VALUE_STREAM
}
and
${
types
.
RECEIVE_UPDATE_VALUE_STREAM_ERROR
}
actions `
,
()
=>
{
return
testAction
(
actions
.
updateValueStream
,
payload
,
state
,
[
{
type
:
types
.
REQUEST_UPDATE_VALUE_STREAM
},
{
type
:
types
.
RECEIVE_UPDATE_VALUE_STREAM_ERROR
,
payload
:
{
message
,
data
:
payload
,
errors
},
},
],
[],
);
return
testAction
(
actions
.
updateValueStream
,
payload
,
state
,
[
{
type
:
types
.
REQUEST_UPDATE_VALUE_STREAM
},
{
type
:
types
.
RECEIVE_UPDATE_VALUE_STREAM_ERROR
,
payload
:
{
message
,
data
:
payload
,
errors
},
},
]);
});
});
});
...
...
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