From 73d6a090303b1157ee032a923c68b8e9477e08ac Mon Sep 17 00:00:00 2001 From: Le Date: Mon, 28 Jul 2025 15:13:13 -0700 Subject: [PATCH] ofmcc-7904 - update Add Core Application check to include only Active applications --- .../src/views/applications/ApplicationsHistoryView.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/src/views/applications/ApplicationsHistoryView.vue b/frontend/src/views/applications/ApplicationsHistoryView.vue index 37b49c3d..0b4f24dc 100644 --- a/frontend/src/views/applications/ApplicationsHistoryView.vue +++ b/frontend/src/views/applications/ApplicationsHistoryView.vue @@ -262,17 +262,19 @@ export default { } }, isAddCoreApplicationAllowed() { + if (!this.isIntakeWindowOpenAndValid) { + return false + } const hasDraftApplication = this.applications?.some( (application) => - application?.stateCode === CRM_STATE_CODES.ACTIVE && application?.statusCode === APPLICATION_STATUS_CODES.DRAFT && application?.applicationRenewalType === APPLICATION_RENEWAL_TYPES.NEW, + application.stateCode === CRM_STATE_CODES.ACTIVE && application.statusCode === APPLICATION_STATUS_CODES.DRAFT && application.applicationRenewalType === APPLICATION_RENEWAL_TYPES.NEW, ) - const hasMissingApplication = this.userInfo?.facilities?.some((facility) => { return !this.applications?.some((application) => { - return application?.facilityId === facility.facilityId && application?.applicationRenewalType === APPLICATION_RENEWAL_TYPES.NEW + return application.facilityId === facility.facilityId && application.applicationRenewalType === APPLICATION_RENEWAL_TYPES.NEW && application.stateCode === CRM_STATE_CODES.ACTIVE }) }) - return this.isIntakeWindowOpenAndValid && (hasDraftApplication || hasMissingApplication) + return hasDraftApplication || hasMissingApplication }, isIntakeWindowOpenAndValid() { return this.userInfo?.facilities?.some(