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
ba6a0972
Commit
ba6a0972
authored
Aug 13, 2021
by
Ezekiel Kigbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address minor review comments
Minor refactor metrics constants and update some externalized strings
parent
6bfdb481
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
21 deletions
+21
-21
app/assets/javascripts/cycle_analytics/components/base.vue
app/assets/javascripts/cycle_analytics/components/base.vue
+2
-2
app/assets/javascripts/cycle_analytics/components/value_stream_metrics.vue
...ripts/cycle_analytics/components/value_stream_metrics.vue
+6
-5
app/assets/javascripts/cycle_analytics/constants.js
app/assets/javascripts/cycle_analytics/constants.js
+8
-9
locale/gitlab.pot
locale/gitlab.pot
+3
-3
spec/frontend/cycle_analytics/value_stream_metrics_spec.js
spec/frontend/cycle_analytics/value_stream_metrics_spec.js
+2
-2
No files found.
app/assets/javascripts/cycle_analytics/components/base.vue
View file @
ba6a0972
...
...
@@ -6,7 +6,7 @@ import PathNavigation from '~/cycle_analytics/components/path_navigation.vue';
import
StageTable
from
'
~/cycle_analytics/components/stage_table.vue
'
;
import
ValueStreamMetrics
from
'
~/cycle_analytics/components/value_stream_metrics.vue
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
projectMetricsRequests
}
from
'
../constants
'
;
import
{
SUMMARY_METRICS_REQUEST
,
METRICS_REQUESTS
}
from
'
../constants
'
;
const
OVERVIEW_DIALOG_COOKIE
=
'
cycle_analytics_help_dismissed
'
;
...
...
@@ -94,7 +94,7 @@ export default {
return
0
;
},
metricsRequests
()
{
return
projectMetricsRequests
(
this
.
features
.
cycleAnalyticsForGroups
)
;
return
this
.
features
?.
cycleAnalyticsForGroups
?
METRICS_REQUESTS
:
SUMMARY_METRICS_REQUEST
;
},
},
methods
:
{
...
...
app/assets/javascripts/cycle_analytics/components/value_stream_metrics.vue
View file @
ba6a0972
...
...
@@ -11,12 +11,13 @@ const requestData = ({ request, path, params, name }) => {
return
request
(
path
,
params
)
.
then
(({
data
})
=>
data
)
.
catch
(()
=>
{
createFlash
({
message
:
sprintf
(
s__
(
'
There was an error while fetching value stream analytics %{requestTypeName} data.
'
),
{
requestTypeName
:
name
},
const
message
=
sprintf
(
s__
(
'
ValueStreamAnalytics|There was an error while fetching value stream analytics %{requestTypeName} data.
'
,
),
});
{
requestTypeName
:
name
},
);
createFlash
({
message
});
});
};
...
...
app/assets/javascripts/cycle_analytics/constants.js
View file @
ba6a0972
...
...
@@ -60,12 +60,11 @@ export const METRICS_POPOVER_CONTENT = {
},
};
export
const
projectMetricsRequests
=
(
cycleAnalyticsForGroups
=
false
)
=>
{
const
summaryMetrics
=
[{
request
:
getValueStreamSummaryMetrics
,
name
:
__
(
'
recent activity
'
)
}];
if
(
cycleAnalyticsForGroups
)
{
return
[{
request
:
getValueStreamTimeSummaryMetrics
,
name
:
__
(
'
time summary
'
)
}].
concat
(
summaryMetrics
,
);
}
return
summaryMetrics
;
};
export
const
SUMMARY_METRICS_REQUEST
=
[
{
request
:
getValueStreamSummaryMetrics
,
name
:
__
(
'
recent activity
'
)
},
];
export
const
METRICS_REQUESTS
=
[
{
request
:
getValueStreamTimeSummaryMetrics
,
name
:
__
(
'
time summary
'
)
},
...
SUMMARY_METRICS_REQUEST
,
];
locale/gitlab.pot
View file @
ba6a0972
...
...
@@ -33714,9 +33714,6 @@ msgstr ""
msgid "There was an error while fetching the table data. Please refresh the page to try again."
msgstr ""
msgid "There was an error while fetching value stream analytics %{requestTypeName} data."
msgstr ""
msgid "There was an error while fetching value stream analytics data."
msgstr ""
...
...
@@ -36555,6 +36552,9 @@ msgstr ""
msgid "ValueStreamAnalytics|Number of new issues created."
msgstr ""
msgid "ValueStreamAnalytics|There was an error while fetching value stream analytics %{requestTypeName} data."
msgstr ""
msgid "ValueStreamAnalytics|Total number of deploys to production."
msgstr ""
...
...
spec/frontend/cycle_analytics/value_stream_metrics_spec.js
View file @
ba6a0972
...
...
@@ -32,7 +32,7 @@ describe('ValueStreamMetrics', () => {
wrapper
=
null
;
});
it
(
'
will display a load
ing icon if `true`
'
,
async
()
=>
{
it
(
'
will display a load
er with pending requests
'
,
async
()
=>
{
mockGetValueStreamSummaryMetrics
=
jest
.
fn
().
mockResolvedValue
({
data
:
metricsData
});
wrapper
=
createComponent
();
await
wrapper
.
vm
.
$nextTick
();
...
...
@@ -105,7 +105,7 @@ describe('ValueStreamMetrics', () => {
await
waitForPromises
();
});
it
(
'
it should render a error message
'
,
()
=>
{
it
(
'
it should render a
n
error message
'
,
()
=>
{
expect
(
createFlash
).
toHaveBeenCalledWith
({
message
:
`There was an error while fetching value stream analytics
${
fakeReqName
}
data.`
,
});
...
...
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