Skip to content

Commit

Permalink
13746 Fix issue with staff (#1032)
Browse files Browse the repository at this point in the history
* 13746 Fix issue with staff

* 13746 Code refactor  based on pr

* 13746 Code refactor  based on pr

* 13746 Refactor
  • Loading branch information
ChasBoucher authored Nov 8, 2022
1 parent 4d0f6db commit e08a05e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions ppr-ui/src/components/tables/common/TableRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</p>
</div>
<p v-else class="ma-0">
<b>{{ item.baseRegistrationNumber }}</b>
<b>{{ item.baseRegistrationNumber || item.mhrNumber }}</b>
</p>
</v-col>
</v-row>
Expand Down Expand Up @@ -340,7 +340,7 @@
</v-row>

<!-- MHR DRAFT ACTIONS -->
<v-row v-else-if="!isPpr && (!isChild || isDraft(item))" class="actions" no-gutters>
<v-row v-else-if="!isPpr && isDraft(item)" class="actions" no-gutters>
<v-col class="edit-action pa-0" cols="auto">
<v-btn
color="primary"
Expand Down
14 changes: 9 additions & 5 deletions ppr-ui/src/composables/mhrRegistration/useNewMhrRegistration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export const useNewMhrRegistration = () => {
getMhrAttentionReferenceNum,
getMhrRegistrationLocation,
getMhrRegistrationHomeOwnerGroups,
getStaffPayment
getStaffPayment,
isRoleQualifiedSupplier
} = useGetters<any>([
'getMhrRegistrationHomeDescription',
'getMhrRegistrationSubmittingParty',
Expand All @@ -29,7 +30,8 @@ export const useNewMhrRegistration = () => {
'getMhrRegistrationLocation',
'getMhrRegistrationHomeOwnerGroups',
'getCertifyInformation',
'getStaffPayment'
'getStaffPayment',
'isRoleQualifiedSupplier'
])
const { setMhrTableHistory } = useActions<any>(['setMhrTableHistory'])

Expand Down Expand Up @@ -199,9 +201,11 @@ export const useNewMhrRegistration = () => {

const fetchMhRegistrations = async (): Promise<void> => {
const draftFilings = await getMhrDrafts()
const myMhrHistory = await mhrRegistrationHistory(true)
const filteredMhrHistory = addHistoryDraftsToMhr(myMhrHistory, draftFilings)
setMhrTableHistory([...filteredMhrHistory])
const myMhrHistory = await mhrRegistrationHistory(isRoleQualifiedSupplier.value)
if (isRoleQualifiedSupplier.value) {
const filteredMhrHistory = addHistoryDraftsToMhr(myMhrHistory, draftFilings)
setMhrTableHistory(filteredMhrHistory)
} else setMhrTableHistory([...draftFilings, ...myMhrHistory])
}

function addHistoryDraftsToMhr (mhrHistory: MhRegistrationSummaryIF[], mhrDrafts: MhrDraftTransferApiIF[]):
Expand Down
5 changes: 4 additions & 1 deletion ppr-ui/src/views/mhrInformation/MhrInformation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,10 @@ export default defineComponent({
return !isGlobalEditingMode.value && isTransferDetailsValid.value && true
}),
isValidTransferReview: computed((): boolean => { // is valid on review step
return localState.isReviewMode && isRefNumValid.value && localState.isCompletionConfirmed && !localState.validateAuthorizationError
return localState.isReviewMode &&
isRefNumValid.value &&
localState.isCompletionConfirmed &&
!localState.validateAuthorizationError
}),
transferErrorMsg: computed((): string => {
const isValidReview = localState.isReviewMode ? !localState.isValidTransferReview : !localState.isValidTransfer
Expand Down

0 comments on commit e08a05e

Please sign in to comment.