diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /app/assets/javascripts/incidents | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'app/assets/javascripts/incidents')
-rw-r--r-- | app/assets/javascripts/incidents/components/incidents_list.vue | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/app/assets/javascripts/incidents/components/incidents_list.vue b/app/assets/javascripts/incidents/components/incidents_list.vue index e1f9d858f2b..0e3839deaf5 100644 --- a/app/assets/javascripts/incidents/components/incidents_list.vue +++ b/app/assets/javascripts/incidents/components/incidents_list.vue @@ -69,9 +69,12 @@ export default { { key: 'incidentSla', label: s__('IncidentManagement|Time to SLA'), - thClass: `gl-pointer-events-none gl-text-right gl-w-eighth`, + thClass: `gl-text-right gl-w-eighth`, tdClass: `${tdClass} gl-text-right`, thAttr: TH_INCIDENT_SLA_TEST_ID, + sortKey: 'SLA_DUE_AT', + sortable: true, + sortDirection: 'asc', }, { key: 'assignees', @@ -253,13 +256,22 @@ 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'; - const sortingColumn = convertToSnakeCase(sortBy) - .replace(/_.*/, '') - .toUpperCase(); + + // Use `sortKey` if provided, otherwise fall back to existing algorithm + if (field?.sortKey) { + sortKey = field.sortKey; + } else { + sortKey = convertToSnakeCase(sortBy) + .replace(/_.*/, '') + .toUpperCase(); + } this.pagination = initialPaginationState; - this.sort = `${sortingColumn}_${sortingDirection}`; + this.sort = `${sortKey}_${sortingDirection}`; }, getSeverity(severity) { return INCIDENT_SEVERITY[severity]; @@ -407,7 +419,7 @@ export default { </template> </gl-table> </template> - <template #emtpy-state> + <template #empty-state> <gl-empty-state :title="emptyStateData.title" :svg-path="emptyListSvgPath" |