the-difference-engine / ksf

7 stars 1 forks source link

Landing Page Home - Sort Applications #148

Closed sierrastephens closed 3 years ago

sierrastephens commented 3 years ago

As an admin, I would like to be able to sort the list of applications on the Home Page, including new files and applications ready for board review, so that I can better view and search for applications based on name or date. image.png Acceptance Criteria:

lsysophia commented 3 years ago

I think there's a small sorting bug in the application view by stages component. On initial landing on the page, all nominations are by default sorted by date. But in the view by stages component, if you switch to sort by a different column, and then change to a different stage, the new stage will be sorted by the previous sort condition instead of going back to sort by date.

My initial fix is not perfect. Right now I've passed in sortConfig key as 'dateReceived' when the stage view changes. But then the sort direction is not being updated correctly. This will need to be further addressed..

lsysophia commented 3 years ago

The naming convention for the Received Date column in both the New Files to Review and Application View By Stages component has been updated to say Submission Date.

On the nomination detail, NominationBanner component, the Created Date has also been updated to Submission Date (dateReceived in the database) to match what's in the home page components.

Mark-Edwards-II commented 3 years ago

In useSort.js our solution to fix the bug was to add a second argument that is optional, doDefault a boolean in requestSort method. The argument "doDefault" is only passed when selecting the dropdown of application stages in ApplicationViewByStages.js, then rendering only applications in selected state. The sort arrow appears up with sorting in direction specified above, upon click even arrow switched direction, arrow moves with selected column and allows toggling direction on click event. The arrow on click event calls to the same requestSort method in useSort.js, it does not pass the second argument allowing the method requestSort to toggle state.

sierrastephens commented 3 years ago

image.png image.png