fix: have technique management page default to most recent active call#1357
fix: have technique management page default to most recent active call#1357ellen-wright wants to merge 18 commits intodevelopfrom
Conversation
…lt-to-newest-active-call
| ).calls; | ||
|
|
||
| const openCall = calls?.find((call) => call.isActive); | ||
| const sortedcalls = calls.sort((a, b) => (a.id > b.id ? -1 : 1)); |
There was a problem hiding this comment.
Should we take it to the backend instead of frontend?
There was a problem hiding this comment.
Also recommending unit tests and e2e, as necessary
…lt-to-newest-active-call
…ctive-call' of https://github.com/UserOfficeProject/user-office-core into 1521-Make-technique-management-page-default-to-newest-active-call
…lt-to-newest-active-call
|
|
||
| @Field(() => Boolean, { nullable: true }) | ||
| public isOrdered?: boolean; | ||
| @Field(() => String, { nullable: true }) |
There was a problem hiding this comment.
This is great, still slightly deviating from other places.
Recommending to follow this approach as we have the same in most other places
- Letting the sortField and sortDirection open as string could result in sql injection error. This is the reason, we want to use PaginationSortDirection
Note: The term pagination is misleading, as this can be used for non pagination entities like here in calls
2. I would recommend sort outside the filter object, since filter is more subject oriented to call and sort is quite generic. It also aligns with the other implementations as well(Proposals, Experiments, Users, Questions etc., )
| ...getFilterStatus(callStatus as CallStatusFilters, isArchivedTab), | ||
| isOrdered: true, | ||
| sortField: 'sort_order', | ||
| sortDirection: 'asc', |
There was a problem hiding this comment.
| sortDirection: 'asc', | |
| sortDirection: PaginationSortDirection.asc, |
| { | ||
| proposalStatusShortCode: 'QUICK_REVIEW', | ||
| sortField: 'call_id', | ||
| sortDirection: 'desc', |
There was a problem hiding this comment.
| sortDirection: 'desc', | |
| sortDirection: PaginationSortDirection.desc, |
| isActiveInternal: isInternalUser, | ||
| isOrdered: true, | ||
| sortField: 'sort_order', | ||
| sortDirection: 'asc', |
There was a problem hiding this comment.
| sortDirection: 'asc', | |
| sortDirection: PaginationSortDirection.asc, |
…ctive-call' of https://github.com/UserOfficeProject/user-office-core into 1521-Make-technique-management-page-default-to-newest-active-call
…lt-to-newest-active-call
…lt-to-newest-active-call
…lt-to-newest-active-call
…lt-to-newest-active-call
Description
refs: UserOfficeProject/issue-tracker#1521
Sets the default call filter in technique management page to be the newest active call.
Motivation and Context
We have a bug where the call filter is still defaulting to the previous technique call instead of moving over to the newly created one for the new year.
This PR sets the URL parameter as the active call with the highest call_id which will be the newest technique call and therefore as there is only one technique call open all year the relevant one will be the default.
How Has This Been Tested
Fixes
Changes
Depends on
Tests included/Docs Updated?