@@ -36,7 +36,7 @@
mdi-delete
-
+
@@ -102,11 +102,11 @@ export default {
}
},
computed: {
- reachUploadLimit() {
+ uploadLimitReached() {
return this.uploadLimit && this.documents?.length + this.uploadedDocuments?.length >= Number(this.uploadLimit)
},
showAddFileButton() {
- return !this.loading && !this.readonly && !this.reachUploadLimit
+ return !this.loading && !this.readonly && !this.uploadLimitReached
},
},
watch: {
@@ -143,7 +143,7 @@ export default {
{ title: 'Description', key: 'description', width: '60%' },
{ title: '', key: 'actionButtons', sortable: false, width: '6%' },
]
- if (!this.disabled && !this.readonly && !this.reachUploadLimit) {
+ if (!this.disabled && !this.readonly && !this.uploadLimitReached) {
this.addFile()
}
},
diff --git a/frontend/src/stores/applications.js b/frontend/src/stores/applications.js
index d53dfe4f..4b2afcaa 100644
--- a/frontend/src/stores/applications.js
+++ b/frontend/src/stores/applications.js
@@ -90,13 +90,13 @@ export const useApplicationsStore = defineStore('applications', {
isLicenceDocumentUploaded() {
return this.currentApplication.licences.every((licence) => {
const uploadedDocument = this.currentApplication?.uploadedDocuments?.filter((document) => document.documentType?.includes(licence?.licence))
- return uploadedDocument?.length > 0
+ return !isEmpty(uploadedDocument)
})
},
isHealthAuthorityReportUploaded() {
const healthAuthorityReports = this.currentApplication?.uploadedDocuments?.filter((document) => document.documentType?.includes(DOCUMENT_TYPES.HEALTH_AUTHORITY_REPORT))
- return healthAuthorityReports?.length > 0
+ return !isEmpty(healthAuthorityReports)
},
/*
diff --git a/frontend/src/views/applications/ServiceDeliveryView.vue b/frontend/src/views/applications/ServiceDeliveryView.vue
index 5af63324..bc9ca1e5 100644
--- a/frontend/src/views/applications/ServiceDeliveryView.vue
+++ b/frontend/src/views/applications/ServiceDeliveryView.vue
@@ -194,11 +194,11 @@ export default {
return !isEmpty(this.healthAuthorityReports?.documentsToUpload) || !isEmpty(this.healthAuthorityReports?.uploadedDocuments)
},
- haveLicenceDocumentsToProcess() {
+ hasLicenceDocumentsToProcess() {
return Object.keys(this.licenceDocuments)?.some((licence) => !isEmpty(this.licenceDocuments[licence]?.documentsToUpload) || !isEmpty(this.licenceDocuments[licence]?.documentsToDelete))
},
- haveHealthAuthorityReportDocumentsToProcess() {
+ hasHealthAuthorityReportDocumentsToProcess() {
return !isEmpty(this.healthAuthorityReports?.documentsToUpload) || !isEmpty(this.healthAuthorityReports?.documentsToDelete)
},
},
@@ -250,7 +250,7 @@ export default {
try {
this.$emit('process', true)
this.processing = true
- let reloadApplication = this.changedLicences?.length > 0 || this.haveLicenceDocumentsToProcess || this.haveHealthAuthorityReportDocumentsToProcess
+ let reloadApplication = !isEmpty(this.changedLicences) || this.hasLicenceDocumentsToProcess || this.hasHealthAuthorityReportDocumentsToProcess
const payload = {
licenceDeclaration: this.licenceDeclaration,
}
@@ -266,11 +266,11 @@ export default {
}),
)
- if (this.haveLicenceDocumentsToProcess) {
+ if (this.hasLicenceDocumentsToProcess) {
await this.processLicenceDocuments()
}
- if (this.haveHealthAuthorityReportDocumentsToProcess) {
+ if (this.hasHealthAuthorityReportDocumentsToProcess) {
await this.processHealthAuthorityReportDocuments()
}