code cleanup
parent
577141be61
commit
19c58de58f
|
|
@ -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}`) +
|
: `${lotOccupancyOccupant.occupantName} ${lotOccupancyOccupant.occupantFamilyName}`)}<br />
|
||||||
'<br />' +
|
<span class="tag">
|
||||||
('<span class="tag">' +
|
<i class="fas fa-fw fa-${cityssm.escapeHTML((_d = lotOccupancyOccupant.fontAwesomeIconClass) !== null && _d !== void 0 ? _d : '')}" aria-hidden="true"></i>
|
||||||
'<i class="fas fa-fw fa-' +
|
<span class="ml-1">${cityssm.escapeHTML((_e = lotOccupancyOccupant.lotOccupantType) !== null && _e !== void 0 ? _e : '')}</span>
|
||||||
cityssm.escapeHTML((_c = lotOccupancyOccupant.fontAwesomeIconClass) !== null && _c !== void 0 ? _c : '') +
|
</span>
|
||||||
'" aria-hidden="true"></i>' +
|
</td><td>
|
||||||
' <span class="ml-1">' +
|
${((_f = lotOccupancyOccupant.occupantAddress1) !== null && _f !== void 0 ? _f : '') === ''
|
||||||
cityssm.escapeHTML((_d = lotOccupancyOccupant.lotOccupantType) !== null && _d !== void 0 ? _d : '') +
|
|
||||||
'</span>' +
|
|
||||||
'</span>') +
|
|
||||||
'</td>' +
|
|
||||||
('<td>' +
|
|
||||||
(((_e = lotOccupancyOccupant.occupantAddress1) !== null && _e !== void 0 ? _e : '') === ''
|
|
||||||
? ''
|
? ''
|
||||||
: cityssm.escapeHTML((_f = lotOccupancyOccupant.occupantAddress1) !== null && _f !== void 0 ? _f : '') +
|
: cityssm.escapeHTML((_g = lotOccupancyOccupant.occupantAddress1) !== null && _g !== void 0 ? _g : '') +
|
||||||
'<br />') +
|
'<br />'}
|
||||||
(((_g = lotOccupancyOccupant.occupantAddress2) !== null && _g !== void 0 ? _g : '') === ''
|
${((_h = lotOccupancyOccupant.occupantAddress2) !== null && _h !== void 0 ? _h : '') === ''
|
||||||
? ''
|
? ''
|
||||||
: cityssm.escapeHTML((_h = lotOccupancyOccupant.occupantAddress2) !== null && _h !== void 0 ? _h : '') +
|
: cityssm.escapeHTML((_j = lotOccupancyOccupant.occupantAddress2) !== null && _j !== void 0 ? _j : '') +
|
||||||
'<br />') +
|
'<br />'}
|
||||||
(((_j = lotOccupancyOccupant.occupantCity) !== null && _j !== void 0 ? _j : '') === ''
|
${((_k = lotOccupancyOccupant.occupantCity) !== null && _k !== void 0 ? _k : '') === ''
|
||||||
? ''
|
? ''
|
||||||
: cityssm.escapeHTML((_k = lotOccupancyOccupant.occupantCity) !== null && _k !== void 0 ? _k : '') +
|
: cityssm.escapeHTML((_l = lotOccupancyOccupant.occupantCity) !== null && _l !== void 0 ? _l : '') + ', '}
|
||||||
', ') +
|
${cityssm.escapeHTML((_m = lotOccupancyOccupant.occupantProvince) !== null && _m !== void 0 ? _m : '')}<br />
|
||||||
cityssm.escapeHTML((_l = lotOccupancyOccupant.occupantProvince) !== null && _l !== void 0 ? _l : '') +
|
${cityssm.escapeHTML((_o = lotOccupancyOccupant.occupantPostalCode) !== null && _o !== void 0 ? _o : '')}</td><td>${((_p = lotOccupancyOccupant.occupantPhoneNumber) !== null && _p !== void 0 ? _p : '') === ''
|
||||||
'<br />' +
|
|
||||||
cityssm.escapeHTML((_m = lotOccupancyOccupant.occupantPostalCode) !== null && _m !== void 0 ? _m : '') +
|
|
||||||
'</td>') +
|
|
||||||
('<td>' +
|
|
||||||
(((_o = lotOccupancyOccupant.occupantPhoneNumber) !== null && _o !== void 0 ? _o : '') === ''
|
|
||||||
? ''
|
? ''
|
||||||
: cityssm.escapeHTML((_p = lotOccupancyOccupant.occupantPhoneNumber) !== null && _p !== void 0 ? _p : '') +
|
: cityssm.escapeHTML((_q = lotOccupancyOccupant.occupantPhoneNumber) !== null && _q !== void 0 ? _q : '') + '<br />'}
|
||||||
'<br />') +
|
${((_r = lotOccupancyOccupant.occupantEmailAddress) !== null && _r !== void 0 ? _r : '') === ''
|
||||||
(((_q = lotOccupancyOccupant.occupantEmailAddress) !== null && _q !== void 0 ? _q : '') === ''
|
|
||||||
? ''
|
? ''
|
||||||
: cityssm.escapeHTML((_r = lotOccupancyOccupant.occupantEmailAddress) !== null && _r !== void 0 ? _r : '')) +
|
: cityssm.escapeHTML((_s = lotOccupancyOccupant.occupantEmailAddress) !== null && _s !== void 0 ? _s : '')}
|
||||||
'</td>') +
|
</td><td>
|
||||||
('<td>' +
|
<span data-tooltip="${cityssm.escapeHTML(((_t = lotOccupancyOccupant.occupantCommentTitle) !== null && _t !== void 0 ? _t : '') === ''
|
||||||
'<span data-tooltip="' +
|
|
||||||
cityssm.escapeHTML(((_s = lotOccupancyOccupant.occupantCommentTitle) !== null && _s !== void 0 ? _s : '') === ''
|
|
||||||
? 'Comment'
|
? 'Comment'
|
||||||
: (_t = lotOccupancyOccupant.occupantCommentTitle) !== null && _t !== void 0 ? _t : '') +
|
: (_u = lotOccupancyOccupant.occupantCommentTitle) !== null && _u !== void 0 ? _u : '')}">
|
||||||
'">' +
|
${cityssm.escapeHTML((_v = lotOccupancyOccupant.occupantComment) !== null && _v !== void 0 ? _v : '')}
|
||||||
cityssm.escapeHTML((_u = lotOccupancyOccupant.occupantComment) !== null && _u !== void 0 ? _u : '') +
|
</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>');
|
|
||||||
(_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`,
|
||||||
|
|
|
||||||
|
|
@ -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}`) +
|
: `${lotOccupancyOccupant.occupantName} ${lotOccupancyOccupant.occupantFamilyName}`)}<br />
|
||||||
'<br />' +
|
<span class="tag">
|
||||||
('<span class="tag">' +
|
<i class="fas fa-fw fa-${cityssm.escapeHTML((_d = lotOccupancyOccupant.fontAwesomeIconClass) !== null && _d !== void 0 ? _d : '')}" aria-hidden="true"></i>
|
||||||
'<i class="fas fa-fw fa-' +
|
<span class="ml-1">${cityssm.escapeHTML((_e = lotOccupancyOccupant.lotOccupantType) !== null && _e !== void 0 ? _e : '')}</span>
|
||||||
cityssm.escapeHTML((_c = lotOccupancyOccupant.fontAwesomeIconClass) !== null && _c !== void 0 ? _c : '') +
|
</span>
|
||||||
'" aria-hidden="true"></i>' +
|
</td><td>
|
||||||
' <span class="ml-1">' +
|
${((_f = lotOccupancyOccupant.occupantAddress1) !== null && _f !== void 0 ? _f : '') === ''
|
||||||
cityssm.escapeHTML((_d = lotOccupancyOccupant.lotOccupantType) !== null && _d !== void 0 ? _d : '') +
|
|
||||||
'</span>' +
|
|
||||||
'</span>') +
|
|
||||||
'</td>' +
|
|
||||||
('<td>' +
|
|
||||||
(((_e = lotOccupancyOccupant.occupantAddress1) !== null && _e !== void 0 ? _e : '') === ''
|
|
||||||
? ''
|
? ''
|
||||||
: cityssm.escapeHTML((_f = lotOccupancyOccupant.occupantAddress1) !== null && _f !== void 0 ? _f : '') +
|
: cityssm.escapeHTML((_g = lotOccupancyOccupant.occupantAddress1) !== null && _g !== void 0 ? _g : '') +
|
||||||
'<br />') +
|
'<br />'}
|
||||||
(((_g = lotOccupancyOccupant.occupantAddress2) !== null && _g !== void 0 ? _g : '') === ''
|
${((_h = lotOccupancyOccupant.occupantAddress2) !== null && _h !== void 0 ? _h : '') === ''
|
||||||
? ''
|
? ''
|
||||||
: cityssm.escapeHTML((_h = lotOccupancyOccupant.occupantAddress2) !== null && _h !== void 0 ? _h : '') +
|
: cityssm.escapeHTML((_j = lotOccupancyOccupant.occupantAddress2) !== null && _j !== void 0 ? _j : '') +
|
||||||
'<br />') +
|
'<br />'}
|
||||||
(((_j = lotOccupancyOccupant.occupantCity) !== null && _j !== void 0 ? _j : '') === ''
|
${((_k = lotOccupancyOccupant.occupantCity) !== null && _k !== void 0 ? _k : '') === ''
|
||||||
? ''
|
? ''
|
||||||
: cityssm.escapeHTML((_k = lotOccupancyOccupant.occupantCity) !== null && _k !== void 0 ? _k : '') +
|
: cityssm.escapeHTML((_l = lotOccupancyOccupant.occupantCity) !== null && _l !== void 0 ? _l : '') + ', '}
|
||||||
', ') +
|
${cityssm.escapeHTML((_m = lotOccupancyOccupant.occupantProvince) !== null && _m !== void 0 ? _m : '')}<br />
|
||||||
cityssm.escapeHTML((_l = lotOccupancyOccupant.occupantProvince) !== null && _l !== void 0 ? _l : '') +
|
${cityssm.escapeHTML((_o = lotOccupancyOccupant.occupantPostalCode) !== null && _o !== void 0 ? _o : '')}</td><td>${((_p = lotOccupancyOccupant.occupantPhoneNumber) !== null && _p !== void 0 ? _p : '') === ''
|
||||||
'<br />' +
|
|
||||||
cityssm.escapeHTML((_m = lotOccupancyOccupant.occupantPostalCode) !== null && _m !== void 0 ? _m : '') +
|
|
||||||
'</td>') +
|
|
||||||
('<td>' +
|
|
||||||
(((_o = lotOccupancyOccupant.occupantPhoneNumber) !== null && _o !== void 0 ? _o : '') === ''
|
|
||||||
? ''
|
? ''
|
||||||
: cityssm.escapeHTML((_p = lotOccupancyOccupant.occupantPhoneNumber) !== null && _p !== void 0 ? _p : '') +
|
: cityssm.escapeHTML((_q = lotOccupancyOccupant.occupantPhoneNumber) !== null && _q !== void 0 ? _q : '') + '<br />'}
|
||||||
'<br />') +
|
${((_r = lotOccupancyOccupant.occupantEmailAddress) !== null && _r !== void 0 ? _r : '') === ''
|
||||||
(((_q = lotOccupancyOccupant.occupantEmailAddress) !== null && _q !== void 0 ? _q : '') === ''
|
|
||||||
? ''
|
? ''
|
||||||
: cityssm.escapeHTML((_r = lotOccupancyOccupant.occupantEmailAddress) !== null && _r !== void 0 ? _r : '')) +
|
: cityssm.escapeHTML((_s = lotOccupancyOccupant.occupantEmailAddress) !== null && _s !== void 0 ? _s : '')}
|
||||||
'</td>') +
|
</td><td>
|
||||||
('<td>' +
|
<span data-tooltip="${cityssm.escapeHTML(((_t = lotOccupancyOccupant.occupantCommentTitle) !== null && _t !== void 0 ? _t : '') === ''
|
||||||
'<span data-tooltip="' +
|
|
||||||
cityssm.escapeHTML(((_s = lotOccupancyOccupant.occupantCommentTitle) !== null && _s !== void 0 ? _s : '') === ''
|
|
||||||
? 'Comment'
|
? 'Comment'
|
||||||
: (_t = lotOccupancyOccupant.occupantCommentTitle) !== null && _t !== void 0 ? _t : '') +
|
: (_u = lotOccupancyOccupant.occupantCommentTitle) !== null && _u !== void 0 ? _u : '')}">
|
||||||
'">' +
|
${cityssm.escapeHTML((_v = lotOccupancyOccupant.occupantComment) !== null && _v !== void 0 ? _v : '')}
|
||||||
cityssm.escapeHTML((_u = lotOccupancyOccupant.occupantComment) !== null && _u !== void 0 ? _u : '') +
|
</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>');
|
|
||||||
(_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`,
|
||||||
|
|
|
||||||
|
|
@ -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 />
|
||||||
'<br />' +
|
<span class="tag">
|
||||||
('<span class="tag">' +
|
<i class="fas fa-fw fa-${cityssm.escapeHTML(lotOccupancyOccupant.fontAwesomeIconClass ?? '')}" aria-hidden="true"></i>
|
||||||
'<i class="fas fa-fw fa-' +
|
<span class="ml-1">${cityssm.escapeHTML(lotOccupancyOccupant.lotOccupantType ?? '')}</span>
|
||||||
cityssm.escapeHTML(lotOccupancyOccupant.fontAwesomeIconClass ?? '') +
|
</span>
|
||||||
'" aria-hidden="true"></i>' +
|
</td><td>
|
||||||
' <span class="ml-1">' +
|
${
|
||||||
cityssm.escapeHTML(lotOccupancyOccupant.lotOccupantType ?? '') +
|
(lotOccupancyOccupant.occupantAddress1 ?? '') === ''
|
||||||
'</span>' +
|
|
||||||
'</span>') +
|
|
||||||
'</td>' +
|
|
||||||
('<td>' +
|
|
||||||
((lotOccupancyOccupant.occupantAddress1 ?? '') === ''
|
|
||||||
? ''
|
? ''
|
||||||
: cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress1 ?? '') +
|
: cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress1 ?? '') +
|
||||||
'<br />') +
|
'<br />'
|
||||||
((lotOccupancyOccupant.occupantAddress2 ?? '') === ''
|
}
|
||||||
|
${
|
||||||
|
(lotOccupancyOccupant.occupantAddress2 ?? '') === ''
|
||||||
? ''
|
? ''
|
||||||
: cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress2 ?? '') +
|
: cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress2 ?? '') +
|
||||||
'<br />') +
|
'<br />'
|
||||||
((lotOccupancyOccupant.occupantCity ?? '') === ''
|
}
|
||||||
|
${
|
||||||
|
(lotOccupancyOccupant.occupantCity ?? '') === ''
|
||||||
? ''
|
? ''
|
||||||
: cityssm.escapeHTML(lotOccupancyOccupant.occupantCity ?? '') +
|
: cityssm.escapeHTML(lotOccupancyOccupant.occupantCity ?? '') + ', '
|
||||||
', ') +
|
}
|
||||||
cityssm.escapeHTML(lotOccupancyOccupant.occupantProvince ?? '') +
|
${cityssm.escapeHTML(lotOccupancyOccupant.occupantProvince ?? '')}<br />
|
||||||
'<br />' +
|
${cityssm.escapeHTML(lotOccupancyOccupant.occupantPostalCode ?? '')}</td><td>${
|
||||||
cityssm.escapeHTML(lotOccupancyOccupant.occupantPostalCode ?? '') +
|
(lotOccupancyOccupant.occupantPhoneNumber ?? '') === ''
|
||||||
'</td>') +
|
|
||||||
('<td>' +
|
|
||||||
((lotOccupancyOccupant.occupantPhoneNumber ?? '') === ''
|
|
||||||
? ''
|
? ''
|
||||||
: cityssm.escapeHTML(lotOccupancyOccupant.occupantPhoneNumber ?? '') +
|
: cityssm.escapeHTML(
|
||||||
'<br />') +
|
lotOccupancyOccupant.occupantPhoneNumber ?? ''
|
||||||
((lotOccupancyOccupant.occupantEmailAddress ?? '') === ''
|
) + '<br />'
|
||||||
|
}
|
||||||
|
${
|
||||||
|
(lotOccupancyOccupant.occupantEmailAddress ?? '') === ''
|
||||||
? ''
|
? ''
|
||||||
: cityssm.escapeHTML(
|
: cityssm.escapeHTML(
|
||||||
lotOccupancyOccupant.occupantEmailAddress ?? ''
|
lotOccupancyOccupant.occupantEmailAddress ?? ''
|
||||||
)) +
|
)
|
||||||
'</td>') +
|
}
|
||||||
('<td>' +
|
</td><td>
|
||||||
'<span data-tooltip="' +
|
<span data-tooltip="${cityssm.escapeHTML(
|
||||||
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(
|
;(
|
||||||
|
modalElement.querySelector(
|
||||||
'#lotOccupancyOccupantAdd--fontAwesomeIconClass'
|
'#lotOccupancyOccupantAdd--fontAwesomeIconClass'
|
||||||
) as HTMLElement).innerHTML =
|
) 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(
|
;(
|
||||||
|
modalElement.querySelector(
|
||||||
'#lotOccupancyOccupantAdd--occupantCommentTitle'
|
'#lotOccupancyOccupantAdd--occupantCommentTitle'
|
||||||
) as HTMLElement).textContent = occupantCommentTitle
|
) as HTMLElement
|
||||||
|
).textContent = occupantCommentTitle
|
||||||
})
|
})
|
||||||
|
|
||||||
addFormElement = modalElement.querySelector(
|
addFormElement = modalElement.querySelector(
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue