Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

10525: Full Spectrum Docket Sorting #5585

Merged
merged 65 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
23f7da2
10525: WIP use SortableHeader for DocketRecord table;
nechama-krigsman Nov 6, 2024
eafd624
10525: Update state with correct sort table information;
Nov 7, 2024
cfecd81
10525: WIP sort docket record table;
nechama-krigsman Nov 7, 2024
b4ae8ad
10525: maintain sort of docket entries on printable docket record;
nechama-krigsman Nov 8, 2024
7eeaee4
10525: Remove Comment;
Nov 8, 2024
7a5aefd
10525: Add unit test to clearSortTableFiltersAction;
Nov 8, 2024
252502f
10525: Add missing sort type to sortable header;
Nov 8, 2024
b78c0b9
10525: Remove unecessary test file;
Nov 8, 2024
2a24b02
10525: Add custom root for sort table data in action;
Nov 11, 2024
76a8d0f
10525: Delete console log;
Nov 11, 2024
554add8
10525: Update typing;
Nov 11, 2024
4cdc8cc
10525: Fix cypress test to use header sort instead of dropdown sort;
Nov 11, 2024
1cd7c30
10525: add default sort by date and secondary sort by index;
Nov 11, 2024
fa9bb7f
10525: set specific docket record table sort key;
nechama-krigsman Nov 11, 2024
f1cd634
10525: Add unit tests around new property;
nechama-krigsman Nov 11, 2024
93969d0
10525: Add unit tests around sorting entries when generating PDF;
nechama-krigsman Nov 11, 2024
5dab4e4
10525: Add unit tests sort fields when generating PDF;
nechama-krigsman Nov 11, 2024
ccfe29a
10525: Add unit tests on helper to assure entries are sorted correctl…
nechama-krigsman Nov 11, 2024
6044f14
Merge branch 'staging' of https://github.com/ustaxcourt/ef-cms into 1…
nechama-krigsman Nov 11, 2024
d5efd8a
10525: Add cypress tests around table sorting on the docket record ta…
nechama-krigsman Nov 12, 2024
60d39f2
10525: Add test around default sort; reload page between tests;
nechama-krigsman Nov 12, 2024
a6a7e25
10525: update test id;
nechama-krigsman Nov 12, 2024
8773d01
10525: Change name of action;
Nov 13, 2024
bb1a6c8
10525: Change name of action;
Nov 13, 2024
3d11f35
10525: Refactor action and improve typing;
Nov 13, 2024
b29fd61
10525: Match screen size for changing to mobile view;
Nov 13, 2024
6da890c
10525: Hide Headers in mobile view;
Nov 13, 2024
12d9bc5
10525: Pass formatted docket entries to the generate PDF method;
Nov 13, 2024
2370d71
10525: Extend unit tet to cover formatted docket entries being passed…
nechama-krigsman Nov 13, 2024
6bfea1a
10525: Default sorting by filed date;
nechama-krigsman Nov 13, 2024
78f9eac
10525: Fix cypress test to cover new default sorting;
nechama-krigsman Nov 13, 2024
98ff6d4
Merge remote-tracking branch 'taxCourt/staging' into 10525-story
Nov 13, 2024
c96bf2a
10525: Fix unit test;
Nov 14, 2024
610cb30
10525: implement sort for public docket record;
nechama-krigsman Nov 18, 2024
79c7775
10525: Revert inlining function in markup;
nechama-krigsman Nov 18, 2024
8f312f4
10525: Fix mobile sorting using dropdown;
nechama-krigsman Nov 18, 2024
2fdc698
10525: WIP get printable working again; Fix dropdown for mobile sorting;
nechama-krigsman Nov 18, 2024
75ffec1
10525: add formatted date field for public docket entries;
nechama-krigsman Nov 19, 2024
ba86cf0
10525: WIP add new sort to state; fix sort to display undefined last;
nechama-krigsman Nov 19, 2024
a2a20ef
10525: Delete test console.logs;
Nov 19, 2024
cae65d1
10525: Rename test name;
Nov 19, 2024
779fb59
10525: Return default value in our sort method
Nov 19, 2024
dd199c6
10525: Type generic constants in public state;
Nov 21, 2024
6178422
10525: Pass table sort information down to child components and fetch…
Nov 21, 2024
06c693b
10525: Add fix for internal users;
Nov 21, 2024
cd0b042
10525: Add cypress test to assure dropdown changes to reflect user se…
Nov 21, 2024
a230f94
Merge remote-tracking branch 'taxCourt/staging' into 10525-story
Nov 22, 2024
51d6a07
Merge branch 'staging' into 10525-story
cruzjone-flexion Nov 22, 2024
7dc8010
Merge branch 'staging' into 10525-story
cruzjone-flexion Nov 25, 2024
d68cea4
10525: fix sorting mismatch on printable docket record when sorting b…
nechama-krigsman Nov 25, 2024
8ac4833
10525: rename file;
nechama-krigsman Nov 25, 2024
11de96a
10525: rename sortable header component; type state for public and in…
nechama-krigsman Nov 25, 2024
9f1ef10
10525: rename constant name and reference;
nechama-krigsman Nov 25, 2024
745ec0a
10525: Fix typing on sort method;
nechama-krigsman Nov 25, 2024
9a255d8
10525: Fix unit test;
nechama-krigsman Nov 25, 2024
db2f2da
10525: update prop name for mobile view;
nechama-krigsman Nov 25, 2024
d1f2ccc
Merge branch 'staging' into 10525-story
jimlerza Nov 26, 2024
980c108
Merge branch 'staging' into 10525-story
cruzjone-flexion Dec 3, 2024
71073f9
Merge branch 'staging' into 10525-story
cruzjone-flexion Dec 4, 2024
1ef0b22
Merge branch 'staging' into 10525-story
jimlerza Dec 4, 2024
afd1ce7
Merge branch 'staging' into 10525-story
jimlerza Dec 4, 2024
bd1eea8
Merge branch 'staging' into 10525-story
cruzjone-flexion Dec 4, 2024
6845d3b
Merge remote-tracking branch 'taxCourt/staging' into 10525-story
Dec 4, 2024
1465425
Merge branch 'staging' into 10525-story
jimlerza Dec 4, 2024
96f244c
10525: Fixed Params in cypres function;
Dec 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { fillPaperFilingForm } from './fill-paper-filing-form';

