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
55da27be
Commit
55da27be
authored
Nov 19, 2021
by
Jose Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sort months of the CI minutes chart app
Changelog: fixed EE: true
parent
5c3289b6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
17 deletions
+33
-17
ee/app/assets/javascripts/ci_minutes_usage/components/app.vue
...pp/assets/javascripts/ci_minutes_usage/components/app.vue
+16
-1
ee/app/assets/javascripts/ci_minutes_usage/components/minutes_usage_project_chart.vue
..._minutes_usage/components/minutes_usage_project_chart.vue
+2
-16
ee/app/assets/javascripts/ci_minutes_usage/constants.js
ee/app/assets/javascripts/ci_minutes_usage/constants.js
+15
-0
No files found.
ee/app/assets/javascripts/ci_minutes_usage/components/app.vue
View file @
55da27be
<
script
>
import
{
MONTHS
}
from
'
../constants
'
;
import
getCiMinutesUsage
from
'
../graphql/queries/ci_minutes.graphql
'
;
import
MinutesUsageMonthChart
from
'
./minutes_usage_month_chart.vue
'
;
import
MinutesUsageProjectChart
from
'
./minutes_usage_project_chart.vue
'
;
...
...
@@ -23,7 +24,21 @@ export default {
},
computed
:
{
minutesUsageDataByMonth
()
{
return
this
.
ciMinutesUsage
.
map
((
cur
)
=>
[
cur
.
month
,
cur
.
minutes
]);
function
monthIndex
([
name
])
{
return
Object
.
keys
(
MONTHS
).
indexOf
(
name
.
toLowerCase
());
}
return
this
.
ciMinutesUsage
.
map
((
cur
)
=>
[
cur
.
month
,
cur
.
minutes
])
.
sort
((
a
,
b
)
=>
{
if
(
monthIndex
(
a
)
>
monthIndex
(
b
))
{
return
1
;
}
if
(
monthIndex
(
a
)
<
monthIndex
(
b
))
{
return
-
1
;
}
return
0
;
});
},
},
};
...
...
ee/app/assets/javascripts/ci_minutes_usage/components/minutes_usage_project_chart.vue
View file @
55da27be
...
...
@@ -2,13 +2,13 @@
import
{
GlAlert
,
GlDropdown
,
GlDropdownItem
}
from
'
@gitlab/ui
'
;
import
{
GlColumnChart
}
from
'
@gitlab/ui/dist/charts
'
;
import
{
keyBy
}
from
'
lodash
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
USAGE_BY_PROJECT
,
X_AXIS_PROJECT_LABEL
,
X_AXIS_CATEGORY
,
Y_AXIS_LABEL
,
NO_CI_MINUTES_MSG
,
MONTHS
,
}
from
'
../constants
'
;
export
default
{
...
...
@@ -17,20 +17,6 @@ export default {
X_AXIS_CATEGORY
,
Y_AXIS_LABEL
,
NO_CI_MINUTES_MSG
,
i18n
:
{
january
:
__
(
'
January
'
),
february
:
__
(
'
February
'
),
march
:
__
(
'
March
'
),
april
:
__
(
'
April
'
),
may
:
__
(
'
May
'
),
june
:
__
(
'
June
'
),
july
:
__
(
'
July
'
),
august
:
__
(
'
August
'
),
september
:
__
(
'
September
'
),
october
:
__
(
'
October
'
),
november
:
__
(
'
November
'
),
december
:
__
(
'
December
'
),
},
components
:
{
GlAlert
,
GlColumnChart
,
...
...
@@ -90,7 +76,7 @@ export default {
[
this
.
selectedMonth
]
=
this
.
months
;
},
getTranslatedMonthName
(
month
)
{
return
this
.
$options
.
i18n
[
month
.
toLowerCase
()]
??
month
;
return
MONTHS
[
month
.
toLowerCase
()]
??
month
;
},
},
};
...
...
ee/app/assets/javascripts/ci_minutes_usage/constants.js
View file @
55da27be
...
...
@@ -9,3 +9,18 @@ export const Y_AXIS_LABEL = __('Minutes');
export
const
NO_CI_MINUTES_MSG
=
s__
(
'
UsageQuota|No CI minutes usage data available.
'
);
export
const
X_AXIS_CATEGORY
=
'
category
'
;
export
const
MONTHS
=
{
january
:
__
(
'
January
'
),
february
:
__
(
'
February
'
),
march
:
__
(
'
March
'
),
april
:
__
(
'
April
'
),
may
:
__
(
'
May
'
),
june
:
__
(
'
June
'
),
july
:
__
(
'
July
'
),
august
:
__
(
'
August
'
),
september
:
__
(
'
September
'
),
october
:
__
(
'
October
'
),
november
:
__
(
'
November
'
),
december
:
__
(
'
December
'
),
};
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