deepsource-autofix-76c6eb20
Dan Gowans 2024-06-25 11:05:11 -04:00
parent d55d76ba03
commit 50e6c19b2b
9 changed files with 476 additions and 480 deletions

View File

@ -311,9 +311,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
lotSelectCloseModalFunction(); lotSelectCloseModalFunction();
} }
function selectExistingLot(clickEvent) { function selectExistingLot(clickEvent) {
var _a, _b;
clickEvent.preventDefault(); clickEvent.preventDefault();
const selectedLotElement = clickEvent.currentTarget; const selectedLotElement = clickEvent.currentTarget;
renderSelectedLotAndClose(selectedLotElement.dataset.lotId, selectedLotElement.dataset.lotName); renderSelectedLotAndClose((_a = selectedLotElement.dataset.lotId) !== null && _a !== void 0 ? _a : '', (_b = selectedLotElement.dataset.lotName) !== null && _b !== void 0 ? _b : '');
} }
function searchLots() { function searchLots() {
// eslint-disable-next-line no-unsanitized/property // eslint-disable-next-line no-unsanitized/property
@ -478,14 +479,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
* Occupants * Occupants
*/ */
"use strict"; "use strict";
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */ // eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
var _a; var _a;
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
let lotOccupancyOccupants = exports.lotOccupancyOccupants; let lotOccupancyOccupants = exports.lotOccupancyOccupants;
delete exports.lotOccupancyOccupants; delete exports.lotOccupancyOccupants;
function openEditLotOccupancyOccupant(clickEvent) { function openEditLotOccupancyOccupant(clickEvent) {
const lotOccupantIndex = Number.parseInt(clickEvent.currentTarget.closest('tr').dataset var _a, _b;
.lotOccupantIndex, 10); const lotOccupantIndex = Number.parseInt((_b = (_a = clickEvent.currentTarget.closest('tr')) === null || _a === void 0 ? void 0 : _a.dataset.lotOccupantIndex) !== null && _b !== void 0 ? _b : '', 10);
const lotOccupancyOccupant = lotOccupancyOccupants.find((currentLotOccupancyOccupant) => { const lotOccupancyOccupant = lotOccupancyOccupants.find((currentLotOccupancyOccupant) => {
return currentLotOccupancyOccupant.lotOccupantIndex === lotOccupantIndex; return currentLotOccupancyOccupant.lotOccupantIndex === lotOccupantIndex;
}); });
@ -493,7 +495,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
let editCloseModalFunction; let editCloseModalFunction;
function editOccupant(submitEvent) { function editOccupant(submitEvent) {
submitEvent.preventDefault(); submitEvent.preventDefault();
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doUpdateLotOccupancyOccupant', editFormElement, (rawResponseJSON) => { cityssm.postJSON(`${los.urlPrefix}/lotOccupancies/doUpdateLotOccupancyOccupant`, editFormElement, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON; const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
@ -503,7 +505,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
} }
else { else {
bulmaJS.alert({ bulmaJS.alert({
title: 'Error Updating ' + los.escapedAliases.Occupant, title: `Error Updating ${los.escapedAliases.Occupant}`,
message: (_a = responseJSON.errorMessage) !== null && _a !== void 0 ? _a : '', message: (_a = responseJSON.errorMessage) !== null && _a !== void 0 ? _a : '',
contextualColorName: 'danger' contextualColorName: 'danger'
}); });
@ -544,7 +546,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
optionElement.selected = true; optionElement.selected = true;
lotOccupantTypeSelectElement.append(optionElement); lotOccupantTypeSelectElement.append(optionElement);
} }
modalElement.querySelector('#lotOccupancyOccupantEdit--fontAwesomeIconClass').innerHTML = `<i class="fas fa-fw fa-${lotOccupancyOccupant.fontAwesomeIconClass}" aria-hidden="true"></i>`; modalElement.querySelector('#lotOccupancyOccupantEdit--fontAwesomeIconClass').innerHTML =
`<i class="fas fa-fw fa-${lotOccupancyOccupant.fontAwesomeIconClass}" aria-hidden="true"></i>`;
modalElement.querySelector('#lotOccupancyOccupantEdit--occupantName').value = lotOccupancyOccupant.occupantName; modalElement.querySelector('#lotOccupancyOccupantEdit--occupantName').value = lotOccupancyOccupant.occupantName;
modalElement.querySelector('#lotOccupancyOccupantEdit--occupantFamilyName').value = lotOccupancyOccupant.occupantFamilyName; modalElement.querySelector('#lotOccupancyOccupantEdit--occupantFamilyName').value = lotOccupancyOccupant.occupantFamilyName;
modalElement.querySelector('#lotOccupancyOccupantEdit--occupantAddress1').value = lotOccupancyOccupant.occupantAddress1; modalElement.querySelector('#lotOccupancyOccupantEdit--occupantAddress1').value = lotOccupancyOccupant.occupantAddress1;
@ -568,7 +571,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
var _a, _b; var _a, _b;
const fontAwesomeIconClass = (_a = lotOccupantTypeIdElement.selectedOptions[0].dataset const fontAwesomeIconClass = (_a = lotOccupantTypeIdElement.selectedOptions[0].dataset
.fontAwesomeIconClass) !== null && _a !== void 0 ? _a : 'user'; .fontAwesomeIconClass) !== null && _a !== void 0 ? _a : 'user';
modalElement.querySelector('#lotOccupancyOccupantEdit--fontAwesomeIconClass').innerHTML = `<i class="fas fa-fw fa-${fontAwesomeIconClass}" aria-hidden="true"></i>`; modalElement.querySelector('#lotOccupancyOccupantEdit--fontAwesomeIconClass').innerHTML =
`<i class="fas fa-fw fa-${fontAwesomeIconClass}" aria-hidden="true"></i>`;
let occupantCommentTitle = (_b = lotOccupantTypeIdElement.selectedOptions[0].dataset let occupantCommentTitle = (_b = lotOccupantTypeIdElement.selectedOptions[0].dataset
.occupantCommentTitle) !== null && _b !== void 0 ? _b : ''; .occupantCommentTitle) !== null && _b !== void 0 ? _b : '';
if (occupantCommentTitle === '') { if (occupantCommentTitle === '') {
@ -644,9 +648,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
lotOccupancyOccupant.lotOccupantIndex.toString(); lotOccupancyOccupant.lotOccupantIndex.toString();
tableRowElement.innerHTML = tableRowElement.innerHTML =
'<td>' + '<td>' +
cityssm.escapeHTML(((_a = lotOccupancyOccupant.occupantName) !== null && _a !== void 0 ? _a : '') === '' && ((_b = lotOccupancyOccupant.occupantFamilyName) !== null && _b !== void 0 ? _b : '') === '' cityssm.escapeHTML(((_a = lotOccupancyOccupant.occupantName) !== null && _a !== void 0 ? _a : '') === '' &&
((_b = lotOccupancyOccupant.occupantFamilyName) !== null && _b !== void 0 ? _b : '') === ''
? '(No Name)' ? '(No Name)'
: lotOccupancyOccupant.occupantName + ' ' + lotOccupancyOccupant.occupantFamilyName) + : lotOccupancyOccupant.occupantName +
' ' +
lotOccupancyOccupant.occupantFamilyName) +
'<br />' + '<br />' +
('<span class="tag">' + ('<span class="tag">' +
'<i class="fas fa-fw fa-' + '<i class="fas fa-fw fa-' +
@ -869,7 +876,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
var _a, _b; var _a, _b;
const fontAwesomeIconClass = (_a = lotOccupantTypeIdElement.selectedOptions[0].dataset const fontAwesomeIconClass = (_a = lotOccupantTypeIdElement.selectedOptions[0].dataset
.fontAwesomeIconClass) !== null && _a !== void 0 ? _a : 'user'; .fontAwesomeIconClass) !== null && _a !== void 0 ? _a : 'user';
modalElement.querySelector('#lotOccupancyOccupantAdd--fontAwesomeIconClass').innerHTML = `<i class="fas fa-fw fa-${fontAwesomeIconClass}" aria-hidden="true"></i>`; modalElement.querySelector('#lotOccupancyOccupantAdd--fontAwesomeIconClass').innerHTML =
`<i class="fas fa-fw fa-${fontAwesomeIconClass}" aria-hidden="true"></i>`;
let occupantCommentTitle = (_b = lotOccupantTypeIdElement.selectedOptions[0].dataset let occupantCommentTitle = (_b = lotOccupantTypeIdElement.selectedOptions[0].dataset
.occupantCommentTitle) !== null && _b !== void 0 ? _b : ''; .occupantCommentTitle) !== null && _b !== void 0 ? _b : '';
if (occupantCommentTitle === '') { if (occupantCommentTitle === '') {
@ -1086,6 +1094,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
renderLotOccupancyComments(); renderLotOccupancyComments();
"use strict"; "use strict";
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */ /* eslint-disable unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
let lotOccupancyFees = exports.lotOccupancyFees; let lotOccupancyFees = exports.lotOccupancyFees;
@ -1101,15 +1110,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
return feeGrandTotal; return feeGrandTotal;
} }
function editLotOccupancyFeeQuantity(clickEvent) { function editLotOccupancyFeeQuantity(clickEvent) {
const feeId = Number.parseInt(clickEvent.currentTarget.closest('tr').dataset var _a, _b;
.feeId, 10); const feeId = Number.parseInt((_b = (_a = clickEvent.currentTarget.closest('tr')) === null || _a === void 0 ? void 0 : _a.dataset.feeId) !== null && _b !== void 0 ? _b : '', 10);
const fee = lotOccupancyFees.find((possibleFee) => { const fee = lotOccupancyFees.find((possibleFee) => {
return possibleFee.feeId === feeId; return possibleFee.feeId === feeId;
}); });
let updateCloseModalFunction; let updateCloseModalFunction;
function doUpdateQuantity(formEvent) { function doUpdateQuantity(formEvent) {
formEvent.preventDefault(); formEvent.preventDefault();
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doUpdateLotOccupancyFeeQuantity', formEvent.currentTarget, (rawResponseJSON) => { cityssm.postJSON(`${los.urlPrefix}/lotOccupancies/doUpdateLotOccupancyFeeQuantity`, formEvent.currentTarget, (rawResponseJSON) => {
const responseJSON = rawResponseJSON; const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
lotOccupancyFees = responseJSON.lotOccupancyFees; lotOccupancyFees = responseJSON.lotOccupancyFees;
@ -1127,11 +1136,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
} }
cityssm.openHtmlModal('lotOccupancy-editFeeQuantity', { cityssm.openHtmlModal('lotOccupancy-editFeeQuantity', {
onshow(modalElement) { onshow(modalElement) {
var _a, _b;
; ;
modalElement.querySelector('#lotOccupancyFeeQuantity--lotOccupancyId').value = lotOccupancyId; modalElement.querySelector('#lotOccupancyFeeQuantity--lotOccupancyId').value = lotOccupancyId;
modalElement.querySelector('#lotOccupancyFeeQuantity--feeId').value = fee.feeId.toString(); modalElement.querySelector('#lotOccupancyFeeQuantity--feeId').value = fee.feeId.toString();
modalElement.querySelector('#lotOccupancyFeeQuantity--quantity').valueAsNumber = fee.quantity; modalElement.querySelector('#lotOccupancyFeeQuantity--quantity').valueAsNumber = (_a = fee.quantity) !== null && _a !== void 0 ? _a : 0;
modalElement.querySelector('#lotOccupancyFeeQuantity--quantityUnit').textContent = fee.quantityUnit; modalElement.querySelector('#lotOccupancyFeeQuantity--quantityUnit').textContent = (_b = fee.quantityUnit) !== null && _b !== void 0 ? _b : '';
}, },
onshown(modalElement, closeModalFunction) { onshown(modalElement, closeModalFunction) {
var _a; var _a;
@ -1149,7 +1159,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
function deleteLotOccupancyFee(clickEvent) { function deleteLotOccupancyFee(clickEvent) {
const feeId = clickEvent.currentTarget.closest('.container--lotOccupancyFee').dataset.feeId; const feeId = clickEvent.currentTarget.closest('.container--lotOccupancyFee').dataset.feeId;
function doDelete() { function doDelete() {
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doDeleteLotOccupancyFee', { cityssm.postJSON(`${los.urlPrefix}/lotOccupancies/doDeleteLotOccupancyFee`, {
lotOccupancyId, lotOccupancyId,
feeId feeId
}, (rawResponseJSON) => { }, (rawResponseJSON) => {
@ -1179,7 +1189,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
}); });
} }
function renderLotOccupancyFees() { function renderLotOccupancyFees() {
var _a, _b, _c, _d, _e, _f, _g; var _a, _b, _c, _d, _e, _f, _g, _h, _j;
if (lotOccupancyFees.length === 0) { if (lotOccupancyFees.length === 0) {
lotOccupancyFeesContainerElement.innerHTML = `<div class="message is-info"> lotOccupancyFeesContainerElement.innerHTML = `<div class="message is-info">
<p class="message-body">There are no fees associated with this record.</p> <p class="message-body">There are no fees associated with this record.</p>
@ -1187,6 +1197,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
renderLotOccupancyTransactions(); renderLotOccupancyTransactions();
return; return;
} }
// eslint-disable-next-line no-secrets/no-secrets
lotOccupancyFeesContainerElement.innerHTML = `<table class="table is-fullwidth is-striped is-hoverable"> lotOccupancyFeesContainerElement.innerHTML = `<table class="table is-fullwidth is-striped is-hoverable">
<thead><tr> <thead><tr>
<th>Fee</th> <th>Fee</th>
@ -1219,45 +1230,41 @@ Object.defineProperty(exports, "__esModule", { value: true });
tableRowElement.dataset.feeId = lotOccupancyFee.feeId.toString(); tableRowElement.dataset.feeId = lotOccupancyFee.feeId.toString();
tableRowElement.dataset.includeQuantity = tableRowElement.dataset.includeQuantity =
((_a = lotOccupancyFee.includeQuantity) !== null && _a !== void 0 ? _a : false) ? '1' : '0'; ((_a = lotOccupancyFee.includeQuantity) !== null && _a !== void 0 ? _a : false) ? '1' : '0';
tableRowElement.innerHTML = // eslint-disable-next-line no-unsanitized/property
'<td colspan="' + tableRowElement.innerHTML = `<td colspan="${lotOccupancyFee.quantity === 1 ? '5' : '1'}">
(lotOccupancyFee.quantity === 1 ? '5' : '1') + ${cityssm.escapeHTML((_b = lotOccupancyFee.feeName) !== null && _b !== void 0 ? _b : '')}<br />
'">' + <span class="tag">${cityssm.escapeHTML((_c = lotOccupancyFee.feeCategory) !== null && _c !== void 0 ? _c : '')}</span>
cityssm.escapeHTML((_b = lotOccupancyFee.feeName) !== null && _b !== void 0 ? _b : '') + </td>
'<br />' + ${lotOccupancyFee.quantity === 1
'<span class="tag">' +
cityssm.escapeHTML((_c = lotOccupancyFee.feeCategory) !== null && _c !== void 0 ? _c : '') +
'</span>' +
'</td>' +
(lotOccupancyFee.quantity === 1
? '' ? ''
: '<td class="has-text-right">$' + : `<td class="has-text-right">
lotOccupancyFee.feeAmount.toFixed(2) + $${(_d = lotOccupancyFee.feeAmount) === null || _d === void 0 ? void 0 : _d.toFixed(2)}
'</td>' + </td>
'<td>&times;</td>' + <td>&times;</td>
'<td class="has-text-right">' + <td class="has-text-right">${(_e = lotOccupancyFee.quantity) === null || _e === void 0 ? void 0 : _e.toString()}</td>
lotOccupancyFee.quantity.toString() + <td>=</td>`}
'</td>' + <td class="has-text-right">
'<td>=</td>') + $${(lotOccupancyFee.feeAmount * lotOccupancyFee.quantity).toFixed(2)}
'<td class="has-text-right">$' + </td>
(lotOccupancyFee.feeAmount * lotOccupancyFee.quantity).toFixed(2) + <td class="is-hidden-print">
'</td>' + <div class="buttons are-small is-flex-wrap-nowrap is-justify-content-end">
('<td class="is-hidden-print">' + ${((_f = lotOccupancyFee.includeQuantity) !== null && _f !== void 0 ? _f : false)
'<div class="buttons are-small is-flex-wrap-nowrap is-justify-content-end">' + ? `<button class="button is-primary button--editQuantity">
(((_d = lotOccupancyFee.includeQuantity) !== null && _d !== void 0 ? _d : false) <span class="icon is-small"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>
? '<button class="button is-primary button--editQuantity"><span class="icon is-small"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span><span>Edit</span></button>' <span>Edit</span>
: '') + </button>`
'<button class="button is-danger is-light button--delete" data-tooltip="Delete Fee" type="button">' + : ''}
'<i class="fas fa-trash" aria-hidden="true"></i>' + <button class="button is-danger is-light button--delete" data-tooltip="Delete Fee" type="button">
'</button>' + <i class="fas fa-trash" aria-hidden="true"></i>
'</div>' + </button>
'</td>'); </div>
(_e = tableRowElement </td>`;
.querySelector('.button--editQuantity')) === null || _e === void 0 ? void 0 : _e.addEventListener('click', editLotOccupancyFeeQuantity); (_g = tableRowElement
(_f = tableRowElement .querySelector('.button--editQuantity')) === null || _g === void 0 ? void 0 : _g.addEventListener('click', editLotOccupancyFeeQuantity);
.querySelector('.button--delete')) === null || _f === void 0 ? void 0 : _f.addEventListener('click', deleteLotOccupancyFee); (_h = tableRowElement
(_g = lotOccupancyFeesContainerElement .querySelector('.button--delete')) === null || _h === void 0 ? void 0 : _h.addEventListener('click', deleteLotOccupancyFee);
.querySelector('tbody')) === null || _g === void 0 ? void 0 : _g.append(tableRowElement); (_j = lotOccupancyFeesContainerElement
.querySelector('tbody')) === null || _j === void 0 ? void 0 : _j.append(tableRowElement);
feeAmountTotal += lotOccupancyFee.feeAmount * lotOccupancyFee.quantity; feeAmountTotal += lotOccupancyFee.feeAmount * lotOccupancyFee.quantity;
taxAmountTotal += lotOccupancyFee.taxAmount * lotOccupancyFee.quantity; taxAmountTotal += lotOccupancyFee.taxAmount * lotOccupancyFee.quantity;
} }
@ -1280,7 +1287,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
let feeFilterElement; let feeFilterElement;
let feeFilterResultsElement; let feeFilterResultsElement;
function doAddFee(feeId, quantity = 1) { function doAddFee(feeId, quantity = 1) {
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doAddLotOccupancyFee', { cityssm.postJSON(`${los.urlPrefix}/lotOccupancies/doAddLotOccupancyFee`, {
lotOccupancyId, lotOccupancyId,
feeId, feeId,
quantity quantity
@ -1311,30 +1318,31 @@ Object.defineProperty(exports, "__esModule", { value: true });
} }
cityssm.openHtmlModal('lotOccupancy-setFeeQuantity', { cityssm.openHtmlModal('lotOccupancy-setFeeQuantity', {
onshow(modalElement) { onshow(modalElement) {
var _a;
; ;
modalElement.querySelector('#lotOccupancyFeeQuantity--quantityUnit').textContent = fee.quantityUnit; modalElement.querySelector('#lotOccupancyFeeQuantity--quantityUnit').textContent = (_a = fee.quantityUnit) !== null && _a !== void 0 ? _a : '';
}, },
onshown(modalElement, closeModalFunction) { onshown(modalElement, closeModalFunction) {
var _a;
quantityCloseModalFunction = closeModalFunction; quantityCloseModalFunction = closeModalFunction;
quantityElement = modalElement.querySelector('#lotOccupancyFeeQuantity--quantity'); quantityElement = modalElement.querySelector('#lotOccupancyFeeQuantity--quantity');
modalElement (_a = modalElement
.querySelector('form') .querySelector('form')) === null || _a === void 0 ? void 0 : _a.addEventListener('submit', doSetQuantity);
.addEventListener('submit', doSetQuantity);
} }
}); });
} }
function tryAddFee(clickEvent) { function tryAddFee(clickEvent) {
var _a; var _a, _b, _c;
clickEvent.preventDefault(); clickEvent.preventDefault();
const feeId = Number.parseInt(clickEvent.currentTarget.dataset.feeId, 10); const feeId = Number.parseInt((_a = clickEvent.currentTarget.dataset.feeId) !== null && _a !== void 0 ? _a : '', 10);
const feeCategoryId = Number.parseInt(clickEvent.currentTarget.dataset.feeCategoryId, 10); const feeCategoryId = Number.parseInt((_b = clickEvent.currentTarget.dataset.feeCategoryId) !== null && _b !== void 0 ? _b : '', 10);
const feeCategory = feeCategories.find((currentFeeCategory) => { const feeCategory = feeCategories.find((currentFeeCategory) => {
return currentFeeCategory.feeCategoryId === feeCategoryId; return currentFeeCategory.feeCategoryId === feeCategoryId;
}); });
const fee = feeCategory.fees.find((currentFee) => { const fee = feeCategory.fees.find((currentFee) => {
return currentFee.feeId === feeId; return currentFee.feeId === feeId;
}); });
if ((_a = fee.includeQuantity) !== null && _a !== void 0 ? _a : false) { if ((_c = fee.includeQuantity) !== null && _c !== void 0 ? _c : false) {
doSetQuantityAndAddFee(fee); doSetQuantityAndAddFee(fee);
} }
else { else {
@ -1353,11 +1361,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
categoryContainerElement.className = 'container--feeCategory'; categoryContainerElement.className = 'container--feeCategory';
categoryContainerElement.dataset.feeCategoryId = categoryContainerElement.dataset.feeCategoryId =
feeCategory.feeCategoryId.toString(); feeCategory.feeCategoryId.toString();
categoryContainerElement.innerHTML = categoryContainerElement.innerHTML = `<h4 class="title is-5 mt-2">${cityssm.escapeHTML((_a = feeCategory.feeCategory) !== null && _a !== void 0 ? _a : '')}</h4>
'<h4 class="title is-5 mt-2">' + <div class="panel mb-5"></div>`;
cityssm.escapeHTML((_a = feeCategory.feeCategory) !== null && _a !== void 0 ? _a : '') +
'</h4>' +
'<div class="panel mb-5"></div>';
let hasFees = false; let hasFees = false;
for (const fee of feeCategory.fees) { for (const fee of feeCategory.fees) {
// Don't include already applied fees that limit quantity // Don't include already applied fees that limit quantity
@ -1365,11 +1370,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
continue; continue;
} }
let includeFee = true; let includeFee = true;
const feeSearchString = (((_b = feeCategory.feeCategory) !== null && _b !== void 0 ? _b : '') + const feeSearchString = `${(_b = feeCategory.feeCategory) !== null && _b !== void 0 ? _b : ''} ${(_c = fee.feeName) !== null && _c !== void 0 ? _c : ''} ${(_d = fee.feeDescription) !== null && _d !== void 0 ? _d : ''}`.toLowerCase();
' ' +
((_c = fee.feeName) !== null && _c !== void 0 ? _c : '') +
' ' +
((_d = fee.feeDescription) !== null && _d !== void 0 ? _d : '')).toLowerCase();
for (const filterStringPiece of filterStringPieces) { for (const filterStringPiece of filterStringPieces) {
if (!feeSearchString.includes(filterStringPiece)) { if (!feeSearchString.includes(filterStringPiece)) {
includeFee = false; includeFee = false;
@ -1386,15 +1387,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
panelBlockElement.dataset.feeCategoryId = panelBlockElement.dataset.feeCategoryId =
feeCategory.feeCategoryId.toString(); feeCategory.feeCategoryId.toString();
panelBlockElement.href = '#'; panelBlockElement.href = '#';
panelBlockElement.innerHTML = // eslint-disable-next-line no-unsanitized/property
'<strong>' + panelBlockElement.innerHTML = `<strong>${cityssm.escapeHTML((_e = fee.feeName) !== null && _e !== void 0 ? _e : '')}</strong><br />
cityssm.escapeHTML((_e = fee.feeName) !== null && _e !== void 0 ? _e : '') + <small>
'</strong><br />' + ${cityssm
'<small>' +
cityssm
.escapeHTML((_f = fee.feeDescription) !== null && _f !== void 0 ? _f : '') .escapeHTML((_f = fee.feeDescription) !== null && _f !== void 0 ? _f : '')
.replace(/\n/g, '<br />') + .replaceAll('\n', '<br />')}
'</small>'; </small>`;
panelBlockElement.addEventListener('click', tryAddFee); panelBlockElement.addEventListener('click', tryAddFee);
categoryContainerElement.querySelector('.panel').append(panelBlockElement); categoryContainerElement.querySelector('.panel').append(panelBlockElement);
} }
@ -1407,7 +1406,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
onshow(modalElement) { onshow(modalElement) {
feeFilterElement = modalElement.querySelector('#feeSelect--feeName'); feeFilterElement = modalElement.querySelector('#feeSelect--feeName');
feeFilterResultsElement = modalElement.querySelector('#resultsContainer--feeSelect'); feeFilterResultsElement = modalElement.querySelector('#resultsContainer--feeSelect');
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doGetFees', { cityssm.postJSON(`${los.urlPrefix}/lotOccupancies/doGetFees`, {
lotOccupancyId lotOccupancyId
}, (rawResponseJSON) => { }, (rawResponseJSON) => {
const responseJSON = rawResponseJSON; const responseJSON = rawResponseJSON;
@ -1441,15 +1440,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
return transactionGrandTotal; return transactionGrandTotal;
} }
function editLotOccupancyTransaction(clickEvent) { function editLotOccupancyTransaction(clickEvent) {
const transactionIndex = Number.parseInt(clickEvent.currentTarget.closest('tr').dataset var _a, _b;
.transactionIndex, 10); const transactionIndex = Number.parseInt((_b = (_a = clickEvent.currentTarget.closest('tr')) === null || _a === void 0 ? void 0 : _a.dataset.transactionIndex) !== null && _b !== void 0 ? _b : '', 10);
const transaction = lotOccupancyTransactions.find((possibleTransaction) => { const transaction = lotOccupancyTransactions.find((possibleTransaction) => {
return possibleTransaction.transactionIndex === transactionIndex; return possibleTransaction.transactionIndex === transactionIndex;
}); });
let editCloseModalFunction; let editCloseModalFunction;
function doEdit(formEvent) { function doEdit(formEvent) {
formEvent.preventDefault(); formEvent.preventDefault();
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doUpdateLotOccupancyTransaction', formEvent.currentTarget, (rawResponseJSON) => { cityssm.postJSON(`${los.urlPrefix}/lotOccupancies/doUpdateLotOccupancyTransaction`, formEvent.currentTarget, (rawResponseJSON) => {
const responseJSON = rawResponseJSON; const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
lotOccupancyTransactions = responseJSON.lotOccupancyTransactions; lotOccupancyTransactions = responseJSON.lotOccupancyTransactions;
@ -1467,15 +1466,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
} }
cityssm.openHtmlModal('lotOccupancy-editTransaction', { cityssm.openHtmlModal('lotOccupancy-editTransaction', {
onshow(modalElement) { onshow(modalElement) {
var _a, _b, _c, _d; var _a, _b, _c, _d, _e, _f;
los.populateAliases(modalElement); los.populateAliases(modalElement);
modalElement.querySelector('#lotOccupancyTransactionEdit--lotOccupancyId').value = lotOccupancyId; modalElement.querySelector('#lotOccupancyTransactionEdit--lotOccupancyId').value = lotOccupancyId;
modalElement.querySelector('#lotOccupancyTransactionEdit--transactionIndex').value = transaction.transactionIndex.toString(); modalElement.querySelector('#lotOccupancyTransactionEdit--transactionIndex').value = (_b = (_a = transaction.transactionIndex) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '';
modalElement.querySelector('#lotOccupancyTransactionEdit--transactionAmount').value = transaction.transactionAmount.toFixed(2); modalElement.querySelector('#lotOccupancyTransactionEdit--transactionAmount').value = transaction.transactionAmount.toFixed(2);
modalElement.querySelector('#lotOccupancyTransactionEdit--externalReceiptNumber').value = (_a = transaction.externalReceiptNumber) !== null && _a !== void 0 ? _a : ''; modalElement.querySelector('#lotOccupancyTransactionEdit--externalReceiptNumber').value = (_c = transaction.externalReceiptNumber) !== null && _c !== void 0 ? _c : '';
modalElement.querySelector('#lotOccupancyTransactionEdit--transactionNote').value = (_b = transaction.transactionNote) !== null && _b !== void 0 ? _b : ''; modalElement.querySelector('#lotOccupancyTransactionEdit--transactionNote').value = (_d = transaction.transactionNote) !== null && _d !== void 0 ? _d : '';
modalElement.querySelector('#lotOccupancyTransactionEdit--transactionDateString').value = (_c = transaction.transactionDateString) !== null && _c !== void 0 ? _c : ''; modalElement.querySelector('#lotOccupancyTransactionEdit--transactionDateString').value = (_e = transaction.transactionDateString) !== null && _e !== void 0 ? _e : '';
modalElement.querySelector('#lotOccupancyTransactionEdit--transactionTimeString').value = (_d = transaction.transactionTimeString) !== null && _d !== void 0 ? _d : ''; modalElement.querySelector('#lotOccupancyTransactionEdit--transactionTimeString').value = (_f = transaction.transactionTimeString) !== null && _f !== void 0 ? _f : '';
}, },
onshown(modalElement, closeModalFunction) { onshown(modalElement, closeModalFunction) {
var _a; var _a;
@ -1493,7 +1492,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
function deleteLotOccupancyTransaction(clickEvent) { function deleteLotOccupancyTransaction(clickEvent) {
const transactionIndex = clickEvent.currentTarget.closest('.container--lotOccupancyTransaction').dataset.transactionIndex; const transactionIndex = clickEvent.currentTarget.closest('.container--lotOccupancyTransaction').dataset.transactionIndex;
function doDelete() { function doDelete() {
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doDeleteLotOccupancyTransaction', { cityssm.postJSON(`${los.urlPrefix}/lotOccupancies/doDeleteLotOccupancyTransaction`, {
lotOccupancyId, lotOccupancyId,
transactionIndex transactionIndex
}, (rawResponseJSON) => { }, (rawResponseJSON) => {
@ -1523,16 +1522,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
}); });
} }
function renderLotOccupancyTransactions() { function renderLotOccupancyTransactions() {
var _a, _b, _c, _d, _e; var _a, _b, _c, _d, _e, _f, _g;
if (lotOccupancyTransactions.length === 0) { if (lotOccupancyTransactions.length === 0) {
lotOccupancyTransactionsContainerElement.innerHTML = // eslint-disable-next-line no-unsanitized/property
'<div class="message ' + lotOccupancyTransactionsContainerElement.innerHTML = `<div class="message ${lotOccupancyFees.length === 0 ? 'is-info' : 'is-warning'}">
(lotOccupancyFees.length === 0 ? 'is-info' : 'is-warning') + <p class="message-body">There are no transactions associated with this record.</p>
'">' + </div>`;
'<p class="message-body">There are no transactions associated with this record.</p>' +
'</div>';
return; return;
} }
// eslint-disable-next-line no-unsanitized/property
lotOccupancyTransactionsContainerElement.innerHTML = `<table class="table is-fullwidth is-striped is-hoverable"> lotOccupancyTransactionsContainerElement.innerHTML = `<table class="table is-fullwidth is-striped is-hoverable">
<thead><tr> <thead><tr>
<th class="has-width-1">Date</th> <th class="has-width-1">Date</th>
@ -1553,10 +1551,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
const tableRowElement = document.createElement('tr'); const tableRowElement = document.createElement('tr');
tableRowElement.className = 'container--lotOccupancyTransaction'; tableRowElement.className = 'container--lotOccupancyTransaction';
tableRowElement.dataset.transactionIndex = tableRowElement.dataset.transactionIndex =
lotOccupancyTransaction.transactionIndex.toString(); (_a = lotOccupancyTransaction.transactionIndex) === null || _a === void 0 ? void 0 : _a.toString();
let externalReceiptNumberHTML = ''; let externalReceiptNumberHTML = '';
if (lotOccupancyTransaction.externalReceiptNumber !== '') { if (lotOccupancyTransaction.externalReceiptNumber !== '') {
externalReceiptNumberHTML = cityssm.escapeHTML((_a = lotOccupancyTransaction.externalReceiptNumber) !== null && _a !== void 0 ? _a : ''); externalReceiptNumberHTML = cityssm.escapeHTML((_b = lotOccupancyTransaction.externalReceiptNumber) !== null && _b !== void 0 ? _b : '');
if (los.dynamicsGPIntegrationIsEnabled) { if (los.dynamicsGPIntegrationIsEnabled) {
if (lotOccupancyTransaction.dynamicsGPDocument === undefined) { if (lotOccupancyTransaction.dynamicsGPDocument === undefined) {
externalReceiptNumberHTML += ` <span data-tooltip="No Matching Document Found"> externalReceiptNumberHTML += ` <span data-tooltip="No Matching Document Found">
@ -1576,52 +1574,50 @@ Object.defineProperty(exports, "__esModule", { value: true });
} }
externalReceiptNumberHTML += '<br />'; externalReceiptNumberHTML += '<br />';
} }
tableRowElement.innerHTML = // eslint-disable-next-line no-unsanitized/property
'<td>' + tableRowElement.innerHTML = `<td>
((_b = lotOccupancyTransaction.transactionDateString) !== null && _b !== void 0 ? _b : '') + ${cityssm.escapeHTML((_c = lotOccupancyTransaction.transactionDateString) !== null && _c !== void 0 ? _c : '')}
'</td>' + </td>
('<td>' + <td>
externalReceiptNumberHTML + ${externalReceiptNumberHTML}
'<small>' + <small>${cityssm.escapeHTML((_d = lotOccupancyTransaction.transactionNote) !== null && _d !== void 0 ? _d : '')}</small>
cityssm.escapeHTML((_c = lotOccupancyTransaction.transactionNote) !== null && _c !== void 0 ? _c : '') + </td>
'</small>' + <td class="has-text-right">
'</td>') + $${cityssm.escapeHTML(lotOccupancyTransaction.transactionAmount.toFixed(2))}
('<td class="has-text-right">$' + </td>
lotOccupancyTransaction.transactionAmount.toFixed(2) + <td class="is-hidden-print">
'</td>') + <div class="buttons are-small is-flex-wrap-nowrap is-justify-content-end">
('<td class="is-hidden-print">' + <button class="button is-primary button--edit" type="button">
'<div class="buttons are-small is-flex-wrap-nowrap is-justify-content-end">' + <span class="icon"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>
'<button class="button is-primary button--edit" type="button">' + <span>Edit</span>
'<span class="icon"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>' + </button>
'<span>Edit</span>' + <button class="button is-danger is-light button--delete" data-tooltip="Delete Transaction" type="button">
'</button>' + <i class="fas fa-trash" aria-hidden="true"></i>
'<button class="button is-danger is-light button--delete" data-tooltip="Delete Transaction" type="button">' + </button>
'<i class="fas fa-trash" aria-hidden="true"></i>' + </div>
'</button>' + </td>`;
'</div>' +
'</td>');
(_d = tableRowElement
.querySelector('.button--edit')) === null || _d === void 0 ? void 0 : _d.addEventListener('click', editLotOccupancyTransaction);
(_e = tableRowElement (_e = tableRowElement
.querySelector('.button--delete')) === null || _e === void 0 ? void 0 : _e.addEventListener('click', deleteLotOccupancyTransaction); .querySelector('.button--edit')) === null || _e === void 0 ? void 0 : _e.addEventListener('click', editLotOccupancyTransaction);
lotOccupancyTransactionsContainerElement (_f = tableRowElement
.querySelector('tbody') .querySelector('.button--delete')) === null || _f === void 0 ? void 0 : _f.addEventListener('click', deleteLotOccupancyTransaction);
.append(tableRowElement); (_g = lotOccupancyTransactionsContainerElement
.querySelector('tbody')) === null || _g === void 0 ? void 0 : _g.append(tableRowElement);
} }
; ;
lotOccupancyTransactionsContainerElement.querySelector('#lotOccupancyTransactions--grandTotal').textContent = '$' + transactionGrandTotal.toFixed(2); lotOccupancyTransactionsContainerElement.querySelector('#lotOccupancyTransactions--grandTotal').textContent = '$' + transactionGrandTotal.toFixed(2);
const feeGrandTotal = getFeeGrandTotal(); const feeGrandTotal = getFeeGrandTotal();
if (feeGrandTotal.toFixed(2) !== transactionGrandTotal.toFixed(2)) { if (feeGrandTotal.toFixed(2) !== transactionGrandTotal.toFixed(2)) {
lotOccupancyTransactionsContainerElement.insertAdjacentHTML('afterbegin', '<div class="message is-warning">' + lotOccupancyTransactionsContainerElement.insertAdjacentHTML('afterbegin', `<div class="message is-warning">
'<div class="message-body">' + <div class="message-body">
'<div class="level">' + <div class="level">
'<div class="level-left"><div class="level-item">Outstanding Balance</div></div>' + <div class="level-left">
'<div class="level-right"><div class="level-item">$' + <div class="level-item">Outstanding Balance</div>
(feeGrandTotal - transactionGrandTotal).toFixed(2) + </div>
'</div></div>' + <div class="level-right">
'</div>' + <div class="level-item">$${cityssm.escapeHTML((feeGrandTotal - transactionGrandTotal).toFixed(2))}</div>
'</div>' + </div>
'</div>'); </div>
</div></div>`);
} }
} }
const addTransactionButtonElement = document.querySelector('#button--addTransaction'); const addTransactionButtonElement = document.querySelector('#button--addTransaction');
@ -1631,7 +1627,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
let addCloseModalFunction; let addCloseModalFunction;
function doAddTransaction(submitEvent) { function doAddTransaction(submitEvent) {
submitEvent.preventDefault(); submitEvent.preventDefault();
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doAddLotOccupancyTransaction', submitEvent.currentTarget, (rawResponseJSON) => { cityssm.postJSON(`${los.urlPrefix}/lotOccupancies/doAddLotOccupancyTransaction`, submitEvent.currentTarget, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON; const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
@ -1650,19 +1646,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
} }
// eslint-disable-next-line @typescript-eslint/naming-convention // eslint-disable-next-line @typescript-eslint/naming-convention
function dynamicsGP_refreshExternalReceiptNumberIcon() { function dynamicsGP_refreshExternalReceiptNumberIcon() {
var _a, _b;
const externalReceiptNumber = externalReceiptNumberElement.value; const externalReceiptNumber = externalReceiptNumberElement.value;
const iconElement = externalReceiptNumberElement const iconElement = (_a = externalReceiptNumberElement
.closest('.control') .closest('.control')) === null || _a === void 0 ? void 0 : _a.querySelector('.icon');
.querySelector('.icon'); const helpTextElement = (_b = externalReceiptNumberElement
const helpTextElement = externalReceiptNumberElement .closest('.field')) === null || _b === void 0 ? void 0 : _b.querySelector('.help');
.closest('.field')
.querySelector('.help');
if (externalReceiptNumber === '') { if (externalReceiptNumber === '') {
helpTextElement.innerHTML = '&nbsp;'; helpTextElement.innerHTML = '&nbsp;';
iconElement.innerHTML = '<i class="fas fa-minus" aria-hidden="true"></i>'; iconElement.innerHTML = '<i class="fas fa-minus" aria-hidden="true"></i>';
return; return;
} }
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doGetDynamicsGPDocument', { cityssm.postJSON(`${los.urlPrefix}/lotOccupancies/doGetDynamicsGPDocument`, {
externalReceiptNumber externalReceiptNumber
}, (rawResponseJSON) => { }, (rawResponseJSON) => {
const responseJSON = rawResponseJSON; const responseJSON = rawResponseJSON;
@ -1698,7 +1693,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
transactionAmountElement.max = Math.max(feeGrandTotal - transactionGrandTotal, 0).toFixed(2); transactionAmountElement.max = Math.max(feeGrandTotal - transactionGrandTotal, 0).toFixed(2);
transactionAmountElement.value = Math.max(feeGrandTotal - transactionGrandTotal, 0).toFixed(2); transactionAmountElement.value = Math.max(feeGrandTotal - transactionGrandTotal, 0).toFixed(2);
if (los.dynamicsGPIntegrationIsEnabled) { if (los.dynamicsGPIntegrationIsEnabled) {
externalReceiptNumberElement = modalElement.querySelector('#lotOccupancyTransactionAdd--externalReceiptNumber'); externalReceiptNumberElement = modalElement.querySelector(
// eslint-disable-next-line no-secrets/no-secrets
'#lotOccupancyTransactionAdd--externalReceiptNumber');
const externalReceiptNumberControlElement = externalReceiptNumberElement.closest('.control'); const externalReceiptNumberControlElement = externalReceiptNumberElement.closest('.control');
externalReceiptNumberControlElement.classList.add('has-icons-right'); externalReceiptNumberControlElement.classList.add('has-icons-right');
externalReceiptNumberControlElement.insertAdjacentHTML('beforeend', '<span class="icon is-small is-right"></span>'); externalReceiptNumberControlElement.insertAdjacentHTML('beforeend', '<span class="icon is-small is-right"></span>');
@ -1709,12 +1706,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
} }
}, },
onshown(modalElement, closeModalFunction) { onshown(modalElement, closeModalFunction) {
var _a;
bulmaJS.toggleHtmlClipped(); bulmaJS.toggleHtmlClipped();
transactionAmountElement.focus(); transactionAmountElement.focus();
addCloseModalFunction = closeModalFunction; addCloseModalFunction = closeModalFunction;
modalElement (_a = modalElement
.querySelector('form') .querySelector('form')) === null || _a === void 0 ? void 0 : _a.addEventListener('submit', doAddTransaction);
.addEventListener('submit', doAddTransaction);
}, },
onremoved() { onremoved() {
bulmaJS.toggleHtmlClipped(); bulmaJS.toggleHtmlClipped();

View File

@ -311,9 +311,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
lotSelectCloseModalFunction(); lotSelectCloseModalFunction();
} }
function selectExistingLot(clickEvent) { function selectExistingLot(clickEvent) {
var _a, _b;
clickEvent.preventDefault(); clickEvent.preventDefault();
const selectedLotElement = clickEvent.currentTarget; const selectedLotElement = clickEvent.currentTarget;
renderSelectedLotAndClose(selectedLotElement.dataset.lotId, selectedLotElement.dataset.lotName); renderSelectedLotAndClose((_a = selectedLotElement.dataset.lotId) !== null && _a !== void 0 ? _a : '', (_b = selectedLotElement.dataset.lotName) !== null && _b !== void 0 ? _b : '');
} }
function searchLots() { function searchLots() {
// eslint-disable-next-line no-unsanitized/property // eslint-disable-next-line no-unsanitized/property

View File

@ -474,8 +474,8 @@ declare const exports: Record<string, unknown>
const selectedLotElement = clickEvent.currentTarget as HTMLElement const selectedLotElement = clickEvent.currentTarget as HTMLElement
renderSelectedLotAndClose( renderSelectedLotAndClose(
selectedLotElement.dataset.lotId!, selectedLotElement.dataset.lotId ?? '',
selectedLotElement.dataset.lotName! selectedLotElement.dataset.lotName ?? ''
) )
} }

View File

@ -1,4 +1,5 @@
"use strict"; "use strict";
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */ /* eslint-disable unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
let lotOccupancyFees = exports.lotOccupancyFees; let lotOccupancyFees = exports.lotOccupancyFees;
@ -14,15 +15,15 @@ function getFeeGrandTotal() {
return feeGrandTotal; return feeGrandTotal;
} }
function editLotOccupancyFeeQuantity(clickEvent) { function editLotOccupancyFeeQuantity(clickEvent) {
const feeId = Number.parseInt(clickEvent.currentTarget.closest('tr').dataset var _a, _b;
.feeId, 10); const feeId = Number.parseInt((_b = (_a = clickEvent.currentTarget.closest('tr')) === null || _a === void 0 ? void 0 : _a.dataset.feeId) !== null && _b !== void 0 ? _b : '', 10);
const fee = lotOccupancyFees.find((possibleFee) => { const fee = lotOccupancyFees.find((possibleFee) => {
return possibleFee.feeId === feeId; return possibleFee.feeId === feeId;
}); });
let updateCloseModalFunction; let updateCloseModalFunction;
function doUpdateQuantity(formEvent) { function doUpdateQuantity(formEvent) {
formEvent.preventDefault(); formEvent.preventDefault();
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doUpdateLotOccupancyFeeQuantity', formEvent.currentTarget, (rawResponseJSON) => { cityssm.postJSON(`${los.urlPrefix}/lotOccupancies/doUpdateLotOccupancyFeeQuantity`, formEvent.currentTarget, (rawResponseJSON) => {
const responseJSON = rawResponseJSON; const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
lotOccupancyFees = responseJSON.lotOccupancyFees; lotOccupancyFees = responseJSON.lotOccupancyFees;
@ -40,11 +41,12 @@ function editLotOccupancyFeeQuantity(clickEvent) {
} }
cityssm.openHtmlModal('lotOccupancy-editFeeQuantity', { cityssm.openHtmlModal('lotOccupancy-editFeeQuantity', {
onshow(modalElement) { onshow(modalElement) {
var _a, _b;
; ;
modalElement.querySelector('#lotOccupancyFeeQuantity--lotOccupancyId').value = lotOccupancyId; modalElement.querySelector('#lotOccupancyFeeQuantity--lotOccupancyId').value = lotOccupancyId;
modalElement.querySelector('#lotOccupancyFeeQuantity--feeId').value = fee.feeId.toString(); modalElement.querySelector('#lotOccupancyFeeQuantity--feeId').value = fee.feeId.toString();
modalElement.querySelector('#lotOccupancyFeeQuantity--quantity').valueAsNumber = fee.quantity; modalElement.querySelector('#lotOccupancyFeeQuantity--quantity').valueAsNumber = (_a = fee.quantity) !== null && _a !== void 0 ? _a : 0;
modalElement.querySelector('#lotOccupancyFeeQuantity--quantityUnit').textContent = fee.quantityUnit; modalElement.querySelector('#lotOccupancyFeeQuantity--quantityUnit').textContent = (_b = fee.quantityUnit) !== null && _b !== void 0 ? _b : '';
}, },
onshown(modalElement, closeModalFunction) { onshown(modalElement, closeModalFunction) {
var _a; var _a;
@ -62,7 +64,7 @@ function editLotOccupancyFeeQuantity(clickEvent) {
function deleteLotOccupancyFee(clickEvent) { function deleteLotOccupancyFee(clickEvent) {
const feeId = clickEvent.currentTarget.closest('.container--lotOccupancyFee').dataset.feeId; const feeId = clickEvent.currentTarget.closest('.container--lotOccupancyFee').dataset.feeId;
function doDelete() { function doDelete() {
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doDeleteLotOccupancyFee', { cityssm.postJSON(`${los.urlPrefix}/lotOccupancies/doDeleteLotOccupancyFee`, {
lotOccupancyId, lotOccupancyId,
feeId feeId
}, (rawResponseJSON) => { }, (rawResponseJSON) => {
@ -92,7 +94,7 @@ function deleteLotOccupancyFee(clickEvent) {
}); });
} }
function renderLotOccupancyFees() { function renderLotOccupancyFees() {
var _a, _b, _c, _d, _e, _f, _g; var _a, _b, _c, _d, _e, _f, _g, _h, _j;
if (lotOccupancyFees.length === 0) { if (lotOccupancyFees.length === 0) {
lotOccupancyFeesContainerElement.innerHTML = `<div class="message is-info"> lotOccupancyFeesContainerElement.innerHTML = `<div class="message is-info">
<p class="message-body">There are no fees associated with this record.</p> <p class="message-body">There are no fees associated with this record.</p>
@ -100,6 +102,7 @@ function renderLotOccupancyFees() {
renderLotOccupancyTransactions(); renderLotOccupancyTransactions();
return; return;
} }
// eslint-disable-next-line no-secrets/no-secrets
lotOccupancyFeesContainerElement.innerHTML = `<table class="table is-fullwidth is-striped is-hoverable"> lotOccupancyFeesContainerElement.innerHTML = `<table class="table is-fullwidth is-striped is-hoverable">
<thead><tr> <thead><tr>
<th>Fee</th> <th>Fee</th>
@ -132,45 +135,41 @@ function renderLotOccupancyFees() {
tableRowElement.dataset.feeId = lotOccupancyFee.feeId.toString(); tableRowElement.dataset.feeId = lotOccupancyFee.feeId.toString();
tableRowElement.dataset.includeQuantity = tableRowElement.dataset.includeQuantity =
((_a = lotOccupancyFee.includeQuantity) !== null && _a !== void 0 ? _a : false) ? '1' : '0'; ((_a = lotOccupancyFee.includeQuantity) !== null && _a !== void 0 ? _a : false) ? '1' : '0';
tableRowElement.innerHTML = // eslint-disable-next-line no-unsanitized/property
'<td colspan="' + tableRowElement.innerHTML = `<td colspan="${lotOccupancyFee.quantity === 1 ? '5' : '1'}">
(lotOccupancyFee.quantity === 1 ? '5' : '1') + ${cityssm.escapeHTML((_b = lotOccupancyFee.feeName) !== null && _b !== void 0 ? _b : '')}<br />
'">' + <span class="tag">${cityssm.escapeHTML((_c = lotOccupancyFee.feeCategory) !== null && _c !== void 0 ? _c : '')}</span>
cityssm.escapeHTML((_b = lotOccupancyFee.feeName) !== null && _b !== void 0 ? _b : '') + </td>
'<br />' + ${lotOccupancyFee.quantity === 1
'<span class="tag">' +
cityssm.escapeHTML((_c = lotOccupancyFee.feeCategory) !== null && _c !== void 0 ? _c : '') +
'</span>' +
'</td>' +
(lotOccupancyFee.quantity === 1
? '' ? ''
: '<td class="has-text-right">$' + : `<td class="has-text-right">
lotOccupancyFee.feeAmount.toFixed(2) + $${(_d = lotOccupancyFee.feeAmount) === null || _d === void 0 ? void 0 : _d.toFixed(2)}
'</td>' + </td>
'<td>&times;</td>' + <td>&times;</td>
'<td class="has-text-right">' + <td class="has-text-right">${(_e = lotOccupancyFee.quantity) === null || _e === void 0 ? void 0 : _e.toString()}</td>
lotOccupancyFee.quantity.toString() + <td>=</td>`}
'</td>' + <td class="has-text-right">
'<td>=</td>') + $${(lotOccupancyFee.feeAmount * lotOccupancyFee.quantity).toFixed(2)}
'<td class="has-text-right">$' + </td>
(lotOccupancyFee.feeAmount * lotOccupancyFee.quantity).toFixed(2) + <td class="is-hidden-print">
'</td>' + <div class="buttons are-small is-flex-wrap-nowrap is-justify-content-end">
('<td class="is-hidden-print">' + ${((_f = lotOccupancyFee.includeQuantity) !== null && _f !== void 0 ? _f : false)
'<div class="buttons are-small is-flex-wrap-nowrap is-justify-content-end">' + ? `<button class="button is-primary button--editQuantity">
(((_d = lotOccupancyFee.includeQuantity) !== null && _d !== void 0 ? _d : false) <span class="icon is-small"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>
? '<button class="button is-primary button--editQuantity"><span class="icon is-small"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span><span>Edit</span></button>' <span>Edit</span>
: '') + </button>`
'<button class="button is-danger is-light button--delete" data-tooltip="Delete Fee" type="button">' + : ''}
'<i class="fas fa-trash" aria-hidden="true"></i>' + <button class="button is-danger is-light button--delete" data-tooltip="Delete Fee" type="button">
'</button>' + <i class="fas fa-trash" aria-hidden="true"></i>
'</div>' + </button>
'</td>'); </div>
(_e = tableRowElement </td>`;
.querySelector('.button--editQuantity')) === null || _e === void 0 ? void 0 : _e.addEventListener('click', editLotOccupancyFeeQuantity); (_g = tableRowElement
(_f = tableRowElement .querySelector('.button--editQuantity')) === null || _g === void 0 ? void 0 : _g.addEventListener('click', editLotOccupancyFeeQuantity);
.querySelector('.button--delete')) === null || _f === void 0 ? void 0 : _f.addEventListener('click', deleteLotOccupancyFee); (_h = tableRowElement
(_g = lotOccupancyFeesContainerElement .querySelector('.button--delete')) === null || _h === void 0 ? void 0 : _h.addEventListener('click', deleteLotOccupancyFee);
.querySelector('tbody')) === null || _g === void 0 ? void 0 : _g.append(tableRowElement); (_j = lotOccupancyFeesContainerElement
.querySelector('tbody')) === null || _j === void 0 ? void 0 : _j.append(tableRowElement);
feeAmountTotal += lotOccupancyFee.feeAmount * lotOccupancyFee.quantity; feeAmountTotal += lotOccupancyFee.feeAmount * lotOccupancyFee.quantity;
taxAmountTotal += lotOccupancyFee.taxAmount * lotOccupancyFee.quantity; taxAmountTotal += lotOccupancyFee.taxAmount * lotOccupancyFee.quantity;
} }
@ -193,7 +192,7 @@ addFeeButtonElement.addEventListener('click', () => {
let feeFilterElement; let feeFilterElement;
let feeFilterResultsElement; let feeFilterResultsElement;
function doAddFee(feeId, quantity = 1) { function doAddFee(feeId, quantity = 1) {
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doAddLotOccupancyFee', { cityssm.postJSON(`${los.urlPrefix}/lotOccupancies/doAddLotOccupancyFee`, {
lotOccupancyId, lotOccupancyId,
feeId, feeId,
quantity quantity
@ -224,30 +223,31 @@ addFeeButtonElement.addEventListener('click', () => {
} }
cityssm.openHtmlModal('lotOccupancy-setFeeQuantity', { cityssm.openHtmlModal('lotOccupancy-setFeeQuantity', {
onshow(modalElement) { onshow(modalElement) {
var _a;
; ;
modalElement.querySelector('#lotOccupancyFeeQuantity--quantityUnit').textContent = fee.quantityUnit; modalElement.querySelector('#lotOccupancyFeeQuantity--quantityUnit').textContent = (_a = fee.quantityUnit) !== null && _a !== void 0 ? _a : '';
}, },
onshown(modalElement, closeModalFunction) { onshown(modalElement, closeModalFunction) {
var _a;
quantityCloseModalFunction = closeModalFunction; quantityCloseModalFunction = closeModalFunction;
quantityElement = modalElement.querySelector('#lotOccupancyFeeQuantity--quantity'); quantityElement = modalElement.querySelector('#lotOccupancyFeeQuantity--quantity');
modalElement (_a = modalElement
.querySelector('form') .querySelector('form')) === null || _a === void 0 ? void 0 : _a.addEventListener('submit', doSetQuantity);
.addEventListener('submit', doSetQuantity);
} }
}); });
} }
function tryAddFee(clickEvent) { function tryAddFee(clickEvent) {
var _a; var _a, _b, _c;
clickEvent.preventDefault(); clickEvent.preventDefault();
const feeId = Number.parseInt(clickEvent.currentTarget.dataset.feeId, 10); const feeId = Number.parseInt((_a = clickEvent.currentTarget.dataset.feeId) !== null && _a !== void 0 ? _a : '', 10);
const feeCategoryId = Number.parseInt(clickEvent.currentTarget.dataset.feeCategoryId, 10); const feeCategoryId = Number.parseInt((_b = clickEvent.currentTarget.dataset.feeCategoryId) !== null && _b !== void 0 ? _b : '', 10);
const feeCategory = feeCategories.find((currentFeeCategory) => { const feeCategory = feeCategories.find((currentFeeCategory) => {
return currentFeeCategory.feeCategoryId === feeCategoryId; return currentFeeCategory.feeCategoryId === feeCategoryId;
}); });
const fee = feeCategory.fees.find((currentFee) => { const fee = feeCategory.fees.find((currentFee) => {
return currentFee.feeId === feeId; return currentFee.feeId === feeId;
}); });
if ((_a = fee.includeQuantity) !== null && _a !== void 0 ? _a : false) { if ((_c = fee.includeQuantity) !== null && _c !== void 0 ? _c : false) {
doSetQuantityAndAddFee(fee); doSetQuantityAndAddFee(fee);
} }
else { else {
@ -266,11 +266,8 @@ addFeeButtonElement.addEventListener('click', () => {
categoryContainerElement.className = 'container--feeCategory'; categoryContainerElement.className = 'container--feeCategory';
categoryContainerElement.dataset.feeCategoryId = categoryContainerElement.dataset.feeCategoryId =
feeCategory.feeCategoryId.toString(); feeCategory.feeCategoryId.toString();
categoryContainerElement.innerHTML = categoryContainerElement.innerHTML = `<h4 class="title is-5 mt-2">${cityssm.escapeHTML((_a = feeCategory.feeCategory) !== null && _a !== void 0 ? _a : '')}</h4>
'<h4 class="title is-5 mt-2">' + <div class="panel mb-5"></div>`;
cityssm.escapeHTML((_a = feeCategory.feeCategory) !== null && _a !== void 0 ? _a : '') +
'</h4>' +
'<div class="panel mb-5"></div>';
let hasFees = false; let hasFees = false;
for (const fee of feeCategory.fees) { for (const fee of feeCategory.fees) {
// Don't include already applied fees that limit quantity // Don't include already applied fees that limit quantity
@ -278,11 +275,7 @@ addFeeButtonElement.addEventListener('click', () => {
continue; continue;
} }
let includeFee = true; let includeFee = true;
const feeSearchString = (((_b = feeCategory.feeCategory) !== null && _b !== void 0 ? _b : '') + const feeSearchString = `${(_b = feeCategory.feeCategory) !== null && _b !== void 0 ? _b : ''} ${(_c = fee.feeName) !== null && _c !== void 0 ? _c : ''} ${(_d = fee.feeDescription) !== null && _d !== void 0 ? _d : ''}`.toLowerCase();
' ' +
((_c = fee.feeName) !== null && _c !== void 0 ? _c : '') +
' ' +
((_d = fee.feeDescription) !== null && _d !== void 0 ? _d : '')).toLowerCase();
for (const filterStringPiece of filterStringPieces) { for (const filterStringPiece of filterStringPieces) {
if (!feeSearchString.includes(filterStringPiece)) { if (!feeSearchString.includes(filterStringPiece)) {
includeFee = false; includeFee = false;
@ -299,15 +292,13 @@ addFeeButtonElement.addEventListener('click', () => {
panelBlockElement.dataset.feeCategoryId = panelBlockElement.dataset.feeCategoryId =
feeCategory.feeCategoryId.toString(); feeCategory.feeCategoryId.toString();
panelBlockElement.href = '#'; panelBlockElement.href = '#';
panelBlockElement.innerHTML = // eslint-disable-next-line no-unsanitized/property
'<strong>' + panelBlockElement.innerHTML = `<strong>${cityssm.escapeHTML((_e = fee.feeName) !== null && _e !== void 0 ? _e : '')}</strong><br />
cityssm.escapeHTML((_e = fee.feeName) !== null && _e !== void 0 ? _e : '') + <small>
'</strong><br />' + ${cityssm
'<small>' +
cityssm
.escapeHTML((_f = fee.feeDescription) !== null && _f !== void 0 ? _f : '') .escapeHTML((_f = fee.feeDescription) !== null && _f !== void 0 ? _f : '')
.replace(/\n/g, '<br />') + .replaceAll('\n', '<br />')}
'</small>'; </small>`;
panelBlockElement.addEventListener('click', tryAddFee); panelBlockElement.addEventListener('click', tryAddFee);
categoryContainerElement.querySelector('.panel').append(panelBlockElement); categoryContainerElement.querySelector('.panel').append(panelBlockElement);
} }
@ -320,7 +311,7 @@ addFeeButtonElement.addEventListener('click', () => {
onshow(modalElement) { onshow(modalElement) {
feeFilterElement = modalElement.querySelector('#feeSelect--feeName'); feeFilterElement = modalElement.querySelector('#feeSelect--feeName');
feeFilterResultsElement = modalElement.querySelector('#resultsContainer--feeSelect'); feeFilterResultsElement = modalElement.querySelector('#resultsContainer--feeSelect');
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doGetFees', { cityssm.postJSON(`${los.urlPrefix}/lotOccupancies/doGetFees`, {
lotOccupancyId lotOccupancyId
}, (rawResponseJSON) => { }, (rawResponseJSON) => {
const responseJSON = rawResponseJSON; const responseJSON = rawResponseJSON;
@ -354,15 +345,15 @@ function getTransactionGrandTotal() {
return transactionGrandTotal; return transactionGrandTotal;
} }
function editLotOccupancyTransaction(clickEvent) { function editLotOccupancyTransaction(clickEvent) {
const transactionIndex = Number.parseInt(clickEvent.currentTarget.closest('tr').dataset var _a, _b;
.transactionIndex, 10); const transactionIndex = Number.parseInt((_b = (_a = clickEvent.currentTarget.closest('tr')) === null || _a === void 0 ? void 0 : _a.dataset.transactionIndex) !== null && _b !== void 0 ? _b : '', 10);
const transaction = lotOccupancyTransactions.find((possibleTransaction) => { const transaction = lotOccupancyTransactions.find((possibleTransaction) => {
return possibleTransaction.transactionIndex === transactionIndex; return possibleTransaction.transactionIndex === transactionIndex;
}); });
let editCloseModalFunction; let editCloseModalFunction;
function doEdit(formEvent) { function doEdit(formEvent) {
formEvent.preventDefault(); formEvent.preventDefault();
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doUpdateLotOccupancyTransaction', formEvent.currentTarget, (rawResponseJSON) => { cityssm.postJSON(`${los.urlPrefix}/lotOccupancies/doUpdateLotOccupancyTransaction`, formEvent.currentTarget, (rawResponseJSON) => {
const responseJSON = rawResponseJSON; const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
lotOccupancyTransactions = responseJSON.lotOccupancyTransactions; lotOccupancyTransactions = responseJSON.lotOccupancyTransactions;
@ -380,15 +371,15 @@ function editLotOccupancyTransaction(clickEvent) {
} }
cityssm.openHtmlModal('lotOccupancy-editTransaction', { cityssm.openHtmlModal('lotOccupancy-editTransaction', {
onshow(modalElement) { onshow(modalElement) {
var _a, _b, _c, _d; var _a, _b, _c, _d, _e, _f;
los.populateAliases(modalElement); los.populateAliases(modalElement);
modalElement.querySelector('#lotOccupancyTransactionEdit--lotOccupancyId').value = lotOccupancyId; modalElement.querySelector('#lotOccupancyTransactionEdit--lotOccupancyId').value = lotOccupancyId;
modalElement.querySelector('#lotOccupancyTransactionEdit--transactionIndex').value = transaction.transactionIndex.toString(); modalElement.querySelector('#lotOccupancyTransactionEdit--transactionIndex').value = (_b = (_a = transaction.transactionIndex) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '';
modalElement.querySelector('#lotOccupancyTransactionEdit--transactionAmount').value = transaction.transactionAmount.toFixed(2); modalElement.querySelector('#lotOccupancyTransactionEdit--transactionAmount').value = transaction.transactionAmount.toFixed(2);
modalElement.querySelector('#lotOccupancyTransactionEdit--externalReceiptNumber').value = (_a = transaction.externalReceiptNumber) !== null && _a !== void 0 ? _a : ''; modalElement.querySelector('#lotOccupancyTransactionEdit--externalReceiptNumber').value = (_c = transaction.externalReceiptNumber) !== null && _c !== void 0 ? _c : '';
modalElement.querySelector('#lotOccupancyTransactionEdit--transactionNote').value = (_b = transaction.transactionNote) !== null && _b !== void 0 ? _b : ''; modalElement.querySelector('#lotOccupancyTransactionEdit--transactionNote').value = (_d = transaction.transactionNote) !== null && _d !== void 0 ? _d : '';
modalElement.querySelector('#lotOccupancyTransactionEdit--transactionDateString').value = (_c = transaction.transactionDateString) !== null && _c !== void 0 ? _c : ''; modalElement.querySelector('#lotOccupancyTransactionEdit--transactionDateString').value = (_e = transaction.transactionDateString) !== null && _e !== void 0 ? _e : '';
modalElement.querySelector('#lotOccupancyTransactionEdit--transactionTimeString').value = (_d = transaction.transactionTimeString) !== null && _d !== void 0 ? _d : ''; modalElement.querySelector('#lotOccupancyTransactionEdit--transactionTimeString').value = (_f = transaction.transactionTimeString) !== null && _f !== void 0 ? _f : '';
}, },
onshown(modalElement, closeModalFunction) { onshown(modalElement, closeModalFunction) {
var _a; var _a;
@ -406,7 +397,7 @@ function editLotOccupancyTransaction(clickEvent) {
function deleteLotOccupancyTransaction(clickEvent) { function deleteLotOccupancyTransaction(clickEvent) {
const transactionIndex = clickEvent.currentTarget.closest('.container--lotOccupancyTransaction').dataset.transactionIndex; const transactionIndex = clickEvent.currentTarget.closest('.container--lotOccupancyTransaction').dataset.transactionIndex;
function doDelete() { function doDelete() {
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doDeleteLotOccupancyTransaction', { cityssm.postJSON(`${los.urlPrefix}/lotOccupancies/doDeleteLotOccupancyTransaction`, {
lotOccupancyId, lotOccupancyId,
transactionIndex transactionIndex
}, (rawResponseJSON) => { }, (rawResponseJSON) => {
@ -436,16 +427,15 @@ function deleteLotOccupancyTransaction(clickEvent) {
}); });
} }
function renderLotOccupancyTransactions() { function renderLotOccupancyTransactions() {
var _a, _b, _c, _d, _e; var _a, _b, _c, _d, _e, _f, _g;
if (lotOccupancyTransactions.length === 0) { if (lotOccupancyTransactions.length === 0) {
lotOccupancyTransactionsContainerElement.innerHTML = // eslint-disable-next-line no-unsanitized/property
'<div class="message ' + lotOccupancyTransactionsContainerElement.innerHTML = `<div class="message ${lotOccupancyFees.length === 0 ? 'is-info' : 'is-warning'}">
(lotOccupancyFees.length === 0 ? 'is-info' : 'is-warning') + <p class="message-body">There are no transactions associated with this record.</p>
'">' + </div>`;
'<p class="message-body">There are no transactions associated with this record.</p>' +
'</div>';
return; return;
} }
// eslint-disable-next-line no-unsanitized/property
lotOccupancyTransactionsContainerElement.innerHTML = `<table class="table is-fullwidth is-striped is-hoverable"> lotOccupancyTransactionsContainerElement.innerHTML = `<table class="table is-fullwidth is-striped is-hoverable">
<thead><tr> <thead><tr>
<th class="has-width-1">Date</th> <th class="has-width-1">Date</th>
@ -466,10 +456,10 @@ function renderLotOccupancyTransactions() {
const tableRowElement = document.createElement('tr'); const tableRowElement = document.createElement('tr');
tableRowElement.className = 'container--lotOccupancyTransaction'; tableRowElement.className = 'container--lotOccupancyTransaction';
tableRowElement.dataset.transactionIndex = tableRowElement.dataset.transactionIndex =
lotOccupancyTransaction.transactionIndex.toString(); (_a = lotOccupancyTransaction.transactionIndex) === null || _a === void 0 ? void 0 : _a.toString();
let externalReceiptNumberHTML = ''; let externalReceiptNumberHTML = '';
if (lotOccupancyTransaction.externalReceiptNumber !== '') { if (lotOccupancyTransaction.externalReceiptNumber !== '') {
externalReceiptNumberHTML = cityssm.escapeHTML((_a = lotOccupancyTransaction.externalReceiptNumber) !== null && _a !== void 0 ? _a : ''); externalReceiptNumberHTML = cityssm.escapeHTML((_b = lotOccupancyTransaction.externalReceiptNumber) !== null && _b !== void 0 ? _b : '');
if (los.dynamicsGPIntegrationIsEnabled) { if (los.dynamicsGPIntegrationIsEnabled) {
if (lotOccupancyTransaction.dynamicsGPDocument === undefined) { if (lotOccupancyTransaction.dynamicsGPDocument === undefined) {
externalReceiptNumberHTML += ` <span data-tooltip="No Matching Document Found"> externalReceiptNumberHTML += ` <span data-tooltip="No Matching Document Found">
@ -489,52 +479,50 @@ function renderLotOccupancyTransactions() {
} }
externalReceiptNumberHTML += '<br />'; externalReceiptNumberHTML += '<br />';
} }
tableRowElement.innerHTML = // eslint-disable-next-line no-unsanitized/property
'<td>' + tableRowElement.innerHTML = `<td>
((_b = lotOccupancyTransaction.transactionDateString) !== null && _b !== void 0 ? _b : '') + ${cityssm.escapeHTML((_c = lotOccupancyTransaction.transactionDateString) !== null && _c !== void 0 ? _c : '')}
'</td>' + </td>
('<td>' + <td>
externalReceiptNumberHTML + ${externalReceiptNumberHTML}
'<small>' + <small>${cityssm.escapeHTML((_d = lotOccupancyTransaction.transactionNote) !== null && _d !== void 0 ? _d : '')}</small>
cityssm.escapeHTML((_c = lotOccupancyTransaction.transactionNote) !== null && _c !== void 0 ? _c : '') + </td>
'</small>' + <td class="has-text-right">
'</td>') + $${cityssm.escapeHTML(lotOccupancyTransaction.transactionAmount.toFixed(2))}
('<td class="has-text-right">$' + </td>
lotOccupancyTransaction.transactionAmount.toFixed(2) + <td class="is-hidden-print">
'</td>') + <div class="buttons are-small is-flex-wrap-nowrap is-justify-content-end">
('<td class="is-hidden-print">' + <button class="button is-primary button--edit" type="button">
'<div class="buttons are-small is-flex-wrap-nowrap is-justify-content-end">' + <span class="icon"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>
'<button class="button is-primary button--edit" type="button">' + <span>Edit</span>
'<span class="icon"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>' + </button>
'<span>Edit</span>' + <button class="button is-danger is-light button--delete" data-tooltip="Delete Transaction" type="button">
'</button>' + <i class="fas fa-trash" aria-hidden="true"></i>
'<button class="button is-danger is-light button--delete" data-tooltip="Delete Transaction" type="button">' + </button>
'<i class="fas fa-trash" aria-hidden="true"></i>' + </div>
'</button>' + </td>`;
'</div>' +
'</td>');
(_d = tableRowElement
.querySelector('.button--edit')) === null || _d === void 0 ? void 0 : _d.addEventListener('click', editLotOccupancyTransaction);
(_e = tableRowElement (_e = tableRowElement
.querySelector('.button--delete')) === null || _e === void 0 ? void 0 : _e.addEventListener('click', deleteLotOccupancyTransaction); .querySelector('.button--edit')) === null || _e === void 0 ? void 0 : _e.addEventListener('click', editLotOccupancyTransaction);
lotOccupancyTransactionsContainerElement (_f = tableRowElement
.querySelector('tbody') .querySelector('.button--delete')) === null || _f === void 0 ? void 0 : _f.addEventListener('click', deleteLotOccupancyTransaction);
.append(tableRowElement); (_g = lotOccupancyTransactionsContainerElement
.querySelector('tbody')) === null || _g === void 0 ? void 0 : _g.append(tableRowElement);
} }
; ;
lotOccupancyTransactionsContainerElement.querySelector('#lotOccupancyTransactions--grandTotal').textContent = '$' + transactionGrandTotal.toFixed(2); lotOccupancyTransactionsContainerElement.querySelector('#lotOccupancyTransactions--grandTotal').textContent = '$' + transactionGrandTotal.toFixed(2);
const feeGrandTotal = getFeeGrandTotal(); const feeGrandTotal = getFeeGrandTotal();
if (feeGrandTotal.toFixed(2) !== transactionGrandTotal.toFixed(2)) { if (feeGrandTotal.toFixed(2) !== transactionGrandTotal.toFixed(2)) {
lotOccupancyTransactionsContainerElement.insertAdjacentHTML('afterbegin', '<div class="message is-warning">' + lotOccupancyTransactionsContainerElement.insertAdjacentHTML('afterbegin', `<div class="message is-warning">
'<div class="message-body">' + <div class="message-body">
'<div class="level">' + <div class="level">
'<div class="level-left"><div class="level-item">Outstanding Balance</div></div>' + <div class="level-left">
'<div class="level-right"><div class="level-item">$' + <div class="level-item">Outstanding Balance</div>
(feeGrandTotal - transactionGrandTotal).toFixed(2) + </div>
'</div></div>' + <div class="level-right">
'</div>' + <div class="level-item">$${cityssm.escapeHTML((feeGrandTotal - transactionGrandTotal).toFixed(2))}</div>
'</div>' + </div>
'</div>'); </div>
</div></div>`);
} }
} }
const addTransactionButtonElement = document.querySelector('#button--addTransaction'); const addTransactionButtonElement = document.querySelector('#button--addTransaction');
@ -544,7 +532,7 @@ addTransactionButtonElement.addEventListener('click', () => {
let addCloseModalFunction; let addCloseModalFunction;
function doAddTransaction(submitEvent) { function doAddTransaction(submitEvent) {
submitEvent.preventDefault(); submitEvent.preventDefault();
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doAddLotOccupancyTransaction', submitEvent.currentTarget, (rawResponseJSON) => { cityssm.postJSON(`${los.urlPrefix}/lotOccupancies/doAddLotOccupancyTransaction`, submitEvent.currentTarget, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON; const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
@ -563,19 +551,18 @@ addTransactionButtonElement.addEventListener('click', () => {
} }
// eslint-disable-next-line @typescript-eslint/naming-convention // eslint-disable-next-line @typescript-eslint/naming-convention
function dynamicsGP_refreshExternalReceiptNumberIcon() { function dynamicsGP_refreshExternalReceiptNumberIcon() {
var _a, _b;
const externalReceiptNumber = externalReceiptNumberElement.value; const externalReceiptNumber = externalReceiptNumberElement.value;
const iconElement = externalReceiptNumberElement const iconElement = (_a = externalReceiptNumberElement
.closest('.control') .closest('.control')) === null || _a === void 0 ? void 0 : _a.querySelector('.icon');
.querySelector('.icon'); const helpTextElement = (_b = externalReceiptNumberElement
const helpTextElement = externalReceiptNumberElement .closest('.field')) === null || _b === void 0 ? void 0 : _b.querySelector('.help');
.closest('.field')
.querySelector('.help');
if (externalReceiptNumber === '') { if (externalReceiptNumber === '') {
helpTextElement.innerHTML = '&nbsp;'; helpTextElement.innerHTML = '&nbsp;';
iconElement.innerHTML = '<i class="fas fa-minus" aria-hidden="true"></i>'; iconElement.innerHTML = '<i class="fas fa-minus" aria-hidden="true"></i>';
return; return;
} }
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doGetDynamicsGPDocument', { cityssm.postJSON(`${los.urlPrefix}/lotOccupancies/doGetDynamicsGPDocument`, {
externalReceiptNumber externalReceiptNumber
}, (rawResponseJSON) => { }, (rawResponseJSON) => {
const responseJSON = rawResponseJSON; const responseJSON = rawResponseJSON;
@ -611,7 +598,9 @@ addTransactionButtonElement.addEventListener('click', () => {
transactionAmountElement.max = Math.max(feeGrandTotal - transactionGrandTotal, 0).toFixed(2); transactionAmountElement.max = Math.max(feeGrandTotal - transactionGrandTotal, 0).toFixed(2);
transactionAmountElement.value = Math.max(feeGrandTotal - transactionGrandTotal, 0).toFixed(2); transactionAmountElement.value = Math.max(feeGrandTotal - transactionGrandTotal, 0).toFixed(2);
if (los.dynamicsGPIntegrationIsEnabled) { if (los.dynamicsGPIntegrationIsEnabled) {
externalReceiptNumberElement = modalElement.querySelector('#lotOccupancyTransactionAdd--externalReceiptNumber'); externalReceiptNumberElement = modalElement.querySelector(
// eslint-disable-next-line no-secrets/no-secrets
'#lotOccupancyTransactionAdd--externalReceiptNumber');
const externalReceiptNumberControlElement = externalReceiptNumberElement.closest('.control'); const externalReceiptNumberControlElement = externalReceiptNumberElement.closest('.control');
externalReceiptNumberControlElement.classList.add('has-icons-right'); externalReceiptNumberControlElement.classList.add('has-icons-right');
externalReceiptNumberControlElement.insertAdjacentHTML('beforeend', '<span class="icon is-small is-right"></span>'); externalReceiptNumberControlElement.insertAdjacentHTML('beforeend', '<span class="icon is-small is-right"></span>');
@ -622,12 +611,12 @@ addTransactionButtonElement.addEventListener('click', () => {
} }
}, },
onshown(modalElement, closeModalFunction) { onshown(modalElement, closeModalFunction) {
var _a;
bulmaJS.toggleHtmlClipped(); bulmaJS.toggleHtmlClipped();
transactionAmountElement.focus(); transactionAmountElement.focus();
addCloseModalFunction = closeModalFunction; addCloseModalFunction = closeModalFunction;
modalElement (_a = modalElement
.querySelector('form') .querySelector('form')) === null || _a === void 0 ? void 0 : _a.addEventListener('submit', doAddTransaction);
.addEventListener('submit', doAddTransaction);
}, },
onremoved() { onremoved() {
bulmaJS.toggleHtmlClipped(); bulmaJS.toggleHtmlClipped();

View File

@ -1,11 +1,11 @@
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */ /* eslint-disable unicorn/prefer-module */
import type * as globalTypes from '../../types/globalTypes' import type { BulmaJS } from '@cityssm/bulma-js/types.js'
import type * as recordTypes from '../../types/recordTypes' import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types' import type * as globalTypes from '../../types/globalTypes.js'
import type * as recordTypes from '../../types/recordTypes.js'
import type { BulmaJS } from '@cityssm/bulma-js/types'
declare const cityssm: cityssmGlobal declare const cityssm: cityssmGlobal
declare const bulmaJS: BulmaJS declare const bulmaJS: BulmaJS
@ -14,7 +14,9 @@ declare const los: globalTypes.LOS
declare const lotOccupancyId: string declare const lotOccupancyId: string
let lotOccupancyFees: recordTypes.LotOccupancyFee[] = exports.lotOccupancyFees declare const exports: Record<string, unknown>
let lotOccupancyFees = exports.lotOccupancyFees as recordTypes.LotOccupancyFee[]
delete exports.lotOccupancyFees delete exports.lotOccupancyFees
const lotOccupancyFeesContainerElement = document.querySelector( const lotOccupancyFeesContainerElement = document.querySelector(
@ -35,8 +37,8 @@ function getFeeGrandTotal(): number {
function editLotOccupancyFeeQuantity(clickEvent: Event): void { function editLotOccupancyFeeQuantity(clickEvent: Event): void {
const feeId = Number.parseInt( const feeId = Number.parseInt(
(clickEvent.currentTarget as HTMLButtonElement).closest('tr')!.dataset (clickEvent.currentTarget as HTMLButtonElement).closest('tr')?.dataset
.feeId!, .feeId ?? '',
10 10
) )
const fee = lotOccupancyFees.find((possibleFee) => { const fee = lotOccupancyFees.find((possibleFee) => {
@ -49,7 +51,7 @@ function editLotOccupancyFeeQuantity(clickEvent: Event): void {
formEvent.preventDefault() formEvent.preventDefault()
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/lotOccupancies/doUpdateLotOccupancyFeeQuantity', `${los.urlPrefix}/lotOccupancies/doUpdateLotOccupancyFeeQuantity`,
formEvent.currentTarget, formEvent.currentTarget,
(rawResponseJSON) => { (rawResponseJSON) => {
const responseJSON = rawResponseJSON as { const responseJSON = rawResponseJSON as {
@ -88,12 +90,12 @@ function editLotOccupancyFeeQuantity(clickEvent: Event): void {
modalElement.querySelector( modalElement.querySelector(
'#lotOccupancyFeeQuantity--quantity' '#lotOccupancyFeeQuantity--quantity'
) as HTMLInputElement ) as HTMLInputElement
).valueAsNumber = fee.quantity! ).valueAsNumber = fee.quantity ?? 0
;( ;(
modalElement.querySelector( modalElement.querySelector(
'#lotOccupancyFeeQuantity--quantityUnit' '#lotOccupancyFeeQuantity--quantityUnit'
) as HTMLElement ) as HTMLElement
).textContent = fee.quantityUnit! ).textContent = fee.quantityUnit ?? ''
}, },
onshown(modalElement, closeModalFunction) { onshown(modalElement, closeModalFunction) {
bulmaJS.toggleHtmlClipped() bulmaJS.toggleHtmlClipped()
@ -124,7 +126,7 @@ function deleteLotOccupancyFee(clickEvent: Event): void {
function doDelete(): void { function doDelete(): void {
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/lotOccupancies/doDeleteLotOccupancyFee', `${los.urlPrefix}/lotOccupancies/doDeleteLotOccupancyFee`,
{ {
lotOccupancyId, lotOccupancyId,
feeId feeId
@ -133,11 +135,11 @@ function deleteLotOccupancyFee(clickEvent: Event): void {
const responseJSON = rawResponseJSON as { const responseJSON = rawResponseJSON as {
success: boolean success: boolean
errorMessage?: string errorMessage?: string
lotOccupancyFees?: recordTypes.LotOccupancyFee[] lotOccupancyFees: recordTypes.LotOccupancyFee[]
} }
if (responseJSON.success) { if (responseJSON.success) {
lotOccupancyFees = responseJSON.lotOccupancyFees! lotOccupancyFees = responseJSON.lotOccupancyFees
renderLotOccupancyFees() renderLotOccupancyFees()
} else { } else {
bulmaJS.alert({ bulmaJS.alert({
@ -172,6 +174,7 @@ function renderLotOccupancyFees(): void {
return return
} }
// eslint-disable-next-line no-secrets/no-secrets
lotOccupancyFeesContainerElement.innerHTML = `<table class="table is-fullwidth is-striped is-hoverable"> lotOccupancyFeesContainerElement.innerHTML = `<table class="table is-fullwidth is-striped is-hoverable">
<thead><tr> <thead><tr>
<th>Fee</th> <th>Fee</th>
@ -207,39 +210,39 @@ function renderLotOccupancyFees(): void {
tableRowElement.dataset.includeQuantity = tableRowElement.dataset.includeQuantity =
lotOccupancyFee.includeQuantity ?? false ? '1' : '0' lotOccupancyFee.includeQuantity ?? false ? '1' : '0'
tableRowElement.innerHTML = // eslint-disable-next-line no-unsanitized/property
'<td colspan="' + tableRowElement.innerHTML = `<td colspan="${lotOccupancyFee.quantity === 1 ? '5' : '1'}">
(lotOccupancyFee.quantity === 1 ? '5' : '1') + ${cityssm.escapeHTML(lotOccupancyFee.feeName ?? '')}<br />
'">' + <span class="tag">${cityssm.escapeHTML(lotOccupancyFee.feeCategory ?? '')}</span>
cityssm.escapeHTML(lotOccupancyFee.feeName ?? '') + </td>
'<br />' + ${
'<span class="tag">' + lotOccupancyFee.quantity === 1
cityssm.escapeHTML(lotOccupancyFee.feeCategory ?? '') +
'</span>' +
'</td>' +
(lotOccupancyFee.quantity === 1
? '' ? ''
: '<td class="has-text-right">$' + : `<td class="has-text-right">
lotOccupancyFee.feeAmount!.toFixed(2) + $${lotOccupancyFee.feeAmount?.toFixed(2)}
'</td>' + </td>
'<td>&times;</td>' + <td>&times;</td>
'<td class="has-text-right">' + <td class="has-text-right">${lotOccupancyFee.quantity?.toString()}</td>
lotOccupancyFee.quantity!.toString() + <td>=</td>`
'</td>' + }
'<td>=</td>') + <td class="has-text-right">
'<td class="has-text-right">$' + $${(lotOccupancyFee.feeAmount! * lotOccupancyFee.quantity!).toFixed(2)}
(lotOccupancyFee.feeAmount! * lotOccupancyFee.quantity!).toFixed(2) + </td>
'</td>' + <td class="is-hidden-print">
('<td class="is-hidden-print">' + <div class="buttons are-small is-flex-wrap-nowrap is-justify-content-end">
'<div class="buttons are-small is-flex-wrap-nowrap is-justify-content-end">' + ${
(lotOccupancyFee.includeQuantity ?? false lotOccupancyFee.includeQuantity ?? false
? '<button class="button is-primary button--editQuantity"><span class="icon is-small"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span><span>Edit</span></button>' ? `<button class="button is-primary button--editQuantity">
: '') + <span class="icon is-small"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>
'<button class="button is-danger is-light button--delete" data-tooltip="Delete Fee" type="button">' + <span>Edit</span>
'<i class="fas fa-trash" aria-hidden="true"></i>' + </button>`
'</button>' + : ''
'</div>' + }
'</td>') <button class="button is-danger is-light button--delete" data-tooltip="Delete Fee" type="button">
<i class="fas fa-trash" aria-hidden="true"></i>
</button>
</div>
</td>`
tableRowElement tableRowElement
.querySelector('.button--editQuantity') .querySelector('.button--editQuantity')
@ -296,7 +299,7 @@ addFeeButtonElement.addEventListener('click', () => {
function doAddFee(feeId: number, quantity: number | string = 1): void { function doAddFee(feeId: number, quantity: number | string = 1): void {
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/lotOccupancies/doAddLotOccupancyFee', `${los.urlPrefix}/lotOccupancies/doAddLotOccupancyFee`,
{ {
lotOccupancyId, lotOccupancyId,
feeId, feeId,
@ -306,11 +309,11 @@ addFeeButtonElement.addEventListener('click', () => {
const responseJSON = rawResponseJSON as { const responseJSON = rawResponseJSON as {
success: boolean success: boolean
errorMessage?: string errorMessage?: string
lotOccupancyFees?: recordTypes.LotOccupancyFee[] lotOccupancyFees: recordTypes.LotOccupancyFee[]
} }
if (responseJSON.success) { if (responseJSON.success) {
lotOccupancyFees = responseJSON.lotOccupancyFees! lotOccupancyFees = responseJSON.lotOccupancyFees
renderLotOccupancyFees() renderLotOccupancyFees()
filterFees() filterFees()
} else { } else {
@ -340,7 +343,7 @@ addFeeButtonElement.addEventListener('click', () => {
modalElement.querySelector( modalElement.querySelector(
'#lotOccupancyFeeQuantity--quantityUnit' '#lotOccupancyFeeQuantity--quantityUnit'
) as HTMLElement ) as HTMLElement
).textContent = fee.quantityUnit! ).textContent = fee.quantityUnit ?? ''
}, },
onshown(modalElement, closeModalFunction) { onshown(modalElement, closeModalFunction) {
quantityCloseModalFunction = closeModalFunction quantityCloseModalFunction = closeModalFunction
@ -350,8 +353,8 @@ addFeeButtonElement.addEventListener('click', () => {
) as HTMLInputElement ) as HTMLInputElement
modalElement modalElement
.querySelector('form')! .querySelector('form')
.addEventListener('submit', doSetQuantity) ?.addEventListener('submit', doSetQuantity)
} }
}) })
} }
@ -360,11 +363,11 @@ addFeeButtonElement.addEventListener('click', () => {
clickEvent.preventDefault() clickEvent.preventDefault()
const feeId = Number.parseInt( const feeId = Number.parseInt(
(clickEvent.currentTarget as HTMLElement).dataset.feeId!, (clickEvent.currentTarget as HTMLElement).dataset.feeId ?? '',
10 10
) )
const feeCategoryId = Number.parseInt( const feeCategoryId = Number.parseInt(
(clickEvent.currentTarget as HTMLElement).dataset.feeCategoryId!, (clickEvent.currentTarget as HTMLElement).dataset.feeCategoryId ?? '',
10 10
) )
@ -399,11 +402,8 @@ addFeeButtonElement.addEventListener('click', () => {
categoryContainerElement.dataset.feeCategoryId = categoryContainerElement.dataset.feeCategoryId =
feeCategory.feeCategoryId.toString() feeCategory.feeCategoryId.toString()
categoryContainerElement.innerHTML = categoryContainerElement.innerHTML = `<h4 class="title is-5 mt-2">${cityssm.escapeHTML(feeCategory.feeCategory ?? '')}</h4>
'<h4 class="title is-5 mt-2">' + <div class="panel mb-5"></div>`
cityssm.escapeHTML(feeCategory.feeCategory ?? '') +
'</h4>' +
'<div class="panel mb-5"></div>'
let hasFees = false let hasFees = false
@ -419,13 +419,8 @@ addFeeButtonElement.addEventListener('click', () => {
let includeFee = true let includeFee = true
const feeSearchString = ( const feeSearchString =
(feeCategory.feeCategory ?? '') + `${feeCategory.feeCategory ?? ''} ${fee.feeName ?? ''} ${fee.feeDescription ?? ''}`.toLowerCase()
' ' +
(fee.feeName ?? '') +
' ' +
(fee.feeDescription ?? '')
).toLowerCase()
for (const filterStringPiece of filterStringPieces) { for (const filterStringPiece of filterStringPieces) {
if (!feeSearchString.includes(filterStringPiece)) { if (!feeSearchString.includes(filterStringPiece)) {
@ -447,15 +442,13 @@ addFeeButtonElement.addEventListener('click', () => {
feeCategory.feeCategoryId.toString() feeCategory.feeCategoryId.toString()
panelBlockElement.href = '#' panelBlockElement.href = '#'
panelBlockElement.innerHTML = // eslint-disable-next-line no-unsanitized/property
'<strong>' + panelBlockElement.innerHTML = `<strong>${cityssm.escapeHTML(fee.feeName ?? '')}</strong><br />
cityssm.escapeHTML(fee.feeName ?? '') + <small>
'</strong><br />' + ${cityssm
'<small>' +
cityssm
.escapeHTML(fee.feeDescription ?? '') .escapeHTML(fee.feeDescription ?? '')
.replace(/\n/g, '<br />') + .replaceAll('\n', '<br />')}
'</small>' </small>`
panelBlockElement.addEventListener('click', tryAddFee) panelBlockElement.addEventListener('click', tryAddFee)
;( ;(
@ -471,14 +464,16 @@ addFeeButtonElement.addEventListener('click', () => {
cityssm.openHtmlModal('lotOccupancy-addFee', { cityssm.openHtmlModal('lotOccupancy-addFee', {
onshow(modalElement) { onshow(modalElement) {
feeFilterElement = modalElement.querySelector('#feeSelect--feeName')! feeFilterElement = modalElement.querySelector(
'#feeSelect--feeName'
) as HTMLInputElement
feeFilterResultsElement = modalElement.querySelector( feeFilterResultsElement = modalElement.querySelector(
'#resultsContainer--feeSelect' '#resultsContainer--feeSelect'
)! ) as HTMLElement
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/lotOccupancies/doGetFees', `${los.urlPrefix}/lotOccupancies/doGetFees`,
{ {
lotOccupancyId lotOccupancyId
}, },
@ -510,8 +505,8 @@ addFeeButtonElement.addEventListener('click', () => {
}) })
}) })
let lotOccupancyTransactions: recordTypes.LotOccupancyTransaction[] = let lotOccupancyTransactions =
exports.lotOccupancyTransactions exports.lotOccupancyTransactions as recordTypes.LotOccupancyTransaction[]
delete exports.lotOccupancyTransactions delete exports.lotOccupancyTransactions
const lotOccupancyTransactionsContainerElement = document.querySelector( const lotOccupancyTransactionsContainerElement = document.querySelector(
@ -530,8 +525,8 @@ function getTransactionGrandTotal(): number {
function editLotOccupancyTransaction(clickEvent: Event): void { function editLotOccupancyTransaction(clickEvent: Event): void {
const transactionIndex = Number.parseInt( const transactionIndex = Number.parseInt(
(clickEvent.currentTarget as HTMLButtonElement).closest('tr')!.dataset (clickEvent.currentTarget as HTMLButtonElement).closest('tr')?.dataset
.transactionIndex!, .transactionIndex ?? '',
10 10
) )
@ -545,7 +540,7 @@ function editLotOccupancyTransaction(clickEvent: Event): void {
formEvent.preventDefault() formEvent.preventDefault()
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/lotOccupancies/doUpdateLotOccupancyTransaction', `${los.urlPrefix}/lotOccupancies/doUpdateLotOccupancyTransaction`,
formEvent.currentTarget, formEvent.currentTarget,
(rawResponseJSON) => { (rawResponseJSON) => {
const responseJSON = rawResponseJSON as { const responseJSON = rawResponseJSON as {
@ -580,7 +575,7 @@ function editLotOccupancyTransaction(clickEvent: Event): void {
modalElement.querySelector( modalElement.querySelector(
'#lotOccupancyTransactionEdit--transactionIndex' '#lotOccupancyTransactionEdit--transactionIndex'
) as HTMLInputElement ) as HTMLInputElement
).value = transaction.transactionIndex!.toString() ).value = transaction.transactionIndex?.toString() ?? ''
;( ;(
modalElement.querySelector( modalElement.querySelector(
'#lotOccupancyTransactionEdit--transactionAmount' '#lotOccupancyTransactionEdit--transactionAmount'
@ -636,7 +631,7 @@ function deleteLotOccupancyTransaction(clickEvent: Event): void {
function doDelete(): void { function doDelete(): void {
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/lotOccupancies/doDeleteLotOccupancyTransaction', `${los.urlPrefix}/lotOccupancies/doDeleteLotOccupancyTransaction`,
{ {
lotOccupancyId, lotOccupancyId,
transactionIndex transactionIndex
@ -645,11 +640,11 @@ function deleteLotOccupancyTransaction(clickEvent: Event): void {
const responseJSON = rawResponseJSON as { const responseJSON = rawResponseJSON as {
success: boolean success: boolean
errorMessage?: string errorMessage?: string
lotOccupancyTransactions?: recordTypes.LotOccupancyTransaction[] lotOccupancyTransactions: recordTypes.LotOccupancyTransaction[]
} }
if (responseJSON.success) { if (responseJSON.success) {
lotOccupancyTransactions = responseJSON.lotOccupancyTransactions! lotOccupancyTransactions = responseJSON.lotOccupancyTransactions
renderLotOccupancyTransactions() renderLotOccupancyTransactions()
} else { } else {
bulmaJS.alert({ bulmaJS.alert({
@ -675,16 +670,15 @@ function deleteLotOccupancyTransaction(clickEvent: Event): void {
function renderLotOccupancyTransactions(): void { function renderLotOccupancyTransactions(): void {
if (lotOccupancyTransactions.length === 0) { if (lotOccupancyTransactions.length === 0) {
lotOccupancyTransactionsContainerElement.innerHTML = // eslint-disable-next-line no-unsanitized/property
'<div class="message ' + lotOccupancyTransactionsContainerElement.innerHTML = `<div class="message ${lotOccupancyFees.length === 0 ? 'is-info' : 'is-warning'}">
(lotOccupancyFees.length === 0 ? 'is-info' : 'is-warning') + <p class="message-body">There are no transactions associated with this record.</p>
'">' + </div>`
'<p class="message-body">There are no transactions associated with this record.</p>' +
'</div>'
return return
} }
// eslint-disable-next-line no-unsanitized/property
lotOccupancyTransactionsContainerElement.innerHTML = `<table class="table is-fullwidth is-striped is-hoverable"> lotOccupancyTransactionsContainerElement.innerHTML = `<table class="table is-fullwidth is-striped is-hoverable">
<thead><tr> <thead><tr>
<th class="has-width-1">Date</th> <th class="has-width-1">Date</th>
@ -708,7 +702,7 @@ function renderLotOccupancyTransactions(): void {
const tableRowElement = document.createElement('tr') const tableRowElement = document.createElement('tr')
tableRowElement.className = 'container--lotOccupancyTransaction' tableRowElement.className = 'container--lotOccupancyTransaction'
tableRowElement.dataset.transactionIndex = tableRowElement.dataset.transactionIndex =
lotOccupancyTransaction.transactionIndex!.toString() lotOccupancyTransaction.transactionIndex?.toString()
let externalReceiptNumberHTML = '' let externalReceiptNumberHTML = ''
@ -744,30 +738,28 @@ function renderLotOccupancyTransactions(): void {
externalReceiptNumberHTML += '<br />' externalReceiptNumberHTML += '<br />'
} }
tableRowElement.innerHTML = // eslint-disable-next-line no-unsanitized/property
'<td>' + tableRowElement.innerHTML = `<td>
(lotOccupancyTransaction.transactionDateString ?? '') + ${cityssm.escapeHTML(lotOccupancyTransaction.transactionDateString ?? '')}
'</td>' + </td>
('<td>' + <td>
externalReceiptNumberHTML + ${externalReceiptNumberHTML}
'<small>' + <small>${cityssm.escapeHTML(lotOccupancyTransaction.transactionNote ?? '')}</small>
cityssm.escapeHTML(lotOccupancyTransaction.transactionNote ?? '') + </td>
'</small>' + <td class="has-text-right">
'</td>') + $${cityssm.escapeHTML(lotOccupancyTransaction.transactionAmount.toFixed(2))}
('<td class="has-text-right">$' + </td>
lotOccupancyTransaction.transactionAmount.toFixed(2) + <td class="is-hidden-print">
'</td>') + <div class="buttons are-small is-flex-wrap-nowrap is-justify-content-end">
('<td class="is-hidden-print">' + <button class="button is-primary button--edit" type="button">
'<div class="buttons are-small is-flex-wrap-nowrap is-justify-content-end">' + <span class="icon"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>
'<button class="button is-primary button--edit" type="button">' + <span>Edit</span>
'<span class="icon"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>' + </button>
'<span>Edit</span>' + <button class="button is-danger is-light button--delete" data-tooltip="Delete Transaction" type="button">
'</button>' + <i class="fas fa-trash" aria-hidden="true"></i>
'<button class="button is-danger is-light button--delete" data-tooltip="Delete Transaction" type="button">' + </button>
'<i class="fas fa-trash" aria-hidden="true"></i>' + </div>
'</button>' + </td>`
'</div>' +
'</td>')
tableRowElement tableRowElement
.querySelector('.button--edit') .querySelector('.button--edit')
@ -778,8 +770,8 @@ function renderLotOccupancyTransactions(): void {
?.addEventListener('click', deleteLotOccupancyTransaction) ?.addEventListener('click', deleteLotOccupancyTransaction)
lotOccupancyTransactionsContainerElement lotOccupancyTransactionsContainerElement
.querySelector('tbody')! .querySelector('tbody')
.append(tableRowElement) ?.append(tableRowElement)
} }
;( ;(
@ -793,16 +785,17 @@ function renderLotOccupancyTransactions(): void {
if (feeGrandTotal.toFixed(2) !== transactionGrandTotal.toFixed(2)) { if (feeGrandTotal.toFixed(2) !== transactionGrandTotal.toFixed(2)) {
lotOccupancyTransactionsContainerElement.insertAdjacentHTML( lotOccupancyTransactionsContainerElement.insertAdjacentHTML(
'afterbegin', 'afterbegin',
'<div class="message is-warning">' + `<div class="message is-warning">
'<div class="message-body">' + <div class="message-body">
'<div class="level">' + <div class="level">
'<div class="level-left"><div class="level-item">Outstanding Balance</div></div>' + <div class="level-left">
'<div class="level-right"><div class="level-item">$' + <div class="level-item">Outstanding Balance</div>
(feeGrandTotal - transactionGrandTotal).toFixed(2) + </div>
'</div></div>' + <div class="level-right">
'</div>' + <div class="level-item">$${cityssm.escapeHTML((feeGrandTotal - transactionGrandTotal).toFixed(2))}</div>
'</div>' + </div>
'</div>' </div>
</div></div>`
) )
} }
} }
@ -821,17 +814,17 @@ addTransactionButtonElement.addEventListener('click', () => {
submitEvent.preventDefault() submitEvent.preventDefault()
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/lotOccupancies/doAddLotOccupancyTransaction', `${los.urlPrefix}/lotOccupancies/doAddLotOccupancyTransaction`,
submitEvent.currentTarget, submitEvent.currentTarget,
(rawResponseJSON) => { (rawResponseJSON) => {
const responseJSON = rawResponseJSON as { const responseJSON = rawResponseJSON as {
success: boolean success: boolean
errorMessage?: string errorMessage?: string
lotOccupancyTransactions?: recordTypes.LotOccupancyTransaction[] lotOccupancyTransactions: recordTypes.LotOccupancyTransaction[]
} }
if (responseJSON.success) { if (responseJSON.success) {
lotOccupancyTransactions = responseJSON.lotOccupancyTransactions! lotOccupancyTransactions = responseJSON.lotOccupancyTransactions
addCloseModalFunction() addCloseModalFunction()
renderLotOccupancyTransactions() renderLotOccupancyTransactions()
} else { } else {
@ -850,12 +843,12 @@ addTransactionButtonElement.addEventListener('click', () => {
const externalReceiptNumber = externalReceiptNumberElement.value const externalReceiptNumber = externalReceiptNumberElement.value
const iconElement = externalReceiptNumberElement const iconElement = externalReceiptNumberElement
.closest('.control')! .closest('.control')
.querySelector('.icon') as HTMLElement ?.querySelector('.icon') as HTMLElement
const helpTextElement = externalReceiptNumberElement const helpTextElement = externalReceiptNumberElement
.closest('.field')! .closest('.field')
.querySelector('.help') as HTMLElement ?.querySelector('.help') as HTMLElement
if (externalReceiptNumber === '') { if (externalReceiptNumber === '') {
helpTextElement.innerHTML = '&nbsp;' helpTextElement.innerHTML = '&nbsp;'
@ -864,7 +857,7 @@ addTransactionButtonElement.addEventListener('click', () => {
} }
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/lotOccupancies/doGetDynamicsGPDocument', `${los.urlPrefix}/lotOccupancies/doGetDynamicsGPDocument`,
{ {
externalReceiptNumber externalReceiptNumber
}, },
@ -929,11 +922,12 @@ addTransactionButtonElement.addEventListener('click', () => {
if (los.dynamicsGPIntegrationIsEnabled) { if (los.dynamicsGPIntegrationIsEnabled) {
externalReceiptNumberElement = modalElement.querySelector( externalReceiptNumberElement = modalElement.querySelector(
// eslint-disable-next-line no-secrets/no-secrets
'#lotOccupancyTransactionAdd--externalReceiptNumber' '#lotOccupancyTransactionAdd--externalReceiptNumber'
)! ) as HTMLInputElement
const externalReceiptNumberControlElement = const externalReceiptNumberControlElement =
externalReceiptNumberElement.closest('.control')! externalReceiptNumberElement.closest('.control') as HTMLElement
externalReceiptNumberControlElement.classList.add('has-icons-right') externalReceiptNumberControlElement.classList.add('has-icons-right')
@ -968,8 +962,8 @@ addTransactionButtonElement.addEventListener('click', () => {
addCloseModalFunction = closeModalFunction addCloseModalFunction = closeModalFunction
modalElement modalElement
.querySelector('form')! .querySelector('form')
.addEventListener('submit', doAddTransaction) ?.addEventListener('submit', doAddTransaction)
}, },
onremoved() { onremoved() {
bulmaJS.toggleHtmlClipped() bulmaJS.toggleHtmlClipped()

View File

@ -1,12 +1,13 @@
"use strict"; "use strict";
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */ // eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
var _a; var _a;
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
let lotOccupancyOccupants = exports.lotOccupancyOccupants; let lotOccupancyOccupants = exports.lotOccupancyOccupants;
delete exports.lotOccupancyOccupants; delete exports.lotOccupancyOccupants;
function openEditLotOccupancyOccupant(clickEvent) { function openEditLotOccupancyOccupant(clickEvent) {
const lotOccupantIndex = Number.parseInt(clickEvent.currentTarget.closest('tr').dataset var _a, _b;
.lotOccupantIndex, 10); const lotOccupantIndex = Number.parseInt((_b = (_a = clickEvent.currentTarget.closest('tr')) === null || _a === void 0 ? void 0 : _a.dataset.lotOccupantIndex) !== null && _b !== void 0 ? _b : '', 10);
const lotOccupancyOccupant = lotOccupancyOccupants.find((currentLotOccupancyOccupant) => { const lotOccupancyOccupant = lotOccupancyOccupants.find((currentLotOccupancyOccupant) => {
return currentLotOccupancyOccupant.lotOccupantIndex === lotOccupantIndex; return currentLotOccupancyOccupant.lotOccupantIndex === lotOccupantIndex;
}); });
@ -14,7 +15,7 @@ function openEditLotOccupancyOccupant(clickEvent) {
let editCloseModalFunction; let editCloseModalFunction;
function editOccupant(submitEvent) { function editOccupant(submitEvent) {
submitEvent.preventDefault(); submitEvent.preventDefault();
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doUpdateLotOccupancyOccupant', editFormElement, (rawResponseJSON) => { cityssm.postJSON(`${los.urlPrefix}/lotOccupancies/doUpdateLotOccupancyOccupant`, editFormElement, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON; const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
@ -24,7 +25,7 @@ function openEditLotOccupancyOccupant(clickEvent) {
} }
else { else {
bulmaJS.alert({ bulmaJS.alert({
title: 'Error Updating ' + los.escapedAliases.Occupant, title: `Error Updating ${los.escapedAliases.Occupant}`,
message: (_a = responseJSON.errorMessage) !== null && _a !== void 0 ? _a : '', message: (_a = responseJSON.errorMessage) !== null && _a !== void 0 ? _a : '',
contextualColorName: 'danger' contextualColorName: 'danger'
}); });
@ -65,7 +66,8 @@ function openEditLotOccupancyOccupant(clickEvent) {
optionElement.selected = true; optionElement.selected = true;
lotOccupantTypeSelectElement.append(optionElement); lotOccupantTypeSelectElement.append(optionElement);
} }
modalElement.querySelector('#lotOccupancyOccupantEdit--fontAwesomeIconClass').innerHTML = `<i class="fas fa-fw fa-${lotOccupancyOccupant.fontAwesomeIconClass}" aria-hidden="true"></i>`; modalElement.querySelector('#lotOccupancyOccupantEdit--fontAwesomeIconClass').innerHTML =
`<i class="fas fa-fw fa-${lotOccupancyOccupant.fontAwesomeIconClass}" aria-hidden="true"></i>`;
modalElement.querySelector('#lotOccupancyOccupantEdit--occupantName').value = lotOccupancyOccupant.occupantName; modalElement.querySelector('#lotOccupancyOccupantEdit--occupantName').value = lotOccupancyOccupant.occupantName;
modalElement.querySelector('#lotOccupancyOccupantEdit--occupantFamilyName').value = lotOccupancyOccupant.occupantFamilyName; modalElement.querySelector('#lotOccupancyOccupantEdit--occupantFamilyName').value = lotOccupancyOccupant.occupantFamilyName;
modalElement.querySelector('#lotOccupancyOccupantEdit--occupantAddress1').value = lotOccupancyOccupant.occupantAddress1; modalElement.querySelector('#lotOccupancyOccupantEdit--occupantAddress1').value = lotOccupancyOccupant.occupantAddress1;
@ -89,7 +91,8 @@ function openEditLotOccupancyOccupant(clickEvent) {
var _a, _b; var _a, _b;
const fontAwesomeIconClass = (_a = lotOccupantTypeIdElement.selectedOptions[0].dataset const fontAwesomeIconClass = (_a = lotOccupantTypeIdElement.selectedOptions[0].dataset
.fontAwesomeIconClass) !== null && _a !== void 0 ? _a : 'user'; .fontAwesomeIconClass) !== null && _a !== void 0 ? _a : 'user';
modalElement.querySelector('#lotOccupancyOccupantEdit--fontAwesomeIconClass').innerHTML = `<i class="fas fa-fw fa-${fontAwesomeIconClass}" aria-hidden="true"></i>`; modalElement.querySelector('#lotOccupancyOccupantEdit--fontAwesomeIconClass').innerHTML =
`<i class="fas fa-fw fa-${fontAwesomeIconClass}" aria-hidden="true"></i>`;
let occupantCommentTitle = (_b = lotOccupantTypeIdElement.selectedOptions[0].dataset let occupantCommentTitle = (_b = lotOccupantTypeIdElement.selectedOptions[0].dataset
.occupantCommentTitle) !== null && _b !== void 0 ? _b : ''; .occupantCommentTitle) !== null && _b !== void 0 ? _b : '';
if (occupantCommentTitle === '') { if (occupantCommentTitle === '') {
@ -165,9 +168,12 @@ function renderLotOccupancyOccupants() {
lotOccupancyOccupant.lotOccupantIndex.toString(); lotOccupancyOccupant.lotOccupantIndex.toString();
tableRowElement.innerHTML = tableRowElement.innerHTML =
'<td>' + '<td>' +
cityssm.escapeHTML(((_a = lotOccupancyOccupant.occupantName) !== null && _a !== void 0 ? _a : '') === '' && ((_b = lotOccupancyOccupant.occupantFamilyName) !== null && _b !== void 0 ? _b : '') === '' cityssm.escapeHTML(((_a = lotOccupancyOccupant.occupantName) !== null && _a !== void 0 ? _a : '') === '' &&
((_b = lotOccupancyOccupant.occupantFamilyName) !== null && _b !== void 0 ? _b : '') === ''
? '(No Name)' ? '(No Name)'
: lotOccupancyOccupant.occupantName + ' ' + lotOccupancyOccupant.occupantFamilyName) + : lotOccupancyOccupant.occupantName +
' ' +
lotOccupancyOccupant.occupantFamilyName) +
'<br />' + '<br />' +
('<span class="tag">' + ('<span class="tag">' +
'<i class="fas fa-fw fa-' + '<i class="fas fa-fw fa-' +
@ -390,7 +396,8 @@ else {
var _a, _b; var _a, _b;
const fontAwesomeIconClass = (_a = lotOccupantTypeIdElement.selectedOptions[0].dataset const fontAwesomeIconClass = (_a = lotOccupantTypeIdElement.selectedOptions[0].dataset
.fontAwesomeIconClass) !== null && _a !== void 0 ? _a : 'user'; .fontAwesomeIconClass) !== null && _a !== void 0 ? _a : 'user';
modalElement.querySelector('#lotOccupancyOccupantAdd--fontAwesomeIconClass').innerHTML = `<i class="fas fa-fw fa-${fontAwesomeIconClass}" aria-hidden="true"></i>`; modalElement.querySelector('#lotOccupancyOccupantAdd--fontAwesomeIconClass').innerHTML =
`<i class="fas fa-fw fa-${fontAwesomeIconClass}" aria-hidden="true"></i>`;
let occupantCommentTitle = (_b = lotOccupantTypeIdElement.selectedOptions[0].dataset let occupantCommentTitle = (_b = lotOccupantTypeIdElement.selectedOptions[0].dataset
.occupantCommentTitle) !== null && _b !== void 0 ? _b : ''; .occupantCommentTitle) !== null && _b !== void 0 ? _b : '';
if (occupantCommentTitle === '') { if (occupantCommentTitle === '') {

View File

@ -1,11 +1,11 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */ // eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
import type * as globalTypes from '../../types/globalTypes' import type { BulmaJS } from '@cityssm/bulma-js/types.js'
import type * as recordTypes from '../../types/recordTypes' import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types' import type * as globalTypes from '../../types/globalTypes.js'
import type * as recordTypes from '../../types/recordTypes.js'
import type { BulmaJS } from '@cityssm/bulma-js/types'
declare const cityssm: cityssmGlobal declare const cityssm: cityssmGlobal
declare const bulmaJS: BulmaJS declare const bulmaJS: BulmaJS
@ -16,14 +16,17 @@ declare const lotOccupancyId: string
declare const isCreate: boolean declare const isCreate: boolean
declare const formElement: HTMLFormElement declare const formElement: HTMLFormElement
let lotOccupancyOccupants: recordTypes.LotOccupancyOccupant[] = declare const exports: Record<string, unknown>
exports.lotOccupancyOccupants
let lotOccupancyOccupants =
exports.lotOccupancyOccupants as recordTypes.LotOccupancyOccupant[]
delete exports.lotOccupancyOccupants delete exports.lotOccupancyOccupants
function openEditLotOccupancyOccupant(clickEvent: Event): void { function openEditLotOccupancyOccupant(clickEvent: Event): void {
const lotOccupantIndex = Number.parseInt( const lotOccupantIndex = Number.parseInt(
(clickEvent.currentTarget as HTMLElement).closest('tr')!.dataset (clickEvent.currentTarget as HTMLElement).closest('tr')?.dataset
.lotOccupantIndex!, .lotOccupantIndex ?? '',
10 10
) )
@ -40,22 +43,22 @@ function openEditLotOccupancyOccupant(clickEvent: Event): void {
submitEvent.preventDefault() submitEvent.preventDefault()
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/lotOccupancies/doUpdateLotOccupancyOccupant', `${los.urlPrefix}/lotOccupancies/doUpdateLotOccupancyOccupant`,
editFormElement, editFormElement,
(rawResponseJSON) => { (rawResponseJSON) => {
const responseJSON = rawResponseJSON as { const responseJSON = rawResponseJSON as {
success: boolean success: boolean
errorMessage?: string errorMessage?: string
lotOccupancyOccupants?: recordTypes.LotOccupancyOccupant[] lotOccupancyOccupants: recordTypes.LotOccupancyOccupant[]
} }
if (responseJSON.success) { if (responseJSON.success) {
lotOccupancyOccupants = responseJSON.lotOccupancyOccupants! lotOccupancyOccupants = responseJSON.lotOccupancyOccupants
editCloseModalFunction() editCloseModalFunction()
renderLotOccupancyOccupants() renderLotOccupancyOccupants()
} else { } else {
bulmaJS.alert({ bulmaJS.alert({
title: 'Error Updating ' + los.escapedAliases.Occupant, title: `Error Updating ${los.escapedAliases.Occupant}`,
message: responseJSON.errorMessage ?? '', message: responseJSON.errorMessage ?? '',
contextualColorName: 'danger' contextualColorName: 'danger'
}) })
@ -125,7 +128,8 @@ function openEditLotOccupancyOccupant(clickEvent: Event): void {
modalElement.querySelector( modalElement.querySelector(
'#lotOccupancyOccupantEdit--fontAwesomeIconClass' '#lotOccupancyOccupantEdit--fontAwesomeIconClass'
)!.innerHTML = `<i class="fas fa-fw fa-${lotOccupancyOccupant.fontAwesomeIconClass!}" aria-hidden="true"></i>` )!.innerHTML =
`<i class="fas fa-fw fa-${lotOccupancyOccupant.fontAwesomeIconClass!}" aria-hidden="true"></i>`
;( ;(
modalElement.querySelector( modalElement.querySelector(
'#lotOccupancyOccupantEdit--occupantName' '#lotOccupancyOccupantEdit--occupantName'
@ -201,7 +205,8 @@ function openEditLotOccupancyOccupant(clickEvent: Event): void {
modalElement.querySelector( modalElement.querySelector(
'#lotOccupancyOccupantEdit--fontAwesomeIconClass' '#lotOccupancyOccupantEdit--fontAwesomeIconClass'
)!.innerHTML = `<i class="fas fa-fw fa-${fontAwesomeIconClass}" aria-hidden="true"></i>` )!.innerHTML =
`<i class="fas fa-fw fa-${fontAwesomeIconClass}" aria-hidden="true"></i>`
let occupantCommentTitle = let occupantCommentTitle =
lotOccupantTypeIdElement.selectedOptions[0].dataset lotOccupantTypeIdElement.selectedOptions[0].dataset
@ -307,9 +312,12 @@ function renderLotOccupancyOccupants(): void {
tableRowElement.innerHTML = tableRowElement.innerHTML =
'<td>' + '<td>' +
cityssm.escapeHTML( cityssm.escapeHTML(
(lotOccupancyOccupant.occupantName ?? '') === '' && (lotOccupancyOccupant.occupantFamilyName ?? '') === '' (lotOccupancyOccupant.occupantName ?? '') === '' &&
(lotOccupancyOccupant.occupantFamilyName ?? '') === ''
? '(No Name)' ? '(No Name)'
: lotOccupancyOccupant.occupantName! + ' ' + lotOccupancyOccupant.occupantFamilyName! : lotOccupancyOccupant.occupantName! +
' ' +
lotOccupancyOccupant.occupantFamilyName!
) + ) +
'<br />' + '<br />' +
('<span class="tag">' + ('<span class="tag">' +
@ -630,7 +638,8 @@ document
modalElement.querySelector( modalElement.querySelector(
'#lotOccupancyOccupantAdd--fontAwesomeIconClass' '#lotOccupancyOccupantAdd--fontAwesomeIconClass'
)!.innerHTML = `<i class="fas fa-fw fa-${fontAwesomeIconClass}" aria-hidden="true"></i>` )!.innerHTML =
`<i class="fas fa-fw fa-${fontAwesomeIconClass}" aria-hidden="true"></i>`
let occupantCommentTitle = let occupantCommentTitle =
lotOccupantTypeIdElement.selectedOptions[0].dataset lotOccupantTypeIdElement.selectedOptions[0].dataset

File diff suppressed because one or more lines are too long

View File

@ -1,8 +1,7 @@
{ {
"compilerOptions": { "compilerOptions": {
"target": "ES6", "target": "ES2017",
"module": "CommonJS", "module": "CommonJS",
"moduleResolution": "Node",
"isolatedModules": false, "isolatedModules": false,
"declaration": true, "declaration": true,
"noImplicitAny": false, "noImplicitAny": false,