\r\n\r\n\r\n\r\n\r\n\r\n","import { render } from \"./index.vue?vue&type=template&id=5dceaad8&scoped=true\"\nimport script from \"./index.vue?vue&type=script&lang=js\"\nexport * from \"./index.vue?vue&type=script&lang=js\"\n\nimport \"./index.vue?vue&type=style&index=0&id=5dceaad8&lang=scss&scoped=true\"\n\nimport exportComponent from \"D:\\\\a\\\\1\\\\s\\\\node_modules\\\\vue-loader-v16\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-5dceaad8\"]])\n\nexport default __exports__","import { mapGetters, mapActions } from 'vuex';\r\nimport base64Encode from '@/utilities/getBase64Encoding';\r\nimport CookieJar from '@/utilities/cookieJar';\r\n\r\nimport UploadList from '@/components/FormComponents/UploadList';\r\n\r\nexport const fileUploads = {\r\n\tdata () {\r\n\t\treturn {\r\n\t\t\tenableUpload: false,\r\n\t\t\tfilesToUpload: [],\r\n\t\t\tuploadMsg: {\r\n\t\t\t\ttype: null,\r\n\t\t\t\ttext: null\r\n\t\t\t},\r\n\t\t\tloadNotesMsg: {\r\n\t\t\t\ttype: null,\r\n\t\t\t\ttext: null\r\n\t\t\t},\r\n\t\t\tnoteSubject: '',\r\n\t\t\tuploaderValue: '',\r\n\t\t\tshowList: false,\r\n\t\t\tsuccessfulUploads: [],\r\n\t\t\tfileUploadError: false\r\n\t\t};\r\n\t},\r\n components: {\r\n\t\tUploadList\r\n\t},\r\n\tcomputed: {\r\n\t\tapplicationType () {\r\n\t\t\treturn this.stage || this.$route.meta.applicationType;\r\n\t\t},\r\n\t\tapplicationTypeID () {\r\n\t\t\tconst types = {\r\n\t\t\t\teoi: 'ua_icexpressionofinterest',\r\n\t\t\t\tapplication: 'ua_icapplication',\r\n\t\t\t\tclaim: 'ua_icclaim'\r\n\t\t\t};\r\n\t\t\treturn types[this.applicationType];\r\n\t\t},\r\n\t\tgetUploadedFiles () {\r\n\t\t\treturn this.getNotesByType(this.applicationTypeID, this.noteSubject);\r\n\t\t},\r\n\t\tgetAllUploadedFiles () {\r\n\t\t\treturn this.getAllNotes(this.applicationTypeID);\r\n\t\t},\r\n\t\t...mapGetters('notes', ['getAllNotes', 'getNotesByType']),\r\n\t\t...mapGetters('eoi', ['getEOIId']),\r\n\t\t...mapGetters('application', ['getApplicationId', 'getApplication', 'getActiveApplication'])\r\n\t},\r\n\tmounted () {\r\n\t\tif (!this.getAllNotes(this.applicationTypeID).length) {\r\n\t\t\tconst payload = {\r\n\t\t\t\tapplicationTypeId: this.applicationTypeID,\r\n\t\t\t\tclaimIdQuery: this.applicationType === 'claim' ? `&icclaimid=${this.$route.params.claimId || this.$route.query.claimId}` : ''\r\n\t\t\t};\r\n\r\n\t\t\tthis.loadNotes(payload).then(res => {\r\n\t\t\t\tif (res === true) {\r\n\t\t\t\t\tif (this.showList) {\r\n\t\t\t\t\t\tthis.populateList();\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (res.status === 422 || res.status === 500) {\r\n\t\t\t\t\tthis.loadNotesMsg.type = res.type;\r\n\t\t\t\t\tthis.loadNotesMsg.text = res.message;\r\n\t\t\t\t} else if (res.status === 401) {\r\n\t\t\t\t\tthis.redeemToken({\r\n\t\t\t\t\t\trefreshtoken: CookieJar.get(`${process.env.VUE_APP_COOKIE_PREFIX}refresh_token`),\r\n\t\t\t\t\t\tbusinessunit: process.env.VUE_APP_BUSINESS_UNIT\r\n\t\t\t\t\t}).then((res) => {\r\n\t\t\t\t\t\tif (res === true) {\r\n\t\t\t\t\t\t\tthis.loadNotes(payload);\r\n\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis.$router.push({ name: 'Login' });\r\n\t\t\t\t\t}).catch(() => {\r\n\t\t\t\t\t\tthis.$router.push({ name: 'Login' });\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\tmethods: {\r\n\t\tprepareFiles (data, stage = null) {\r\n\t\t\tconst files = Object.values(data);\r\n\t\t\tconst fileList = [];\r\n\r\n\t\t\tconst objectId = {\r\n\t\t\t\teoi: this.getEOIId,\r\n\t\t\t\tapplication: this.applicationType !== 'eoi' ? this.getApplicationId(this.getActiveApplication) : null,\r\n\t\t\t\tclaim: this.$route.params.claimId || this.$route.query.claimId\r\n\t\t\t};\r\n\t\t\tfiles.forEach(async (file) => {\r\n\t\t\t\tconst docBody = await base64Encode(file);\r\n\t\t\t\tconst payload = {\r\n\t\t\t\t\tsubject: this.noteSubject,\r\n\t\t\t\t\tfilename: file.name,\r\n\t\t\t\t\tdocumentbody: docBody.split(',')[1],\r\n\t\t\t\t\tobjectid: objectId[this.applicationType],\r\n\t\t\t\t\tobjecttypecode: this.applicationTypeID\r\n\t\t\t\t};\r\n\t\t\t\tfileList.push(payload);\r\n\t\t\t});\r\n\r\n\t\t\tthis.filesToUpload = fileList;\r\n\t\t\tthis.enableUpload = true;\r\n\t\t\tthis.uploaderValue = data;\r\n\t\t},\r\n\t\tuploadFiles () {\r\n\t\t\tthis.uploadMsg = {\r\n\t\t\t\ttype: null,\r\n\t\t\t\ttext: null\r\n\t\t\t};\r\n\t\t\tthis.uploadNotes({ itemType: this.noteSubject, applicationType: this.applicationTypeID, data: this.filesToUpload }).then(res => {\r\n\t\t\t\tthis.uploaderValue = '';\r\n\t\t\t\tthis.enableUpload = false;\r\n\t\t\t\tif (res === true) {\r\n\t\t\t\t\tthis.uploadMsg.text = 'Your files have all been uploaded successfully.';\r\n\t\t\t\t\tthis.uploadMsg.type = 'success';\r\n\t\t\t\t} else if (res.status === 401) {\r\n\t\t\t\t\tthis.redeemToken({\r\n\t\t\t\t\t\trefreshtoken: CookieJar.get(`${process.env.VUE_APP_COOKIE_PREFIX}refresh_token`),\r\n\t\t\t\t\t\tbusinessunit: process.env.VUE_APP_BUSINESS_UNIT\r\n\t\t\t\t\t}).then((res) => {\r\n\t\t\t\t\t\tif (res === true) {\r\n\t\t\t\t\t\t\tthis.uploadFiles();\r\n\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis.$router.push({ name: 'Login' });\r\n\t\t\t\t\t}).catch(() => {\r\n\t\t\t\t\t\tthis.$router.push({ name: 'Login' });\r\n\t\t\t\t\t});\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.uploadMsg.text = res.message;\r\n\t\t\t\t\tthis.uploadMsg.type = res.type;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.showList) {\r\n\t\t\t\t\tthis.populateList();\r\n\t\t\t\t}\r\n\t\t\t}).catch(err => {\r\n\t\t\t\tthis.uploadMsg.text = err.message;\r\n\t\t\t\tthis.uploadMsg.type = 'error';\r\n\t\t\t});\r\n\t\t},\r\n\t\tuploadSharepointFiles () {\r\n\t\t\tthis.uploadMsg = {\r\n\t\t\t\ttype: null,\r\n\t\t\t\ttext: null\r\n\t\t\t};\r\n\t\t\tthis.successfulUploads = [];\r\n\r\n\t\t\tconst promises = this.filesToUpload.map((file) => {\r\n\t\t\t\treturn this.uploadToSharepoint(file).then(res => {\r\n\t\t\t\t\tthis.uploaderValue = '';\r\n\t\t\t\t\tthis.enableUpload = false;\r\n\t\t\t\t\tif (res === true) {\r\n\t\t\t\t\t\tthis.successfulUploads.push(file.fileName);\r\n\t\t\t\t\t} else if (res.status === 401) {\r\n\t\t\t\t\t\tthis.redeemToken({\r\n\t\t\t\t\t\t\trefreshtoken: CookieJar.get(`${process.env.VUE_APP_COOKIE_PREFIX}refresh_token`),\r\n\t\t\t\t\t\t\tbusinessunit: process.env.VUE_APP_BUSINESS_UNIT\r\n\t\t\t\t\t\t}).then((res) => {\r\n\t\t\t\t\t\t\tif (res === true) {\r\n\t\t\t\t\t\t\t\tthis.uploadSharepointFiles();\r\n\t\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tthis.$router.push({ name: 'Login' });\r\n\t\t\t\t\t\t}).catch(() => {\r\n\t\t\t\t\t\t\tthis.$router.push({ name: 'Login' });\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.uploadMsg.text = res.message;\r\n\t\t\t\t\t\tthis.uploadMsg.type = res.type;\r\n\t\t\t\t\t}\r\n\t\t\t\t}).catch(err => {\r\n\t\t\t\t\tthis.uploadMsg.text = err.message;\r\n\t\t\t\t\tthis.uploadMsg.type = 'error';\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t\tPromise.all(promises).then(() => {\r\n\t\t\t\tthis.uploadMsg.text = `The following files were uploaded successfully. ${this.successfulUploads.join(', ')}`;\r\n\t\t\t\tthis.uploadMsg.type = 'success';\r\n\t\t\t});\r\n\t\t},\r\n\t\t...mapActions('auth', ['redeemToken']),\r\n\t\t...mapActions('notes', ['uploadNotes', 'loadNotes'])\r\n\t}\r\n};\r\n","\r\n\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\r\n\r\n\r\n\r\n","import { mapGetters, mapActions } from 'vuex';\r\nimport CookieJar from '@/utilities/cookieJar';\r\n\r\nexport const formSteps = {\r\n data () {\r\n\t\treturn {\r\n showStepErrors: false,\r\n activityList: []\r\n };\r\n },\r\n computed: {\r\n noItemsAdded () {\r\n return this.getItemsByType ? this.getItemsByType.length < 1 : false;\r\n },\r\n otherCriteriaValid () {\r\n // additional conditions for validity may be set per section\r\n return true;\r\n },\r\n ...mapGetters('claim', ['getCurrentClaim']),\r\n ...mapGetters('childEntities', ['getItems'])\r\n },\r\n mounted () {\r\n const formEle = document.querySelector('form');\r\n const focusableEles = formEle.querySelectorAll('.form-control, a, button');\r\n\r\n focusableEles[0].focus();\r\n // We get a list of claims back so we need to grab the information for the current one\r\n // based on it's ID\r\n this.fetchCurrentClaim({ id: this.$route.params.claimId, size: this.$route.params.size }).then((res) => {\r\n Object.assign(this.formData, this.getCurrentClaim);\r\n });\r\n\r\n this.fetchEligibleActivities();\r\n\t},\r\n methods: {\r\n saveAndSubmit (nextStep, validateStep = true, finalSubmit = false) {\r\n const formEle = document.querySelector('form');\r\n const focusableEles = formEle.querySelectorAll('.form-control, a, button');\r\n\r\n this.showStepErrors = true;\r\n if (!validateStep || (this.isValid(this.$refs.form) && !this.noItemsAdded && this.otherCriteriaValid)) {\r\n /* If we're continuing (validateStep is true) we want to save the next step as the one to return to,\r\n otherwise, we should return the user to the one they saved last */\r\n const returnStep = validateStep ? nextStep : this.$route.name;\r\n\r\n // set ua_claimsubmitted to 1/true if this is the final submission\r\n this.formData.ua_claimsubmitted = finalSubmit ? 1 : 2;\r\n\r\n this.submitClaim(finalSubmit, returnStep, nextStep);\r\n } else {\r\n window.scrollTo(0, 0);\r\n focusableEles[0].focus();\r\n }\r\n },\r\n submitClaim (finalSubmit, returnStep, nextStep) {\r\n this.updateClaim(this.formData).then((res) => {\r\n if (res === true) {\r\n // If the claim was successfully updated, go off and update the activities as well\r\n this.flagActivitiesClaimed(nextStep);\r\n } else if (res.status === 401) {\r\n this.redeemToken({\r\n refreshtoken: CookieJar.get(`${process.env.VUE_APP_COOKIE_PREFIX}refresh_token`),\r\n businessunit: process.env.VUE_APP_BUSINESS_UNIT\r\n }).then((res) => {\r\n if (res === true) {\r\n this.submitClaim(finalSubmit, returnStep, nextStep);\r\n return true;\r\n }\r\n this.$router.push({ name: 'Login' });\r\n }).catch(() => {\r\n this.$router.push({ name: 'Login' });\r\n });\r\n }\r\n }).catch((err) => {\r\n this.error = err.message;\r\n });\r\n },\r\n flagActivitiesClaimed (nextStep) {\r\n const promises = this.activityList.map((activity) => {\r\n // Loop through all the activities selected and grab their data object because we need to send the whole thing up\r\n const activityData = this.getItems('activities').find(elActivity => elActivity.ua_icactivitylineid === activity.value);\r\n\r\n // If the activity has been selected, the claim ID should be null, if not, it should be set to the current claim ID\r\n const claimId = !activity.selected ? null : this.$route.params.claimId;\r\n\r\n const payload = {\r\n data: {\r\n\t\t\t\t\t\t...activityData,\r\n\t\t\t\t\t\t...{ ua_claim: claimId }\r\n\t\t\t\t\t},\r\n id: activity.value,\r\n\t\t\t\t\titemType: 'activities'\r\n };\r\n\r\n return this.editById(payload).catch((err) => {\r\n throw err;\r\n });\r\n });\r\n\r\n Promise.all(promises).then(() => {\r\n // When all of the activities have been updated, send the user back to the dashboard (or the confirmation page if they've submitted)\r\n this.$router.push({ name: nextStep });\r\n });\r\n },\r\n parseBoolAsInt (fieldName) {\r\n // We send the declarations up as 1 or 0 (yes or no) but we get tham back down as true/false.\r\n // This is to facilitate prefilling the checkboxes from server data\r\n\t\t\tif (typeof fieldName === 'boolean') {\r\n\t\t\t\treturn fieldName ? 1 : 0;\r\n\t\t\t}\r\n\t\t\treturn fieldName;\r\n\t\t},\r\n\t\tgetSelected (data) {\r\n // add selected activity values to selectedActivities array. This is used to prefill checkboxes\r\n\t\t\tthis.selectedActivities = data;\r\n\r\n // set chosenActivities to empty array\r\n\t\t\tthis.chosenActivities = [];\r\n\r\n this.activityList.forEach((activity) => {\r\n // To start with set every activity in the list to unselected\r\n activity.selected = false;\r\n });\r\n\r\n data.forEach((activity) => {\r\n // After that, go through the selected ones, find them in the activityList, and set theire selected property to true\r\n\r\n\t\t\t\tconst a = this.activityList.find(item => item.value === activity);\r\n\r\n a.selected = true;\r\n\r\n // Add the selected item's label to chosenActivities. This is to populate the reference list of selected activities\r\n this.chosenActivities.push(\r\n\t\t\t\t\ta.label\r\n\t\t\t\t);\r\n\t\t\t});\r\n\t\t},\r\n\t\tfetchEligibleActivities () {\r\n // If we don't already have a list of activities eligible for this claim, fetch activities from server\r\n if (!this.getEligibleActivities(this.$route.params.claimId).length) {\r\n this.fetchItems('activities').catch((err) => {\r\n if (err.status === 422 || err.status === 500) {\r\n this.activitesError.type = err.type;\r\n this.activitesError.text = err.message;\r\n }\r\n }).finally(() => {\r\n // Add eligibile activities to a data prop - this is so we can manipulate it later\r\n this.activityList = this.getEligibleActivities(this.$route.params.claimId);\r\n this.activitiesLoading = false;\r\n this.checkForSelected();\r\n });\r\n } else {\r\n this.activityList = this.getEligibleActivities(this.$route.params.claimId);\r\n this.activitiesLoading = false;\r\n this.checkForSelected();\r\n }\r\n\t\t},\r\n checkForSelected () {\r\n // check through the activity list for any activities that have previously been selected and\r\n // add them to the list of pre-selected options to show in the hceckbox list\r\n this.activityList.forEach((activity) => {\r\n if (activity.selected) {\r\n this.selectedActivities.push(activity.value);\r\n this.chosenActivities.push(activity.label);\r\n }\r\n });\r\n },\r\n ...mapActions('auth', ['redeemToken']),\r\n ...mapActions('claim', ['updateClaim', 'fetchCurrentClaim']),\r\n ...mapActions('childEntities', ['fetchItems', 'editById'])\r\n }\r\n };\r\n","\r\n\r\n\r\n\r\n\r\n","import { render } from \"./AssetFields.vue?vue&type=template&id=1f002983\"\nimport script from \"./AssetFields.vue?vue&type=script&lang=js\"\nexport * from \"./AssetFields.vue?vue&type=script&lang=js\"\n\nimport exportComponent from \"D:\\\\a\\\\1\\\\s\\\\node_modules\\\\vue-loader-v16\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { render } from \"./claim-details.vue?vue&type=template&id=3f902c42\"\nimport script from \"./claim-details.vue?vue&type=script&lang=js\"\nexport * from \"./claim-details.vue?vue&type=script&lang=js\"\n\nimport exportComponent from \"D:\\\\a\\\\1\\\\s\\\\node_modules\\\\vue-loader-v16\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__"],"sourceRoot":""}