From 3fcff0fa22d74e40209ba2314f09267c4e9190ac Mon Sep 17 00:00:00 2001 From: BrandonSharratt Date: Fri, 6 Dec 2024 08:25:15 -0800 Subject: [PATCH] Fix for future effective bootstrap business address and directors also #94 (#96) * show more bootstrap information * add back errantly delated commit * remove line that somehow was removed * fix alignment * fix lint --- .../bcros/OfficeAddressBootstrap.vue | 53 +++++++++++++++++-- src/components/bcros/PartyInfo.vue | 22 ++++++-- src/components/bcros/accordion/Index.vue | 18 +++++-- src/components/bcros/accordion/Item.vue | 6 ++- .../bcros/businessDetails/Links.vue | 23 +++++++- src/interfaces/accordion-item-i.ts | 5 +- src/interfaces/bootstrap-i.ts | 2 + src/pages/dashboard.vue | 17 ++++-- 8 files changed, 127 insertions(+), 19 deletions(-) diff --git a/src/components/bcros/OfficeAddressBootstrap.vue b/src/components/bcros/OfficeAddressBootstrap.vue index 24e8889..9e9cb1c 100644 --- a/src/components/bcros/OfficeAddressBootstrap.vue +++ b/src/components/bcros/OfficeAddressBootstrap.vue @@ -1,5 +1,25 @@ @@ -9,23 +10,33 @@ import { storeToRefs } from 'pinia' const business = useBcrosBusiness() +const bootstrap = useBcrosBusinessBootstrap() const { currentParties } = storeToRefs(business) +const { bootstrapFiling } = storeToRefs(bootstrap) const props = defineProps({ name: { type: String, required: true }, roleType: { type: String, required: true }, showEmail: { type: Boolean, required: true }, - expandTopItem: { type: Boolean, default: false } + expandTopItem: { type: Boolean, default: false }, + showAddress: { type: Boolean, default: true } +}) + +const disableExpand = computed(() => { + return !currentParties?.value?.parties && !!bootstrapFiling?.value?.filing?.incorporationApplication?.parties }) const partyItems = computed(() => { const items: BcrosAccordionItem[] = [] - - if (currentParties.value.parties) { - currentParties.value.parties.forEach((party) => { + const parties = currentParties?.value?.parties || bootstrapFiling?.value?.filing?.incorporationApplication?.parties + const disabled = !currentParties?.value?.parties && + !!bootstrapFiling?.value?.filing?.incorporationApplication?.parties + if (parties) { + parties.forEach((party) => { if (party.roles.find(role => role.roleType === props.roleType && !role.cessationDate)) { items.push({ label: getName(party), + disabled, defaultOpen: false, showAddressIcons: false, showAvatar: true, @@ -36,6 +47,9 @@ const partyItems = computed(() => { }, email: party.officer.email }) + if (!props.showAddress) { + delete items[items.length - 1].address + } } }) } diff --git a/src/components/bcros/accordion/Index.vue b/src/components/bcros/accordion/Index.vue index 2ba70dd..c795f56 100644 --- a/src/components/bcros/accordion/Index.vue +++ b/src/components/bcros/accordion/Index.vue @@ -2,19 +2,29 @@ defineProps({ name: { type: String, required: true }, items: { type: Array as PropType, required: true }, - pendingAddress: { type: Boolean, default: false, required: false } + pendingAddress: { type: Boolean, default: false, required: false }, + disabled: { type: Boolean, default: false, required: false } }) +