export function createAndSaveForLaterPaperFiling({
dateReceived,
documentType,
}: {
documentType: string;
dateReceived: string;
}) {
fillPaperFilingForm({ dateReceived, documentType });

cy.get('[data-testid="save-for-later"]').click();
}
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
import { attachFile } from '../../../file/upload-file';
import { selectTypeaheadInput } from '../../../components/typeAhead/select-typeahead-input';
import { fillPaperFilingForm } from './fill-paper-filing-form';

export function createAndServePaperFiling(
documentType: string,
dateReceived: string,
) {
cy.get('[data-testid="case-detail-menu-button"]').click();
cy.get('[data-testid="menu-button-add-paper-filing"]').click();
cy.get(
'.usa-date-picker__wrapper > [data-testid="date-received-picker"]',
).type(dateReceived);
selectTypeaheadInput('primary-document-type-search', documentType);
cy.get('[data-testid="filed-by-option"]').click();
cy.get('[data-testid="objections-No"]').click();
cy.get('[data-testid="upload-pdf-button"]').click();

attachFile({
filePath: '../../helpers/file/sample.pdf',
selector: 'input#primaryDocumentFile-file',
selectorToAwaitOnSuccess: '[data-testid="remove-pdf"]',
});
export function createAndServePaperFiling({
dateReceived,
documentType,
isPaperCase = true,
}: {
documentType: string;
dateReceived: string;
isPaperCase?: boolean;
}) {
fillPaperFilingForm({ dateReceived, documentType });

cy.get('[data-testid="save-and-serve"]').click();
cy.get('[data-testid="modal-button-confirm"]').click();
cy.get('[data-testid="print-paper-service-done-button"]').click();
if (isPaperCase)
cy.get('[data-testid="print-paper-service-done-button"]').click();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { attachFile } from '../../../file/upload-file';
import { selectTypeaheadInput } from '../../../components/typeAhead/select-typeahead-input';

export function fillPaperFilingForm({
cruzjone-flexion marked this conversation as resolved.
Show resolved Hide resolved
dateReceived,
documentType,
}: {
documentType: string;
dateReceived: string;
}) {
cy.get('[data-testid="case-detail-menu-button"]').click();
cy.get('[data-testid="menu-button-add-paper-filing"]').click();
cy.get(
'.usa-date-picker__wrapper > [data-testid="date-received-picker"]',
).type(dateReceived);
selectTypeaheadInput('primary-document-type-search', documentType);
cy.get('[data-testid="filed-by-option"]').click();
cy.get('[data-testid="objections-No"]').click();
cy.get('[data-testid="upload-pdf-button"]').click();

attachFile({
filePath: '../../helpers/file/sample.pdf',
selector: 'input#primaryDocumentFile-file',
selectorToAwaitOnSuccess: '[data-testid="remove-pdf"]',
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,12 @@ export function createAndServePaperPetition(
];

expectedDocuments.forEach(({ eventCode, index, servedTo }) => {
cy.get(`[data-testid="docket-entry-index-${index}-eventCode"]`).should(
cy.get(`[data-testid="docket-entry-eventCode-${index}"]`).should(
'have.text',
eventCode,
);
cy.get(
`[data-testid="docket-entry-index-${index}-servedPartiesCode"]`,
`[data-testid="docket-entry-servedPartiesCode-${index}"]`,
).should('have.text', servedTo);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,25 @@ describe('Docket clerk views consolidated case', function () {
});

it('should persist the selected sort filter by navigating away from the tab', () => {
cy.get('select[name="docketRecordSort.111-19"]').should(
'have.value',
'byDate',
);
cy.get('select[name="docketRecordSort.111-19"]').select('Newest');
cy.get('[data-testid="descriptionDisplay-sortable-button"]')
.find('svg')
.invoke('attr', 'data-icon')
.should('equal', 'exchange-alt');

cy.get('[data-testid="descriptionDisplay-sortable-button"]').click();

cy.get('[data-testid="descriptionDisplay-sortable-button"]')
.find('svg')
.invoke('attr', 'data-icon')
.should('equal', 'long-arrow-alt-up');

cy.get('#tab-document-view').click();
cy.get('#tab-docket-sub-record').click();
cy.get('select[name="docketRecordSort.111-19"]').should(
'have.value',
'byDateDesc',
);

cy.get('[data-testid="descriptionDisplay-sortable-button"]')
.find('svg')
.invoke('attr', 'data-icon')
.should('equal', 'long-arrow-alt-up');
});

it('should persist the populated consolidated cases in the overview tab when petitioner counsel is added to parties', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ describe('Judge`s chambers stamps an order', () => {
createAndServePaperPetition().then(({ docketNumber }) => {
loginAsDocketClerk1();
goToCase(docketNumber);
createAndServePaperFiling('Motion to Proceed Remotely', '01/01/2022');
createAndServePaperFiling({
dateReceived: '01/01/2022',
documentType: 'Motion to Proceed Remotely',
});
cy.get(
'[data-testid="docket-record-table"] td:contains("Motion to Proceed Remotely")',
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ describe('Judge`s chambers stamps an order', () => {
createAndServePaperPetition().then(({ docketNumber }) => {
loginAsDocketClerk1();
goToCase(docketNumber);
createAndServePaperFiling('Motion to Proceed Remotely', '01/01/2022');
createAndServePaperFiling({
dateReceived: '01/01/2022',
documentType: 'Motion to Proceed Remotely',
});
cy.get(
'[data-testid="docket-record-table"] td:contains("Motion to Proceed Remotely")',
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
import { createAndSaveForLaterPaperFiling } from '../../../../../helpers/caseDetail/docketRecord/paperFiling/create-and-save-for-later-paper-filing';
import { createAndServePaperFiling } from '../../../../../helpers/caseDetail/docketRecord/paperFiling/create-and-serve-paper-filing';
import { externalUserCreatesElectronicCase } from '../../../../../helpers/fileAPetition/petitioner-creates-electronic-case';
import { goToCase } from '../../../../../helpers/caseDetail/go-to-case';
import {
loginAsDocketClerk,
loginAsPetitioner,
} from '../../../../../helpers/authentication/login-as-helpers';
import { logout } from '../../../../../helpers/authentication/logout';
import { petitionsClerkServesPetition } from '../../../../../helpers/documentQC/petitionsclerk-serves-petition';

describe('Docket record sort', () => {
before(() => {
loginAsPetitioner();
externalUserCreatesElectronicCase().then(docketNumber => {
cy.wrap(docketNumber).as('DOCKET_NUMBER');
petitionsClerkServesPetition(docketNumber);
logout();
loginAsDocketClerk();
goToCase(docketNumber);
createAndServePaperFiling({
dateReceived: '01/01/2022',
documentType: 'Motion for a New Trial',
isPaperCase: false,
});
createAndSaveForLaterPaperFiling({
dateReceived: '01/01/2022',
documentType: 'Motion for a New Trial',
});
goToCase(docketNumber);
});
});

beforeEach(() => {
cy.reload(true);
cy.keepAliases();
});

it('should display docket entries in default sort order', () => {
getColumnTextFields('docket-entry-filedDate').then(columnTextFields => {
const sortedColumnsTextFieldsAsc = [...columnTextFields].sort(
sortColumnsAsc,
);

expect(columnTextFields).to.deep.equal(sortedColumnsTextFieldsAsc);
});
});

[
{
columnId: 'docket-entry-index',
fieldName: 'index',
sortButtonId: 'index-sortable-button',
},
{
columnId: 'docket-entry-filedDate',
defaultSort: true,
fieldName: 'date',
sortButtonId: 'sortingFilingDate-sortable-button',
},
{
columnId: 'docket-entry-eventCode',
fieldName: 'event code',
sortButtonId: 'eventCode-sortable-button',
},
{
columnId: 'docket-entry-filingsAndProceedings',
fieldName: 'filings and proceedings',
sortButtonId: 'descriptionDisplay-sortable-button',
},
{
columnId: 'docket-entry-numberOfPages',
fieldName: 'number of pages',
sortButtonId: 'numberOfPages-sortable-button',
},
{
columnId: 'docket-entry-filedBy',
fieldName: 'filed by',
sortButtonId: 'filedBy-sortable-button',
},
{
columnId: 'docket-entry-action',
fieldName: 'action',
sortButtonId: 'action-sortable-button',
},
{
columnId: 'docket-record-cell-not-served',
fieldName: 'served',
sortButtonId: 'servedAt-sortable-button',
},
{
columnId: 'docket-entry-servedPartiesCode',
fieldName: 'served parties',
sortButtonId: 'servedPartiesCode-sortable-button',
},
].forEach(testInfo => {
it(`should display docket entries in correct order when sorting by ${testInfo.fieldName} ascending and descending`, () => {
if (!testInfo.defaultSort) {
cy.get(`[data-testid="${testInfo.sortButtonId}"]`).click();
}
getColumnTextFields(testInfo.columnId).then(columnTextFields => {
const sortedColumnsTextFieldsAsc = [...columnTextFields].sort(
sortColumnsAsc,
);

expect(columnTextFields).to.deep.equal(sortedColumnsTextFieldsAsc);
});

cy.get(`[data-testid="${testInfo.sortButtonId}"]`).click();

getColumnTextFields(testInfo.columnId).then(columnTextFields => {
const sortedColumnsTextFieldsDesc = [...columnTextFields]
.sort(sortColumnsAsc)
.reverse();
expect(columnTextFields).to.deep.equal(sortedColumnsTextFieldsDesc);
});
});
});

describe('Mobile View', () => {
beforeEach(() => {
cy.viewport('iphone-5');
});
it('should update the dropdown value when user selects an option', () => {
cy.get('[data-testid="docket-record-sort-select"]').should(
'have.value',
'byDate',
);
cy.get('[data-testid="docket-record-sort-select"]').select('byIndexDesc');
cy.get('[data-testid="docket-record-sort-select"]').should(
'have.value',
'byIndexDesc',
);
});
});
});

const getColumnTextFields = (dataTestId: string) => {
return cy.get(`[data-testid^="${dataTestId}"]`).then($cells => {
return $cells.toArray().map(cell => cell.innerText);
});
};

function sortColumnsAsc(a: string, b: string) {
const getPriority = (value: string) => {
if (value === '') return 1;
if (value?.toLocaleLowerCase() === 'not served') return 2;
return 0;
};

const priorityA = getPriority(a);
const priorityB = getPriority(b);

if (priorityA !== priorityB) return priorityA - priorityB;
return a.localeCompare(b);
}
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,10 @@ describe('Verify the activity report', () => {
goToCase(docketNumber);
updateCaseStatus('Submitted', 'Colvin');
goToCase(docketNumber);
createAndServePaperFiling('Motion for a New Trial', '01/01/2022');
createAndServePaperFiling({
dateReceived: '01/01/2022',
documentType: 'Motion for a New Trial',
});
goToCase(docketNumber);

cy.get(
Expand Down
18 changes: 14 additions & 4 deletions shared/src/business/entities/EntityConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ import courtIssuedEventCodesJson from '../../tools/courtIssuedEventCodes.json';
import externalFilingEventsJson from '../../tools/externalFilingEvents.json';
import internalFilingEventsJson from '../../tools/internalFilingEvents.json';

export const STATE_KEYS = {
DOCKET_RECORD_TABLE_SORT:
'DOCKET_RECORD_TABLE_SORT' as 'DOCKET_RECORD_TABLE_SORT',
};

export const DEBOUNCE_TIME_MILLISECONDS = 500;

interface FilingEvent {
Expand Down Expand Up @@ -1644,10 +1649,15 @@ export const DOCKET_ENTRY_SEALED_TO_TYPES = {
export const ASCENDING: 'asc' = 'asc';
export const DESCENDING: 'desc' = 'desc';

export const CHRONOLOGICALLY_ASCENDING = 'Oldest to newest';
export const CHRONOLOGICALLY_DESCENDING = 'Newest to oldest';
export const ALPHABETICALLY_ASCENDING = 'In A-Z ascending order';
export const ALPHABETICALLY_DESCENDING = 'In Z-A descending order';
export const SORT_ASCENDING_TEXT = {
date: 'Oldest to newest',
string: 'In A-Z ascending order',
};

export const SORT_DESCENDING_TEXT = {
date: 'Newest to oldest',
string: 'In Z-A descending order',
};

export const PRACTITIONER_DOCUMENT_TYPES_MAP = {
APPLICATION_PACKAGE: 'Application Package',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,4 +310,24 @@ describe('formatDocketEntry', () => {
},
);
});

describe('sortingFilingDate', () => {
it('should set the property "sortingFilingDate" correctly using filingDate', () => {
const result = formatDocketEntry(applicationContext, {
createdAt: '2020-03-01T21:40:46.415Z',
filingDate: '2019-03-01T21:40:46.415Z',
isOnDocketRecord: true,
isUnservable: true,
});
expect(result.sortingFilingDate).toEqual('20190301');
});
it('should set the property "sortingFilingDate" correctly using createdAt', () => {
const result = formatDocketEntry(applicationContext, {
createdAt: '2020-03-01T21:40:46.415Z',
filingDate: '2019-03-01T21:40:46.415Z',
isOnDocketRecord: false,
});
expect(result.sortingFilingDate).toEqual('20200301');
});
});
});
6 changes: 6 additions & 0 deletions shared/src/business/utilities/getFormattedCaseDetail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,16 @@ export const formatDocketEntry = (applicationContext, docketEntry) => {
formattedEntry.createdAtFormatted = applicationContext
.getUtilities()
.formatDateString(formattedEntry.filingDate, 'MMDDYY');
formattedEntry.sortingFilingDate = applicationContext
.getUtilities()
.formatDateString(formattedEntry.filingDate, 'YYYYMMDD_NUMERIC');
} else {
formattedEntry.createdAtFormatted = applicationContext
.getUtilities()
.formatDateString(formattedEntry.createdAt, 'MMDDYY');
formattedEntry.sortingFilingDate = applicationContext
.getUtilities()
.formatDateString(formattedEntry.createdAt, 'YYYYMMDD_NUMERIC');
}

formattedEntry.filingsAndProceedings =
Expand Down
Loading
Loading