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
4b353e8d
Commit
4b353e8d
authored
Jul 23, 2020
by
Adam Hegyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Similarity search in projects dropdown
parent
83d8d7b1
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
53 additions
and
18 deletions
+53
-18
ee/app/assets/javascripts/analytics/cycle_analytics/components/base.vue
...javascripts/analytics/cycle_analytics/components/base.vue
+12
-8
ee/app/assets/javascripts/analytics/cycle_analytics/index.js
ee/app/assets/javascripts/analytics/cycle_analytics/index.js
+2
-0
ee/app/assets/javascripts/analytics/productivity_analytics/components/filter_dropdowns.vue
...cs/productivity_analytics/components/filter_dropdowns.vue
+12
-8
ee/app/assets/javascripts/analytics/shared/constants.js
ee/app/assets/javascripts/analytics/shared/constants.js
+2
-0
ee/app/controllers/analytics/cycle_analytics_controller.rb
ee/app/controllers/analytics/cycle_analytics_controller.rb
+1
-0
ee/app/controllers/analytics/productivity_analytics_controller.rb
...ontrollers/analytics/productivity_analytics_controller.rb
+1
-0
ee/app/controllers/groups/analytics/productivity_analytics_controller.rb
...ers/groups/analytics/productivity_analytics_controller.rb
+1
-0
ee/spec/features/groups/analytics/cycle_analytics_spec.rb
ee/spec/features/groups/analytics/cycle_analytics_spec.rb
+2
-1
ee/spec/frontend/analytics/cycle_analytics/components/base_spec.js
...rontend/analytics/cycle_analytics/components/base_spec.js
+20
-1
No files found.
ee/app/assets/javascripts/analytics/cycle_analytics/components/base.vue
View file @
4b353e8d
...
...
@@ -5,7 +5,7 @@ import { featureAccessLevel } from '~/pages/projects/shared/permissions/constant
import
{
PROJECTS_PER_PAGE
,
STAGE_ACTIONS
}
from
'
../constants
'
;
import
GroupsDropdownFilter
from
'
../../shared/components/groups_dropdown_filter.vue
'
;
import
ProjectsDropdownFilter
from
'
../../shared/components/projects_dropdown_filter.vue
'
;
import
{
LAST_ACTIVITY_AT
,
DATE_RANGE_LIMIT
}
from
'
../../shared/constants
'
;
import
{
SIMILARITY_ORDER
,
LAST_ACTIVITY_AT
,
DATE_RANGE_LIMIT
}
from
'
../../shared/constants
'
;
import
DateRange
from
'
../../shared/components/daterange.vue
'
;
import
StageTable
from
'
./stage_table.vue
'
;
import
DurationChart
from
'
./duration_chart.vue
'
;
...
...
@@ -143,6 +143,16 @@ export default {
hasProject
()
{
return
this
.
selectedProjectIds
.
length
>
0
;
},
projectsQueryParams
()
{
return
{
per_page
:
PROJECTS_PER_PAGE
,
with_shared
:
false
,
order_by
:
this
.
featureFlags
.
hasAnalyticsSimilaritySearch
?
SIMILARITY_ORDER
:
LAST_ACTIVITY_AT
,
include_subgroups
:
true
,
};
},
},
methods
:
{
...
...
@@ -203,12 +213,6 @@ export default {
groupsQueryParams
:
{
min_access_level
:
featureAccessLevel
.
EVERYONE
,
},
projectsQueryParams
:
{
per_page
:
PROJECTS_PER_PAGE
,
with_shared
:
false
,
order_by
:
LAST_ACTIVITY_AT
,
include_subgroups
:
true
,
},
maxDateRange
:
DATE_RANGE_LIMIT
,
STAGE_ACTIONS
,
};
...
...
@@ -252,7 +256,7 @@ export default {
:key=
"selectedGroup.id"
class=
"js-projects-dropdown-filter project-select"
:group-id=
"selectedGroup.id"
:query-params=
"
$options.
projectsQueryParams"
:query-params=
"projectsQueryParams"
:multi-select=
"$options.multiProjectSelect"
:default-projects=
"selectedProjects"
@
selected=
"onProjectsSelect"
...
...
ee/app/assets/javascripts/analytics/cycle_analytics/index.js
View file @
4b353e8d
...
...
@@ -18,6 +18,7 @@ export default () => {
valueStreamAnalyticsPathNavigation
:
hasPathNavigation
=
false
,
valueStreamAnalyticsFilterBar
:
hasFilterBar
=
false
,
valueStreamAnalyticsCreateMultipleValueStreams
:
hasCreateMultipleValueStreams
=
false
,
analyticsSimilaritySearch
:
hasAnalyticsSimilaritySearch
=
false
,
}
=
gon
?.
features
;
store
.
dispatch
(
'
initializeCycleAnalytics
'
,
{
...
...
@@ -28,6 +29,7 @@ export default () => {
hasPathNavigation
,
hasFilterBar
,
hasCreateMultipleValueStreams
,
hasAnalyticsSimilaritySearch
,
},
});
...
...
ee/app/assets/javascripts/analytics/productivity_analytics/components/filter_dropdowns.vue
View file @
4b353e8d
<
script
>
import
{
mapState
,
mapActions
}
from
'
vuex
'
;
import
GroupsDropdownFilter
from
'
../../shared/components/groups_dropdown_filter.vue
'
;
import
glFeatureFlagsMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
import
ProjectsDropdownFilter
from
'
../../shared/components/projects_dropdown_filter.vue
'
;
import
{
accessLevelReporter
,
projectsPerPage
}
from
'
../constants
'
;
import
{
LAST_ACTIVITY_AT
}
from
'
../../shared/constants
'
;
import
{
SIMILARITY_ORDER
,
LAST_ACTIVITY_AT
}
from
'
../../shared/constants
'
;
export
default
{
components
:
{
GroupsDropdownFilter
,
ProjectsDropdownFilter
,
},
mixins
:
[
glFeatureFlagsMixin
()],
props
:
{
group
:
{
type
:
Object
,
...
...
@@ -40,6 +42,14 @@ export default {
projects
()
{
return
this
.
project
&&
Object
.
keys
(
this
.
project
).
length
?
[
this
.
project
]
:
null
;
},
projectsQueryParams
()
{
return
{
per_page
:
projectsPerPage
,
with_shared
:
false
,
// exclude forks
order_by
:
this
.
glFeatures
.
analyticsSimilaritySearch
?
SIMILARITY_ORDER
:
LAST_ACTIVITY_AT
,
include_subgroups
:
true
,
};
},
},
methods
:
{
...
mapActions
(
'
filters
'
,
[
'
setGroupNamespace
'
,
'
setProjectPath
'
]),
...
...
@@ -69,12 +79,6 @@ export default {
groupsQueryParams
:
{
min_access_level
:
accessLevelReporter
,
},
projectsQueryParams
:
{
per_page
:
projectsPerPage
,
with_shared
:
false
,
// exclude forks
order_by
:
LAST_ACTIVITY_AT
,
include_subgroups
:
true
,
},
};
</
script
>
...
...
@@ -92,7 +96,7 @@ export default {
:key=
"groupId"
class=
"project-select"
:default-projects=
"projects"
:query-params=
"
$options.
projectsQueryParams"
:query-params=
"projectsQueryParams"
:group-id=
"groupId"
@
selected=
"onProjectsSelected"
/>
...
...
ee/app/assets/javascripts/analytics/shared/constants.js
View file @
4b353e8d
...
...
@@ -16,6 +16,8 @@ export const scatterChartLineProps = {
export
const
LAST_ACTIVITY_AT
=
'
last_activity_at
'
;
export
const
SIMILARITY_ORDER
=
'
similarity
'
;
export
const
DATE_RANGE_LIMIT
=
180
;
export
const
OFFSET_DATE_BY_ONE
=
1
;
...
...
ee/app/controllers/analytics/cycle_analytics_controller.rb
View file @
4b353e8d
...
...
@@ -17,6 +17,7 @@ class Analytics::CycleAnalyticsController < Analytics::ApplicationController
push_frontend_feature_flag
(
:value_stream_analytics_path_navigation
,
@group
)
push_frontend_feature_flag
(
:value_stream_analytics_filter_bar
,
@group
)
push_frontend_feature_flag
(
:value_stream_analytics_create_multiple_value_streams
,
@group
)
push_frontend_feature_flag
(
:analytics_similarity_search
,
@group
)
end
private
...
...
ee/app/controllers/analytics/productivity_analytics_controller.rb
View file @
4b353e8d
...
...
@@ -19,6 +19,7 @@ module Analytics
before_action
->
{
push_frontend_feature_flag
(
:productivity_analytics_scatterplot_enabled
,
default_enabled:
true
)
push_frontend_feature_flag
(
:analytics_similarity_search
,
@group
)
}
before_action
:validate_params
,
only: :show
,
if:
->
{
request
.
format
.
json?
}
...
...
ee/app/controllers/groups/analytics/productivity_analytics_controller.rb
View file @
4b353e8d
...
...
@@ -19,6 +19,7 @@ class Groups::Analytics::ProductivityAnalyticsController < Groups::Analytics::Ap
}
before_action
->
{
push_frontend_feature_flag
(
:productivity_analytics_scatterplot_enabled
,
default_enabled:
true
)
push_frontend_feature_flag
(
:analytics_similarity_search
,
@group
)
}
before_action
:validate_params
,
only: :show
,
if:
->
{
request
.
format
.
json?
}
...
...
ee/spec/features/groups/analytics/cycle_analytics_spec.rb
View file @
4b353e8d
...
...
@@ -21,7 +21,8 @@ RSpec.describe 'Group value stream analytics' do
cycleAnalyticsScatterplotEnabled:
true
,
cycleAnalyticsScatterplotMedianEnabled:
true
,
valueStreamAnalyticsPathNavigation:
true
,
valueStreamAnalyticsFilterBar:
true
valueStreamAnalyticsFilterBar:
true
,
analyticsSimilaritySearch:
true
)
end
...
...
ee/spec/frontend/analytics/cycle_analytics/components/base_spec.js
View file @
4b353e8d
...
...
@@ -304,13 +304,32 @@ describe('Cycle Analytics component', () => {
expect
(
wrapper
.
find
(
ProjectsDropdownFilter
).
props
()).
toEqual
(
expect
.
objectContaining
({
queryParams
:
wrapper
.
vm
.
$options
.
projectsQueryParams
,
queryParams
:
wrapper
.
vm
.
projectsQueryParams
,
groupId
:
mockData
.
group
.
id
,
multiSelect
:
wrapper
.
vm
.
$options
.
multiProjectSelect
,
}),
);
});
describe
(
'
when analyticsSimilaritySearch feature flag is on
'
,
()
=>
{
beforeEach
(()
=>
{
wrapper
=
createComponent
({
withStageSelected
:
true
,
featureFlags
:
{
hasAnalyticsSimilaritySearch
:
true
,
},
});
});
it
(
'
uses similarity as the order param
'
,
()
=>
{
displaysProjectsDropdownFilter
(
true
);
expect
(
wrapper
.
find
(
ProjectsDropdownFilter
).
props
().
queryParams
.
order_by
).
toEqual
(
'
similarity
'
,
);
});
});
it
(
'
displays the date range picker
'
,
()
=>
{
displaysDateRangePicker
(
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