code cleanup

deepsource-autofix-76c6eb20
Dan Gowans 2024-06-25 15:25:35 -04:00
parent 577141be61
commit 19c58de58f
4 changed files with 184 additions and 225 deletions

View File

@ -626,7 +626,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
}); });
} }
function renderLotOccupancyOccupants() { function renderLotOccupancyOccupants() {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x; var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
const occupantsContainer = document.querySelector('#container--lotOccupancyOccupants'); const occupantsContainer = document.querySelector('#container--lotOccupancyOccupants');
cityssm.clearElement(occupantsContainer); cityssm.clearElement(occupantsContainer);
if (lotOccupancyOccupants.length === 0) { if (lotOccupancyOccupants.length === 0) {
@ -650,77 +650,58 @@ Object.defineProperty(exports, "__esModule", { value: true });
for (const lotOccupancyOccupant of lotOccupancyOccupants) { for (const lotOccupancyOccupant of lotOccupancyOccupants) {
const tableRowElement = document.createElement('tr'); const tableRowElement = document.createElement('tr');
tableRowElement.dataset.lotOccupantIndex = tableRowElement.dataset.lotOccupantIndex =
lotOccupancyOccupant.lotOccupantIndex.toString(); (_a = lotOccupancyOccupant.lotOccupantIndex) === null || _a === void 0 ? void 0 : _a.toString();
// eslint-disable-next-line no-unsanitized/property // eslint-disable-next-line no-unsanitized/property
tableRowElement.innerHTML = tableRowElement.innerHTML = `<td>
'<td>' + ${cityssm.escapeHTML(((_b = lotOccupancyOccupant.occupantName) !== null && _b !== void 0 ? _b : '') === '' &&
cityssm.escapeHTML(((_a = lotOccupancyOccupant.occupantName) !== null && _a !== void 0 ? _a : '') === '' && ((_c = lotOccupancyOccupant.occupantFamilyName) !== null && _c !== void 0 ? _c : '') === ''
((_b = lotOccupancyOccupant.occupantFamilyName) !== null && _b !== void 0 ? _b : '') === '' ? '(No Name)'
? '(No Name)' : `${lotOccupancyOccupant.occupantName} ${lotOccupancyOccupant.occupantFamilyName}`)}<br />
: `${lotOccupancyOccupant.occupantName} ${lotOccupancyOccupant.occupantFamilyName}`) + <span class="tag">
'<br />' + <i class="fas fa-fw fa-${cityssm.escapeHTML((_d = lotOccupancyOccupant.fontAwesomeIconClass) !== null && _d !== void 0 ? _d : '')}" aria-hidden="true"></i>
('<span class="tag">' + <span class="ml-1">${cityssm.escapeHTML((_e = lotOccupancyOccupant.lotOccupantType) !== null && _e !== void 0 ? _e : '')}</span>
'<i class="fas fa-fw fa-' + </span>
cityssm.escapeHTML((_c = lotOccupancyOccupant.fontAwesomeIconClass) !== null && _c !== void 0 ? _c : '') + </td><td>
'" aria-hidden="true"></i>' + ${((_f = lotOccupancyOccupant.occupantAddress1) !== null && _f !== void 0 ? _f : '') === ''
' <span class="ml-1">' + ? ''
cityssm.escapeHTML((_d = lotOccupancyOccupant.lotOccupantType) !== null && _d !== void 0 ? _d : '') + : cityssm.escapeHTML((_g = lotOccupancyOccupant.occupantAddress1) !== null && _g !== void 0 ? _g : '') +
'</span>' + '<br />'}
'</span>') + ${((_h = lotOccupancyOccupant.occupantAddress2) !== null && _h !== void 0 ? _h : '') === ''
'</td>' + ? ''
('<td>' + : cityssm.escapeHTML((_j = lotOccupancyOccupant.occupantAddress2) !== null && _j !== void 0 ? _j : '') +
(((_e = lotOccupancyOccupant.occupantAddress1) !== null && _e !== void 0 ? _e : '') === '' '<br />'}
? '' ${((_k = lotOccupancyOccupant.occupantCity) !== null && _k !== void 0 ? _k : '') === ''
: cityssm.escapeHTML((_f = lotOccupancyOccupant.occupantAddress1) !== null && _f !== void 0 ? _f : '') + ? ''
'<br />') + : cityssm.escapeHTML((_l = lotOccupancyOccupant.occupantCity) !== null && _l !== void 0 ? _l : '') + ', '}
(((_g = lotOccupancyOccupant.occupantAddress2) !== null && _g !== void 0 ? _g : '') === '' ${cityssm.escapeHTML((_m = lotOccupancyOccupant.occupantProvince) !== null && _m !== void 0 ? _m : '')}<br />
? '' ${cityssm.escapeHTML((_o = lotOccupancyOccupant.occupantPostalCode) !== null && _o !== void 0 ? _o : '')}</td><td>${((_p = lotOccupancyOccupant.occupantPhoneNumber) !== null && _p !== void 0 ? _p : '') === ''
: cityssm.escapeHTML((_h = lotOccupancyOccupant.occupantAddress2) !== null && _h !== void 0 ? _h : '') + ? ''
'<br />') + : cityssm.escapeHTML((_q = lotOccupancyOccupant.occupantPhoneNumber) !== null && _q !== void 0 ? _q : '') + '<br />'}
(((_j = lotOccupancyOccupant.occupantCity) !== null && _j !== void 0 ? _j : '') === '' ${((_r = lotOccupancyOccupant.occupantEmailAddress) !== null && _r !== void 0 ? _r : '') === ''
? '' ? ''
: cityssm.escapeHTML((_k = lotOccupancyOccupant.occupantCity) !== null && _k !== void 0 ? _k : '') + : cityssm.escapeHTML((_s = lotOccupancyOccupant.occupantEmailAddress) !== null && _s !== void 0 ? _s : '')}
', ') + </td><td>
cityssm.escapeHTML((_l = lotOccupancyOccupant.occupantProvince) !== null && _l !== void 0 ? _l : '') + <span data-tooltip="${cityssm.escapeHTML(((_t = lotOccupancyOccupant.occupantCommentTitle) !== null && _t !== void 0 ? _t : '') === ''
'<br />' + ? 'Comment'
cityssm.escapeHTML((_m = lotOccupancyOccupant.occupantPostalCode) !== null && _m !== void 0 ? _m : '') + : (_u = lotOccupancyOccupant.occupantCommentTitle) !== null && _u !== void 0 ? _u : '')}">
'</td>') + ${cityssm.escapeHTML((_v = lotOccupancyOccupant.occupantComment) !== null && _v !== void 0 ? _v : '')}
('<td>' + </span>
(((_o = lotOccupancyOccupant.occupantPhoneNumber) !== null && _o !== void 0 ? _o : '') === '' </td><td class="is-hidden-print">
? '' <div class="buttons are-small is-justify-content-end">
: cityssm.escapeHTML((_p = lotOccupancyOccupant.occupantPhoneNumber) !== null && _p !== void 0 ? _p : '') + <button class="button is-primary button--edit" type="button">
'<br />') + <span class="icon is-small"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>
(((_q = lotOccupancyOccupant.occupantEmailAddress) !== null && _q !== void 0 ? _q : '') === '' <span>Edit</span>
? '' </button>
: cityssm.escapeHTML((_r = lotOccupancyOccupant.occupantEmailAddress) !== null && _r !== void 0 ? _r : '')) + <button class="button is-light is-danger button--delete" data-tooltip="Delete ${los.escapedAliases.Occupant}" type="button" aria-label="Delete">
'</td>') + <i class="fas fa-trash" aria-hidden="true"></i>
('<td>' + </button>
'<span data-tooltip="' + </div>
cityssm.escapeHTML(((_s = lotOccupancyOccupant.occupantCommentTitle) !== null && _s !== void 0 ? _s : '') === '' </td>`;
? 'Comment'
: (_t = lotOccupancyOccupant.occupantCommentTitle) !== null && _t !== void 0 ? _t : '') +
'">' +
cityssm.escapeHTML((_u = lotOccupancyOccupant.occupantComment) !== null && _u !== void 0 ? _u : '') +
'</span>' +
'</td>') +
('<td class="is-hidden-print">' +
'<div class="buttons are-small is-justify-content-end">' +
('<button class="button is-primary button--edit" type="button">' +
'<span class="icon is-small"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>' +
' <span>Edit</span>' +
'</button>') +
('<button class="button is-light is-danger button--delete" data-tooltip="Delete ' +
los.escapedAliases.Occupant +
'" type="button" aria-label="Delete">' +
'<i class="fas fa-trash" aria-hidden="true"></i>' +
'</button>') +
'</div>' +
'</td>');
(_v = tableRowElement
.querySelector('.button--edit')) === null || _v === void 0 ? void 0 : _v.addEventListener('click', openEditLotOccupancyOccupant);
(_w = tableRowElement (_w = tableRowElement
.querySelector('.button--delete')) === null || _w === void 0 ? void 0 : _w.addEventListener('click', deleteLotOccupancyOccupant); .querySelector('.button--edit')) === null || _w === void 0 ? void 0 : _w.addEventListener('click', openEditLotOccupancyOccupant);
(_x = tableElement.querySelector('tbody')) === null || _x === void 0 ? void 0 : _x.append(tableRowElement); (_x = tableRowElement
.querySelector('.button--delete')) === null || _x === void 0 ? void 0 : _x.addEventListener('click', deleteLotOccupancyOccupant);
(_y = tableElement.querySelector('tbody')) === null || _y === void 0 ? void 0 : _y.append(tableRowElement);
} }
occupantsContainer.append(tableElement); occupantsContainer.append(tableElement);
} }
@ -774,12 +755,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
} }
let pastOccupantSearchResults = []; let pastOccupantSearchResults = [];
function addOccupantFromCopy(clickEvent) { function addOccupantFromCopy(clickEvent) {
var _a; var _a, _b;
clickEvent.preventDefault(); clickEvent.preventDefault();
const panelBlockElement = clickEvent.currentTarget; const panelBlockElement = clickEvent.currentTarget;
const occupant = pastOccupantSearchResults[Number.parseInt(panelBlockElement.dataset.index, 10)]; const occupant = pastOccupantSearchResults[Number.parseInt((_a = panelBlockElement.dataset.index) !== null && _a !== void 0 ? _a : '', 10)];
const lotOccupantTypeId = ((_a = panelBlockElement const lotOccupantTypeId = ((_b = panelBlockElement
.closest('.modal')) === null || _a === void 0 ? void 0 : _a.querySelector('#lotOccupancyOccupantCopy--lotOccupantTypeId')).value; .closest('.modal')) === null || _b === void 0 ? void 0 : _b.querySelector('#lotOccupancyOccupantCopy--lotOccupantTypeId')).value;
if (lotOccupantTypeId === '') { if (lotOccupantTypeId === '') {
bulmaJS.alert({ bulmaJS.alert({
title: `No ${los.escapedAliases.Occupant} Type Selected`, title: `No ${los.escapedAliases.Occupant} Type Selected`,

View File

@ -146,7 +146,7 @@ function deleteLotOccupancyOccupant(clickEvent) {
}); });
} }
function renderLotOccupancyOccupants() { function renderLotOccupancyOccupants() {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x; var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
const occupantsContainer = document.querySelector('#container--lotOccupancyOccupants'); const occupantsContainer = document.querySelector('#container--lotOccupancyOccupants');
cityssm.clearElement(occupantsContainer); cityssm.clearElement(occupantsContainer);
if (lotOccupancyOccupants.length === 0) { if (lotOccupancyOccupants.length === 0) {
@ -170,77 +170,58 @@ function renderLotOccupancyOccupants() {
for (const lotOccupancyOccupant of lotOccupancyOccupants) { for (const lotOccupancyOccupant of lotOccupancyOccupants) {
const tableRowElement = document.createElement('tr'); const tableRowElement = document.createElement('tr');
tableRowElement.dataset.lotOccupantIndex = tableRowElement.dataset.lotOccupantIndex =
lotOccupancyOccupant.lotOccupantIndex.toString(); (_a = lotOccupancyOccupant.lotOccupantIndex) === null || _a === void 0 ? void 0 : _a.toString();
// eslint-disable-next-line no-unsanitized/property // eslint-disable-next-line no-unsanitized/property
tableRowElement.innerHTML = tableRowElement.innerHTML = `<td>
'<td>' + ${cityssm.escapeHTML(((_b = lotOccupancyOccupant.occupantName) !== null && _b !== void 0 ? _b : '') === '' &&
cityssm.escapeHTML(((_a = lotOccupancyOccupant.occupantName) !== null && _a !== void 0 ? _a : '') === '' && ((_c = lotOccupancyOccupant.occupantFamilyName) !== null && _c !== void 0 ? _c : '') === ''
((_b = lotOccupancyOccupant.occupantFamilyName) !== null && _b !== void 0 ? _b : '') === '' ? '(No Name)'
? '(No Name)' : `${lotOccupancyOccupant.occupantName} ${lotOccupancyOccupant.occupantFamilyName}`)}<br />
: `${lotOccupancyOccupant.occupantName} ${lotOccupancyOccupant.occupantFamilyName}`) + <span class="tag">
'<br />' + <i class="fas fa-fw fa-${cityssm.escapeHTML((_d = lotOccupancyOccupant.fontAwesomeIconClass) !== null && _d !== void 0 ? _d : '')}" aria-hidden="true"></i>
('<span class="tag">' + <span class="ml-1">${cityssm.escapeHTML((_e = lotOccupancyOccupant.lotOccupantType) !== null && _e !== void 0 ? _e : '')}</span>
'<i class="fas fa-fw fa-' + </span>
cityssm.escapeHTML((_c = lotOccupancyOccupant.fontAwesomeIconClass) !== null && _c !== void 0 ? _c : '') + </td><td>
'" aria-hidden="true"></i>' + ${((_f = lotOccupancyOccupant.occupantAddress1) !== null && _f !== void 0 ? _f : '') === ''
' <span class="ml-1">' + ? ''
cityssm.escapeHTML((_d = lotOccupancyOccupant.lotOccupantType) !== null && _d !== void 0 ? _d : '') + : cityssm.escapeHTML((_g = lotOccupancyOccupant.occupantAddress1) !== null && _g !== void 0 ? _g : '') +
'</span>' + '<br />'}
'</span>') + ${((_h = lotOccupancyOccupant.occupantAddress2) !== null && _h !== void 0 ? _h : '') === ''
'</td>' + ? ''
('<td>' + : cityssm.escapeHTML((_j = lotOccupancyOccupant.occupantAddress2) !== null && _j !== void 0 ? _j : '') +
(((_e = lotOccupancyOccupant.occupantAddress1) !== null && _e !== void 0 ? _e : '') === '' '<br />'}
? '' ${((_k = lotOccupancyOccupant.occupantCity) !== null && _k !== void 0 ? _k : '') === ''
: cityssm.escapeHTML((_f = lotOccupancyOccupant.occupantAddress1) !== null && _f !== void 0 ? _f : '') + ? ''
'<br />') + : cityssm.escapeHTML((_l = lotOccupancyOccupant.occupantCity) !== null && _l !== void 0 ? _l : '') + ', '}
(((_g = lotOccupancyOccupant.occupantAddress2) !== null && _g !== void 0 ? _g : '') === '' ${cityssm.escapeHTML((_m = lotOccupancyOccupant.occupantProvince) !== null && _m !== void 0 ? _m : '')}<br />
? '' ${cityssm.escapeHTML((_o = lotOccupancyOccupant.occupantPostalCode) !== null && _o !== void 0 ? _o : '')}</td><td>${((_p = lotOccupancyOccupant.occupantPhoneNumber) !== null && _p !== void 0 ? _p : '') === ''
: cityssm.escapeHTML((_h = lotOccupancyOccupant.occupantAddress2) !== null && _h !== void 0 ? _h : '') + ? ''
'<br />') + : cityssm.escapeHTML((_q = lotOccupancyOccupant.occupantPhoneNumber) !== null && _q !== void 0 ? _q : '') + '<br />'}
(((_j = lotOccupancyOccupant.occupantCity) !== null && _j !== void 0 ? _j : '') === '' ${((_r = lotOccupancyOccupant.occupantEmailAddress) !== null && _r !== void 0 ? _r : '') === ''
? '' ? ''
: cityssm.escapeHTML((_k = lotOccupancyOccupant.occupantCity) !== null && _k !== void 0 ? _k : '') + : cityssm.escapeHTML((_s = lotOccupancyOccupant.occupantEmailAddress) !== null && _s !== void 0 ? _s : '')}
', ') + </td><td>
cityssm.escapeHTML((_l = lotOccupancyOccupant.occupantProvince) !== null && _l !== void 0 ? _l : '') + <span data-tooltip="${cityssm.escapeHTML(((_t = lotOccupancyOccupant.occupantCommentTitle) !== null && _t !== void 0 ? _t : '') === ''
'<br />' + ? 'Comment'
cityssm.escapeHTML((_m = lotOccupancyOccupant.occupantPostalCode) !== null && _m !== void 0 ? _m : '') + : (_u = lotOccupancyOccupant.occupantCommentTitle) !== null && _u !== void 0 ? _u : '')}">
'</td>') + ${cityssm.escapeHTML((_v = lotOccupancyOccupant.occupantComment) !== null && _v !== void 0 ? _v : '')}
('<td>' + </span>
(((_o = lotOccupancyOccupant.occupantPhoneNumber) !== null && _o !== void 0 ? _o : '') === '' </td><td class="is-hidden-print">
? '' <div class="buttons are-small is-justify-content-end">
: cityssm.escapeHTML((_p = lotOccupancyOccupant.occupantPhoneNumber) !== null && _p !== void 0 ? _p : '') + <button class="button is-primary button--edit" type="button">
'<br />') + <span class="icon is-small"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>
(((_q = lotOccupancyOccupant.occupantEmailAddress) !== null && _q !== void 0 ? _q : '') === '' <span>Edit</span>
? '' </button>
: cityssm.escapeHTML((_r = lotOccupancyOccupant.occupantEmailAddress) !== null && _r !== void 0 ? _r : '')) + <button class="button is-light is-danger button--delete" data-tooltip="Delete ${los.escapedAliases.Occupant}" type="button" aria-label="Delete">
'</td>') + <i class="fas fa-trash" aria-hidden="true"></i>
('<td>' + </button>
'<span data-tooltip="' + </div>
cityssm.escapeHTML(((_s = lotOccupancyOccupant.occupantCommentTitle) !== null && _s !== void 0 ? _s : '') === '' </td>`;
? 'Comment'
: (_t = lotOccupancyOccupant.occupantCommentTitle) !== null && _t !== void 0 ? _t : '') +
'">' +
cityssm.escapeHTML((_u = lotOccupancyOccupant.occupantComment) !== null && _u !== void 0 ? _u : '') +
'</span>' +
'</td>') +
('<td class="is-hidden-print">' +
'<div class="buttons are-small is-justify-content-end">' +
('<button class="button is-primary button--edit" type="button">' +
'<span class="icon is-small"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>' +
' <span>Edit</span>' +
'</button>') +
('<button class="button is-light is-danger button--delete" data-tooltip="Delete ' +
los.escapedAliases.Occupant +
'" type="button" aria-label="Delete">' +
'<i class="fas fa-trash" aria-hidden="true"></i>' +
'</button>') +
'</div>' +
'</td>');
(_v = tableRowElement
.querySelector('.button--edit')) === null || _v === void 0 ? void 0 : _v.addEventListener('click', openEditLotOccupancyOccupant);
(_w = tableRowElement (_w = tableRowElement
.querySelector('.button--delete')) === null || _w === void 0 ? void 0 : _w.addEventListener('click', deleteLotOccupancyOccupant); .querySelector('.button--edit')) === null || _w === void 0 ? void 0 : _w.addEventListener('click', openEditLotOccupancyOccupant);
(_x = tableElement.querySelector('tbody')) === null || _x === void 0 ? void 0 : _x.append(tableRowElement); (_x = tableRowElement
.querySelector('.button--delete')) === null || _x === void 0 ? void 0 : _x.addEventListener('click', deleteLotOccupancyOccupant);
(_y = tableElement.querySelector('tbody')) === null || _y === void 0 ? void 0 : _y.append(tableRowElement);
} }
occupantsContainer.append(tableElement); occupantsContainer.append(tableElement);
} }
@ -294,12 +275,12 @@ else {
} }
let pastOccupantSearchResults = []; let pastOccupantSearchResults = [];
function addOccupantFromCopy(clickEvent) { function addOccupantFromCopy(clickEvent) {
var _a; var _a, _b;
clickEvent.preventDefault(); clickEvent.preventDefault();
const panelBlockElement = clickEvent.currentTarget; const panelBlockElement = clickEvent.currentTarget;
const occupant = pastOccupantSearchResults[Number.parseInt(panelBlockElement.dataset.index, 10)]; const occupant = pastOccupantSearchResults[Number.parseInt((_a = panelBlockElement.dataset.index) !== null && _a !== void 0 ? _a : '', 10)];
const lotOccupantTypeId = ((_a = panelBlockElement const lotOccupantTypeId = ((_b = panelBlockElement
.closest('.modal')) === null || _a === void 0 ? void 0 : _a.querySelector('#lotOccupancyOccupantCopy--lotOccupantTypeId')).value; .closest('.modal')) === null || _b === void 0 ? void 0 : _b.querySelector('#lotOccupancyOccupantCopy--lotOccupantTypeId')).value;
if (lotOccupantTypeId === '') { if (lotOccupantTypeId === '') {
bulmaJS.alert({ bulmaJS.alert({
title: `No ${los.escapedAliases.Occupant} Type Selected`, title: `No ${los.escapedAliases.Occupant} Type Selected`,

View File

@ -34,7 +34,7 @@ function openEditLotOccupancyOccupant(clickEvent: Event): void {
(currentLotOccupancyOccupant) => { (currentLotOccupancyOccupant) => {
return currentLotOccupancyOccupant.lotOccupantIndex === lotOccupantIndex return currentLotOccupancyOccupant.lotOccupantIndex === lotOccupantIndex
} }
)! ) as recordTypes.LotOccupancyOccupant
let editFormElement: HTMLFormElement let editFormElement: HTMLFormElement
let editCloseModalFunction: () => void let editCloseModalFunction: () => void
@ -314,79 +314,72 @@ function renderLotOccupancyOccupants(): void {
for (const lotOccupancyOccupant of lotOccupancyOccupants) { for (const lotOccupancyOccupant of lotOccupancyOccupants) {
const tableRowElement = document.createElement('tr') const tableRowElement = document.createElement('tr')
tableRowElement.dataset.lotOccupantIndex = tableRowElement.dataset.lotOccupantIndex =
lotOccupancyOccupant.lotOccupantIndex!.toString() lotOccupancyOccupant.lotOccupantIndex?.toString()
// eslint-disable-next-line no-unsanitized/property // eslint-disable-next-line no-unsanitized/property
tableRowElement.innerHTML = tableRowElement.innerHTML = `<td>
'<td>' + ${cityssm.escapeHTML(
cityssm.escapeHTML( (lotOccupancyOccupant.occupantName ?? '') === '' &&
(lotOccupancyOccupant.occupantName ?? '') === '' && (lotOccupancyOccupant.occupantFamilyName ?? '') === ''
(lotOccupancyOccupant.occupantFamilyName ?? '') === '' ? '(No Name)'
? '(No Name)' : `${lotOccupancyOccupant.occupantName} ${lotOccupancyOccupant.occupantFamilyName}`
: `${lotOccupancyOccupant.occupantName} ${lotOccupancyOccupant.occupantFamilyName}` )}<br />
) + <span class="tag">
'<br />' + <i class="fas fa-fw fa-${cityssm.escapeHTML(lotOccupancyOccupant.fontAwesomeIconClass ?? '')}" aria-hidden="true"></i>
('<span class="tag">' + <span class="ml-1">${cityssm.escapeHTML(lotOccupancyOccupant.lotOccupantType ?? '')}</span>
'<i class="fas fa-fw fa-' + </span>
cityssm.escapeHTML(lotOccupancyOccupant.fontAwesomeIconClass ?? '') + </td><td>
'" aria-hidden="true"></i>' + ${
' <span class="ml-1">' + (lotOccupancyOccupant.occupantAddress1 ?? '') === ''
cityssm.escapeHTML(lotOccupancyOccupant.lotOccupantType ?? '') + ? ''
'</span>' + : cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress1 ?? '') +
'</span>') + '<br />'
'</td>' + }
('<td>' + ${
((lotOccupancyOccupant.occupantAddress1 ?? '') === '' (lotOccupancyOccupant.occupantAddress2 ?? '') === ''
? '' ? ''
: cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress1 ?? '') + : cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress2 ?? '') +
'<br />') + '<br />'
((lotOccupancyOccupant.occupantAddress2 ?? '') === '' }
? '' ${
: cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress2 ?? '') + (lotOccupancyOccupant.occupantCity ?? '') === ''
'<br />') + ? ''
((lotOccupancyOccupant.occupantCity ?? '') === '' : cityssm.escapeHTML(lotOccupancyOccupant.occupantCity ?? '') + ', '
? '' }
: cityssm.escapeHTML(lotOccupancyOccupant.occupantCity ?? '') + ${cityssm.escapeHTML(lotOccupancyOccupant.occupantProvince ?? '')}<br />
', ') + ${cityssm.escapeHTML(lotOccupancyOccupant.occupantPostalCode ?? '')}</td><td>${
cityssm.escapeHTML(lotOccupancyOccupant.occupantProvince ?? '') + (lotOccupancyOccupant.occupantPhoneNumber ?? '') === ''
'<br />' + ? ''
cityssm.escapeHTML(lotOccupancyOccupant.occupantPostalCode ?? '') + : cityssm.escapeHTML(
'</td>') + lotOccupancyOccupant.occupantPhoneNumber ?? ''
('<td>' + ) + '<br />'
((lotOccupancyOccupant.occupantPhoneNumber ?? '') === '' }
? '' ${
: cityssm.escapeHTML(lotOccupancyOccupant.occupantPhoneNumber ?? '') + (lotOccupancyOccupant.occupantEmailAddress ?? '') === ''
'<br />') + ? ''
((lotOccupancyOccupant.occupantEmailAddress ?? '') === '' : cityssm.escapeHTML(
? '' lotOccupancyOccupant.occupantEmailAddress ?? ''
: cityssm.escapeHTML( )
lotOccupancyOccupant.occupantEmailAddress ?? '' }
)) + </td><td>
'</td>') + <span data-tooltip="${cityssm.escapeHTML(
('<td>' +
'<span data-tooltip="' +
cityssm.escapeHTML(
(lotOccupancyOccupant.occupantCommentTitle ?? '') === '' (lotOccupancyOccupant.occupantCommentTitle ?? '') === ''
? 'Comment' ? 'Comment'
: lotOccupancyOccupant.occupantCommentTitle ?? '' : lotOccupancyOccupant.occupantCommentTitle ?? ''
) + )}">
'">' + ${cityssm.escapeHTML(lotOccupancyOccupant.occupantComment ?? '')}
cityssm.escapeHTML(lotOccupancyOccupant.occupantComment ?? '') + </span>
'</span>' + </td><td class="is-hidden-print">
'</td>') + <div class="buttons are-small is-justify-content-end">
('<td class="is-hidden-print">' + <button class="button is-primary button--edit" type="button">
'<div class="buttons are-small is-justify-content-end">' + <span class="icon is-small"><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 is-small"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>' + </button>
' <span>Edit</span>' + <button class="button is-light is-danger button--delete" data-tooltip="Delete ${los.escapedAliases.Occupant}" type="button" aria-label="Delete">
'</button>') + <i class="fas fa-trash" aria-hidden="true"></i>
('<button class="button is-light is-danger button--delete" data-tooltip="Delete ' + </button>
los.escapedAliases.Occupant + </div>
'" type="button" aria-label="Delete">' + </td>`
'<i class="fas fa-trash" aria-hidden="true"></i>' +
'</button>') +
'</div>' +
'</td>')
tableRowElement tableRowElement
.querySelector('.button--edit') .querySelector('.button--edit')
@ -484,7 +477,7 @@ document
const occupant = const occupant =
pastOccupantSearchResults[ pastOccupantSearchResults[
Number.parseInt(panelBlockElement.dataset.index!, 10) Number.parseInt(panelBlockElement.dataset.index ?? '', 10)
] ]
const lotOccupantTypeId = ( const lotOccupantTypeId = (
@ -643,9 +636,11 @@ document
lotOccupantTypeIdElement.selectedOptions[0].dataset lotOccupantTypeIdElement.selectedOptions[0].dataset
.fontAwesomeIconClass ?? 'user' .fontAwesomeIconClass ?? 'user'
;(modalElement.querySelector( ;(
'#lotOccupancyOccupantAdd--fontAwesomeIconClass' modalElement.querySelector(
) as HTMLElement).innerHTML = '#lotOccupancyOccupantAdd--fontAwesomeIconClass'
) as HTMLElement
).innerHTML =
`<i class="fas fa-fw fa-${cityssm.escapeHTML(fontAwesomeIconClass)}" aria-hidden="true"></i>` `<i class="fas fa-fw fa-${cityssm.escapeHTML(fontAwesomeIconClass)}" aria-hidden="true"></i>`
let occupantCommentTitle = let occupantCommentTitle =
@ -656,9 +651,11 @@ document
occupantCommentTitle = 'Comment' occupantCommentTitle = 'Comment'
} }
;(modalElement.querySelector( ;(
'#lotOccupancyOccupantAdd--occupantCommentTitle' modalElement.querySelector(
) as HTMLElement).textContent = occupantCommentTitle '#lotOccupancyOccupantAdd--occupantCommentTitle'
) as HTMLElement
).textContent = occupantCommentTitle
}) })
addFormElement = modalElement.querySelector( addFormElement = modalElement.querySelector(

File diff suppressed because one or more lines are too long