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
23c3c81f
Commit
23c3c81f
authored
May 18, 2020
by
lauraMon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sets up graphql sorting
parent
b4af5106
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
app/assets/javascripts/alert_management/components/alert_management_list.vue
...pts/alert_management/components/alert_management_list.vue
+9
-0
app/assets/javascripts/alert_management/graphql/queries/get_alerts.query.graphql
...alert_management/graphql/queries/get_alerts.query.graphql
+2
-2
No files found.
app/assets/javascripts/alert_management/components/alert_management_list.vue
View file @
23c3c81f
...
...
@@ -154,7 +154,9 @@ export default {
errored
:
false
,
isAlertDismissed
:
false
,
isErrorAlertDismissed
:
false
,
sort
:
null
,
statusFilter
:
this
.
$options
.
statusTabs
[
4
].
filters
,
};
},
computed
:
{
...
...
@@ -180,6 +182,11 @@ export default {
filterAlertsByStatus
(
tabIndex
)
{
this
.
statusFilter
=
this
.
$options
.
statusTabs
[
tabIndex
].
filters
;
},
fetchSortedData
({
sortBy
,
sortDesc
})
{
const
sortDirection
=
sortDesc
?
'
DESC
'
:
'
ASC
'
;
const
sortColumn
=
sortBy
.
replace
(
/
([
A-Z
])
/g
,
'
_$1
'
).
toUpperCase
();
this
.
sort
=
`
${
sortColumn
}
_
${
sortDirection
}
`
;
},
capitalizeFirstCharacter
,
updateAlertStatus
(
status
,
iid
)
{
this
.
$apollo
...
...
@@ -241,7 +248,9 @@ export default {
:busy=
"loading"
stacked=
"md"
:tbody-tr-class=
"tbodyTrClass"
:no-local-sorting=
"true"
@
row-clicked=
"navigateToAlertDetails"
@
sort-changed=
"fetchSortedData"
>
<
template
#cell(severity)=
"{ item }"
>
<div
...
...
app/assets/javascripts/alert_management/graphql/queries/get_alerts.query.graphql
View file @
23c3c81f
#import "../fragments/list_item.fragment.graphql"
query
getAlerts
(
$projectPath
:
ID
!,
$statuses
:
[
AlertManagementStatus
!])
{
query
getAlerts
(
$projectPath
:
ID
!,
$statuses
:
[
AlertManagementStatus
!]
,
$sort
:
AlertManagementAlertSort
)
{
project
(
fullPath
:
$projectPath
)
{
alertManagementAlerts
(
statuses
:
$statuses
)
{
alertManagementAlerts
(
statuses
:
$statuses
,
sort
:
$sort
)
{
nodes
{
...
AlertListItem
}
...
...
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