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
8ad897d1
Commit
8ad897d1
authored
May 21, 2020
by
lauraMon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated with Andrews feedback
parent
87cdbd22
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
app/assets/javascripts/alert_management/components/alert_management_list.vue
...pts/alert_management/components/alert_management_list.vue
+7
-6
spec/frontend/alert_management/components/alert_management_list_spec.js
...alert_management/components/alert_management_list_spec.js
+1
-1
No files found.
app/assets/javascripts/alert_management/components/alert_management_list.vue
View file @
8ad897d1
...
...
@@ -21,12 +21,12 @@ 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
}
from
'
../constants
'
;
import
updateAlertStatus
from
'
../graphql/mutations/update_alert_status.graphql
'
;
import
{
capitalizeFirstCharacter
}
from
'
~/lib/utils/text_utility
'
;
import
{
capitalizeFirstCharacter
,
convertToSnakeCase
}
from
'
~/lib/utils/text_utility
'
;
const
tdClass
=
'
table-col d-flex d-md-table-cell align-items-center
'
;
const
bodyTrClass
=
'
gl-border-1 gl-border-t-solid gl-border-gray-100 hover-bg-blue-50 hover-gl-cursor-pointer hover-gl-border-b-solid hover-gl-border-blue-200
'
;
const
find
SortColumn
=
()
=>
document
.
querySelector
(
'
.
started-at
'
);
const
find
DefaultSortColumn
=
()
=>
document
.
querySelector
(
'
.js-
started-at
'
);
export
default
{
i18n
:
{
...
...
@@ -47,7 +47,7 @@ export default {
{
key
:
'
startTime
'
,
label
:
s__
(
'
AlertManagement|Start time
'
),
thClass
:
'
started-at
'
,
thClass
:
'
js-
started-at
'
,
tdClass
,
sortable
:
true
,
},
...
...
@@ -181,7 +181,7 @@ export default {
},
},
mounted
()
{
findSortColumn
().
ariaSort
=
'
ascending
'
;
find
Default
SortColumn
().
ariaSort
=
'
ascending
'
;
},
methods
:
{
filterAlertsByStatus
(
tabIndex
)
{
...
...
@@ -189,9 +189,10 @@ export default {
},
fetchSortedData
({
sortBy
,
sortDesc
})
{
const
sortDirection
=
sortDesc
?
'
DESC
'
:
'
ASC
'
;
const
sortColumn
=
sortBy
.
replace
(
/
([
A-Z
])
/g
,
'
_$1
'
).
toUpperCase
();
const
sortColumn
=
convertToSnakeCase
(
sortBy
).
toUpperCase
();
if
(
sortBy
!==
'
startTime
'
)
{
findSortColumn
().
ariaSort
=
'
none
'
;
find
Default
SortColumn
().
ariaSort
=
'
none
'
;
}
this
.
sort
=
`
${
sortColumn
}
_
${
sortDirection
}
`
;
},
...
...
spec/frontend/alert_management/components/alert_management_list_spec.js
View file @
8ad897d1
...
...
@@ -292,7 +292,7 @@ describe('AlertManagementList', () => {
beforeEach
(()
=>
{
mountComponent
({
props
:
{
alertManagementEnabled
:
true
,
userCanEnableAlertManagement
:
true
},
data
:
{
alerts
:
mockAlerts
,
errored
:
false
,
sort
:
'
START_TIME_ASC
'
},
data
:
{
alerts
:
mockAlerts
,
errored
:
false
,
sort
:
'
START_TIME_ASC
'
,
alertsCount
},
loading
:
false
,
});
});
...
...
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