Skip to content

fix: have technique management page default to most recent active call#1357

Open
ellen-wright wants to merge 18 commits intodevelopfrom
1521-Make-technique-management-page-default-to-newest-active-call
Open

fix: have technique management page default to most recent active call#1357
ellen-wright wants to merge 18 commits intodevelopfrom
1521-Make-technique-management-page-default-to-newest-active-call

Conversation

@ellen-wright
Copy link
Contributor

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?

  • I have added tests to cover my changes.
  • All relevant doc has been updated

@ellen-wright ellen-wright requested a review from a team as a code owner February 16, 2026 17:08
@ellen-wright ellen-wright requested review from a team, EdwardHaynes, martin-trajanovski and yoganandaness and removed request for a team and martin-trajanovski February 16, 2026 17:08
@ellen-wright ellen-wright changed the title Have technique management page default to most recent active call fix: have technique management page default to most recent active call Feb 16, 2026
).calls;

const openCall = calls?.find((call) => call.isActive);
const sortedcalls = calls.sort((a, b) => (a.id > b.id ? -1 : 1));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we take it to the backend instead of frontend?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also recommending unit tests and e2e, as necessary


@Field(() => Boolean, { nullable: true })
public isOrdered?: boolean;
@Field(() => String, { nullable: true })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, still slightly deviating from other places.

Recommending to follow this approach as we have the same in most other places

  1. 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',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sortDirection: 'asc',
sortDirection: PaginationSortDirection.asc,

{
proposalStatusShortCode: 'QUICK_REVIEW',
sortField: 'call_id',
sortDirection: 'desc',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sortDirection: 'desc',
sortDirection: PaginationSortDirection.desc,

isActiveInternal: isInternalUser,
isOrdered: true,
sortField: 'sort_order',
sortDirection: 'asc',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sortDirection: 'asc',
sortDirection: PaginationSortDirection.asc,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants