Skip to content

Commit

Permalink
Fix which modal shows (#81)
Browse files Browse the repository at this point in the history
* fix not in good standing staff change business information

* fix showing wrong dialog

* fixes
  • Loading branch information
BrandonSharratt authored Nov 26, 2024
1 parent 37edbf4 commit bda7cc6
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/components/bcros/businessDetails/Links.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const isChangeBusinessInfoDisabled = computed(() => {
!!getStoredFlag('special-resolution-ui-enabled') &&
isAllowedToFile(FilingTypes.SPECIAL_RESOLUTION)) ||
// if it's firm
(isFirm && isAllowedToFile(FilingTypes.CHANGE_OF_REGISTRATION)) ||
(isFirm.value && isAllowedToFile(FilingTypes.CHANGE_OF_REGISTRATION)) ||
// otherwise
isAllowedToFile(FilingTypes.ALTERATION)
Expand All @@ -62,12 +62,15 @@ const setShowDissolutionDialog = (show: boolean) => {
isDissolutionDialogOpen.value = show
}
const dialogTitle = computed<string>(() => {
return (!currentBusiness?.value?.goodStanding && hasRoleStaff)
? t('title.dialog.notGoodStanding.notInGoodStanding')
: businessConfig.value?.dissolutionConfirmation.modalTitle
})
const dissolutionDialogOptions = computed<DialogOptionsI>(() => {
const title = currentBusiness?.value?.goodStanding || hasRoleStaff
? businessConfig.value?.dissolutionConfirmation.modalTitle
: t('title.dialog.notGoodStanding.notInGoodStanding')
return {
title,
title: dialogTitle.value,
text: '', // content slot is used
hideClose: false,
buttons: [] as DialogButtonI[], // button slot is used
Expand All @@ -94,7 +97,7 @@ const closeNotGoodStandingDialog = () => {
* Otherwise, navigates to Edit UI to create a Special Resolution or Change or Alteration filing.
*/
const promptChangeBusinessInfo = () => {
if (!currentBusiness.value.goodStanding) {
if (!currentBusiness.value.goodStanding && !hasRoleStaff) {
// show not good standing popup
showDissolutionText.value = false
setShowChangeNotInGoodStandingDialog(true)
Expand All @@ -104,12 +107,12 @@ const promptChangeBusinessInfo = () => {
const baseUrl = useRuntimeConfig().public.editApiURL
const editUrl = `${baseUrl}/${currentBusinessIdentifier.value}`
if (!currentBusiness.value.goodStanding && hasRoleStaff) {
if (!currentBusiness.value.goodStanding && !hasRoleStaff) {
alert('change company info')
// this.emitNotInGoodStanding(NigsMessage.CHANGE_COMPANY_INFO)
} else if (currentBusiness.value.legalType === CorpTypeCd.COOP) {
navigateTo(`${editUrl}/special-resolution`, { external: true })
} else if (isFirm) {
} else if (isFirm.value) {
navigateTo(`${editUrl}/change`, { external: true })
} else {
navigateTo(`${editUrl}/alteration`, { external: true })
Expand Down Expand Up @@ -184,7 +187,7 @@ const contacts = getContactInfo('registries')
@close="closeNotGoodStandingDialog"
>
<template #content>
<div v-if="!currentBusiness.goodStanding && !hasRoleStaff">
<div v-if="(!currentBusiness.goodStanding && hasRoleStaff)">
<p>
{{ showDissolutionText
? $t('text.dialog.notGoodStanding.notGoodStanding1')
Expand All @@ -210,7 +213,7 @@ const contacts = getContactInfo('registries')
</div>
</template>
<template #buttons>
<div v-if="!currentBusiness.goodStanding && !hasRoleStaff" class="flex justify-center gap-5">
<div v-if="(!currentBusiness.goodStanding && hasRoleStaff)" class="flex justify-center gap-5">
<UButton
variant="outline"
class="px-10 py-2"
Expand Down

0 comments on commit bda7cc6

Please sign in to comment.