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
d314a600
Commit
d314a600
authored
Nov 27, 2020
by
Martin Wortschack
Committed by
Sean McGivern
Nov 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove codeReviewAnalyticsHasNewSearch
feature flag
parent
8bb7aacd
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
120 deletions
+21
-120
ee/app/assets/javascripts/analytics/code_review_analytics/components/app.vue
...cripts/analytics/code_review_analytics/components/app.vue
+1
-12
ee/app/controllers/projects/analytics/code_reviews_controller.rb
...controllers/projects/analytics/code_reviews_controller.rb
+0
-1
ee/app/views/projects/analytics/code_reviews/index.html.haml
ee/app/views/projects/analytics/code_reviews/index.html.haml
+0
-2
ee/config/feature_flags/development/code_review_analytics_has_new_search.yml
...lags/development/code_review_analytics_has_new_search.yml
+0
-8
ee/spec/features/analytics/code_analytics_spec.rb
ee/spec/features/analytics/code_analytics_spec.rb
+15
-55
ee/spec/frontend/analytics/code_review_analytics/components/app_spec.js
...nd/analytics/code_review_analytics/components/app_spec.js
+5
-42
No files found.
ee/app/assets/javascripts/analytics/code_review_analytics/components/app.vue
View file @
d314a600
<
script
>
import
{
mapState
,
mapActions
}
from
'
vuex
'
;
import
{
GlBadge
,
GlLoadingIcon
,
GlEmptyState
,
GlPagination
}
from
'
@gitlab/ui
'
;
import
glFeatureFlagsMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
import
MergeRequestTable
from
'
./merge_request_table.vue
'
;
import
FilterBar
from
'
./filter_bar.vue
'
;
import
FilteredSearchCodeReviewAnalytics
from
'
../filtered_search_code_review_analytics
'
;
export
default
{
components
:
{
...
...
@@ -15,7 +13,6 @@ export default {
FilterBar
,
MergeRequestTable
,
},
mixins
:
[
glFeatureFlagsMixin
()],
props
:
{
projectId
:
{
type
:
Number
,
...
...
@@ -50,16 +47,8 @@ export default {
this
.
fetchMergeRequests
();
},
},
codeReviewAnalyticsHasNewSearch
()
{
return
this
.
glFeatures
.
codeReviewAnalyticsHasNewSearch
;
},
},
created
()
{
if
(
!
this
.
codeReviewAnalyticsHasNewSearch
)
{
this
.
filterManager
=
new
FilteredSearchCodeReviewAnalytics
();
this
.
filterManager
.
setup
();
}
this
.
setProjectId
(
this
.
projectId
);
this
.
fetchMergeRequests
();
},
...
...
@@ -71,7 +60,7 @@ export default {
<
template
>
<div>
<filter-bar
v-if=
"codeReviewAnalyticsHasNewSearch"
:project-path=
"projectPath"
/>
<filter-bar
:project-path=
"projectPath"
/>
<div
class=
"mt-2"
>
<gl-loading-icon
v-show=
"isLoading"
size=
"md"
class=
"mt-3"
/>
<template
v-if=
"!isLoading"
>
...
...
ee/app/controllers/projects/analytics/code_reviews_controller.rb
View file @
d314a600
...
...
@@ -7,7 +7,6 @@ module Projects
before_action
:authorize_read_code_review_analytics!
before_action
do
push_frontend_feature_flag
(
:code_review_analytics_has_new_search
)
push_frontend_feature_flag
(
:not_issuable_queries
,
@project
,
default_enabled:
true
)
end
...
...
ee/app/views/projects/analytics/code_reviews/index.html.haml
View file @
d314a600
...
...
@@ -5,6 +5,4 @@
%h3
.mb-2
=
_
(
'Code Review'
)
%span
.text-secondary
=
_
(
'Review time is defined as the time it takes from first comment until merged.'
)
-
if
Feature
.
disabled?
(
:code_review_analytics_has_new_search
)
=
render
'shared/issuable/search_bar'
,
type: :issues_analytics
,
show_sorting_dropdown:
false
,
placeholder:
_
(
'Filter results...'
)
#js-code-review-analytics
{
data:
{
project_id:
@project
.
id
,
project_path:
project_path
(
@project
),
new_merge_request_url:
namespace_project_new_merge_request_path
(
@project
.
namespace
),
empty_state_svg_path:
image_path
(
'illustrations/merge_requests.svg'
),
milestone_path:
project_milestones_path
(
@project
),
labels_path:
project_labels_path
(
@project
)
}
}
ee/config/feature_flags/development/code_review_analytics_has_new_search.yml
deleted
100644 → 0
View file @
8bb7aacd
---
name
:
code_review_analytics_has_new_search
introduced_by_url
:
rollout_issue_url
:
milestone
:
type
:
development
group
:
default_enabled
:
false
ee/spec/features/analytics/code_analytics_spec.rb
View file @
d314a600
...
...
@@ -3,8 +3,6 @@
require
'spec_helper'
RSpec
.
describe
'CodeReviewAnalytics Filtered Search'
,
:js
do
include
FilteredSearchHelpers
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
...
...
@@ -12,11 +10,6 @@ RSpec.describe 'CodeReviewAnalytics Filtered Search', :js do
stub_licensed_features
(
code_review_analytics:
true
)
project
.
add_reporter
(
user
)
end
context
'when the "new search" feature is disabled'
do
before
do
stub_feature_flags
(
code_review_analytics_has_new_search:
false
)
sign_in
(
user
)
...
...
@@ -24,56 +17,23 @@ RSpec.describe 'CodeReviewAnalytics Filtered Search', :js do
end
it
'renders the filtered search bar correctly'
do
page
.
within
(
'.content-wrapper .content .issues-filters'
)
do
expect
(
page
).
to
have_css
(
'.filtered-search-box'
)
page
.
within
(
'.content-wrapper .content .vue-filtered-search-bar-container'
)
do
expect
(
page
).
to
have_selector
(
'.gl-search-box-by-click'
)
expect
(
page
.
find
(
'.gl-filtered-search-term-input'
)[
:placeholder
]).
to
eq
(
'Filter results'
)
end
end
it
'displays label and milestone in search hint'
do
filtered_search
.
click
page
.
within
(
'.content-wrapper .content .vue-filtered-search-bar-container'
)
do
page
.
find
(
'.gl-search-box-by-click'
).
click
page
.
within
(
'#js-dropdown-hint'
)
do
expect
(
page
).
to
have_content
(
'Label'
)
expect
(
page
).
to
have_content
(
'Milestone'
)
end
end
expect
(
page
).
to
have_selector
(
'.gl-filtered-search-suggestion-list'
)
context
'with merge_requests'
do
let
(
:label
)
{
create
(
:label
,
title:
'awesome label'
,
project:
project
)
}
hints
=
page
.
find_all
(
'.gl-filtered-search-suggestion-list > li'
)
before
do
create
(
:merge_request
,
title:
"Bug fix-1"
,
source_project:
project
,
source_branch:
"branch-1"
)
create
(
:labeled_merge_request
,
title:
"Bug fix with label"
,
source_project:
project
,
source_branch:
"branch-with-label"
,
labels:
[
label
])
create
(
:labeled_merge_request
,
title:
"Bug fix with label#2"
,
source_project:
project
,
source_branch:
"branch-with-label-2"
,
labels:
[
label
])
end
it
'filters the list of merge requests'
,
quarantine:
'https://gitlab.com/gitlab-org/gitlab/-/issues/250638'
do
has_merge_requests
(
3
)
select_label_on_dropdown
(
label
.
title
)
has_merge_requests
(
2
)
end
end
expect
(
hints
.
length
).
to
eq
(
2
)
expect
(
hints
[
0
]).
to
have_content
(
'Milestone'
)
expect
(
hints
[
1
]).
to
have_content
(
'Label'
)
end
context
'when the "new search" feature is enabled'
do
before
do
stub_feature_flags
(
code_review_analytics_has_new_search:
true
)
sign_in
(
user
)
visit
project_analytics_code_reviews_path
(
project
)
end
it
'does not render the filtered search bar'
do
page
.
within
(
'.content-wrapper .content'
)
do
expect
(
page
).
not_to
have_css
(
'.issues-filters'
)
end
end
end
def
has_merge_requests
(
num
=
0
)
expect
(
page
).
to
have_text
(
"Merge Requests in Review
#{
num
}
"
)
end
end
ee/spec/frontend/analytics/code_review_analytics/components/app_spec.js
View file @
d314a600
...
...
@@ -9,13 +9,6 @@ import createMergeRequestsState from 'ee/analytics/code_review_analytics/store/m
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
import
createFiltersState
from
'
~/vue_shared/components/filtered_search_bar/store/modules/filters/state
'
;
const
mockFilterManagerSetup
=
jest
.
fn
();
jest
.
mock
(
'
ee/analytics/code_review_analytics/filtered_search_code_review_analytics
'
,
()
=>
jest
.
fn
().
mockImplementation
(()
=>
({
setup
:
mockFilterManagerSetup
,
})),
);
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
...
...
@@ -62,7 +55,7 @@ describe('CodeReviewAnalyticsApp component', () => {
},
});
const
createComponent
=
(
store
,
codeReviewAnalyticsHasNewSearch
=
false
)
=>
const
createComponent
=
store
=>
shallowMount
(
CodeReviewAnalyticsApp
,
{
localVue
,
store
,
...
...
@@ -74,11 +67,6 @@ describe('CodeReviewAnalyticsApp component', () => {
projectPath
:
TEST_HOST
,
labelsPath
:
`
${
TEST_HOST
}
/labels`
,
},
provide
:
{
glFeatures
:
{
codeReviewAnalyticsHasNewSearch
,
},
},
});
beforeEach
(()
=>
{
...
...
@@ -98,38 +86,13 @@ describe('CodeReviewAnalyticsApp component', () => {
const
findPagination
=
()
=>
wrapper
.
find
(
GlPagination
);
describe
(
'
template
'
,
()
=>
{
describe
(
'
when "codeReviewAnalyticsHasNewSearch" is disabled
'
,
()
=>
{
beforeEach
(()
=>
{
vuexStore
=
createStore
();
wrapper
=
createComponent
(
vuexStore
);
});
it
(
'
does not render the filter bar component
'
,
()
=>
{
expect
(
findFilterBar
().
exists
()).
toBe
(
false
);
});
it
(
"
calls the filterManager's setup method
"
,
()
=>
{
expect
(
mockFilterManagerSetup
).
toHaveBeenCalled
();
});
});
describe
(
'
when "codeReviewAnalyticsHasNewSearch" is enabled
'
,
()
=>
{
describe
(
'
when the feature is enabled
'
,
()
=>
{
beforeEach
(()
=>
{
it
(
'
renders the filter bar component
'
,
()
=>
{
vuexStore
=
createStore
();
wrapper
=
createComponent
(
vuexStore
,
true
);
});
it
(
'
renders the filter bar component
'
,
()
=>
{
expect
(
findFilterBar
().
exists
()).
toBe
(
true
);
});
it
(
"
does not call the filterManager's setup method
"
,
()
=>
{
expect
(
mockFilterManagerSetup
).
not
.
toHaveBeenCalled
();
});
});
});
describe
(
'
while loading
'
,
()
=>
{
beforeEach
(()
=>
{
vuexStore
=
createStore
({
mergeRequests
:
{
isLoading
:
true
}
});
...
...
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