Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

24659 - Implement Withdraw Action in Ledger #119

Merged
merged 7 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.1",
"version": "1.0.2",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please rebase again. The version is already 1.0.2.

https://github.com/bcgov/business-dashboard-ui/blob/main/package.json

"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"
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
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">
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
<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"
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
: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/`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please call out this fix in your ticket so that QA knows to verify this.

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
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 @@ -71,6 +71,7 @@
"actions": {
"fileACorrection": "File a Correction",
"addDetail": "Add Detail",
"fileAWithdrawal": "File a Withdrawal",
"requestACopy": "Request a Copy",
"close": "Close",
"view": "View",
Expand Down
Loading