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
4da2f986
Commit
4da2f986
authored
Oct 30, 2019
by
Ezekiel Kigbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added additional test data to fixtures
Mock chart data request for cycle analytics base specs
parent
5af819b7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
52 deletions
+20
-52
ee/app/assets/javascripts/analytics/cycle_analytics/store/mutations.js
.../javascripts/analytics/cycle_analytics/store/mutations.js
+8
-50
ee/spec/frontend/analytics/cycle_analytics/mock_data.js
ee/spec/frontend/analytics/cycle_analytics/mock_data.js
+2
-0
ee/spec/frontend/fixtures/analytics.rb
ee/spec/frontend/fixtures/analytics.rb
+10
-2
No files found.
ee/app/assets/javascripts/analytics/cycle_analytics/store/mutations.js
View file @
4da2f986
...
...
@@ -127,54 +127,12 @@ export default {
state
.
isSavingCustomStage
=
false
;
},
[
types
.
REQUEST_TASKS_BY_TYPE_DATA
](
state
)
{
// [
// {
// "label": {
// "id": 1,
// "title": "label 1",
// "color": "#428BCA",
// "text_color": "#FFFFFF"
// },
// "series": [
// [
// "2018-01-01",
// 23
// ],
// [
// "2018-01-02",
// 5
// ]
// ]
// },
// {
// "label": {
// "id": 2,
// "title": "label 3",
// "color": "#428BCA",
// "text_color": "#FFFFFF"
// },
// "series": [
// [
// "2018-01-01",
// 3
// ],
// [
// "2018-01-03",
// 10
// ]
// ]
// }
// ]
// transforms the raw data into a dictionary
/*
{
labelId: {
issues: [],
merge_requests: []
}
}
*/
},
[
types
.
RECEIVE_TASKS_BY_TYPE_DATA_ERROR
](
state
)
{},
[
types
.
RECEIVE_TASKS_BY_TYPE_DATA_SUCCESS
](
state
)
{},
state
.
isLoadingChartData
=
true
;
},
[
types
.
RECEIVE_TASKS_BY_TYPE_DATA_ERROR
](
state
)
{
state
.
isLoadingChartData
=
false
;
},
[
types
.
RECEIVE_TASKS_BY_TYPE_DATA_SUCCESS
](
state
)
{
state
.
isLoadingChartData
=
false
;
},
};
ee/spec/frontend/analytics/cycle_analytics/mock_data.js
View file @
4da2f986
...
...
@@ -103,3 +103,5 @@ export const customStageEvents = [
labelStartEvent
,
labelStopEvent
,
];
export
const
tasksByTypeData
=
getJSONFixture
(
'
analytics/type_of_work/tasks_by_type.json
'
);
ee/spec/frontend/fixtures/analytics.rb
View file @
4da2f986
...
...
@@ -108,8 +108,16 @@ describe 'Analytics (JavaScript fixtures)', :sidekiq_inline do
render_views
let
(
:label
)
{
create
(
:group_label
,
group:
group
)
}
let
(
:label2
)
{
create
(
:group_label
,
group:
group
)
}
let
(
:label3
)
{
create
(
:group_label
,
group:
group
)
}
before
do
5
.
times
do
|
i
|
create
(
:labeled_issue
,
created_at:
i
.
days
.
ago
,
project:
create
(
:project
,
group:
group
),
labels:
[
label
])
create
(
:labeled_issue
,
created_at:
i
.
days
.
ago
,
project:
create
(
:project
,
group:
group
),
labels:
[
label2
])
create
(
:labeled_issue
,
created_at:
i
.
days
.
ago
,
project:
create
(
:project
,
group:
group
),
labels:
[
label3
])
end
stub_licensed_features
(
type_of_work_analytics:
true
)
stub_feature_flags
(
Gitlab
::
Analytics
::
TASKS_BY_TYPE_CHART_FEATURE_FLAG
=>
true
)
...
...
@@ -118,8 +126,8 @@ describe 'Analytics (JavaScript fixtures)', :sidekiq_inline do
sign_in
(
user
)
end
it
'analytics/tasks_by_type.json'
do
params
=
{
group_id:
group
.
full_path
,
label_ids:
[
label
.
id
],
created_after:
10
.
days
.
ago
,
subject:
'Issue'
}
it
'analytics/t
ype_of_work/t
asks_by_type.json'
do
params
=
{
group_id:
group
.
full_path
,
label_ids:
[
label
.
id
,
label2
.
id
,
label3
.
id
],
created_after:
10
.
days
.
ago
,
subject:
'Issue'
}
get
(
:show
,
params:
params
,
format: :json
)
...
...
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