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
397fb4d3
Commit
397fb4d3
authored
May 18, 2020
by
lauraMon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refacotred vars to allow internationalization
parent
b1527121
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
29 deletions
+15
-29
app/assets/javascripts/alert_management/components/alert_management_list.vue
...pts/alert_management/components/alert_management_list.vue
+5
-11
app/assets/javascripts/alert_management/constants.js
app/assets/javascripts/alert_management/constants.js
+10
-18
No files found.
app/assets/javascripts/alert_management/components/alert_management_list.vue
View file @
397fb4d3
...
...
@@ -20,14 +20,13 @@ import TimeAgo from '~/vue_shared/components/time_ago_tooltip.vue';
import
getAlerts
from
'
../graphql/queries/get_alerts.query.graphql
'
;
import
getAlertsCountByStatus
from
'
../graphql/queries/get_count_by_status.query.graphql
'
;
import
{
ALERTS_STATUS
,
ALERTS_STATUS_TABS
,
ALERTS_SEVERITY_LABELS
,
trackAlertListViewsOptions
,
trackAlertStatusUpdateOptions
,
}
from
'
../constants
'
;
import
updateAlertStatus
from
'
../graphql/mutations/update_alert_status.graphql
'
;
import
{
c
apitalizeFirstCharacter
,
c
onvertToSnakeCase
}
from
'
~/lib/utils/text_utility
'
;
import
{
convertToSnakeCase
}
from
'
~/lib/utils/text_utility
'
;
import
Tracking
from
'
~/tracking
'
;
const
tdClass
=
'
table-col d-flex d-md-table-cell align-items-center
'
;
...
...
@@ -87,9 +86,9 @@ export default {
},
],
statuses
:
{
[
ALERTS_STATUS
.
TRIGGERED
]
:
s__
(
'
AlertManagement|Triggered
'
),
[
ALERTS_STATUS
.
ACKNOWLEDGED
]
:
s__
(
'
AlertManagement|Acknowledged
'
),
[
ALERTS_STATUS
.
RESOLVED
]
:
s__
(
'
AlertManagement|Resolved
'
),
TRIGGERED
:
s__
(
'
AlertManagement|Triggered
'
),
ACKNOWLEDGED
:
s__
(
'
AlertManagement|Acknowledged
'
),
RESOLVED
:
s__
(
'
AlertManagement|Resolved
'
),
},
severityLabels
:
ALERTS_SEVERITY_LABELS
,
statusTabs
:
ALERTS_STATUS_TABS
,
...
...
@@ -204,7 +203,6 @@ export default {
}
this
.
sort
=
`
${
sortColumn
}
_
${
sortDirection
}
`
;
},
capitalizeFirstCharacter
,
updateAlertStatus
(
status
,
iid
)
{
this
.
$apollo
.
mutate
({
...
...
@@ -311,11 +309,7 @@ export default {
</
template
>
<
template
#cell(status)=
"{ item }"
>
<gl-dropdown
:text=
"capitalizeFirstCharacter(item.status.toLowerCase())"
class=
"w-100"
right
>
<gl-dropdown
:text=
"$options.statuses[item.status]"
class=
"w-100"
right
>
<gl-dropdown-item
v-for=
"(label, field) in $options.statuses"
:key=
"field"
...
...
app/assets/javascripts/alert_management/constants.js
View file @
397fb4d3
...
...
@@ -9,39 +9,31 @@ export const ALERTS_SEVERITY_LABELS = {
UNKNOWN
:
s__
(
'
AlertManagement|Unknown
'
),
};
export
const
ALERTS_STATUS
=
{
OPEN
:
'
OPEN
'
,
TRIGGERED
:
'
TRIGGERED
'
,
ACKNOWLEDGED
:
'
ACKNOWLEDGED
'
,
RESOLVED
:
'
RESOLVED
'
,
ALL
:
'
ALL
'
,
};
export
const
ALERTS_STATUS_TABS
=
[
{
title
:
s__
(
'
AlertManagement|Open
'
),
status
:
ALERTS_STATUS
.
OPEN
,
filters
:
[
ALERTS_STATUS
.
TRIGGERED
,
ALERTS_STATUS
.
ACKNOWLEDGED
],
status
:
'
OPEN
'
,
filters
:
[
'
TRIGGERED
'
,
'
ACKNOWLEDGED
'
],
},
{
title
:
s__
(
'
AlertManagement|Triggered
'
),
status
:
ALERTS_STATUS
.
TRIGGERED
,
filters
:
[
ALERTS_STATUS
.
TRIGGERED
]
,
status
:
'
TRIGGERED
'
,
filters
:
'
TRIGGERED
'
,
},
{
title
:
s__
(
'
AlertManagement|Acknowledged
'
),
status
:
ALERTS_STATUS
.
ACKNOWLEDGED
,
filters
:
[
ALERTS_STATUS
.
ACKNOWLEDGED
]
,
status
:
'
ACKNOWLEDGED
'
,
filters
:
'
ACKNOWLEDGED
'
,
},
{
title
:
s__
(
'
AlertManagement|Resolved
'
),
status
:
ALERTS_STATUS
.
RESOLVED
,
filters
:
[
ALERTS_STATUS
.
RESOLVED
]
,
status
:
'
RESOLVED
'
,
filters
:
'
RESOLVED
'
,
},
{
title
:
s__
(
'
AlertManagement|All alerts
'
),
status
:
ALERTS_STATUS
.
ALL
,
filters
:
[
ALERTS_STATUS
.
TRIGGERED
,
ALERTS_STATUS
.
ACKNOWLEDGED
,
ALERTS_STATUS
.
RESOLVED
],
status
:
'
ALL
'
,
filters
:
[
'
TRIGGERED
'
,
'
ACKNOWLEDGED
'
,
'
RESOLVED
'
],
},
];
...
...
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