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
701ba4bc
Commit
701ba4bc
authored
Jan 07, 2020
by
Martin Wortschack
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add filtered search
- Adds the search bar to the code analytics review page
parent
6b45f448
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
124 additions
and
5 deletions
+124
-5
app/views/shared/issuable/_search_bar.html.haml
app/views/shared/issuable/_search_bar.html.haml
+2
-1
ee/app/assets/javascripts/analytics/code_review_analytics/code_review_analytics_filtered_search_token_keys.js
...ytics/code_review_analytics_filtered_search_token_keys.js
+27
-0
ee/app/assets/javascripts/analytics/code_review_analytics/components/app.vue
...cripts/analytics/code_review_analytics/components/app.vue
+7
-0
ee/app/assets/javascripts/analytics/code_review_analytics/filtered_search_code_review_analytics.js
...review_analytics/filtered_search_code_review_analytics.js
+16
-0
ee/app/assets/javascripts/analytics/code_review_analytics/index.js
...sets/javascripts/analytics/code_review_analytics/index.js
+21
-0
ee/app/assets/javascripts/pages/projects/analytics/code_reviews/index/index.js
...ipts/pages/projects/analytics/code_reviews/index/index.js
+5
-0
ee/app/views/layouts/nav/sidebar/_project_analytics_link.html.haml
...ews/layouts/nav/sidebar/_project_analytics_link.html.haml
+1
-1
ee/app/views/projects/analytics/code_reviews/index.html.haml
ee/app/views/projects/analytics/code_reviews/index.html.haml
+4
-3
ee/spec/features/analytics/code_analytics_spec.rb
ee/spec/features/analytics/code_analytics_spec.rb
+41
-0
No files found.
app/views/shared/issuable/_search_bar.html.haml
View file @
701ba4bc
-
type
=
local_assigns
.
fetch
(
:type
)
-
board
=
local_assigns
.
fetch
(
:board
,
nil
)
-
show_sorting_dropdown
=
local_assigns
.
fetch
(
:show_sorting_dropdown
,
true
)
-
is_not_boards_modal_or_productivity_analytics
=
type
!=
:boards_modal
&&
type
!=
:productivity_analytics
-
block_css_class
=
is_not_boards_modal_or_productivity_analytics
?
'row-content-block second-block'
:
''
-
user_can_admin_list
=
board
&&
can?
(
current_user
,
:admin_list
,
board
.
resource_parent
)
...
...
@@ -169,5 +170,5 @@
-
if
@project
#js-add-issues-btn
.prepend-left-10
{
data:
{
can_admin_list:
can?
(
current_user
,
:admin_list
,
@project
)
}
}
#js-toggle-focus-btn
-
elsif
is_not_boards_modal_or_productivity_analytics
-
elsif
is_not_boards_modal_or_productivity_analytics
&&
show_sorting_dropdown
=
render
'shared/issuable/sort_dropdown'
ee/app/assets/javascripts/analytics/code_review_analytics/code_review_analytics_filtered_search_token_keys.js
0 → 100644
View file @
701ba4bc
import
{
__
}
from
'
~/locale
'
;
import
FilteredSearchTokenKeys
from
'
~/filtered_search/filtered_search_token_keys
'
;
const
tokenKeys
=
[
{
formattedKey
:
__
(
'
Milestone
'
),
key
:
'
milestone
'
,
type
:
'
string
'
,
param
:
'
title
'
,
symbol
:
'
%
'
,
icon
:
'
clock
'
,
tag
:
'
%milestone
'
,
},
{
formattedKey
:
__
(
'
Label
'
),
key
:
'
label
'
,
type
:
'
array
'
,
param
:
'
name[]
'
,
symbol
:
'
~
'
,
icon
:
'
labels
'
,
tag
:
'
~label
'
,
},
];
const
CodeReviewAnalyticsFilteredSearchTokenKeys
=
new
FilteredSearchTokenKeys
(
tokenKeys
);
export
default
CodeReviewAnalyticsFilteredSearchTokenKeys
;
ee/app/assets/javascripts/analytics/code_review_analytics/components/app.vue
0 → 100644
View file @
701ba4bc
<
script
>
export
default
{};
</
script
>
<
template
>
<div
class=
"mt-2"
></div>
</
template
>
ee/app/assets/javascripts/analytics/code_review_analytics/filtered_search_code_review_analytics.js
0 → 100644
View file @
701ba4bc
import
CodeReviewAnalyticsFilteredSearchTokenKeys
from
'
./code_review_analytics_filtered_search_token_keys
'
;
import
FilteredSearchManager
from
'
~/filtered_search/filtered_search_manager
'
;
export
default
class
FilteredSearchCodeReviewAnalytics
extends
FilteredSearchManager
{
constructor
()
{
super
({
page
:
'
code_reviews
'
,
isGroupDecendent
:
true
,
stateFiltersSelector
:
'
.issues-state-filters
'
,
isGroup
:
true
,
filteredSearchTokenKeys
:
CodeReviewAnalyticsFilteredSearchTokenKeys
,
});
this
.
isHandledAsync
=
true
;
}
}
ee/app/assets/javascripts/analytics/code_review_analytics/index.js
0 → 100644
View file @
701ba4bc
import
Vue
from
'
vue
'
;
import
CodeAnalyticsApp
from
'
./components/app.vue
'
;
import
FilteredSearchCodeReviewAnalytics
from
'
./filtered_search_code_review_analytics
'
;
export
default
()
=>
{
const
container
=
document
.
getElementById
(
'
js-code-review-analytics
'
);
if
(
!
container
)
return
;
// eslint-disable-next-line no-new
new
Vue
({
el
:
container
,
mounted
()
{
this
.
filterManager
=
new
FilteredSearchCodeReviewAnalytics
();
this
.
filterManager
.
setup
();
},
render
(
h
)
{
return
h
(
CodeAnalyticsApp
,
{});
},
});
};
ee/app/assets/javascripts/pages/projects/analytics/code_reviews/index/index.js
0 → 100644
View file @
701ba4bc
import
initCodeReviewAnalyticsApp
from
'
ee/analytics/code_review_analytics
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
initCodeReviewAnalyticsApp
();
});
ee/app/views/layouts/nav/sidebar/_project_analytics_link.html.haml
View file @
701ba4bc
-
if
Feature
.
enabled?
(
:code_review_analytics
)
&&
can?
(
current_user
,
:read_code_review_analytics
,
@project
)
-
project_analytics_link
=
namespace_project_analytics_code_reviews_path
(
@project
.
namespace
,
@project
)
-
project_analytics_link
=
project_analytics_code_reviews_path
(
@project
)
=
nav_link
controller: :code_review
do
=
link_to
project_analytics_link
,
data:
{
qa_selector:
'project_analytics_link'
}
do
...
...
ee/app/views/projects/analytics/code_reviews/index.html.haml
View file @
701ba4bc
-
breadcrumb_title
_
(
"Code Review"
)
-
page_title
_
(
"Code Review"
)
.
d-flex.align-items-center
%h
1
.page-title
.
mb-3
%h
3
=
_
(
'Code Review'
)
.text-secondary
=
_
(
'Review time is defined as the time it takes from first comment until merged.'
)
%span
.text-secondary
=
_
(
'Review time is defined as the time it takes from first comment until merged.'
)
=
render
'shared/issuable/search_bar'
,
type: :issues_analytics
,
show_sorting_dropdown:
false
#js-code-review-analytics
{
data:
{
project:
@project
}
}
ee/spec/features/analytics/code_analytics_spec.rb
0 → 100644
View file @
701ba4bc
# frozen_string_literal: true
require
'spec_helper'
describe
'CodeReviewAnalytics'
,
:js
do
include
FilteredSearchHelpers
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
before
do
stub_licensed_features
(
code_review_analytics:
true
)
project
.
add_reporter
(
user
)
sign_in
(
user
)
end
context
'when the feature is enabled'
do
before
do
stub_feature_flags
(
code_review_analytics:
true
)
visit
project_analytics_code_reviews_path
(
project
)
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'
)
end
end
it
'displays label and milestone in search hint'
do
filtered_search
.
click
page
.
within
(
'#js-dropdown-hint'
)
do
expect
(
page
).
to
have_content
(
'Label'
)
expect
(
page
).
to
have_content
(
'Milestone'
)
end
end
end
end
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