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
5c0cb34d
Commit
5c0cb34d
authored
Jul 15, 2020
by
Ezekiel Kigbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor review feedback
parent
78bf43a1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
13 deletions
+15
-13
ee/app/assets/javascripts/analytics/cycle_analytics/components/value_stream_select.vue
...lytics/cycle_analytics/components/value_stream_select.vue
+6
-3
ee/spec/features/analytics/cycle_analytics/cycle_analytics_spec.rb
...eatures/analytics/cycle_analytics/cycle_analytics_spec.rb
+4
-7
ee/spec/frontend/analytics/cycle_analytics/components/value_stream_select_spec.js
...cs/cycle_analytics/components/value_stream_select_spec.js
+5
-3
No files found.
ee/app/assets/javascripts/analytics/cycle_analytics/components/value_stream_select.vue
View file @
5c0cb34d
...
@@ -63,7 +63,9 @@ export default {
...
@@ -63,7 +63,9 @@ export default {
const
{
name
}
=
this
;
const
{
name
}
=
this
;
return
this
.
createValueStream
({
name
}).
then
(()
=>
{
return
this
.
createValueStream
({
name
}).
then
(()
=>
{
this
.
$refs
.
modal
.
hide
();
this
.
$refs
.
modal
.
hide
();
this
.
$toast
.
show
(
sprintf
(
__
(
"
'%{name}' Value Stream created
"
),
{
name
}));
this
.
$toast
.
show
(
sprintf
(
__
(
"
'%{name}' Value Stream created
"
),
{
name
}),
{
position
:
'
top-center
'
,
});
this
.
name
=
''
;
this
.
name
=
''
;
});
});
},
},
...
@@ -76,7 +78,7 @@ export default {
...
@@ -76,7 +78,7 @@ export default {
</
script
>
</
script
>
<
template
>
<
template
>
<gl-form>
<gl-form>
<gl-button
v-gl-modal-directive=
"'create-value-stream-modal'"
>
{{
<gl-button
v-gl-modal-directive=
"'create-value-stream-modal'"
@
click=
"onHandleInput"
>
{{
__
(
'
Create new value stream
'
)
__
(
'
Create new value stream
'
)
}}
</gl-button>
}}
</gl-button>
<gl-modal
<gl-modal
...
@@ -97,12 +99,13 @@ export default {
...
@@ -97,12 +99,13 @@ export default {
@primary.prevent="onSubmit"
@primary.prevent="onSubmit"
>
>
<gl-form-group
<gl-form-group
label=
"Name
"
:label=
"__('Name')
"
label-for=
"create-value-stream-name"
label-for=
"create-value-stream-name"
:invalid-feedback=
"invalidFeedback"
:invalid-feedback=
"invalidFeedback"
:state=
"isValid"
:state=
"isValid"
>
>
<gl-form-input
<gl-form-input
id=
"create-value-stream-name"
v-model.trim=
"name"
v-model.trim=
"name"
name=
"create-value-stream-name"
name=
"create-value-stream-name"
:placeholder=
"__('Example: My value stream')"
:placeholder=
"__('Example: My value stream')"
...
...
ee/spec/features/analytics/cycle_analytics/cycle_analytics_spec.rb
View file @
5c0cb34d
...
@@ -1010,7 +1010,7 @@ RSpec.describe 'Group Value Stream Analytics', :js do
...
@@ -1010,7 +1010,7 @@ RSpec.describe 'Group Value Stream Analytics', :js do
end
end
describe
'Create value stream'
,
:js
do
describe
'Create value stream'
,
:js
do
custom_value_stream_name
=
"Test value stream"
let
(
:custom_value_stream_name
)
{
"Test value stream"
}
before
do
before
do
visit
analytics_cycle_analytics_path
visit
analytics_cycle_analytics_path
...
@@ -1019,15 +1019,12 @@ RSpec.describe 'Group Value Stream Analytics', :js do
...
@@ -1019,15 +1019,12 @@ RSpec.describe 'Group Value Stream Analytics', :js do
end
end
it
'can create a value stream'
do
it
'can create a value stream'
do
expect
(
page
).
to
have_text
(
'Create new value stream'
)
page
.
find_button
(
_
(
'Create new value stream'
)).
click
modal_button
=
page
.
find_button
(
'Create new value stream'
)
modal_button
.
click
fill_in
'create-value-stream-name'
,
with:
custom_value_stream_name
fill_in
'create-value-stream-name'
,
with:
custom_value_stream_name
page
.
find_button
(
'Create value stream'
).
click
page
.
find_button
(
_
(
'Create value stream'
)
).
click
expect
(
page
).
to
have_text
(
"'
#{
custom_value_stream_name
}
' Value Stream created"
)
expect
(
page
).
to
have_text
(
_
(
"'%{name}' Value Stream created"
)
%
{
name:
custom_value_stream_name
}
)
end
end
end
end
end
end
ee/spec/frontend/analytics/cycle_analytics/components/value_stream_select_spec.js
View file @
5c0cb34d
...
@@ -55,7 +55,7 @@ describe('ValueStreamSelect', () => {
...
@@ -55,7 +55,7 @@ describe('ValueStreamSelect', () => {
describe
(
'
with valid fields
'
,
()
=>
{
describe
(
'
with valid fields
'
,
()
=>
{
const
streamName
=
'
Cool stream
'
;
const
streamName
=
'
Cool stream
'
;
beforeEach
(
async
()
=>
{
beforeEach
(()
=>
{
wrapper
=
createComponent
({
data
:
{
name
:
streamName
}
});
wrapper
=
createComponent
({
data
:
{
name
:
streamName
}
});
wrapper
.
vm
.
$refs
.
modal
.
hide
=
mockModalHide
;
wrapper
.
vm
.
$refs
.
modal
.
hide
=
mockModalHide
;
});
});
...
@@ -77,7 +77,9 @@ describe('ValueStreamSelect', () => {
...
@@ -77,7 +77,9 @@ describe('ValueStreamSelect', () => {
});
});
it
(
'
displays a toast message
'
,
()
=>
{
it
(
'
displays a toast message
'
,
()
=>
{
expect
(
mockToastShow
).
toHaveBeenCalledWith
(
`'
${
streamName
}
' Value Stream created`
);
expect
(
mockToastShow
).
toHaveBeenCalledWith
(
`'
${
streamName
}
' Value Stream created`
,
{
position
:
'
top-center
'
,
});
});
});
it
(
'
hides the modal
'
,
()
=>
{
it
(
'
hides the modal
'
,
()
=>
{
...
@@ -88,7 +90,7 @@ describe('ValueStreamSelect', () => {
...
@@ -88,7 +90,7 @@ describe('ValueStreamSelect', () => {
describe
(
'
form submission fails
'
,
()
=>
{
describe
(
'
form submission fails
'
,
()
=>
{
const
createValueStreamMockFail
=
jest
.
fn
(()
=>
Promise
.
reject
());
const
createValueStreamMockFail
=
jest
.
fn
(()
=>
Promise
.
reject
());
beforeEach
(
async
()
=>
{
beforeEach
(()
=>
{
wrapper
=
createComponent
({
wrapper
=
createComponent
({
data
:
{
name
:
streamName
},
data
:
{
name
:
streamName
},
methods
:
{
methods
:
{
...
...
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