diff --git a/src/components/bcros/OfficeAddressBootstrap.vue b/src/components/bcros/OfficeAddressBootstrap.vue index 24e88896..9e9cb1cb 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 2ba70ddd..c795f56f 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 } }) +