Skip to content

Commit

Permalink
template literals
Browse files Browse the repository at this point in the history
  • Loading branch information
dangowans committed Jun 27, 2024
1 parent 610bc7e commit 5aeb485
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 50 deletions.
32 changes: 16 additions & 16 deletions public-typescript/lotOccupancyEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
</div>`;
return;
}
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doGetOccupancyTypeFields', {
cityssm.postJSON(`${los.urlPrefix}/lotOccupancies/doGetOccupancyTypeFields`, {
occupancyTypeId: occupancyTypeIdElement.value
}, (rawResponseJSON) => {
var _a, _b;
Expand Down Expand Up @@ -664,19 +664,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
</td><td>
${((_f = lotOccupancyOccupant.occupantAddress1) !== null && _f !== void 0 ? _f : '') === ''
? ''
: cityssm.escapeHTML((_g = lotOccupancyOccupant.occupantAddress1) !== null && _g !== void 0 ? _g : '') +
'<br />'}
: `${cityssm.escapeHTML((_g = lotOccupancyOccupant.occupantAddress1) !== null && _g !== void 0 ? _g : '')}<br />`}
${((_h = lotOccupancyOccupant.occupantAddress2) !== null && _h !== void 0 ? _h : '') === ''
? ''
: cityssm.escapeHTML((_j = lotOccupancyOccupant.occupantAddress2) !== null && _j !== void 0 ? _j : '') +
'<br />'}
: `${cityssm.escapeHTML((_j = lotOccupancyOccupant.occupantAddress2) !== null && _j !== void 0 ? _j : '')}<br />`}
${((_k = lotOccupancyOccupant.occupantCity) !== null && _k !== void 0 ? _k : '') === ''
? ''
: cityssm.escapeHTML((_l = lotOccupancyOccupant.occupantCity) !== null && _l !== void 0 ? _l : '') + ', '}
: `${cityssm.escapeHTML((_l = lotOccupancyOccupant.occupantCity) !== null && _l !== void 0 ? _l : '')}, `}
${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((_o = lotOccupancyOccupant.occupantPostalCode) !== null && _o !== void 0 ? _o : '')}
</td><td>
${((_p = lotOccupancyOccupant.occupantPhoneNumber) !== null && _p !== void 0 ? _p : '') === ''
? ''
: cityssm.escapeHTML((_q = lotOccupancyOccupant.occupantPhoneNumber) !== null && _q !== void 0 ? _q : '') + '<br />'}
: `${cityssm.escapeHTML((_q = lotOccupancyOccupant.occupantPhoneNumber) !== null && _q !== void 0 ? _q : '')}<br />`}
${((_r = lotOccupancyOccupant.occupantEmailAddress) !== null && _r !== void 0 ? _r : '') === ''
? ''
: cityssm.escapeHTML((_s = lotOccupancyOccupant.occupantEmailAddress) !== null && _s !== void 0 ? _s : '')}
Expand Down Expand Up @@ -805,15 +805,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
${cityssm.escapeHTML((_c = occupant.occupantAddress1) !== null && _c !== void 0 ? _c : '')}<br />
${((_d = occupant.occupantAddress2) !== null && _d !== void 0 ? _d : '') === ''
? ''
: cityssm.escapeHTML((_e = occupant.occupantAddress2) !== null && _e !== void 0 ? _e : '') +
'<br />'}${cityssm.escapeHTML((_f = occupant.occupantCity) !== null && _f !== void 0 ? _f : '')}, ${cityssm.escapeHTML((_g = occupant.occupantProvince) !== null && _g !== void 0 ? _g : '')}<br />
: `${cityssm.escapeHTML((_e = occupant.occupantAddress2) !== null && _e !== void 0 ? _e : '')}<br />`}${cityssm.escapeHTML((_f = occupant.occupantCity) !== null && _f !== void 0 ? _f : '')}, ${cityssm.escapeHTML((_g = occupant.occupantProvince) !== null && _g !== void 0 ? _g : '')}<br />
${cityssm.escapeHTML((_h = occupant.occupantPostalCode) !== null && _h !== void 0 ? _h : '')}
</div>
<div class="column">
${((_j = occupant.occupantPhoneNumber) !== null && _j !== void 0 ? _j : '') === ''
? ''
: cityssm.escapeHTML((_k = occupant.occupantPhoneNumber) !== null && _k !== void 0 ? _k : '') +
'<br />'}
: `${cityssm.escapeHTML((_k = occupant.occupantPhoneNumber) !== null && _k !== void 0 ? _k : '')}<br />`}
${cityssm.escapeHTML((_l = occupant.occupantEmailAddress) !== null && _l !== void 0 ? _l : '')}<br />
</div>
</div>`;
Expand Down Expand Up @@ -1251,9 +1249,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
((_p = lotOccupancyFee.taxAmount) !== null && _p !== void 0 ? _p : 0) * ((_q = lotOccupancyFee.quantity) !== null && _q !== void 0 ? _q : 0);
}
;
lotOccupancyFeesContainerElement.querySelector('#lotOccupancyFees--feeAmountTotal').textContent = '$' + feeAmountTotal.toFixed(2);
lotOccupancyFeesContainerElement.querySelector('#lotOccupancyFees--taxAmountTotal').textContent = '$' + taxAmountTotal.toFixed(2);
lotOccupancyFeesContainerElement.querySelector('#lotOccupancyFees--grandTotal').textContent = '$' + (feeAmountTotal + taxAmountTotal).toFixed(2);
lotOccupancyFeesContainerElement.querySelector('#lotOccupancyFees--feeAmountTotal').textContent = `$${feeAmountTotal.toFixed(2)}`;
lotOccupancyFeesContainerElement.querySelector('#lotOccupancyFees--taxAmountTotal').textContent = `$${taxAmountTotal.toFixed(2)}`;
lotOccupancyFeesContainerElement.querySelector('#lotOccupancyFees--grandTotal').textContent = `$${(feeAmountTotal + taxAmountTotal).toFixed(2)}`;
renderLotOccupancyTransactions();
}
const addFeeButtonElement = document.querySelector('#button--addFee');
Expand Down Expand Up @@ -1343,7 +1341,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
categoryContainerElement.className = 'container--feeCategory';
categoryContainerElement.dataset.feeCategoryId =
feeCategory.feeCategoryId.toString();
categoryContainerElement.innerHTML = `<h4 class="title is-5 mt-2">${cityssm.escapeHTML((_a = feeCategory.feeCategory) !== null && _a !== void 0 ? _a : '')}</h4>
categoryContainerElement.innerHTML = `<h4 class="title is-5 mt-2">
${cityssm.escapeHTML((_a = feeCategory.feeCategory) !== null && _a !== void 0 ? _a : '')}
</h4>
<div class="panel mb-5"></div>`;
let hasFees = false;
for (const fee of feeCategory.fees) {
Expand Down
2 changes: 1 addition & 1 deletion public-typescript/lotOccupancyEdit/lotOccupancyEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
</div>`;
return;
}
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doGetOccupancyTypeFields', {
cityssm.postJSON(`${los.urlPrefix}/lotOccupancies/doGetOccupancyTypeFields`, {
occupancyTypeId: occupancyTypeIdElement.value
}, (rawResponseJSON) => {
var _a, _b;
Expand Down
2 changes: 1 addition & 1 deletion public-typescript/lotOccupancyEdit/lotOccupancyEdit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ declare const exports: Record<string, unknown>
}

cityssm.postJSON(
los.urlPrefix + '/lotOccupancies/doGetOccupancyTypeFields',
`${los.urlPrefix}/lotOccupancies/doGetOccupancyTypeFields`,
{
occupancyTypeId: occupancyTypeIdElement.value
},
Expand Down
10 changes: 6 additions & 4 deletions public-typescript/lotOccupancyEdit/lotOccupancyEditFees.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ function renderLotOccupancyFees() {
((_p = lotOccupancyFee.taxAmount) !== null && _p !== void 0 ? _p : 0) * ((_q = lotOccupancyFee.quantity) !== null && _q !== void 0 ? _q : 0);
}
;
lotOccupancyFeesContainerElement.querySelector('#lotOccupancyFees--feeAmountTotal').textContent = '$' + feeAmountTotal.toFixed(2);
lotOccupancyFeesContainerElement.querySelector('#lotOccupancyFees--taxAmountTotal').textContent = '$' + taxAmountTotal.toFixed(2);
lotOccupancyFeesContainerElement.querySelector('#lotOccupancyFees--grandTotal').textContent = '$' + (feeAmountTotal + taxAmountTotal).toFixed(2);
lotOccupancyFeesContainerElement.querySelector('#lotOccupancyFees--feeAmountTotal').textContent = `$${feeAmountTotal.toFixed(2)}`;
lotOccupancyFeesContainerElement.querySelector('#lotOccupancyFees--taxAmountTotal').textContent = `$${taxAmountTotal.toFixed(2)}`;
lotOccupancyFeesContainerElement.querySelector('#lotOccupancyFees--grandTotal').textContent = `$${(feeAmountTotal + taxAmountTotal).toFixed(2)}`;
renderLotOccupancyTransactions();
}
const addFeeButtonElement = document.querySelector('#button--addFee');
Expand Down Expand Up @@ -269,7 +269,9 @@ addFeeButtonElement.addEventListener('click', () => {
categoryContainerElement.className = 'container--feeCategory';
categoryContainerElement.dataset.feeCategoryId =
feeCategory.feeCategoryId.toString();
categoryContainerElement.innerHTML = `<h4 class="title is-5 mt-2">${cityssm.escapeHTML((_a = feeCategory.feeCategory) !== null && _a !== void 0 ? _a : '')}</h4>
categoryContainerElement.innerHTML = `<h4 class="title is-5 mt-2">
${cityssm.escapeHTML((_a = feeCategory.feeCategory) !== null && _a !== void 0 ? _a : '')}
</h4>
<div class="panel mb-5"></div>`;
let hasFees = false;
for (const fee of feeCategory.fees) {
Expand Down
10 changes: 6 additions & 4 deletions public-typescript/lotOccupancyEdit/lotOccupancyEditFees.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,17 +268,17 @@ function renderLotOccupancyFees(): void {
lotOccupancyFeesContainerElement.querySelector(
'#lotOccupancyFees--feeAmountTotal'
) as HTMLElement
).textContent = '$' + feeAmountTotal.toFixed(2)
).textContent = `$${feeAmountTotal.toFixed(2)}`
;(
lotOccupancyFeesContainerElement.querySelector(
'#lotOccupancyFees--taxAmountTotal'
) as HTMLElement
).textContent = '$' + taxAmountTotal.toFixed(2)
).textContent = `$${taxAmountTotal.toFixed(2)}`
;(
lotOccupancyFeesContainerElement.querySelector(
'#lotOccupancyFees--grandTotal'
) as HTMLElement
).textContent = '$' + (feeAmountTotal + taxAmountTotal).toFixed(2)
).textContent = `$${(feeAmountTotal + taxAmountTotal).toFixed(2)}`

renderLotOccupancyTransactions()
}
Expand Down Expand Up @@ -406,7 +406,9 @@ addFeeButtonElement.addEventListener('click', () => {
categoryContainerElement.dataset.feeCategoryId =
feeCategory.feeCategoryId.toString()

categoryContainerElement.innerHTML = `<h4 class="title is-5 mt-2">${cityssm.escapeHTML(feeCategory.feeCategory ?? '')}</h4>
categoryContainerElement.innerHTML = `<h4 class="title is-5 mt-2">
${cityssm.escapeHTML(feeCategory.feeCategory ?? '')}
</h4>
<div class="panel mb-5"></div>`

let hasFees = false
Expand Down
20 changes: 9 additions & 11 deletions public-typescript/lotOccupancyEdit/lotOccupancyEditOccupants.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,19 +184,19 @@ function renderLotOccupancyOccupants() {
</td><td>
${((_f = lotOccupancyOccupant.occupantAddress1) !== null && _f !== void 0 ? _f : '') === ''
? ''
: cityssm.escapeHTML((_g = lotOccupancyOccupant.occupantAddress1) !== null && _g !== void 0 ? _g : '') +
'<br />'}
: `${cityssm.escapeHTML((_g = lotOccupancyOccupant.occupantAddress1) !== null && _g !== void 0 ? _g : '')}<br />`}
${((_h = lotOccupancyOccupant.occupantAddress2) !== null && _h !== void 0 ? _h : '') === ''
? ''
: cityssm.escapeHTML((_j = lotOccupancyOccupant.occupantAddress2) !== null && _j !== void 0 ? _j : '') +
'<br />'}
: `${cityssm.escapeHTML((_j = lotOccupancyOccupant.occupantAddress2) !== null && _j !== void 0 ? _j : '')}<br />`}
${((_k = lotOccupancyOccupant.occupantCity) !== null && _k !== void 0 ? _k : '') === ''
? ''
: cityssm.escapeHTML((_l = lotOccupancyOccupant.occupantCity) !== null && _l !== void 0 ? _l : '') + ', '}
: `${cityssm.escapeHTML((_l = lotOccupancyOccupant.occupantCity) !== null && _l !== void 0 ? _l : '')}, `}
${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((_o = lotOccupancyOccupant.occupantPostalCode) !== null && _o !== void 0 ? _o : '')}
</td><td>
${((_p = lotOccupancyOccupant.occupantPhoneNumber) !== null && _p !== void 0 ? _p : '') === ''
? ''
: cityssm.escapeHTML((_q = lotOccupancyOccupant.occupantPhoneNumber) !== null && _q !== void 0 ? _q : '') + '<br />'}
: `${cityssm.escapeHTML((_q = lotOccupancyOccupant.occupantPhoneNumber) !== null && _q !== void 0 ? _q : '')}<br />`}
${((_r = lotOccupancyOccupant.occupantEmailAddress) !== null && _r !== void 0 ? _r : '') === ''
? ''
: cityssm.escapeHTML((_s = lotOccupancyOccupant.occupantEmailAddress) !== null && _s !== void 0 ? _s : '')}
Expand Down Expand Up @@ -325,15 +325,13 @@ else {
${cityssm.escapeHTML((_c = occupant.occupantAddress1) !== null && _c !== void 0 ? _c : '')}<br />
${((_d = occupant.occupantAddress2) !== null && _d !== void 0 ? _d : '') === ''
? ''
: cityssm.escapeHTML((_e = occupant.occupantAddress2) !== null && _e !== void 0 ? _e : '') +
'<br />'}${cityssm.escapeHTML((_f = occupant.occupantCity) !== null && _f !== void 0 ? _f : '')}, ${cityssm.escapeHTML((_g = occupant.occupantProvince) !== null && _g !== void 0 ? _g : '')}<br />
: `${cityssm.escapeHTML((_e = occupant.occupantAddress2) !== null && _e !== void 0 ? _e : '')}<br />`}${cityssm.escapeHTML((_f = occupant.occupantCity) !== null && _f !== void 0 ? _f : '')}, ${cityssm.escapeHTML((_g = occupant.occupantProvince) !== null && _g !== void 0 ? _g : '')}<br />
${cityssm.escapeHTML((_h = occupant.occupantPostalCode) !== null && _h !== void 0 ? _h : '')}
</div>
<div class="column">
${((_j = occupant.occupantPhoneNumber) !== null && _j !== void 0 ? _j : '') === ''
? ''
: cityssm.escapeHTML((_k = occupant.occupantPhoneNumber) !== null && _k !== void 0 ? _k : '') +
'<br />'}
: `${cityssm.escapeHTML((_k = occupant.occupantPhoneNumber) !== null && _k !== void 0 ? _k : '')}<br />`}
${cityssm.escapeHTML((_l = occupant.occupantEmailAddress) !== null && _l !== void 0 ? _l : '')}<br />
</div>
</div>`;
Expand Down
22 changes: 10 additions & 12 deletions public-typescript/lotOccupancyEdit/lotOccupancyEditOccupants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,27 +332,27 @@ function renderLotOccupancyOccupants(): void {
${
(lotOccupancyOccupant.occupantAddress1 ?? '') === ''
? ''
: cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress1 ?? '') +
'<br />'
: `${cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress1 ?? '')}<br />`
}
${
(lotOccupancyOccupant.occupantAddress2 ?? '') === ''
? ''
: cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress2 ?? '') +
'<br />'
: `${cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress2 ?? '')}<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.occupantPostalCode ?? '')}
</td><td>
${
(lotOccupancyOccupant.occupantPhoneNumber ?? '') === ''
? ''
: cityssm.escapeHTML(
: `${cityssm.escapeHTML(
lotOccupancyOccupant.occupantPhoneNumber ?? ''
) + '<br />'
)}<br />`
}
${
(lotOccupancyOccupant.occupantEmailAddress ?? '') === ''
Expand Down Expand Up @@ -551,17 +551,15 @@ document
${
(occupant.occupantAddress2 ?? '') === ''
? ''
: cityssm.escapeHTML(occupant.occupantAddress2 ?? '') +
'<br />'
: `${cityssm.escapeHTML(occupant.occupantAddress2 ?? '')}<br />`
}${cityssm.escapeHTML(occupant.occupantCity ?? '')}, ${cityssm.escapeHTML(occupant.occupantProvince ?? '')}<br />
${cityssm.escapeHTML(occupant.occupantPostalCode ?? '')}
</div>
<div class="column">
${
(occupant.occupantPhoneNumber ?? '') === ''
? ''
: cityssm.escapeHTML(occupant.occupantPhoneNumber ?? '') +
'<br />'
: `${cityssm.escapeHTML(occupant.occupantPhoneNumber ?? '')}<br />`
}
${cityssm.escapeHTML(occupant.occupantEmailAddress ?? '')}<br />
</div>
Expand Down
2 changes: 1 addition & 1 deletion public/javascripts/lotOccupancyEdit.min.js

Large diffs are not rendered by default.

0 comments on commit 5aeb485

Please sign in to comment.