Skip to content

Commit

Permalink
24659 - Implement Withdraw Action in Ledger (#119)
Browse files Browse the repository at this point in the history
* 24659-Implement-withdraw-action-for-reg-and-temp-business

* 24659-Enable-view-documents-for-bootstrap-business

* 24659-Revert-lock-file

* 24659-Remove-conditional-for-displaying-document-button

* 24659-Update navigate function and bump version

* 24659-Update-version
  • Loading branch information
meawong authored Jan 14, 2025
1 parent 5f51504 commit 4f5d4db
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "bcros-business-dashboard",
"private": true,
"type": "module",
"version": "1.0.2",
"version": "1.0.3",
"scripts": {
"build": "nuxt generate",
"build:local": "nuxt build",
Expand Down
34 changes: 27 additions & 7 deletions src/components/bcros/filing/common/HeaderActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
</BcrosDialog>
<!-- the main button -->
<UButton
v-if="!isBootstrapFiling || !isExpanded"
variant="ghost"
class="px-3 py-2"
data-cy="filing-main-action-button"
Expand All @@ -64,7 +63,7 @@
<strong v-if="!isExpanded">{{ $t('button.filing.actions.requestACopy') }}</strong>
<strong v-else>{{ $t('button.filing.actions.close') }}</strong>
</template>
<template v-else-if="isTypeStaff || isBootstrapFiling">
<template v-else-if="isTypeStaff">
<strong v-if="!isExpanded">{{ $t('button.filing.actions.view') }}</strong>
<strong v-else>{{ $t('button.filing.actions.hide') }}</strong>
</template>
Expand All @@ -76,7 +75,7 @@

<!-- the drop-down menu -->
<UDropdown
v-if="!isDisableNonBenCorps() && hasRoleStaff && isBusiness"
v-if="!isDisableNonBenCorps() && hasRoleStaff"
:items="actions"
:popper="{ placement: 'bottom-end' }"
padding="p-3"
Expand All @@ -96,15 +95,16 @@
<script setup lang="ts">
import { FilingTypes } from '@bcrs-shared-components/enums'
import { z } from 'zod'
import { type ApiResponseFilingI, FilingStatusE, isFilingStatus, isStaffFiling } from '#imports'
import { type ApiResponseFilingI, FilingStatusE, isFilingStatus, isStaffFiling, isFutureEffective } from '#imports'
import { FilingCorrectionTypesE } from '~/enums/filing-correction-types-e'
const { getStoredFlag } = useBcrosLaunchdarkly()
const { hasRoleStaff } = storeToRefs(useBcrosKeycloak())
const { isAllowedToFile, isBaseCompany, isDisableNonBenCorps, isEntityCoop, isEntityFirm } = useBcrosBusiness()
const { currentBusiness } = storeToRefs(useBcrosBusiness())
const { bootstrapFiling } = storeToRefs(useBcrosBusinessBootstrap())
const { isBootstrapFiling } = useBcrosBusinessBootstrap()
const { goToEditPage } = useBcrosNavigate()
const { goToFilingUI, goToEditPage } = useBcrosNavigate()
const ui = useBcrosDashboardUi()
const isCommentOpen = ref(false)
Expand All @@ -116,7 +116,11 @@ const filing = defineModel('filing', { type: Object as PropType<ApiResponseFilin
const t = useNuxtApp().$i18n.t
const currentBusinessIdentifier = computed(() => currentBusiness.value.identifier)
const tempBusinessIdentifier = computed(() => bootstrapFiling.value.filing.business.identifier)
const filingId = computed(() => filing.value.filingId)
const isTypeStaff = computed(() => isStaffFiling(filing.value))
const isFutureEffectiveFiling = computed(() => isFutureEffective(filing.value))
const setShowFilingModal = (value: boolean) => {
showFilingModal.value = value
Expand Down Expand Up @@ -147,7 +151,7 @@ const correctionFormSubmit = async function () {
{
comment: '',
correctedFilingDate: dateToYyyyMmDd(new Date(filing.value.submittedDate)),
correctedFilingId: filing.value.filingId,
correctedFilingId: filingId.value,
correctedFilingType: filing.value.name,
type: correctionType
},
Expand All @@ -167,7 +171,7 @@ const correctionFormSubmit = async function () {
filingError.value = 'Unable to get correction filing id'
return
}
const path = `/${currentBusiness.value.identifier}/correction/`
const path = `/${currentBusinessIdentifier.value}/correction/`
const params = { 'correction-id': draftFilingId }
goToEditPage(path, params)
Expand Down Expand Up @@ -310,6 +314,16 @@ const showCommentDialog = (show?: boolean) => {
isCommentOpen.value = show
}
const goToNoticeOfWithdrawal = () => {
const businessIdentifier = isBootstrapFiling ? tempBusinessIdentifier.value : currentBusinessIdentifier.value
const path = `/${businessIdentifier}/notice-of-withdrawal/`
const params = {
filingToBeWithdrawn: filingId.value.toString(),
filingId: '0'
}
goToFilingUI(path, params)
}
const actions: any[][] = [[
{
label: t('button.filing.actions.fileACorrection'),
Expand All @@ -323,6 +337,12 @@ const actions: any[][] = [[
click: showCommentDialog,
disabled: !(isBusiness && hasRoleStaff),
icon: 'i-mdi-comment-plus'
},
{
label: t('button.filing.actions.fileAWithdrawal'),
click: goToNoticeOfWithdrawal,
disabled: !(hasRoleStaff && isFutureEffectiveFiling.value),
icon: 'i-mdi-undo'
}
]]
Expand Down
5 changes: 3 additions & 2 deletions src/components/bcros/filing/common/futureEffective/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ watch(prop.filing, () => {
</script>

<template>
<div class="flex flex-col gap-3 mt-3">
<div class="font-bold">
<div class="flex flex-col gap-3">
<UDivider class="mt-6" />
<div class="font-bold mt-3">
{{ subtitle }}
</div>

Expand Down
1 change: 1 addition & 0 deletions src/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"actions": {
"fileACorrection": "File a Correction",
"addDetail": "Add Detail",
"fileAWithdrawal": "File a Withdrawal",
"requestACopy": "Request a Copy",
"close": "Close",
"view": "View",
Expand Down

0 comments on commit 4f5d4db

Please sign in to comment.