Commit c4151a09 authored by syasonik's avatar syasonik

Add ability to sort by status column in incident list view

Swaps status column to be sortable under project > Monitor > Incidents.
parent a2a64e65
...@@ -33,6 +33,7 @@ import { ...@@ -33,6 +33,7 @@ import {
TH_CREATED_AT_TEST_ID, TH_CREATED_AT_TEST_ID,
TH_INCIDENT_SLA_TEST_ID, TH_INCIDENT_SLA_TEST_ID,
TH_SEVERITY_TEST_ID, TH_SEVERITY_TEST_ID,
TH_ESCALATION_STATUS_TEST_ID,
TH_PUBLISHED_TEST_ID, TH_PUBLISHED_TEST_ID,
INCIDENT_DETAILS_PATH, INCIDENT_DETAILS_PATH,
trackIncidentCreateNewOptions, trackIncidentCreateNewOptions,
...@@ -67,8 +68,11 @@ export default { ...@@ -67,8 +68,11 @@ export default {
{ {
key: 'escalationStatus', key: 'escalationStatus',
label: s__('IncidentManagement|Status'), label: s__('IncidentManagement|Status'),
thClass: `${thClass} gl-w-eighth gl-pointer-events-none`, thClass: `${thClass} gl-w-eighth`,
tdClass, tdClass: `${tdClass} sortable-cell`,
actualSortKey: 'ESCALATION_STATUS',
sortable: true,
thAttr: TH_ESCALATION_STATUS_TEST_ID,
}, },
{ {
key: 'createdAt', key: 'createdAt',
......
...@@ -47,6 +47,7 @@ export const ESCALATION_STATUSES = { ...@@ -47,6 +47,7 @@ export const ESCALATION_STATUSES = {
export const DEFAULT_PAGE_SIZE = 20; export const DEFAULT_PAGE_SIZE = 20;
export const TH_CREATED_AT_TEST_ID = { 'data-testid': 'incident-management-created-at-sort' }; export const TH_CREATED_AT_TEST_ID = { 'data-testid': 'incident-management-created-at-sort' };
export const TH_SEVERITY_TEST_ID = { 'data-testid': 'incident-management-severity-sort' }; export const TH_SEVERITY_TEST_ID = { 'data-testid': 'incident-management-severity-sort' };
export const TH_ESCALATION_STATUS_TEST_ID = { 'data-testid': 'incident-management-status-sort' };
export const TH_INCIDENT_SLA_TEST_ID = { 'data-testid': 'incident-management-sla' }; export const TH_INCIDENT_SLA_TEST_ID = { 'data-testid': 'incident-management-sla' };
export const TH_PUBLISHED_TEST_ID = { 'data-testid': 'incident-management-published-sort' }; export const TH_PUBLISHED_TEST_ID = { 'data-testid': 'incident-management-published-sort' };
export const INCIDENT_DETAILS_PATH = 'incident'; export const INCIDENT_DETAILS_PATH = 'incident';
......
...@@ -7,6 +7,7 @@ import { ...@@ -7,6 +7,7 @@ import {
I18N, I18N,
TH_CREATED_AT_TEST_ID, TH_CREATED_AT_TEST_ID,
TH_SEVERITY_TEST_ID, TH_SEVERITY_TEST_ID,
TH_ESCALATION_STATUS_TEST_ID,
TH_PUBLISHED_TEST_ID, TH_PUBLISHED_TEST_ID,
TH_INCIDENT_SLA_TEST_ID, TH_INCIDENT_SLA_TEST_ID,
trackIncidentCreateNewOptions, trackIncidentCreateNewOptions,
...@@ -297,6 +298,7 @@ describe('Incidents List', () => { ...@@ -297,6 +298,7 @@ describe('Incidents List', () => {
description | selector | initialSort | firstSort | nextSort description | selector | initialSort | firstSort | nextSort
${'creation date'} | ${TH_CREATED_AT_TEST_ID} | ${descSort} | ${ascSort} | ${descSort} ${'creation date'} | ${TH_CREATED_AT_TEST_ID} | ${descSort} | ${ascSort} | ${descSort}
${'severity'} | ${TH_SEVERITY_TEST_ID} | ${noneSort} | ${descSort} | ${ascSort} ${'severity'} | ${TH_SEVERITY_TEST_ID} | ${noneSort} | ${descSort} | ${ascSort}
${'status'} | ${TH_ESCALATION_STATUS_TEST_ID} | ${noneSort} | ${descSort} | ${ascSort}
${'publish date'} | ${TH_PUBLISHED_TEST_ID} | ${noneSort} | ${descSort} | ${ascSort} ${'publish date'} | ${TH_PUBLISHED_TEST_ID} | ${noneSort} | ${descSort} | ${ascSort}
${'due date'} | ${TH_INCIDENT_SLA_TEST_ID} | ${noneSort} | ${ascSort} | ${descSort} ${'due date'} | ${TH_INCIDENT_SLA_TEST_ID} | ${noneSort} | ${ascSort} | ${descSort}
`( `(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment