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
cc2be1ac
Commit
cc2be1ac
authored
Dec 17, 2020
by
Ezekiel Kigbo
Committed by
Martin Wortschack
Dec 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds value_stream_analytics_extended_form feature flag
Adds the feature flag for extended value stream create form
parent
afb907e4
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
52 additions
and
3 deletions
+52
-3
config/feature_flags/development/value_stream_analytics_extended_form.yml
...lags/development/value_stream_analytics_extended_form.yml
+8
-0
ee/app/assets/javascripts/analytics/cycle_analytics/components/base.vue
...javascripts/analytics/cycle_analytics/components/base.vue
+1
-0
ee/app/assets/javascripts/analytics/cycle_analytics/components/value_stream_form.vue
...nalytics/cycle_analytics/components/value_stream_form.vue
+6
-0
ee/app/assets/javascripts/analytics/cycle_analytics/index.js
ee/app/assets/javascripts/analytics/cycle_analytics/index.js
+2
-0
ee/app/controllers/groups/analytics/cycle_analytics_controller.rb
...ontrollers/groups/analytics/cycle_analytics_controller.rb
+1
-0
ee/spec/features/groups/analytics/cycle_analytics/cycle_analytics_spec.rb
.../groups/analytics/cycle_analytics/cycle_analytics_spec.rb
+14
-1
ee/spec/frontend/analytics/cycle_analytics/components/value_stream_form_spec.js
...tics/cycle_analytics/components/value_stream_form_spec.js
+20
-2
No files found.
config/feature_flags/development/value_stream_analytics_extended_form.yml
0 → 100644
View file @
cc2be1ac
---
name
:
value_stream_analytics_extended_form
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/50229
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/294190
milestone
:
'
13.7'
type
:
development
group
:
group::optimize
default_enabled
:
false
ee/app/assets/javascripts/analytics/cycle_analytics/components/base.vue
View file @
cc2be1ac
...
@@ -179,6 +179,7 @@ export default {
...
@@ -179,6 +179,7 @@ export default {
<value-stream-select
<value-stream-select
v-if=
"shouldDisplayCreateMultipleValueStreams"
v-if=
"shouldDisplayCreateMultipleValueStreams"
class=
"gl-align-self-start gl-sm-align-self-start gl-mt-0 gl-sm-mt-5"
class=
"gl-align-self-start gl-sm-align-self-start gl-mt-0 gl-sm-mt-5"
:has-extended-form-fields=
"featureFlags.hasExtendedFormFields"
/>
/>
</div>
</div>
<gl-empty-state
<gl-empty-state
...
...
ee/app/assets/javascripts/analytics/cycle_analytics/components/value_stream_form.vue
View file @
cc2be1ac
...
@@ -46,6 +46,11 @@ export default {
...
@@ -46,6 +46,11 @@ export default {
required
:
false
,
required
:
false
,
default
:
()
=>
({}),
default
:
()
=>
({}),
},
},
hasExtendedFormFields
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
},
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -143,6 +148,7 @@ export default {
...
@@ -143,6 +148,7 @@ export default {
@
input=
"onHandleInput"
@
input=
"onHandleInput"
/>
/>
</gl-form-group>
</gl-form-group>
<div
v-if=
"hasExtendedFormFields"
data-testid=
"extended-form-fields"
></div>
</gl-form>
</gl-form>
</gl-modal>
</gl-modal>
</
template
>
</
template
>
ee/app/assets/javascripts/analytics/cycle_analytics/index.js
View file @
cc2be1ac
...
@@ -23,6 +23,7 @@ export default () => {
...
@@ -23,6 +23,7 @@ export default () => {
cycleAnalyticsScatterplotEnabled
:
hasDurationChart
=
false
,
cycleAnalyticsScatterplotEnabled
:
hasDurationChart
=
false
,
valueStreamAnalyticsPathNavigation
:
hasPathNavigation
=
false
,
valueStreamAnalyticsPathNavigation
:
hasPathNavigation
=
false
,
valueStreamAnalyticsCreateMultipleValueStreams
:
hasCreateMultipleValueStreams
=
false
,
valueStreamAnalyticsCreateMultipleValueStreams
:
hasCreateMultipleValueStreams
=
false
,
valueStreamAnalyticsExtendedForm
:
hasExtendedFormFields
=
false
,
}
=
gon
?.
features
;
}
=
gon
?.
features
;
const
{
const
{
...
@@ -42,6 +43,7 @@ export default () => {
...
@@ -42,6 +43,7 @@ export default () => {
hasDurationChart
,
hasDurationChart
,
hasPathNavigation
,
hasPathNavigation
,
hasCreateMultipleValueStreams
,
hasCreateMultipleValueStreams
,
hasExtendedFormFields
,
},
},
});
});
...
...
ee/app/controllers/groups/analytics/cycle_analytics_controller.rb
View file @
cc2be1ac
...
@@ -16,6 +16,7 @@ class Groups::Analytics::CycleAnalyticsController < Groups::Analytics::Applicati
...
@@ -16,6 +16,7 @@ class Groups::Analytics::CycleAnalyticsController < Groups::Analytics::Applicati
push_frontend_feature_flag
(
:cycle_analytics_scatterplot_enabled
,
default_enabled:
true
)
push_frontend_feature_flag
(
:cycle_analytics_scatterplot_enabled
,
default_enabled:
true
)
push_frontend_feature_flag
(
:value_stream_analytics_path_navigation
,
@group
)
push_frontend_feature_flag
(
:value_stream_analytics_path_navigation
,
@group
)
push_frontend_feature_flag
(
:value_stream_analytics_create_multiple_value_streams
,
default_enabled:
true
)
push_frontend_feature_flag
(
:value_stream_analytics_create_multiple_value_streams
,
default_enabled:
true
)
push_frontend_feature_flag
(
:value_stream_analytics_extended_form
,
@group
)
render_403
unless
can?
(
current_user
,
:read_group_cycle_analytics
,
@group
)
render_403
unless
can?
(
current_user
,
:read_group_cycle_analytics
,
@group
)
end
end
...
...
ee/spec/features/groups/analytics/cycle_analytics/cycle_analytics_spec.rb
View file @
cc2be1ac
...
@@ -19,7 +19,8 @@ RSpec.describe 'Group value stream analytics' do
...
@@ -19,7 +19,8 @@ RSpec.describe 'Group value stream analytics' do
expect
(
page
).
to
have_pushed_frontend_feature_flags
(
expect
(
page
).
to
have_pushed_frontend_feature_flags
(
cycleAnalyticsScatterplotEnabled:
true
,
cycleAnalyticsScatterplotEnabled:
true
,
valueStreamAnalyticsPathNavigation:
true
valueStreamAnalyticsPathNavigation:
true
,
valueStreamAnalyticsExtendedForm:
true
)
)
end
end
...
@@ -35,6 +36,18 @@ RSpec.describe 'Group value stream analytics' do
...
@@ -35,6 +36,18 @@ RSpec.describe 'Group value stream analytics' do
end
end
end
end
context
'when `value_stream_analytics_extended_form` is disabled for a group'
do
before
do
stub_feature_flags
(
value_stream_analytics_extended_form:
false
,
thing:
group
)
end
it
'pushes disabled feature flag to the frontend'
do
visit
group_analytics_cycle_analytics_path
(
group
)
expect
(
page
).
to
have_pushed_frontend_feature_flags
(
valueStreamAnalyticsExtendedForm:
false
)
end
end
context
'when `value_stream_analytics_create_multiple_value_streams` is disabled for a group'
do
context
'when `value_stream_analytics_create_multiple_value_streams` is disabled for a group'
do
before
do
before
do
stub_feature_flags
(
value_stream_analytics_create_multiple_value_streams:
false
,
thing:
group
)
stub_feature_flags
(
value_stream_analytics_create_multiple_value_streams:
false
,
thing:
group
)
...
...
ee/spec/frontend/analytics/cycle_analytics/components/value_stream_form_spec.js
View file @
cc2be1ac
...
@@ -27,7 +27,7 @@ describe('ValueStreamForm', () => {
...
@@ -27,7 +27,7 @@ describe('ValueStreamForm', () => {
},
},
});
});
const
createComponent
=
({
data
=
{},
initialState
=
{}
}
=
{})
=>
const
createComponent
=
({
props
=
{},
data
=
{},
initialState
=
{}
}
=
{})
=>
shallowMount
(
ValueStreamForm
,
{
shallowMount
(
ValueStreamForm
,
{
localVue
,
localVue
,
store
:
fakeStore
({
initialState
}),
store
:
fakeStore
({
initialState
}),
...
@@ -36,6 +36,9 @@ describe('ValueStreamForm', () => {
...
@@ -36,6 +36,9 @@ describe('ValueStreamForm', () => {
...
data
,
...
data
,
};
};
},
},
propsData
:
{
...
props
,
},
mocks
:
{
mocks
:
{
$toast
:
{
$toast
:
{
show
:
mockToastShow
,
show
:
mockToastShow
,
...
@@ -48,6 +51,7 @@ describe('ValueStreamForm', () => {
...
@@ -48,6 +51,7 @@ describe('ValueStreamForm', () => {
findModal
().
props
(
'
actionPrimary
'
).
attributes
[
1
].
disabled
;
findModal
().
props
(
'
actionPrimary
'
).
attributes
[
1
].
disabled
;
const
submitModal
=
()
=>
findModal
().
vm
.
$emit
(
'
primary
'
,
mockEvent
);
const
submitModal
=
()
=>
findModal
().
vm
.
$emit
(
'
primary
'
,
mockEvent
);
const
findFormGroup
=
()
=>
wrapper
.
find
(
GlFormGroup
);
const
findFormGroup
=
()
=>
wrapper
.
find
(
GlFormGroup
);
const
findExtendedFormFields
=
()
=>
wrapper
.
find
(
'
[data-testid="extended-form-fields"]
'
);
afterEach
(()
=>
{
afterEach
(()
=>
{
wrapper
.
destroy
();
wrapper
.
destroy
();
...
@@ -56,12 +60,26 @@ describe('ValueStreamForm', () => {
...
@@ -56,12 +60,26 @@ describe('ValueStreamForm', () => {
describe
(
'
default state
'
,
()
=>
{
describe
(
'
default state
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
wrapper
=
createComponent
(
{
initialState
:
{}
}
);
wrapper
=
createComponent
();
});
});
it
(
'
submit button is disabled
'
,
()
=>
{
it
(
'
submit button is disabled
'
,
()
=>
{
expect
(
createSubmitButtonDisabledState
()).
toBe
(
true
);
expect
(
createSubmitButtonDisabledState
()).
toBe
(
true
);
});
});
it
(
'
does not include extended fields
'
,
()
=>
{
expect
(
findExtendedFormFields
().
exists
()).
toBe
(
false
);
});
});
describe
(
'
with hasExtendedFormFields=true
'
,
()
=>
{
beforeEach
(()
=>
{
wrapper
=
createComponent
({
props
:
{
hasExtendedFormFields
:
true
}
});
});
it
(
'
has the extended fields
'
,
()
=>
{
expect
(
findExtendedFormFields
().
exists
()).
toBe
(
true
);
});
});
});
describe
(
'
form errors
'
,
()
=>
{
describe
(
'
form 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