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
06c868c3
Commit
06c868c3
authored
May 07, 2021
by
Tristan Read
Committed by
Paul Gascou-Vaillancourt
May 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use a sort key for all sortable columns
parent
71861c69
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
13 deletions
+5
-13
app/assets/javascripts/incidents/components/incidents_list.vue
...ssets/javascripts/incidents/components/incidents_list.vue
+5
-13
No files found.
app/assets/javascripts/incidents/components/incidents_list.vue
View file @
06c868c3
...
...
@@ -10,7 +10,6 @@ import {
GlIcon
,
GlEmptyState
,
}
from
'
@gitlab/ui
'
;
import
{
convertToSnakeCase
}
from
'
~/lib/utils/text_utility
'
;
import
{
visitUrl
,
mergeUrlParams
,
joinPaths
}
from
'
~/lib/utils/url_utility
'
;
import
{
s__
}
from
'
~/locale
'
;
import
{
INCIDENT_SEVERITY
}
from
'
~/sidebar/components/severity/constants
'
;
...
...
@@ -49,6 +48,7 @@ export default {
label
:
s__
(
'
IncidentManagement|Severity
'
),
thClass
:
`
${
thClass
}
w-15p`
,
tdClass
:
`
${
tdClass
}
sortable-cell`
,
actualSortKey
:
'
SEVERITY
'
,
sortable
:
true
,
thAttr
:
TH_SEVERITY_TEST_ID
,
},
...
...
@@ -63,6 +63,7 @@ export default {
label
:
s__
(
'
IncidentManagement|Date created
'
),
thClass
:
`
${
thClass
}
gl-w-eighth`
,
tdClass
:
`
${
tdClass
}
sortable-cell`
,
actualSortKey
:
'
CREATED
'
,
sortable
:
true
,
thAttr
:
TH_CREATED_AT_TEST_ID
,
},
...
...
@@ -87,6 +88,7 @@ export default {
label
:
s__
(
'
IncidentManagement|Published
'
),
thClass
:
`
${
thClass
}
w-15p`
,
tdClass
:
`
${
tdClass
}
sortable-cell`
,
actualSortKey
:
'
PUBLISHED
'
,
sortable
:
true
,
thAttr
:
TH_PUBLISHED_TEST_ID
,
},
...
...
@@ -175,7 +177,6 @@ export default {
incidents
:
{},
incidentsCount
:
{},
sort
:
'
CREATED_DESC
'
,
sortBy
:
'
createdAt
'
,
sortDesc
:
true
,
statusFilter
:
''
,
filteredByStatus
:
''
,
...
...
@@ -256,20 +257,11 @@ export default {
this
.
redirecting
=
true
;
},
fetchSortedData
({
sortBy
,
sortDesc
})
{
let
sortKey
;
// In bootstrap-vue v2.17.0, sortKey becomes natively supported and we can eliminate this function
const
field
=
this
.
availableFields
.
find
(({
key
})
=>
key
===
sortBy
);
const
sortingDirection
=
sortDesc
?
'
DESC
'
:
'
ASC
'
;
// Use `sortKey` if provided, otherwise fall back to existing algorithm
if
(
field
?.
actualSortKey
)
{
sortKey
=
field
.
actualSortKey
;
}
else
{
sortKey
=
convertToSnakeCase
(
sortBy
).
replace
(
/_.*/
,
''
).
toUpperCase
();
}
this
.
pagination
=
initialPaginationState
;
this
.
sort
=
`
${
s
ortKey
}
_
${
sortingDirection
}
`
;
this
.
sort
=
`
${
field
.
actualS
ortKey
}
_
${
sortingDirection
}
`
;
},
getSeverity
(
severity
)
{
return
INCIDENT_SEVERITY
[
severity
];
...
...
@@ -339,7 +331,7 @@ export default {
:tbody-tr-class=
"tbodyTrClass"
sort-direction=
"desc"
:sort-desc.sync=
"sortDesc"
:sort-by.sync=
"sortBy
"
sort-by=
"createdAt
"
show-empty
no-local-sorting
sort-icon-left
...
...
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