Skip to content

Commit

Permalink
24205 - update funstions
Browse files Browse the repository at this point in the history
  • Loading branch information
ketaki-deodhar committed Dec 11, 2024
1 parent 4bff04c commit 1af83ee
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
20 changes: 16 additions & 4 deletions app/src/components/existing-request/nr-approved-gray-box.vue
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,13 @@ export default class NrApprovedGrayBox extends Mixins(CommonMixin) {
@Getter getNr!: Partial<NameRequestI>
@Getter getIsLearBusiness!: boolean
isBusinesCheckDone = false
/** Called when component is mounted. */
mounted () {
this.checkBusiness()
}
get isConversion (): boolean {
return (this.getNr.request_action_cd === NrRequestActionCodes.CONVERSION)
}
Expand Down Expand Up @@ -300,12 +307,10 @@ export default class NrApprovedGrayBox extends Mixins(CommonMixin) {
}
get showOpenExternalIcon (): boolean {
// check if business is in Lear and set store value of isLearBusiness flag
this.checkBusinessInLear(this.getNr?.corpNum)
if (this.showAmalgamateNowButton && !this.isSupportedAmalgamation(this.getNr.entity_type_cd)) return true
if (this.showAlterNowButton && !this.getIsLearBusiness) return true
if (this.showAlterNowButton && this.isBusinesCheckDone && !this.getIsLearBusiness) return true
if (this.showBeginContinuationButton && !this.isSupportedContinuationIn(this.getNr.entity_type_cd)) return true
if (this.showNameChangeButton && !this.getIsLearBusiness) return true
if (this.showNameChangeButton && this.isBusinesCheckDone && !this.getIsLearBusiness) return true
return false
}
Expand Down Expand Up @@ -337,7 +342,14 @@ export default class NrApprovedGrayBox extends Mixins(CommonMixin) {
this.isApprovedOrConsentUnRequired
)
}
/** check if business is in Lear and set store value of isLearBusiness flag */
async checkBusiness (): Promise<void> {
await this.checkBusinessInLear(this.getNr?.corpNum)
this.isBusinesCheckDone = true
}
}
</script>

<style lang="scss" scoped>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default class BusinessLookupFetch extends Mixins(CommonMixin, SearchMixin
// set the from business for alteration (conversion)
this.setOriginEntityTypeCd(this.getSearchBusiness.legalType)
// check if business is in Lear and set store value of isLearBusiness flag
this.checkBusinessInLear(this.getSearchBusiness.identifier)
await this.checkBusinessInLear(this.getSearchBusiness.identifier)
} else {
// clear all related fields when clearing business search/fetch for alter
this.setConversionType(null)
Expand Down Expand Up @@ -163,7 +163,7 @@ export default class BusinessLookupFetch extends Mixins(CommonMixin, SearchMixin
}
// check if business is in Lear and set store value of isLearBusiness flag
this.checkBusinessInLear(this.getSearchBusiness?.identifier)
await this.checkBusinessInLear(this.getSearchBusiness.identifier)
}
}
}
Expand Down

0 comments on commit 1af83ee

Please sign in to comment.