fee search category name

and linting too
deepsource-autofix-76c6eb20
Dan Gowans 2023-02-27 12:38:18 -05:00
parent 40f6079d32
commit 95fd36be87
4 changed files with 76 additions and 48 deletions

View File

@ -1091,8 +1091,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doDeleteLotOccupancyFee', {
lotOccupancyId,
feeId
}, (responseJSON) => {
}, (rawResponseJSON) => {
var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) {
lotOccupancyFees = responseJSON.lotOccupancyFees;
renderLotOccupancyFees();
@ -1174,7 +1175,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
'</td>' +
'<td>&times;</td>' +
'<td class="has-text-right">' +
lotOccupancyFee.quantity +
lotOccupancyFee.quantity.toString() +
'</td>' +
'<td>=</td>') +
'<td class="has-text-right">$' +
@ -1216,8 +1217,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
lotOccupancyId,
feeId,
quantity
}, (responseJSON) => {
}, (rawResponseJSON) => {
var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) {
lotOccupancyFees = responseJSON.lotOccupancyFees;
renderLotOccupancyFees();
@ -1273,7 +1275,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
}
}
function filterFees() {
var _a, _b, _c, _d, _e;
var _a, _b, _c, _d, _e, _f;
const filterStringPieces = feeFilterElement.value
.trim()
.toLowerCase()
@ -1296,9 +1298,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
continue;
}
let includeFee = true;
const feeSearchString = (((_b = fee.feeName) !== null && _b !== void 0 ? _b : '') +
const feeSearchString = (((_b = feeCategory.feeCategory) !== null && _b !== void 0 ? _b : '') +
' ' +
((_c = fee.feeDescription) !== null && _c !== void 0 ? _c : '')).toLowerCase();
((_c = fee.feeName) !== null && _c !== void 0 ? _c : '') +
' ' +
((_d = fee.feeDescription) !== null && _d !== void 0 ? _d : '')).toLowerCase();
for (const filterStringPiece of filterStringPieces) {
if (!feeSearchString.includes(filterStringPiece)) {
includeFee = false;
@ -1317,11 +1321,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
panelBlockElement.href = '#';
panelBlockElement.innerHTML =
'<strong>' +
cityssm.escapeHTML((_d = fee.feeName) !== null && _d !== void 0 ? _d : '') +
cityssm.escapeHTML((_e = fee.feeName) !== null && _e !== void 0 ? _e : '') +
'</strong><br />' +
'<small>' +
cityssm
.escapeHTML((_e = fee.feeDescription) !== null && _e !== void 0 ? _e : '')
.escapeHTML((_f = fee.feeDescription) !== null && _f !== void 0 ? _f : '')
.replace(/\n/g, '<br />') +
'</small>';
panelBlockElement.addEventListener('click', tryAddFee);
@ -1338,7 +1342,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
feeFilterResultsElement = modalElement.querySelector('#resultsContainer--feeSelect');
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doGetFees', {
lotOccupancyId
}, (responseJSON) => {
}, (rawResponseJSON) => {
const responseJSON = rawResponseJSON;
feeCategories = responseJSON.feeCategories;
feeFilterElement.disabled = false;
feeFilterElement.addEventListener('keyup', filterFees);
@ -1373,8 +1378,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doDeleteLotOccupancyTransaction', {
lotOccupancyId,
transactionIndex
}, (responseJSON) => {
}, (rawResponseJSON) => {
var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) {
lotOccupancyTransactions = responseJSON.lotOccupancyTransactions;
renderLotOccupancyTransactions();
@ -1460,7 +1466,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
;
lotOccupancyTransactionsContainerElement.querySelector('#lotOccupancyTransactions--grandTotal').textContent = '$' + transactionGrandTotal.toFixed(2);
const feeGrandTotal = getFeeGrandTotal();
if (feeGrandTotal > transactionGrandTotal) {
if (feeGrandTotal.toFixed(2) !== transactionGrandTotal.toFixed(2)) {
lotOccupancyTransactionsContainerElement.insertAdjacentHTML('afterbegin', '<div class="message is-warning">' +
'<div class="message-body">' +
'<div class="level">' +
@ -1479,8 +1485,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
let addCloseModalFunction;
function doAddTransaction(submitEvent) {
submitEvent.preventDefault();
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doAddLotOccupancyTransaction', submitEvent.currentTarget, (responseJSON) => {
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doAddLotOccupancyTransaction', submitEvent.currentTarget, (rawResponseJSON) => {
var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) {
lotOccupancyTransactions = responseJSON.lotOccupancyTransactions;
addCloseModalFunction();

View File

@ -20,8 +20,9 @@ function deleteLotOccupancyFee(clickEvent) {
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doDeleteLotOccupancyFee', {
lotOccupancyId,
feeId
}, (responseJSON) => {
}, (rawResponseJSON) => {
var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) {
lotOccupancyFees = responseJSON.lotOccupancyFees;
renderLotOccupancyFees();
@ -103,7 +104,7 @@ function renderLotOccupancyFees() {
'</td>' +
'<td>&times;</td>' +
'<td class="has-text-right">' +
lotOccupancyFee.quantity +
lotOccupancyFee.quantity.toString() +
'</td>' +
'<td>=</td>') +
'<td class="has-text-right">$' +
@ -145,8 +146,9 @@ function renderLotOccupancyFees() {
lotOccupancyId,
feeId,
quantity
}, (responseJSON) => {
}, (rawResponseJSON) => {
var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) {
lotOccupancyFees = responseJSON.lotOccupancyFees;
renderLotOccupancyFees();
@ -202,7 +204,7 @@ function renderLotOccupancyFees() {
}
}
function filterFees() {
var _a, _b, _c, _d, _e;
var _a, _b, _c, _d, _e, _f;
const filterStringPieces = feeFilterElement.value
.trim()
.toLowerCase()
@ -225,9 +227,11 @@ function renderLotOccupancyFees() {
continue;
}
let includeFee = true;
const feeSearchString = (((_b = fee.feeName) !== null && _b !== void 0 ? _b : '') +
const feeSearchString = (((_b = feeCategory.feeCategory) !== null && _b !== void 0 ? _b : '') +
' ' +
((_c = fee.feeDescription) !== null && _c !== void 0 ? _c : '')).toLowerCase();
((_c = fee.feeName) !== null && _c !== void 0 ? _c : '') +
' ' +
((_d = fee.feeDescription) !== null && _d !== void 0 ? _d : '')).toLowerCase();
for (const filterStringPiece of filterStringPieces) {
if (!feeSearchString.includes(filterStringPiece)) {
includeFee = false;
@ -246,11 +250,11 @@ function renderLotOccupancyFees() {
panelBlockElement.href = '#';
panelBlockElement.innerHTML =
'<strong>' +
cityssm.escapeHTML((_d = fee.feeName) !== null && _d !== void 0 ? _d : '') +
cityssm.escapeHTML((_e = fee.feeName) !== null && _e !== void 0 ? _e : '') +
'</strong><br />' +
'<small>' +
cityssm
.escapeHTML((_e = fee.feeDescription) !== null && _e !== void 0 ? _e : '')
.escapeHTML((_f = fee.feeDescription) !== null && _f !== void 0 ? _f : '')
.replace(/\n/g, '<br />') +
'</small>';
panelBlockElement.addEventListener('click', tryAddFee);
@ -267,7 +271,8 @@ function renderLotOccupancyFees() {
feeFilterResultsElement = modalElement.querySelector('#resultsContainer--feeSelect');
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doGetFees', {
lotOccupancyId
}, (responseJSON) => {
}, (rawResponseJSON) => {
const responseJSON = rawResponseJSON;
feeCategories = responseJSON.feeCategories;
feeFilterElement.disabled = false;
feeFilterElement.addEventListener('keyup', filterFees);
@ -302,8 +307,9 @@ function deleteLotOccupancyTransaction(clickEvent) {
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doDeleteLotOccupancyTransaction', {
lotOccupancyId,
transactionIndex
}, (responseJSON) => {
}, (rawResponseJSON) => {
var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) {
lotOccupancyTransactions = responseJSON.lotOccupancyTransactions;
renderLotOccupancyTransactions();
@ -389,7 +395,7 @@ function renderLotOccupancyTransactions() {
;
lotOccupancyTransactionsContainerElement.querySelector('#lotOccupancyTransactions--grandTotal').textContent = '$' + transactionGrandTotal.toFixed(2);
const feeGrandTotal = getFeeGrandTotal();
if (feeGrandTotal > transactionGrandTotal) {
if (feeGrandTotal.toFixed(2) !== transactionGrandTotal.toFixed(2)) {
lotOccupancyTransactionsContainerElement.insertAdjacentHTML('afterbegin', '<div class="message is-warning">' +
'<div class="message-body">' +
'<div class="level">' +
@ -408,8 +414,9 @@ document
let addCloseModalFunction;
function doAddTransaction(submitEvent) {
submitEvent.preventDefault();
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doAddLotOccupancyTransaction', submitEvent.currentTarget, (responseJSON) => {
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doAddLotOccupancyTransaction', submitEvent.currentTarget, (rawResponseJSON) => {
var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) {
lotOccupancyTransactions = responseJSON.lotOccupancyTransactions;
addCloseModalFunction();

View File

@ -47,11 +47,13 @@ function deleteLotOccupancyFee(clickEvent: Event): void {
lotOccupancyId,
feeId
},
(responseJSON: {
success: boolean
errorMessage?: string
lotOccupancyFees?: recordTypes.LotOccupancyFee[]
}) => {
(rawResponseJSON) => {
const responseJSON = rawResponseJSON as {
success: boolean
errorMessage?: string
lotOccupancyFees?: recordTypes.LotOccupancyFee[]
}
if (responseJSON.success) {
lotOccupancyFees = responseJSON.lotOccupancyFees!
renderLotOccupancyFees()
@ -140,7 +142,7 @@ function renderLotOccupancyFees(): void {
'</td>' +
'<td>&times;</td>' +
'<td class="has-text-right">' +
lotOccupancyFee.quantity +
lotOccupancyFee.quantity!.toString() +
'</td>' +
'<td>=</td>') +
'<td class="has-text-right">$' +
@ -205,11 +207,13 @@ document.querySelector('#button--addFee')?.addEventListener('click', () => {
feeId,
quantity
},
(responseJSON: {
success: boolean
errorMessage?: string
lotOccupancyFees?: recordTypes.LotOccupancyFee[]
}) => {
(rawResponseJSON) => {
const responseJSON = rawResponseJSON as {
success: boolean
errorMessage?: string
lotOccupancyFees?: recordTypes.LotOccupancyFee[]
}
if (responseJSON.success) {
lotOccupancyFees = responseJSON.lotOccupancyFees!
renderLotOccupancyFees()
@ -321,6 +325,8 @@ document.querySelector('#button--addFee')?.addEventListener('click', () => {
let includeFee = true
const feeSearchString = (
(feeCategory.feeCategory ?? '') +
' ' +
(fee.feeName ?? '') +
' ' +
(fee.feeDescription ?? '')
@ -381,7 +387,11 @@ document.querySelector('#button--addFee')?.addEventListener('click', () => {
{
lotOccupancyId
},
(responseJSON: { feeCategories: recordTypes.FeeCategory[] }) => {
(rawResponseJSON) => {
const responseJSON = rawResponseJSON as {
feeCategories: recordTypes.FeeCategory[]
}
feeCategories = responseJSON.feeCategories
feeFilterElement.disabled = false
@ -436,11 +446,13 @@ function deleteLotOccupancyTransaction(clickEvent: Event): void {
lotOccupancyId,
transactionIndex
},
(responseJSON: {
success: boolean
errorMessage?: string
lotOccupancyTransactions?: recordTypes.LotOccupancyTransaction[]
}) => {
(rawResponseJSON) => {
const responseJSON = rawResponseJSON as {
success: boolean
errorMessage?: string
lotOccupancyTransactions?: recordTypes.LotOccupancyTransaction[]
}
if (responseJSON.success) {
lotOccupancyTransactions = responseJSON.lotOccupancyTransactions!
renderLotOccupancyTransactions()
@ -543,7 +555,7 @@ function renderLotOccupancyTransactions(): void {
const feeGrandTotal = getFeeGrandTotal()
if (feeGrandTotal > transactionGrandTotal) {
if (feeGrandTotal.toFixed(2) !== transactionGrandTotal.toFixed(2)) {
lotOccupancyTransactionsContainerElement.insertAdjacentHTML(
'afterbegin',
'<div class="message is-warning">' +
@ -571,11 +583,13 @@ document
cityssm.postJSON(
los.urlPrefix + '/lotOccupancies/doAddLotOccupancyTransaction',
submitEvent.currentTarget,
(responseJSON: {
success: boolean
errorMessage?: string
lotOccupancyTransactions?: recordTypes.LotOccupancyTransaction[]
}) => {
(rawResponseJSON) => {
const responseJSON = rawResponseJSON as {
success: boolean
errorMessage?: string
lotOccupancyTransactions?: recordTypes.LotOccupancyTransaction[]
}
if (responseJSON.success) {
lotOccupancyTransactions = responseJSON.lotOccupancyTransactions!
addCloseModalFunction()

File diff suppressed because one or more lines are too long