Skip to content
Merged

Dev #1373

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@
data: 'organizationType',
className: 'data-table-header',
render: function (data) {
return data ?? '';
return getFullType(data) ?? '';
},
index: 39
}
Expand Down Expand Up @@ -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', () => {
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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, ' ');
Expand Down