Skip to content

Examiner UI - Application Details - Assign and Unassign#669

Merged
shaangill025 merged 5 commits intobcgov:mainfrom
shaangill025:fix_26347
Apr 11, 2025
Merged

Examiner UI - Application Details - Assign and Unassign#669
shaangill025 merged 5 commits intobcgov:mainfrom
shaangill025:fix_26347

Conversation

@shaangill025
Copy link
Copy Markdown
Contributor

@shaangill025 shaangill025 commented Apr 8, 2025

Issue:

Description of changes:
#663 needs to be merged first.

image
image
image
image
image

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the BC Registry and Digital Services BSD 3-Clause License

@shaangill025 shaangill025 requested a review from dimak1 April 8, 2025 14:22
@shaangill025 shaangill025 self-assigned this Apr 8, 2025
@bcregistry-sre
Copy link
Copy Markdown
Collaborator

Temporary Url for review: https://strr-examiner-dev--pr-669-lxwb50p1.web.app

@shaangill025
Copy link
Copy Markdown
Contributor Author

@andyyanggov This is ready for UXA.

@andyyanggov
Copy link
Copy Markdown

@shaangill025 A few discrepancies I noticed:

  • Both 'NOC - Pending' and 'NOC - Expired' applications aren't being auto assigned for some reason. The manual assign button returns an error as well.
  • When unassigned, the email body and decision actions should be disabled/greyed out instead.
  • The assign/unassign feature should work the same way for registrations too

Copy link
Copy Markdown
Collaborator

@dimak1 dimak1 left a comment

Choose a reason for hiding this comment

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

Nice work, thanks for the tests! Added few comments, and maybe we can connect to go over some of the code. Thank you

}

const props = withDefaults(defineProps<Props>(), {
confirmButtonText: 'Confirm',
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should use translation here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

/**
* Composable for managing action modals
*/
export const useConfirmationModal = () => {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not sure if we need this composable... Nothing extraordinary is happening here. We can pass the labels and actions directly to ConfirmationModal component.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is needed to avoid code duplication, otherwise this will be replicated in both application and registration details along with AssignmentActions component.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Has been reworked based on our discussion.

if (examinerActions && examinerActions.length > 0) {
const leftButtons: ConnectBtnControlItem[] = []
const rightButtons: ConnectBtnControlItem[] = []
const currentButtons = mergeWithExisting ? getButtonControl() : { leftButtons: [], rightButtons: [] }
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe you can walk me thru this piece.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure, this has been updated in commit and cleaned up.

@shaangill025
Copy link
Copy Markdown
Contributor Author

/gcbrun

@bcregistry-sre

This comment was marked as outdated.

@shaangill025
Copy link
Copy Markdown
Contributor Author

  • Both 'NOC - Pending' and 'NOC - Expired' applications aren't being auto assigned for some reason. The manual assign button returns an error as well.

@andyyanggov clarified that assign or unassign operation should be allowed on all application statuses including approved (end states)
Changes made in UI to allow it. But currently the API only allow assign or unassign for FULL_REVIEW and PROVISIONAL_REVIEW and this check will be removed in a follow-up API PR.

  • When unassigned, the email body and decision actions should be disabled/greyed out instead.

Done, email body is hidden and action buttons disabled in application and registration details.

  • The assign/unassign feature should work the same way for registrations too

Done, this should be fully functional once the follow-up API PR (above) is merged. Also includes a confirmation modal for cancel action.

Signed-off-by: Shaanjot Gill <gill.shaanjots@gmail.com>
Signed-off-by: Shaanjot Gill <gill.shaanjots@gmail.com>
… app statuses

Signed-off-by: Shaanjot Gill <gill.shaanjots@gmail.com>
Signed-off-by: Shaanjot Gill <gill.shaanjots@gmail.com>
@bcregistry-sre

This comment was marked as outdated.

Signed-off-by: Shaanjot Gill <gill.shaanjots@gmail.com>
@sonarqubecloud
Copy link
Copy Markdown

@bcregistry-sre
Copy link
Copy Markdown
Collaborator

Temporary Url for review: https://strr-examiner-dev--pr-669-lxwb50p1.web.app

Copy link
Copy Markdown
Collaborator

@dimak1 dimak1 left a comment

Choose a reason for hiding this comment

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

We can make few improvements after. Thanks for addressing earlier comments. 👍🏻

watch(
() => [activeHeader.value?.applicationNumber, activeHeader.value?.reviewer?.username],
async ([applicationNumber, _]) => {
try {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No need of the try/catch block here because isCurrentUserAssignee is already handling errors and returning false so isCurrentUserAssignee could be called and assigned right away.

<AssignmentActions :is-registration-page="true" @refresh="refresh" />
<ConfirmationModal
ref="confirmErrorModal"
:is-open="false"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is-open should be conditional.

approve: {
action: (id: string) => handleApplicationAction(id, ApplicationActionsE.APPROVE, 'right', 1),
label: t('btn.approve')
action: (id: string) => handleAssigneeAction(id, ApplicationActionsE.APPROVE, 'right', 1),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nested functions could be reduced to just checking isAssignedToUser.value and calling original handleApplicationAction() or open confirm modal.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I will address these comments during next sprint.

@shaangill025 shaangill025 merged commit ffca523 into bcgov:main Apr 11, 2025
14 checks passed
@andyyanggov
Copy link
Copy Markdown

@shaangill025 Looks good to me. Good work!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants