Commit b9911fb5 authored by Frédéric Caplette's avatar Frédéric Caplette

Merge branch 'sy-sort-incidents-by-status-fe' into 'master'

Add escalation status sort to incident list view

See merge request gitlab-org/gitlab!82237
parents b860ef9d c4151a09
...@@ -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,
...@@ -294,11 +295,12 @@ describe('Incidents List', () => { ...@@ -294,11 +295,12 @@ describe('Incidents List', () => {
const noneSort = 'none'; const noneSort = 'none';
it.each` it.each`
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}
${'publish date'} | ${TH_PUBLISHED_TEST_ID} | ${noneSort} | ${descSort} | ${ascSort} ${'status'} | ${TH_ESCALATION_STATUS_TEST_ID} | ${noneSort} | ${descSort} | ${ascSort}
${'due date'} | ${TH_INCIDENT_SLA_TEST_ID} | ${noneSort} | ${ascSort} | ${descSort} ${'publish date'} | ${TH_PUBLISHED_TEST_ID} | ${noneSort} | ${descSort} | ${ascSort}
${'due date'} | ${TH_INCIDENT_SLA_TEST_ID} | ${noneSort} | ${ascSort} | ${descSort}
`( `(
'updates sort with new direction when sorting by $description', 'updates sort with new direction when sorting by $description',
async ({ selector, initialSort, firstSort, nextSort }) => { async ({ selector, initialSort, firstSort, nextSort }) => {
......
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