diff --git a/applications/Unity.GrantManager/src/Unity.GrantManager.Web/Pages/GrantApplications/Details.js b/applications/Unity.GrantManager/src/Unity.GrantManager.Web/Pages/GrantApplications/Details.js index 5994796a0..495216743 100644 --- a/applications/Unity.GrantManager/src/Unity.GrantManager.Web/Pages/GrantApplications/Details.js +++ b/applications/Unity.GrantManager/src/Unity.GrantManager.Web/Pages/GrantApplications/Details.js @@ -341,8 +341,18 @@ $(function () { let formSchemaString = document.getElementById('ApplicationFormSchema').value; let submissionJson = JSON.parse(submissionDataString); let formSchema; - let data; let submissionData; + + // Initialize data with correct structure + let data = { + version: { + schema: null + }, + submission: { + submission: null + } + }; + // Check if the submission data is pure data or the entire form if (submissionJson.version !== undefined && submissionJson.submission !== undefined) { diff --git a/applications/Unity.GrantManager/src/Unity.GrantManager.Web/Pages/GrantApplications/Index.js b/applications/Unity.GrantManager/src/Unity.GrantManager.Web/Pages/GrantApplications/Index.js index 8b7792d34..b6d598137 100644 --- a/applications/Unity.GrantManager/src/Unity.GrantManager.Web/Pages/GrantApplications/Index.js +++ b/applications/Unity.GrantManager/src/Unity.GrantManager.Web/Pages/GrantApplications/Index.js @@ -779,7 +779,7 @@ data: 'organizationType', className: 'data-table-header', render: function (data) { - return data ?? ''; + return getFullType(data) ?? ''; }, index: 39 } @@ -1083,6 +1083,47 @@ } } + function getFullType(code) { + const companyTypes = [ + { code: "BC", name: "BC Company" }, + { code: "CP", name: "Cooperative" }, + { code: "GP", name: "General Partnership" }, + { code: "S", name: "Society" }, + { code: "SP", name: "Sole Proprietorship" }, + { code: "A", name: "Extraprovincial Company" }, + { code: "B", name: "Extraprovincial" }, + { code: "BEN", name: "Benefit Company" }, + { code: "C", name: "Continuation In" }, + { code: "CC", name: "BC Community Contribution Company" }, + { code: "CS", name: "Continued In Society" }, + { code: "CUL", name: "Continuation In as a BC ULC" }, + { code: "EPR", name: "Extraprovincial Registration" }, + { code: "FI", name: "Financial Institution" }, + { code: "FOR", name: "Foreign Registration" }, + { code: "LIB", name: "Public Library Association" }, + { code: "LIC", name: "Licensed (Extra-Pro)" }, + { code: "LL", name: "Limited Liability Partnership" }, + { code: "LLC", name: "Limited Liability Company" }, + { code: "LP", name: "Limited Partnership" }, + { code: "MF", name: "Miscellaneous Firm" }, + { code: "PA", name: "Private Act" }, + { code: "PAR", name: "Parish" }, + { code: "QA", name: "CO 1860" }, + { code: "QB", name: "CO 1862" }, + { code: "QC", name: "CO 1878" }, + { code: "QD", name: "CO 1890" }, + { code: "QE", name: "CO 1897" }, + { code: "REG", name: "Registraton (Extra-pro)" }, + { code: "ULC", name: "BC Unlimited Liability Company" }, + { code: "XCP", name: "Extraprovincial Cooperative" }, + { code: "XL", name: "Extrapro Limited Liability Partnership" }, + { code: "XP", name: "Extraprovincial Limited Partnership" }, + { code: "XS", name: "Extraprovincial Society" } + ]; + const match = companyTypes.find(entry => entry.code === code); + return match ? match.name : "Unknown"; + } + window.addEventListener('resize', () => { }); diff --git a/applications/Unity.GrantManager/src/Unity.GrantManager.Web/Views/Shared/Components/EmailsWidget/Default.js b/applications/Unity.GrantManager/src/Unity.GrantManager.Web/Views/Shared/Components/EmailsWidget/Default.js index 8d4f6decc..3813c69d0 100644 --- a/applications/Unity.GrantManager/src/Unity.GrantManager.Web/Views/Shared/Components/EmailsWidget/Default.js +++ b/applications/Unity.GrantManager/src/Unity.GrantManager.Web/Views/Shared/Components/EmailsWidget/Default.js @@ -454,18 +454,25 @@ } function processString(token,inputString) { let lookupArray = ['category', 'status', 'decline_rationale']; + let datesArray = ['submission_date', 'approval_date', 'project_start_date', 'project_end_date'] if(typeof inputString !== 'string') { return inputString; } - - let date = new Date(inputString); - if (!isNaN(date.getTime())) { - - return luxon.DateTime.fromISO(inputString, { - locale: abp.localization.currentCulture.name, - }).toUTC().toLocaleString() - } else { + + if (datesArray.includes(token)) { + let date = new Date(inputString); + if (!isNaN(date.getTime())) { + + return luxon.DateTime.fromISO(inputString, { + locale: abp.localization.currentCulture.name, + }).toUTC().toLocaleString() + } + else { + return ''; + } + } + else { if (lookupArray.includes(token)) { inputString = inputString.replace(/_/g, ' ');