deepsource-autofix-76c6eb20
Dan Gowans 2023-01-20 15:08:24 -05:00
parent 749f381ebd
commit 99efd66955
34 changed files with 356 additions and 326 deletions

View File

@ -6,15 +6,15 @@ import dartSass from 'sass';
import gulpSass from 'gulp-sass';
const sass = gulpSass(dartSass);
const publicSCSSDestination = 'public/stylesheets';
const publicSCSSFunction = () => {
function publicSCSSFunction() {
return gulp
.src('public-scss/*.scss')
.pipe(sass({ outputStyle: 'compressed', includePaths: ['node_modules'] }).on('error', sass.logError))
.pipe(gulp.dest(publicSCSSDestination));
};
}
gulp.task('public-scss', publicSCSSFunction);
const publicJavascriptsDestination = 'public/javascripts';
const publicJavascriptsMinFunction = () => {
function publicJavascriptsMinFunction() {
return gulp
.src('public-typescript/*.js', { allowEmpty: true })
.pipe(changed(publicJavascriptsDestination, {
@ -22,36 +22,36 @@ const publicJavascriptsMinFunction = () => {
}))
.pipe(minify({ noSource: true, ext: { min: '.min.js' } }))
.pipe(gulp.dest(publicJavascriptsDestination));
};
const publicJavascriptsAdminTablesFunction = () => {
}
function publicJavascriptsAdminTablesFunction() {
return gulp
.src('public-typescript/adminTables/adminTables.js')
.pipe(include())
.pipe(gulp.dest('public-typescript'));
};
const publicJavascriptsLotOccupancyEditFunction = () => {
}
function publicJavascriptsLotOccupancyEditFunction() {
return gulp
.src('public-typescript/lotOccupancyEdit/lotOccupancyEdit.js')
.pipe(include())
.pipe(gulp.dest('public-typescript'));
};
const publicJavascriptsWorkOrderEditFunction = () => {
}
function publicJavascriptsWorkOrderEditFunction() {
return gulp
.src('public-typescript/workOrderEdit/workOrderEdit.js')
.pipe(include())
.pipe(gulp.dest('public-typescript'));
};
}
gulp.task('public-javascript-adminTables', publicJavascriptsAdminTablesFunction);
gulp.task('public-javascript-lotOccupancyEdit', publicJavascriptsLotOccupancyEditFunction);
gulp.task('public-javascript-workOrderEdit', publicJavascriptsWorkOrderEditFunction);
gulp.task('public-javascript-min', publicJavascriptsMinFunction);
const watchFunction = () => {
function watchFunction() {
gulp.watch('public-scss/*.scss', publicSCSSFunction);
gulp.watch('public-typescript/adminTables/*.js', publicJavascriptsAdminTablesFunction);
gulp.watch('public-typescript/lotOccupancyEdit/*.js', publicJavascriptsLotOccupancyEditFunction);
gulp.watch('public-typescript/workOrderEdit/*.js', publicJavascriptsWorkOrderEditFunction);
gulp.watch('public-typescript/*.js', publicJavascriptsMinFunction);
};
}
gulp.task('watch', watchFunction);
gulp.task('default', () => {
publicJavascriptsAdminTablesFunction();

View File

@ -15,10 +15,15 @@ const sass = gulpSass(dartSass)
const publicSCSSDestination = 'public/stylesheets'
const publicSCSSFunction = () => {
function publicSCSSFunction(): NodeJS.ReadWriteStream {
return gulp
.src('public-scss/*.scss')
.pipe(sass({ outputStyle: 'compressed', includePaths: ['node_modules'] }).on('error', sass.logError))
.pipe(
sass({ outputStyle: 'compressed', includePaths: ['node_modules'] }).on(
'error',
sass.logError
)
)
.pipe(gulp.dest(publicSCSSDestination))
}
@ -30,7 +35,7 @@ gulp.task('public-scss', publicSCSSFunction)
const publicJavascriptsDestination = 'public/javascripts'
const publicJavascriptsMinFunction = () => {
function publicJavascriptsMinFunction(): NodeJS.ReadWriteStream {
return gulp
.src('public-typescript/*.js', { allowEmpty: true })
.pipe(
@ -42,21 +47,21 @@ const publicJavascriptsMinFunction = () => {
.pipe(gulp.dest(publicJavascriptsDestination))
}
const publicJavascriptsAdminTablesFunction = () => {
function publicJavascriptsAdminTablesFunction(): NodeJS.ReadWriteStream {
return gulp
.src('public-typescript/adminTables/adminTables.js')
.pipe(include())
.pipe(gulp.dest('public-typescript'))
}
const publicJavascriptsLotOccupancyEditFunction = () => {
function publicJavascriptsLotOccupancyEditFunction(): NodeJS.ReadWriteStream {
return gulp
.src('public-typescript/lotOccupancyEdit/lotOccupancyEdit.js')
.pipe(include())
.pipe(gulp.dest('public-typescript'))
}
const publicJavascriptsWorkOrderEditFunction = () => {
function publicJavascriptsWorkOrderEditFunction(): NodeJS.ReadWriteStream {
return gulp
.src('public-typescript/workOrderEdit/workOrderEdit.js')
.pipe(include())
@ -64,22 +69,37 @@ const publicJavascriptsWorkOrderEditFunction = () => {
}
gulp.task('public-javascript-adminTables', publicJavascriptsAdminTablesFunction)
gulp.task('public-javascript-lotOccupancyEdit', publicJavascriptsLotOccupancyEditFunction)
gulp.task('public-javascript-workOrderEdit', publicJavascriptsWorkOrderEditFunction)
gulp.task(
'public-javascript-lotOccupancyEdit',
publicJavascriptsLotOccupancyEditFunction
)
gulp.task(
'public-javascript-workOrderEdit',
publicJavascriptsWorkOrderEditFunction
)
gulp.task('public-javascript-min', publicJavascriptsMinFunction)
/*
* Watch
*/
const watchFunction = () => {
function watchFunction(): void {
gulp.watch('public-scss/*.scss', publicSCSSFunction)
gulp.watch('public-typescript/adminTables/*.js', publicJavascriptsAdminTablesFunction)
gulp.watch(
'public-typescript/adminTables/*.js',
publicJavascriptsAdminTablesFunction
)
gulp.watch('public-typescript/lotOccupancyEdit/*.js', publicJavascriptsLotOccupancyEditFunction)
gulp.watch(
'public-typescript/lotOccupancyEdit/*.js',
publicJavascriptsLotOccupancyEditFunction
)
gulp.watch('public-typescript/workOrderEdit/*.js', publicJavascriptsWorkOrderEditFunction)
gulp.watch(
'public-typescript/workOrderEdit/*.js',
publicJavascriptsWorkOrderEditFunction
)
gulp.watch('public-typescript/*.js', publicJavascriptsMinFunction)
}

View File

@ -32,12 +32,12 @@ function buildEventSummary(milestone) {
if (summary !== '') {
summary += ': ';
}
summary += occupant.occupantName;
summary += occupant.occupantName ?? '';
}
}
}
if (occupantCount > 1) {
summary += ' plus ' + (occupantCount - 1);
summary += ' plus ' + (occupantCount - 1).toString();
}
return summary;
}
@ -169,7 +169,7 @@ function buildEventDescriptionHTML(request, milestone) {
function buildEventCategoryList(milestone) {
const categories = [];
if (milestone.workOrderMilestoneTypeId) {
categories.push(milestone.workOrderMilestoneType, milestone.workOrderType);
categories.push(milestone.workOrderMilestoneType, milestone.workOrderType ?? '');
}
if (milestone.workOrderMilestoneCompletionDate) {
categories.push('Completed');

View File

@ -65,18 +65,19 @@ function buildEventSummary(milestone: recordTypes.WorkOrderMilestone): string {
summary += ': '
}
summary += occupant.occupantName
summary += occupant.occupantName ?? ''
}
}
}
if (occupantCount > 1) {
summary += ' plus ' + (occupantCount - 1)
summary += ' plus ' + (occupantCount - 1).toString()
}
return summary
}
// eslint-disable-next-line @typescript-eslint/naming-convention
function buildEventDescriptionHTML_occupancies(
request: Request,
milestone: recordTypes.WorkOrderMilestone
@ -140,6 +141,7 @@ function buildEventDescriptionHTML_occupancies(
return descriptionHTML
}
// eslint-disable-next-line @typescript-eslint/naming-convention
function buildEventDescriptionHTML_lots(
request: Request,
milestone: recordTypes.WorkOrderMilestone
@ -190,6 +192,7 @@ function buildEventDescriptionHTML_lots(
return descriptionHTML
}
// eslint-disable-next-line @typescript-eslint/naming-convention
function buildEventDescriptionHTML_prints(
request: Request,
milestone: recordTypes.WorkOrderMilestone
@ -249,7 +252,10 @@ function buildEventCategoryList(
const categories: string[] = []
if (milestone.workOrderMilestoneTypeId) {
categories.push(milestone.workOrderMilestoneType, milestone.workOrderType)
categories.push(
milestone.workOrderMilestoneType!,
milestone.workOrderType ?? ''
)
}
if (milestone.workOrderMilestoneCompletionDate) {
@ -270,7 +276,10 @@ function buildEventLocation(milestone: recordTypes.WorkOrderMilestone): string {
return lotNames.join(', ')
}
export async function handler(request: Request, response: Response): Promise<void> {
export async function handler(
request: Request,
response: Response
): Promise<void> {
const urlRoot = getUrlRoot(request)
/*

View File

@ -6,7 +6,7 @@ export async function addWorkOrder(workOrderForm, requestSession) {
const database = await acquireConnection();
const rightNow = new Date();
let workOrderNumber = workOrderForm.workOrderNumber;
if (!workOrderNumber) {
if ((workOrderNumber ?? '') === '') {
workOrderNumber = await getNextWorkOrderNumber(database);
}
const result = database
@ -16,13 +16,13 @@ export async function addWorkOrder(workOrderForm, requestSession) {
recordCreate_userName, recordCreate_timeMillis,
recordUpdate_userName, recordUpdate_timeMillis)
values (?, ?, ?, ?, ?, ?, ?, ?, ?)`)
.run(workOrderForm.workOrderTypeId, workOrderNumber, workOrderForm.workOrderDescription, workOrderForm.workOrderOpenDateString
? dateStringToInteger(workOrderForm.workOrderOpenDateString)
: dateToInteger(rightNow), workOrderForm.workOrderCloseDateString
? dateStringToInteger(workOrderForm.workOrderCloseDateString)
: undefined, requestSession.user.userName, rightNow.getTime(), requestSession.user.userName, rightNow.getTime());
.run(workOrderForm.workOrderTypeId, workOrderNumber, workOrderForm.workOrderDescription, (workOrderForm.workOrderOpenDateString ?? '') === ''
? dateToInteger(rightNow)
: dateStringToInteger(workOrderForm.workOrderOpenDateString), (workOrderForm.workOrderCloseDateString ?? '') === ''
? undefined
: dateStringToInteger(workOrderForm.workOrderCloseDateString), requestSession.user.userName, rightNow.getTime(), requestSession.user.userName, rightNow.getTime());
const workOrderId = result.lastInsertRowid;
if (workOrderForm.lotOccupancyId) {
if ((workOrderForm.lotOccupancyId ?? '') !== '') {
await addWorkOrderLotOccupancy({
workOrderId,
lotOccupancyId: workOrderForm.lotOccupancyId

View File

@ -29,7 +29,7 @@ export async function addWorkOrder(
let workOrderNumber = workOrderForm.workOrderNumber
if (!workOrderNumber) {
if ((workOrderNumber ?? '') === '') {
workOrderNumber = await getNextWorkOrderNumber(database)
}
@ -46,12 +46,12 @@ export async function addWorkOrder(
workOrderForm.workOrderTypeId,
workOrderNumber,
workOrderForm.workOrderDescription,
workOrderForm.workOrderOpenDateString
? dateStringToInteger(workOrderForm.workOrderOpenDateString)
: dateToInteger(rightNow),
workOrderForm.workOrderCloseDateString
? dateStringToInteger(workOrderForm.workOrderCloseDateString)
: undefined,
(workOrderForm.workOrderOpenDateString ?? '') === ''
? dateToInteger(rightNow)
: dateStringToInteger(workOrderForm.workOrderOpenDateString!),
(workOrderForm.workOrderCloseDateString ?? '') === ''
? undefined
: dateStringToInteger(workOrderForm.workOrderCloseDateString!),
requestSession.user!.userName,
rightNow.getTime(),
requestSession.user!.userName,
@ -60,11 +60,11 @@ export async function addWorkOrder(
const workOrderId = result.lastInsertRowid as number
if (workOrderForm.lotOccupancyId) {
if ((workOrderForm.lotOccupancyId ?? '') !== '') {
await addWorkOrderLotOccupancy(
{
workOrderId,
lotOccupancyId: workOrderForm.lotOccupancyId
lotOccupancyId: workOrderForm.lotOccupancyId!
},
requestSession,
database

View File

@ -5,7 +5,8 @@ import Debug from 'debug';
const debug = Debug('lot-occupancy-system:lotOccupancyDB:pool');
const pool = new Pool(databasePath);
export async function acquireConnection() {
return await pool.acquire();
const connection = await pool.acquire();
return connection;
}
exitHook(() => {
debug('Closing database pool');

View File

@ -10,7 +10,8 @@ const debug = Debug('lot-occupancy-system:lotOccupancyDB:pool')
const pool = new Pool(databasePath)
export async function acquireConnection(): Promise<PoolConnection> {
return await pool.acquire()
const connection = await pool.acquire()
return connection
}
exitHook(() => {

View File

@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
let feeCategories = exports.feeCategories;
delete exports.feeCategories;
function renderFeeCategories() {
var _a, _b, _c, _d, _e, _f;
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
if (feeCategories.length === 0) {
feeCategoriesContainerElement.innerHTML = `<div class="message is-warning">
<p class="message-body">There are no available fees.</p>
@ -61,7 +61,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
<div class="message is-info">
<p class="message-body">
There are no fees in the
"${cityssm.escapeHTML(feeCategory.feeCategory || '')}"
"${cityssm.escapeHTML((_b = feeCategory.feeCategory) !== null && _b !== void 0 ? _b : '')}"
category.
</p>
</div>
@ -75,39 +75,41 @@ Object.defineProperty(exports, "__esModule", { value: true });
const panelBlockElement = document.createElement('div');
panelBlockElement.className = 'panel-block is-block container--fee';
panelBlockElement.dataset.feeId = fee.feeId.toString();
const hasTagsBlock = fee.isRequired || fee.occupancyTypeId || fee.lotTypeId;
const hasTagsBlock = ((_c = fee.isRequired) !== null && _c !== void 0 ? _c : false) ||
fee.occupancyTypeId !== undefined ||
fee.lotTypeId !== undefined;
panelBlockElement.innerHTML =
'<div class="columns">' +
('<div class="column is-half">' +
'<p>' +
'<a class="has-text-weight-bold" href="#">' +
cityssm.escapeHTML((_b = fee.feeName) !== null && _b !== void 0 ? _b : '') +
cityssm.escapeHTML((_d = fee.feeName) !== null && _d !== void 0 ? _d : '') +
'</a><br />' +
'<small>' +
cityssm
.escapeHTML((_c = fee.feeDescription) !== null && _c !== void 0 ? _c : '')
.escapeHTML((_e = fee.feeDescription) !== null && _e !== void 0 ? _e : '')
.replace(/\n/g, '<br />') +
'</small>' +
'</p>' +
(hasTagsBlock
? '<p class="tags">' +
(fee.isRequired
(((_f = fee.isRequired) !== null && _f !== void 0 ? _f : false)
? '<span class="tag is-warning">Required</span>'
: '') +
(fee.occupancyTypeId
? ' <span class="tag has-tooltip-bottom" data-tooltip="' +
(fee.occupancyTypeId === undefined
? ''
: ' <span class="tag has-tooltip-bottom" data-tooltip="' +
los.escapedAliases.Occupancy +
' Type Filter">' +
cityssm.escapeHTML((_d = fee.occupancyType) !== null && _d !== void 0 ? _d : '') +
'</span>'
: '') +
(fee.lotTypeId
? ' <span class="tag has-tooltip-bottom" data-tooltip="' +
cityssm.escapeHTML((_g = fee.occupancyType) !== null && _g !== void 0 ? _g : '') +
'</span>') +
(fee.lotTypeId === undefined
? ''
: ' <span class="tag has-tooltip-bottom" data-tooltip="' +
los.escapedAliases.Lot +
' Type Filter">' +
cityssm.escapeHTML((_e = fee.lotType) !== null && _e !== void 0 ? _e : '') +
'</span>'
: '') +
cityssm.escapeHTML((_h = fee.lotType) !== null && _h !== void 0 ? _h : '') +
'</span>') +
'</p>'
: '') +
'</div>') +
@ -131,7 +133,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
'</div>') +
('<div class="column has-text-centered">' +
(fee.includeQuantity
? cityssm.escapeHTML((_f = fee.quantityUnit) !== null && _f !== void 0 ? _f : '') +
? cityssm.escapeHTML((_j = fee.quantityUnit) !== null && _j !== void 0 ? _j : '') +
'<br />' +
'<small>Quantity</small>'
: '') +
@ -501,7 +503,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
}
cityssm.openHtmlModal('adminFees-editFee', {
onshow(modalElement) {
var _a;
var _a, _b, _c;
editModalElement = modalElement;
modalElement.querySelector('#feeEdit--feeId').value = fee.feeId.toString();
const feeCategoryElement = modalElement.querySelector('#feeEdit--feeCategoryId');
@ -551,13 +553,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
taxPercentageElement.addEventListener('keyup', toggleTaxFields);
toggleTaxFields();
const includeQuantityElement = modalElement.querySelector('#feeEdit--includeQuantity');
if (fee.includeQuantity) {
if ((_a = fee.includeQuantity) !== null && _a !== void 0 ? _a : false) {
includeQuantityElement.value = '1';
}
includeQuantityElement.addEventListener('change', toggleQuantityFields);
modalElement.querySelector('#feeEdit--quantityUnit').value = (_a = fee.quantityUnit) !== null && _a !== void 0 ? _a : '';
modalElement.querySelector('#feeEdit--quantityUnit').value = (_b = fee.quantityUnit) !== null && _b !== void 0 ? _b : '';
toggleQuantityFields();
if (fee.isRequired) {
if ((_c = fee.isRequired) !== null && _c !== void 0 ? _c : false) {
;
modalElement.querySelector('#feeEdit--isRequired').value = '1';
}

View File

@ -85,9 +85,7 @@ declare const bulmaJS: BulmaJS
<div class="message is-info">
<p class="message-body">
There are no fees in the
"${cityssm.escapeHTML(
feeCategory.feeCategory || ''
)}"
"${cityssm.escapeHTML(feeCategory.feeCategory ?? '')}"
category.
</p>
</div>
@ -105,7 +103,9 @@ declare const bulmaJS: BulmaJS
panelBlockElement.dataset.feeId = fee.feeId.toString()
const hasTagsBlock =
fee.isRequired || fee.occupancyTypeId || fee.lotTypeId
(fee.isRequired ?? false) ||
fee.occupancyTypeId !== undefined ||
fee.lotTypeId !== undefined
panelBlockElement.innerHTML =
'<div class="columns">' +
@ -122,23 +122,23 @@ declare const bulmaJS: BulmaJS
'</p>' +
(hasTagsBlock
? '<p class="tags">' +
(fee.isRequired
(fee.isRequired ?? false
? '<span class="tag is-warning">Required</span>'
: '') +
(fee.occupancyTypeId
? ' <span class="tag has-tooltip-bottom" data-tooltip="' +
(fee.occupancyTypeId === undefined
? ''
: ' <span class="tag has-tooltip-bottom" data-tooltip="' +
los.escapedAliases.Occupancy +
' Type Filter">' +
cityssm.escapeHTML(fee.occupancyType ?? '') +
'</span>'
: '') +
(fee.lotTypeId
? ' <span class="tag has-tooltip-bottom" data-tooltip="' +
'</span>') +
(fee.lotTypeId === undefined
? ''
: ' <span class="tag has-tooltip-bottom" data-tooltip="' +
los.escapedAliases.Lot +
' Type Filter">' +
cityssm.escapeHTML(fee.lotType ?? '') +
'</span>'
: '') +
'</span>') +
'</p>'
: '') +
'</div>') +
@ -844,7 +844,7 @@ declare const bulmaJS: BulmaJS
'#feeEdit--includeQuantity'
) as HTMLSelectElement
if (fee.includeQuantity) {
if (fee.includeQuantity ?? false) {
includeQuantityElement.value = '1'
}
@ -857,7 +857,7 @@ declare const bulmaJS: BulmaJS
toggleQuantityFields()
if (fee.isRequired) {
if (fee.isRequired ?? false) {
;(
modalElement.querySelector(
'#feeEdit--isRequired'

View File

@ -186,6 +186,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doGetOccupancyTypeFields', {
occupancyTypeId: occupancyTypeIdElement.value
}, (responseJSON) => {
var _a;
if (responseJSON.occupancyTypeFields.length === 0) {
lotOccupancyFieldsContainerElement.innerHTML = `<div class="message is-info">
<p class="message-body">There are no additional fields for this ${los.escapedAliases.occupancy} type.</p>
@ -196,9 +197,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
let occupancyTypeFieldIds = '';
for (const occupancyTypeField of responseJSON.occupancyTypeFields) {
occupancyTypeFieldIds +=
',' + occupancyTypeField.occupancyTypeFieldId;
',' + occupancyTypeField.occupancyTypeFieldId.toString();
const fieldName = 'lotOccupancyFieldValue_' +
occupancyTypeField.occupancyTypeFieldId;
occupancyTypeField.occupancyTypeFieldId.toString();
const fieldId = 'lotOccupancy--' + fieldName;
const fieldElement = document.createElement('div');
fieldElement.className = 'field';
@ -215,8 +216,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
occupancyTypeField.minimumLength;
inputElement.maxLength =
occupancyTypeField.maximumLength;
if (occupancyTypeField.pattern &&
occupancyTypeField.pattern !== '') {
if (((_a = occupancyTypeField.pattern) !== null && _a !== void 0 ? _a : '') !== '') {
inputElement.pattern = occupancyTypeField.pattern;
}
;
@ -224,14 +224,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
}
else {
;
fieldElement.querySelector('.control').innerHTML =
'<div class="select is-fullwidth"><select id="' +
fieldId +
'" name="' +
fieldName +
'">' +
'<option value="">(Not Set)</option>' +
'</select></div>';
fieldElement.querySelector('.control').innerHTML = `<div class="select is-fullwidth">
<select id="${fieldId}" name="${fieldName}">
<option value="">(Not Set)</option>
</select>
</div>`;
const selectElement = fieldElement.querySelector('select');
selectElement.required = occupancyTypeField.isRequired;
const optionValues = occupancyTypeField.occupancyTypeFieldValues.split('\n');
@ -421,15 +418,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
.querySelector('.is-lot-view-button')
.addEventListener('click', () => {
const lotId = document.querySelector('#lotOccupancy--lotId').value;
if (lotId) {
window.open(los.urlPrefix + '/lots/' + lotId);
}
else {
if (lotId === '') {
bulmaJS.alert({
message: `No ${los.escapedAliases.lot} selected.`,
contextualColorName: 'info'
});
}
else {
window.open(los.urlPrefix + '/lots/' + lotId);
}
});
document
.querySelector('.is-clear-lot-button')
@ -570,7 +567,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
});
}
function renderLotOccupancyOccupants() {
var _a, _b, _c;
var _a, _b, _c, _d, _e, _f, _g, _h;
const occupantsContainer = document.querySelector('#container--lotOccupancyOccupants');
cityssm.clearElement(occupantsContainer);
if (lotOccupancyOccupants.length === 0) {
@ -609,27 +606,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
'</span>') +
'</td>' +
('<td>' +
(lotOccupancyOccupant.occupantAddress1
? cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress1) + '<br />'
: '') +
(lotOccupancyOccupant.occupantAddress2
? cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress2) + '<br />'
: '') +
(lotOccupancyOccupant.occupantCity
? cityssm.escapeHTML(lotOccupancyOccupant.occupantCity) + ', '
: '') +
cityssm.escapeHTML((_b = lotOccupancyOccupant.occupantProvince) !== null && _b !== void 0 ? _b : '') +
(((_b = lotOccupancyOccupant.occupantAddress1) !== null && _b !== void 0 ? _b : '') === ''
? ''
: cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress1) +
'<br />') +
(((_c = lotOccupancyOccupant.occupantAddress2) !== null && _c !== void 0 ? _c : '') === ''
? ''
: cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress2) +
'<br />') +
(((_d = lotOccupancyOccupant.occupantCity) !== null && _d !== void 0 ? _d : '') === ''
? ''
: cityssm.escapeHTML(lotOccupancyOccupant.occupantCity) + ', ') +
cityssm.escapeHTML((_e = lotOccupancyOccupant.occupantProvince) !== null && _e !== void 0 ? _e : '') +
'<br />' +
cityssm.escapeHTML((_c = lotOccupancyOccupant.occupantPostalCode) !== null && _c !== void 0 ? _c : '') +
cityssm.escapeHTML((_f = lotOccupancyOccupant.occupantPostalCode) !== null && _f !== void 0 ? _f : '') +
'</td>') +
('<td>' +
(lotOccupancyOccupant.occupantPhoneNumber
? cityssm.escapeHTML(lotOccupancyOccupant.occupantPhoneNumber) +
'<br />'
: '') +
(lotOccupancyOccupant.occupantEmailAddress
? cityssm.escapeHTML(lotOccupancyOccupant.occupantEmailAddress)
: '') +
(((_g = lotOccupancyOccupant.occupantPhoneNumber) !== null && _g !== void 0 ? _g : '') === ''
? ''
: cityssm.escapeHTML(lotOccupancyOccupant.occupantPhoneNumber) +
'<br />') +
(((_h = lotOccupancyOccupant.occupantEmailAddress) !== null && _h !== void 0 ? _h : '') === ''
? ''
: cityssm.escapeHTML(lotOccupancyOccupant.occupantEmailAddress)) +
'</td>') +
('<td>' +
cityssm.escapeHTML(lotOccupancyOccupant.occupantComment) +
@ -730,7 +729,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
searchResultsElement.innerHTML =
los.getLoadingParagraphHTML('Searching...');
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doSearchPastOccupants', searchFormElement, (responseJSON) => {
var _a, _b, _c, _d, _e, _f;
var _a, _b, _c, _d, _e, _f, _g, _h;
pastOccupantSearchResults = responseJSON.occupants;
const panelElement = document.createElement('div');
panelElement.className = 'panel';
@ -747,21 +746,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
('<div class="column">' +
cityssm.escapeHTML((_b = occupant.occupantAddress1) !== null && _b !== void 0 ? _b : '') +
'<br />' +
(occupant.occupantAddress2
? cityssm.escapeHTML(occupant.occupantAddress2) + '<br />'
: '') +
cityssm.escapeHTML((_c = occupant.occupantCity) !== null && _c !== void 0 ? _c : '') +
(((_c = occupant.occupantAddress2) !== null && _c !== void 0 ? _c : '') === ''
? ''
: cityssm.escapeHTML(occupant.occupantAddress2) +
'<br />') +
cityssm.escapeHTML((_d = occupant.occupantCity) !== null && _d !== void 0 ? _d : '') +
', ' +
cityssm.escapeHTML((_d = occupant.occupantProvince) !== null && _d !== void 0 ? _d : '') +
cityssm.escapeHTML((_e = occupant.occupantProvince) !== null && _e !== void 0 ? _e : '') +
'<br />' +
cityssm.escapeHTML((_e = occupant.occupantPostalCode) !== null && _e !== void 0 ? _e : '') +
cityssm.escapeHTML((_f = occupant.occupantPostalCode) !== null && _f !== void 0 ? _f : '') +
'</div>') +
('<div class="column">' +
(occupant.occupantPhoneNumber
? cityssm.escapeHTML(occupant.occupantPhoneNumber) +
'<br />'
: '') +
cityssm.escapeHTML((_f = occupant.occupantEmailAddress) !== null && _f !== void 0 ? _f : '') +
(((_g = occupant.occupantPhoneNumber) !== null && _g !== void 0 ? _g : '') === ''
? ''
: cityssm.escapeHTML(occupant.occupantPhoneNumber) +
'<br />') +
cityssm.escapeHTML((_h = occupant.occupantEmailAddress) !== null && _h !== void 0 ? _h : '') +
'<br />' +
'</div>') +
'</div>';
@ -906,7 +906,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
});
}
function renderLotOccupancyComments() {
var _a, _b;
var _a, _b, _c;
const containerElement = document.querySelector('#container--lotOccupancyComments');
if (lotOccupancyComments.length === 0) {
containerElement.innerHTML =
@ -934,13 +934,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
cityssm.escapeHTML((_a = lotOccupancyComment.recordCreate_userName) !== null && _a !== void 0 ? _a : '') +
'</td>' +
'<td>' +
lotOccupancyComment.lotOccupancyCommentDateString +
((_b = lotOccupancyComment.lotOccupancyCommentDateString) !== null && _b !== void 0 ? _b : '') +
(lotOccupancyComment.lotOccupancyCommentTime === 0
? ''
: ' ' + lotOccupancyComment.lotOccupancyCommentTimeString) +
'</td>' +
'<td>' +
cityssm.escapeHTML((_b = lotOccupancyComment.lotOccupancyComment) !== null && _b !== void 0 ? _b : '') +
cityssm.escapeHTML((_c = lotOccupancyComment.lotOccupancyComment) !== null && _c !== void 0 ? _c : '') +
'</td>' +
('<td class="is-hidden-print">' +
'<div class="buttons are-small is-justify-content-end">' +
@ -1051,7 +1051,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
});
}
function renderLotOccupancyFees() {
var _a;
var _a, _b;
if (lotOccupancyFees.length === 0) {
lotOccupancyFeesContainerElement.innerHTML = `<div class="message is-info">
<p class="message-body">There are no fees associated with this record.</p>
@ -1089,14 +1089,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
const tableRowElement = document.createElement('tr');
tableRowElement.className = 'container--lotOccupancyFee';
tableRowElement.dataset.feeId = lotOccupancyFee.feeId.toString();
tableRowElement.dataset.includeQuantity = lotOccupancyFee.includeQuantity
? '1'
: '0';
tableRowElement.dataset.includeQuantity =
((_a = lotOccupancyFee.includeQuantity) !== null && _a !== void 0 ? _a : false) ? '1' : '0';
tableRowElement.innerHTML =
'<td colspan="' +
(lotOccupancyFee.quantity === 1 ? '5' : '1') +
'">' +
cityssm.escapeHTML((_a = lotOccupancyFee.feeName) !== null && _a !== void 0 ? _a : '') +
cityssm.escapeHTML((_b = lotOccupancyFee.feeName) !== null && _b !== void 0 ? _b : '') +
'</td>' +
(lotOccupancyFee.quantity === 1
? ''
@ -1186,6 +1185,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
});
}
function tryAddFee(clickEvent) {
var _a;
clickEvent.preventDefault();
const feeId = Number.parseInt(clickEvent.currentTarget.dataset.feeId, 10);
const feeCategoryId = Number.parseInt(clickEvent.currentTarget.dataset.feeCategoryId, 10);
@ -1195,7 +1195,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
const fee = feeCategory.fees.find((currentFee) => {
return currentFee.feeId === feeId;
});
if (fee.includeQuantity) {
if ((_a = fee.includeQuantity) !== null && _a !== void 0 ? _a : false) {
doSetQuantityAndAddFee(fee);
}
else {
@ -1329,7 +1329,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
});
}
function renderLotOccupancyTransactions() {
var _a, _b;
var _a, _b, _c;
if (lotOccupancyTransactions.length === 0) {
lotOccupancyTransactionsContainerElement.innerHTML =
'<div class="message ' +
@ -1362,13 +1362,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
lotOccupancyTransaction.transactionIndex.toString();
tableRowElement.innerHTML =
'<td>' +
lotOccupancyTransaction.transactionDateString +
((_a = lotOccupancyTransaction.transactionDateString) !== null && _a !== void 0 ? _a : '') +
'</td>' +
('<td>' +
cityssm.escapeHTML((_a = lotOccupancyTransaction.externalReceiptNumber) !== null && _a !== void 0 ? _a : '') +
cityssm.escapeHTML((_b = lotOccupancyTransaction.externalReceiptNumber) !== null && _b !== void 0 ? _b : '') +
'<br />' +
'<small>' +
cityssm.escapeHTML((_b = lotOccupancyTransaction.transactionNote) !== null && _b !== void 0 ? _b : '') +
cityssm.escapeHTML((_c = lotOccupancyTransaction.transactionNote) !== null && _c !== void 0 ? _c : '') +
'</small>' +
'</td>') +
('<td class="has-text-right">$' +

View File

@ -186,6 +186,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doGetOccupancyTypeFields', {
occupancyTypeId: occupancyTypeIdElement.value
}, (responseJSON) => {
var _a;
if (responseJSON.occupancyTypeFields.length === 0) {
lotOccupancyFieldsContainerElement.innerHTML = `<div class="message is-info">
<p class="message-body">There are no additional fields for this ${los.escapedAliases.occupancy} type.</p>
@ -196,9 +197,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
let occupancyTypeFieldIds = '';
for (const occupancyTypeField of responseJSON.occupancyTypeFields) {
occupancyTypeFieldIds +=
',' + occupancyTypeField.occupancyTypeFieldId;
',' + occupancyTypeField.occupancyTypeFieldId.toString();
const fieldName = 'lotOccupancyFieldValue_' +
occupancyTypeField.occupancyTypeFieldId;
occupancyTypeField.occupancyTypeFieldId.toString();
const fieldId = 'lotOccupancy--' + fieldName;
const fieldElement = document.createElement('div');
fieldElement.className = 'field';
@ -215,8 +216,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
occupancyTypeField.minimumLength;
inputElement.maxLength =
occupancyTypeField.maximumLength;
if (occupancyTypeField.pattern &&
occupancyTypeField.pattern !== '') {
if (((_a = occupancyTypeField.pattern) !== null && _a !== void 0 ? _a : '') !== '') {
inputElement.pattern = occupancyTypeField.pattern;
}
;
@ -224,14 +224,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
}
else {
;
fieldElement.querySelector('.control').innerHTML =
'<div class="select is-fullwidth"><select id="' +
fieldId +
'" name="' +
fieldName +
'">' +
'<option value="">(Not Set)</option>' +
'</select></div>';
fieldElement.querySelector('.control').innerHTML = `<div class="select is-fullwidth">
<select id="${fieldId}" name="${fieldName}">
<option value="">(Not Set)</option>
</select>
</div>`;
const selectElement = fieldElement.querySelector('select');
selectElement.required = occupancyTypeField.isRequired;
const optionValues = occupancyTypeField.occupancyTypeFieldValues.split('\n');
@ -421,15 +418,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
.querySelector('.is-lot-view-button')
.addEventListener('click', () => {
const lotId = document.querySelector('#lotOccupancy--lotId').value;
if (lotId) {
window.open(los.urlPrefix + '/lots/' + lotId);
}
else {
if (lotId === '') {
bulmaJS.alert({
message: `No ${los.escapedAliases.lot} selected.`,
contextualColorName: 'info'
});
}
else {
window.open(los.urlPrefix + '/lots/' + lotId);
}
});
document
.querySelector('.is-clear-lot-button')

View File

@ -296,11 +296,11 @@ declare const bulmaJS: BulmaJS
for (const occupancyTypeField of responseJSON.occupancyTypeFields) {
occupancyTypeFieldIds +=
',' + occupancyTypeField.occupancyTypeFieldId
',' + occupancyTypeField.occupancyTypeFieldId!.toString()
const fieldName =
'lotOccupancyFieldValue_' +
occupancyTypeField.occupancyTypeFieldId
occupancyTypeField.occupancyTypeFieldId!.toString()
const fieldId = 'lotOccupancy--' + fieldName
@ -328,11 +328,8 @@ declare const bulmaJS: BulmaJS
inputElement.maxLength =
occupancyTypeField.maximumLength as number
if (
occupancyTypeField.pattern &&
occupancyTypeField.pattern !== ''
) {
inputElement.pattern = occupancyTypeField.pattern
if ((occupancyTypeField.pattern ?? '') !== '') {
inputElement.pattern = occupancyTypeField.pattern!
}
;(fieldElement.querySelector('.control') as HTMLElement).append(
@ -341,14 +338,11 @@ declare const bulmaJS: BulmaJS
} else {
;(
fieldElement.querySelector('.control') as HTMLElement
).innerHTML =
'<div class="select is-fullwidth"><select id="' +
fieldId +
'" name="' +
fieldName +
'">' +
'<option value="">(Not Set)</option>' +
'</select></div>'
).innerHTML = `<div class="select is-fullwidth">
<select id="${fieldId}" name="${fieldName}">
<option value="">(Not Set)</option>
</select>
</div>`
const selectElement = fieldElement.querySelector(
'select'
@ -647,13 +641,13 @@ declare const bulmaJS: BulmaJS
document.querySelector('#lotOccupancy--lotId') as HTMLInputElement
).value
if (lotId) {
window.open(los.urlPrefix + '/lots/' + lotId)
} else {
if (lotId === '') {
bulmaJS.alert({
message: `No ${los.escapedAliases.lot} selected.`,
contextualColorName: 'info'
})
} else {
window.open(los.urlPrefix + '/lots/' + lotId)
}
})

View File

@ -92,7 +92,7 @@ function deleteLotOccupancyComment(clickEvent) {
});
}
function renderLotOccupancyComments() {
var _a, _b;
var _a, _b, _c;
const containerElement = document.querySelector('#container--lotOccupancyComments');
if (lotOccupancyComments.length === 0) {
containerElement.innerHTML =
@ -120,13 +120,13 @@ function renderLotOccupancyComments() {
cityssm.escapeHTML((_a = lotOccupancyComment.recordCreate_userName) !== null && _a !== void 0 ? _a : '') +
'</td>' +
'<td>' +
lotOccupancyComment.lotOccupancyCommentDateString +
((_b = lotOccupancyComment.lotOccupancyCommentDateString) !== null && _b !== void 0 ? _b : '') +
(lotOccupancyComment.lotOccupancyCommentTime === 0
? ''
: ' ' + lotOccupancyComment.lotOccupancyCommentTimeString) +
'</td>' +
'<td>' +
cityssm.escapeHTML((_b = lotOccupancyComment.lotOccupancyComment) !== null && _b !== void 0 ? _b : '') +
cityssm.escapeHTML((_c = lotOccupancyComment.lotOccupancyComment) !== null && _c !== void 0 ? _c : '') +
'</td>' +
('<td class="is-hidden-print">' +
'<div class="buttons are-small is-justify-content-end">' +

View File

@ -200,10 +200,10 @@ function renderLotOccupancyComments(): void {
cityssm.escapeHTML(lotOccupancyComment.recordCreate_userName ?? '') +
'</td>' +
'<td>' +
lotOccupancyComment.lotOccupancyCommentDateString +
(lotOccupancyComment.lotOccupancyCommentDateString ?? '') +
(lotOccupancyComment.lotOccupancyCommentTime === 0
? ''
: ' ' + lotOccupancyComment.lotOccupancyCommentTimeString) +
: ' ' + lotOccupancyComment.lotOccupancyCommentTimeString!) +
'</td>' +
'<td>' +
cityssm.escapeHTML(lotOccupancyComment.lotOccupancyComment ?? '') +

View File

@ -45,7 +45,7 @@ function deleteLotOccupancyFee(clickEvent) {
});
}
function renderLotOccupancyFees() {
var _a;
var _a, _b;
if (lotOccupancyFees.length === 0) {
lotOccupancyFeesContainerElement.innerHTML = `<div class="message is-info">
<p class="message-body">There are no fees associated with this record.</p>
@ -83,14 +83,13 @@ function renderLotOccupancyFees() {
const tableRowElement = document.createElement('tr');
tableRowElement.className = 'container--lotOccupancyFee';
tableRowElement.dataset.feeId = lotOccupancyFee.feeId.toString();
tableRowElement.dataset.includeQuantity = lotOccupancyFee.includeQuantity
? '1'
: '0';
tableRowElement.dataset.includeQuantity =
((_a = lotOccupancyFee.includeQuantity) !== null && _a !== void 0 ? _a : false) ? '1' : '0';
tableRowElement.innerHTML =
'<td colspan="' +
(lotOccupancyFee.quantity === 1 ? '5' : '1') +
'">' +
cityssm.escapeHTML((_a = lotOccupancyFee.feeName) !== null && _a !== void 0 ? _a : '') +
cityssm.escapeHTML((_b = lotOccupancyFee.feeName) !== null && _b !== void 0 ? _b : '') +
'</td>' +
(lotOccupancyFee.quantity === 1
? ''
@ -180,6 +179,7 @@ document.querySelector('#button--addFee').addEventListener('click', () => {
});
}
function tryAddFee(clickEvent) {
var _a;
clickEvent.preventDefault();
const feeId = Number.parseInt(clickEvent.currentTarget.dataset.feeId, 10);
const feeCategoryId = Number.parseInt(clickEvent.currentTarget.dataset.feeCategoryId, 10);
@ -189,7 +189,7 @@ document.querySelector('#button--addFee').addEventListener('click', () => {
const fee = feeCategory.fees.find((currentFee) => {
return currentFee.feeId === feeId;
});
if (fee.includeQuantity) {
if ((_a = fee.includeQuantity) !== null && _a !== void 0 ? _a : false) {
doSetQuantityAndAddFee(fee);
}
else {
@ -323,7 +323,7 @@ function deleteLotOccupancyTransaction(clickEvent) {
});
}
function renderLotOccupancyTransactions() {
var _a, _b;
var _a, _b, _c;
if (lotOccupancyTransactions.length === 0) {
lotOccupancyTransactionsContainerElement.innerHTML =
'<div class="message ' +
@ -356,13 +356,13 @@ function renderLotOccupancyTransactions() {
lotOccupancyTransaction.transactionIndex.toString();
tableRowElement.innerHTML =
'<td>' +
lotOccupancyTransaction.transactionDateString +
((_a = lotOccupancyTransaction.transactionDateString) !== null && _a !== void 0 ? _a : '') +
'</td>' +
('<td>' +
cityssm.escapeHTML((_a = lotOccupancyTransaction.externalReceiptNumber) !== null && _a !== void 0 ? _a : '') +
cityssm.escapeHTML((_b = lotOccupancyTransaction.externalReceiptNumber) !== null && _b !== void 0 ? _b : '') +
'<br />' +
'<small>' +
cityssm.escapeHTML((_b = lotOccupancyTransaction.transactionNote) !== null && _b !== void 0 ? _b : '') +
cityssm.escapeHTML((_c = lotOccupancyTransaction.transactionNote) !== null && _c !== void 0 ? _c : '') +
'</small>' +
'</td>') +
('<td class="has-text-right">$' +

View File

@ -120,9 +120,8 @@ function renderLotOccupancyFees(): void {
const tableRowElement = document.createElement('tr')
tableRowElement.className = 'container--lotOccupancyFee'
tableRowElement.dataset.feeId = lotOccupancyFee.feeId.toString()
tableRowElement.dataset.includeQuantity = lotOccupancyFee.includeQuantity
? '1'
: '0'
tableRowElement.dataset.includeQuantity =
lotOccupancyFee.includeQuantity ?? false ? '1' : '0'
tableRowElement.innerHTML =
'<td colspan="' +
@ -274,7 +273,7 @@ document.querySelector('#button--addFee')!.addEventListener('click', () => {
return currentFee.feeId === feeId
})!
if (fee.includeQuantity) {
if (fee.includeQuantity ?? false) {
doSetQuantityAndAddFee(fee)
} else {
doAddFee(feeId)
@ -502,7 +501,7 @@ function renderLotOccupancyTransactions(): void {
tableRowElement.innerHTML =
'<td>' +
lotOccupancyTransaction.transactionDateString +
(lotOccupancyTransaction.transactionDateString ?? '') +
'</td>' +
('<td>' +
cityssm.escapeHTML(

View File

@ -109,7 +109,7 @@ function deleteLotOccupancyOccupant(clickEvent) {
});
}
function renderLotOccupancyOccupants() {
var _a, _b, _c;
var _a, _b, _c, _d, _e, _f, _g, _h;
const occupantsContainer = document.querySelector('#container--lotOccupancyOccupants');
cityssm.clearElement(occupantsContainer);
if (lotOccupancyOccupants.length === 0) {
@ -148,27 +148,29 @@ function renderLotOccupancyOccupants() {
'</span>') +
'</td>' +
('<td>' +
(lotOccupancyOccupant.occupantAddress1
? cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress1) + '<br />'
: '') +
(lotOccupancyOccupant.occupantAddress2
? cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress2) + '<br />'
: '') +
(lotOccupancyOccupant.occupantCity
? cityssm.escapeHTML(lotOccupancyOccupant.occupantCity) + ', '
: '') +
cityssm.escapeHTML((_b = lotOccupancyOccupant.occupantProvince) !== null && _b !== void 0 ? _b : '') +
(((_b = lotOccupancyOccupant.occupantAddress1) !== null && _b !== void 0 ? _b : '') === ''
? ''
: cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress1) +
'<br />') +
(((_c = lotOccupancyOccupant.occupantAddress2) !== null && _c !== void 0 ? _c : '') === ''
? ''
: cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress2) +
'<br />') +
(((_d = lotOccupancyOccupant.occupantCity) !== null && _d !== void 0 ? _d : '') === ''
? ''
: cityssm.escapeHTML(lotOccupancyOccupant.occupantCity) + ', ') +
cityssm.escapeHTML((_e = lotOccupancyOccupant.occupantProvince) !== null && _e !== void 0 ? _e : '') +
'<br />' +
cityssm.escapeHTML((_c = lotOccupancyOccupant.occupantPostalCode) !== null && _c !== void 0 ? _c : '') +
cityssm.escapeHTML((_f = lotOccupancyOccupant.occupantPostalCode) !== null && _f !== void 0 ? _f : '') +
'</td>') +
('<td>' +
(lotOccupancyOccupant.occupantPhoneNumber
? cityssm.escapeHTML(lotOccupancyOccupant.occupantPhoneNumber) +
'<br />'
: '') +
(lotOccupancyOccupant.occupantEmailAddress
? cityssm.escapeHTML(lotOccupancyOccupant.occupantEmailAddress)
: '') +
(((_g = lotOccupancyOccupant.occupantPhoneNumber) !== null && _g !== void 0 ? _g : '') === ''
? ''
: cityssm.escapeHTML(lotOccupancyOccupant.occupantPhoneNumber) +
'<br />') +
(((_h = lotOccupancyOccupant.occupantEmailAddress) !== null && _h !== void 0 ? _h : '') === ''
? ''
: cityssm.escapeHTML(lotOccupancyOccupant.occupantEmailAddress)) +
'</td>') +
('<td>' +
cityssm.escapeHTML(lotOccupancyOccupant.occupantComment) +
@ -269,7 +271,7 @@ else {
searchResultsElement.innerHTML =
los.getLoadingParagraphHTML('Searching...');
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doSearchPastOccupants', searchFormElement, (responseJSON) => {
var _a, _b, _c, _d, _e, _f;
var _a, _b, _c, _d, _e, _f, _g, _h;
pastOccupantSearchResults = responseJSON.occupants;
const panelElement = document.createElement('div');
panelElement.className = 'panel';
@ -286,21 +288,22 @@ else {
('<div class="column">' +
cityssm.escapeHTML((_b = occupant.occupantAddress1) !== null && _b !== void 0 ? _b : '') +
'<br />' +
(occupant.occupantAddress2
? cityssm.escapeHTML(occupant.occupantAddress2) + '<br />'
: '') +
cityssm.escapeHTML((_c = occupant.occupantCity) !== null && _c !== void 0 ? _c : '') +
(((_c = occupant.occupantAddress2) !== null && _c !== void 0 ? _c : '') === ''
? ''
: cityssm.escapeHTML(occupant.occupantAddress2) +
'<br />') +
cityssm.escapeHTML((_d = occupant.occupantCity) !== null && _d !== void 0 ? _d : '') +
', ' +
cityssm.escapeHTML((_d = occupant.occupantProvince) !== null && _d !== void 0 ? _d : '') +
cityssm.escapeHTML((_e = occupant.occupantProvince) !== null && _e !== void 0 ? _e : '') +
'<br />' +
cityssm.escapeHTML((_e = occupant.occupantPostalCode) !== null && _e !== void 0 ? _e : '') +
cityssm.escapeHTML((_f = occupant.occupantPostalCode) !== null && _f !== void 0 ? _f : '') +
'</div>') +
('<div class="column">' +
(occupant.occupantPhoneNumber
? cityssm.escapeHTML(occupant.occupantPhoneNumber) +
'<br />'
: '') +
cityssm.escapeHTML((_f = occupant.occupantEmailAddress) !== null && _f !== void 0 ? _f : '') +
(((_g = occupant.occupantPhoneNumber) !== null && _g !== void 0 ? _g : '') === ''
? ''
: cityssm.escapeHTML(occupant.occupantPhoneNumber) +
'<br />') +
cityssm.escapeHTML((_h = occupant.occupantEmailAddress) !== null && _h !== void 0 ? _h : '') +
'<br />' +
'</div>') +
'</div>';

View File

@ -264,27 +264,29 @@ function renderLotOccupancyOccupants(): void {
'</span>') +
'</td>' +
('<td>' +
(lotOccupancyOccupant.occupantAddress1
? cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress1) + '<br />'
: '') +
(lotOccupancyOccupant.occupantAddress2
? cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress2) + '<br />'
: '') +
(lotOccupancyOccupant.occupantCity
? cityssm.escapeHTML(lotOccupancyOccupant.occupantCity) + ', '
: '') +
((lotOccupancyOccupant.occupantAddress1 ?? '') === ''
? ''
: cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress1!) +
'<br />') +
((lotOccupancyOccupant.occupantAddress2 ?? '') === ''
? ''
: cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress2!) +
'<br />') +
((lotOccupancyOccupant.occupantCity ?? '') === ''
? ''
: cityssm.escapeHTML(lotOccupancyOccupant.occupantCity!) + ', ') +
cityssm.escapeHTML(lotOccupancyOccupant.occupantProvince ?? '') +
'<br />' +
cityssm.escapeHTML(lotOccupancyOccupant.occupantPostalCode ?? '') +
'</td>') +
('<td>' +
(lotOccupancyOccupant.occupantPhoneNumber
? cityssm.escapeHTML(lotOccupancyOccupant.occupantPhoneNumber) +
'<br />'
: '') +
(lotOccupancyOccupant.occupantEmailAddress
? cityssm.escapeHTML(lotOccupancyOccupant.occupantEmailAddress)
: '') +
((lotOccupancyOccupant.occupantPhoneNumber ?? '') === ''
? ''
: cityssm.escapeHTML(lotOccupancyOccupant.occupantPhoneNumber!) +
'<br />') +
((lotOccupancyOccupant.occupantEmailAddress ?? '') === ''
? ''
: cityssm.escapeHTML(lotOccupancyOccupant.occupantEmailAddress!)) +
'</td>') +
('<td>' +
cityssm.escapeHTML(lotOccupancyOccupant.occupantComment!) +
@ -455,9 +457,10 @@ if (isCreate) {
('<div class="column">' +
cityssm.escapeHTML(occupant.occupantAddress1 ?? '') +
'<br />' +
(occupant.occupantAddress2
? cityssm.escapeHTML(occupant.occupantAddress2) + '<br />'
: '') +
((occupant.occupantAddress2 ?? '') === ''
? ''
: cityssm.escapeHTML(occupant.occupantAddress2!) +
'<br />') +
cityssm.escapeHTML(occupant.occupantCity ?? '') +
', ' +
cityssm.escapeHTML(occupant.occupantProvince ?? '') +
@ -465,10 +468,10 @@ if (isCreate) {
cityssm.escapeHTML(occupant.occupantPostalCode ?? '') +
'</div>') +
('<div class="column">' +
(occupant.occupantPhoneNumber
? cityssm.escapeHTML(occupant.occupantPhoneNumber) +
'<br />'
: '') +
((occupant.occupantPhoneNumber ?? '') === ''
? ''
: cityssm.escapeHTML(occupant.occupantPhoneNumber!) +
'<br />') +
cityssm.escapeHTML(occupant.occupantEmailAddress ?? '') +
'<br />' +
'</div>') +

View File

@ -29,12 +29,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
// eslint-disable-next-line no-constant-condition
while (true) {
svgElementToHighlight = mapContainerElement.querySelector('#' + svgId);
if (svgElementToHighlight || !svgId.includes('-')) {
if (svgElementToHighlight !== null || !svgId.includes('-')) {
break;
}
svgId = svgId.slice(0, Math.max(0, svgId.lastIndexOf('-')));
}
if (svgElementToHighlight) {
if (svgElementToHighlight !== null) {
// eslint-disable-next-line unicorn/no-null
svgElementToHighlight.style.fill = '';
svgElementToHighlight.classList.add('highlight', 'is-' + contextualClass);
@ -80,6 +80,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
displayMode: 'dialog'
};
function initializeDatePickers(containerElement) {
var _a;
const dateElements = containerElement.querySelectorAll("input[type='date']");
for (const dateElement of dateElements) {
const datePickerOptions = Object.assign({}, datePickerBaseOptions);
@ -87,11 +88,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
datePickerOptions.showClearButton = false;
}
// apply min date if set
if (dateElement.min) {
if (dateElement.min !== '') {
datePickerOptions.minDate = cityssm.dateStringToDate(dateElement.min);
}
// apply max date if set
if (dateElement.max) {
if (dateElement.max !== '') {
datePickerOptions.maxDate = cityssm.dateStringToDate(dateElement.max);
}
const cal = exports.bulmaCalendar.attach(dateElement, datePickerOptions)[0];
@ -113,12 +114,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
// Override the previous and next month button styles
const datePickerNavButtonElements = datepickerElement.querySelectorAll('.datepicker-nav button.is-text');
for (const datePickerNavButtonElement of datePickerNavButtonElements) {
datePickerNavButtonElement.classList.add('is-' + datePickerBaseOptions.color);
datePickerNavButtonElement.classList.add(`is-${(_a = datePickerBaseOptions.color) !== null && _a !== void 0 ? _a : ''}`);
datePickerNavButtonElement.classList.remove('is-text');
}
// Override the clear button style
const clearButtonElement = datepickerElement.querySelector('.datetimepicker-clear-button');
if (clearButtonElement) {
if (clearButtonElement !== null) {
if (dateElement.required) {
clearButtonElement.remove();
}
@ -131,7 +132,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
}
// Apply a label
const labelElement = document.querySelector("label[for='" + dateElement.id + "']");
if (labelElement) {
if (labelElement !== null) {
datepickerElement.querySelector('.datetimepicker-dummy-input').ariaLabel = labelElement.textContent;
}
}
@ -359,9 +360,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
return (urlPrefix +
'/' +
recordTypePlural +
(recordId ? '/' + recordId : '') +
(recordId ? '/' + recordId.toString() : '') +
(recordId && edit ? '/edit' : '') +
(time ? '/?t=' + Date.now() : ''));
(time ? '/?t=' + Date.now().toString() : ''));
}
function getMapURL(mapId = '', edit = false, time = false) {
return getRecordURL('maps', mapId, edit, time);

View File

@ -47,14 +47,14 @@ declare const bulmaJS: BulmaJS
while (true) {
svgElementToHighlight = mapContainerElement.querySelector('#' + svgId)
if (svgElementToHighlight || !svgId.includes('-')) {
if (svgElementToHighlight !== null || !svgId.includes('-')) {
break
}
svgId = svgId.slice(0, Math.max(0, svgId.lastIndexOf('-')))
}
if (svgElementToHighlight) {
if (svgElementToHighlight !== null) {
// eslint-disable-next-line unicorn/no-null
svgElementToHighlight.style.fill = ''
@ -127,12 +127,12 @@ declare const bulmaJS: BulmaJS
}
// apply min date if set
if (dateElement.min) {
if (dateElement.min !== '') {
datePickerOptions.minDate = cityssm.dateStringToDate(dateElement.min)
}
// apply max date if set
if (dateElement.max) {
if (dateElement.max !== '') {
datePickerOptions.maxDate = cityssm.dateStringToDate(dateElement.max)
}
@ -158,8 +158,7 @@ declare const bulmaJS: BulmaJS
})
// Get the datepicker container element
const datepickerElement: HTMLElement | null =
containerElement.querySelector('#' + cal._id)!
const datepickerElement = containerElement.querySelector('#' + cal._id)!
// Override the previous and next month button styles
const datePickerNavButtonElements = datepickerElement.querySelectorAll(
@ -168,7 +167,7 @@ declare const bulmaJS: BulmaJS
for (const datePickerNavButtonElement of datePickerNavButtonElements) {
datePickerNavButtonElement.classList.add(
'is-' + datePickerBaseOptions.color
`is-${datePickerBaseOptions.color ?? ''}`
)
datePickerNavButtonElement.classList.remove('is-text')
}
@ -177,7 +176,7 @@ declare const bulmaJS: BulmaJS
const clearButtonElement: HTMLElement | null =
datepickerElement.querySelector('.datetimepicker-clear-button')
if (clearButtonElement) {
if (clearButtonElement !== null) {
if (dateElement.required) {
clearButtonElement.remove()
} else {
@ -193,7 +192,7 @@ declare const bulmaJS: BulmaJS
"label[for='" + dateElement.id + "']"
)
if (labelElement) {
if (labelElement !== null) {
datepickerElement.querySelector(
'.datetimepicker-dummy-input'
)!.ariaLabel = labelElement.textContent
@ -483,9 +482,9 @@ declare const bulmaJS: BulmaJS
urlPrefix +
'/' +
recordTypePlural +
(recordId ? '/' + recordId : '') +
(recordId ? '/' + recordId.toString() : '') +
(recordId && edit ? '/edit' : '') +
(time ? '/?t=' + Date.now() : '')
(time ? '/?t=' + Date.now().toString() : '')
)
}

View File

@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
const searchFilterElement = document.querySelector('#searchFilter--map');
const searchResultsContainerElement = document.querySelector('#container--searchResults');
function renderResults() {
var _a, _b, _c, _d, _e, _f, _g, _h;
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
searchResultsContainerElement.innerHTML = los.getLoadingParagraphHTML(`Loading ${los.escapedAliases.Maps}...`);
let searchResultCount = 0;
const searchResultsTbodyElement = document.createElement('tbody');
@ -40,34 +40,36 @@ Object.defineProperty(exports, "__esModule", { value: true });
'</span>' +
'</td>') +
('<td>' +
(map.mapAddress1
? cityssm.escapeHTML(map.mapAddress1) + '<br />'
: '') +
(map.mapAddress2
? cityssm.escapeHTML(map.mapAddress2) + '<br />'
: '') +
(((_f = map.mapAddress1) !== null && _f !== void 0 ? _f : '') === ''
? ''
: cityssm.escapeHTML(map.mapAddress1) + '<br />') +
(((_g = map.mapAddress2) !== null && _g !== void 0 ? _g : '') === ''
? ''
: cityssm.escapeHTML(map.mapAddress2) + '<br />') +
(map.mapCity || map.mapProvince
? cityssm.escapeHTML((_f = map.mapCity) !== null && _f !== void 0 ? _f : '') +
? cityssm.escapeHTML((_h = map.mapCity) !== null && _h !== void 0 ? _h : '') +
', ' +
cityssm.escapeHTML((_g = map.mapProvince) !== null && _g !== void 0 ? _g : '') +
cityssm.escapeHTML((_j = map.mapProvince) !== null && _j !== void 0 ? _j : '') +
'<br />'
: '') +
(map.mapPostalCode ? cityssm.escapeHTML(map.mapPostalCode) : '') +
(((_k = map.mapPostalCode) !== null && _k !== void 0 ? _k : '') === ''
? ''
: cityssm.escapeHTML(map.mapPostalCode)) +
'</td>') +
('<td>' + cityssm.escapeHTML((_h = map.mapPhoneNumber) !== null && _h !== void 0 ? _h : '') + '</td>') +
('<td>' + cityssm.escapeHTML((_l = map.mapPhoneNumber) !== null && _l !== void 0 ? _l : '') + '</td>') +
'<td class="has-text-centered">' +
(map.mapLatitude && map.mapLongitude
? '<span data-tooltip="Has Geographic Coordinates"><i class="fas fa-map-marker-alt" aria-label="Has Geographic Coordinates"></i></span>'
: '') +
'</td>' +
'<td class="has-text-centered">' +
(map.mapSVG
? '<span data-tooltip="Has Image"><i class="fas fa-image" aria-label="Has Image"></i></span>'
: '') +
(((_m = map.mapSVG) !== null && _m !== void 0 ? _m : '') === ''
? ''
: '<span data-tooltip="Has Image"><i class="fas fa-image" aria-label="Has Image"></i></span>') +
'</td>' +
(`<td class="has-text-right">
`<td class="has-text-right">
<a href="${los.urlPrefix}/lots?mapId=${map.mapId}">${map.lotCount}</a>
</td>`) +
</td>` +
'</tr>');
}
searchResultsContainerElement.innerHTML = '';

View File

@ -68,19 +68,21 @@ declare const cityssm: cityssmGlobal
'</span>' +
'</td>') +
('<td>' +
(map.mapAddress1
? cityssm.escapeHTML(map.mapAddress1) + '<br />'
: '') +
(map.mapAddress2
? cityssm.escapeHTML(map.mapAddress2) + '<br />'
: '') +
((map.mapAddress1 ?? '') === ''
? ''
: cityssm.escapeHTML(map.mapAddress1!) + '<br />') +
((map.mapAddress2 ?? '') === ''
? ''
: cityssm.escapeHTML(map.mapAddress2!) + '<br />') +
(map.mapCity || map.mapProvince
? cityssm.escapeHTML(map.mapCity ?? '') +
', ' +
cityssm.escapeHTML(map.mapProvince ?? '') +
'<br />'
: '') +
(map.mapPostalCode ? cityssm.escapeHTML(map.mapPostalCode) : '') +
((map.mapPostalCode ?? '') === ''
? ''
: cityssm.escapeHTML(map.mapPostalCode!)) +
'</td>') +
('<td>' + cityssm.escapeHTML(map.mapPhoneNumber ?? '') + '</td>') +
'<td class="has-text-centered">' +
@ -89,13 +91,15 @@ declare const cityssm: cityssmGlobal
: '') +
'</td>' +
'<td class="has-text-centered">' +
(map.mapSVG
? '<span data-tooltip="Has Image"><i class="fas fa-image" aria-label="Has Image"></i></span>'
: '') +
((map.mapSVG ?? '') === ''
? ''
: '<span data-tooltip="Has Image"><i class="fas fa-image" aria-label="Has Image"></i></span>') +
'</td>' +
(`<td class="has-text-right">
<a href="${los.urlPrefix}/lots?mapId=${map.mapId!}">${map.lotCount!}</a>
</td>`) +
`<td class="has-text-right">
<a href="${
los.urlPrefix
}/lots?mapId=${map.mapId!}">${map.lotCount!}</a>
</td>` +
'</tr>'
)
}

View File

@ -3,7 +3,7 @@
Object.defineProperty(exports, "__esModule", { value: true });
(() => {
const mapContainerElement = document.querySelector('#map--leaflet');
if (mapContainerElement) {
if (mapContainerElement !== null) {
const mapLatitude = Number.parseFloat(mapContainerElement.dataset.mapLatitude);
const mapLongitude = Number.parseFloat(mapContainerElement.dataset.mapLongitude);
const mapCoordinates = [mapLatitude, mapLongitude];

View File

@ -3,13 +3,11 @@
import type * as Leaflet from 'leaflet'
declare const L
;(() => {
const mapContainerElement = document.querySelector(
'#map--leaflet'
) as HTMLElement
const mapContainerElement: HTMLElement | null =
document.querySelector('#map--leaflet')
if (mapContainerElement) {
if (mapContainerElement !== null) {
const mapLatitude = Number.parseFloat(
mapContainerElement.dataset.mapLatitude!
)

View File

@ -17,7 +17,7 @@ import type * as globalTypes from '../types/globalTypes'
'#icsFilters--calendarURL'
) as HTMLTextAreaElement
function updateCalendarURL() {
function updateCalendarURL(): void {
let url =
window.location.href.slice(
0,
@ -81,9 +81,7 @@ import type * as globalTypes from '../types/globalTypes'
const inputSelectElements = (
document.querySelector('#panel--icsFilters') as HTMLElement
).querySelectorAll('input, select') as NodeListOf<
HTMLInputElement | HTMLSelectElement
>
).querySelectorAll('input, select')
for (const element of inputSelectElements) {
element.addEventListener('change', updateCalendarURL)

View File

@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
(() => {
const los = exports.los;
const reopenWorkOrderButtonElement = document.querySelector('#button--reopenWorkOrder');
if (reopenWorkOrderButtonElement) {
if (reopenWorkOrderButtonElement !== null) {
const workOrderId = reopenWorkOrderButtonElement.dataset.workOrderId;
reopenWorkOrderButtonElement.addEventListener('click', () => {
function doReopen() {

View File

@ -11,11 +11,10 @@ declare const bulmaJS: BulmaJS
;(() => {
const los = exports.los as globalTypes.LOS
const reopenWorkOrderButtonElement = document.querySelector(
'#button--reopenWorkOrder'
) as HTMLButtonElement
const reopenWorkOrderButtonElement: HTMLButtonElement | null =
document.querySelector('#button--reopenWorkOrder')
if (reopenWorkOrderButtonElement) {
if (reopenWorkOrderButtonElement !== null) {
const workOrderId = reopenWorkOrderButtonElement.dataset.workOrderId!
reopenWorkOrderButtonElement.addEventListener('click', () => {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,a=exports.maps,s=document.querySelector("#searchFilter--map"),t=document.querySelector("#container--searchResults");function r(){var r,i,d,n,o,c,p,l;t.innerHTML=e.getLoadingParagraphHTML(`Loading ${e.escapedAliases.Maps}...`);let m=0;const h=document.createElement("tbody"),u=s.value.trim().toLowerCase().split(" ");for(const s of a){const a=`${null!==(r=s.mapName)&&void 0!==r?r:""} ${null!==(i=s.mapDescription)&&void 0!==i?i:""} ${null!==(d=s.mapAddress1)&&void 0!==d?d:""} ${null!==(n=s.mapAddress2)&&void 0!==n?n:""}`.toLowerCase();let t=!0;for(const e of u)if(!a.includes(e)){t=!1;break}t&&(m+=1,h.insertAdjacentHTML("beforeend",'<tr><td><a class="has-text-weight-bold" href="'+e.getMapURL(s.mapId)+'">'+cityssm.escapeHTML(""===s.mapName?"(No Name)":s.mapName)+'</a><br /><span class="is-size-7">'+cityssm.escapeHTML(null!==(o=s.mapDescription)&&void 0!==o?o:"")+"</span></td><td>"+(s.mapAddress1?cityssm.escapeHTML(s.mapAddress1)+"<br />":"")+(s.mapAddress2?cityssm.escapeHTML(s.mapAddress2)+"<br />":"")+(s.mapCity||s.mapProvince?cityssm.escapeHTML(null!==(c=s.mapCity)&&void 0!==c?c:"")+", "+cityssm.escapeHTML(null!==(p=s.mapProvince)&&void 0!==p?p:"")+"<br />":"")+(s.mapPostalCode?cityssm.escapeHTML(s.mapPostalCode):"")+"</td><td>"+cityssm.escapeHTML(null!==(l=s.mapPhoneNumber)&&void 0!==l?l:"")+'</td><td class="has-text-centered">'+(s.mapLatitude&&s.mapLongitude?'<span data-tooltip="Has Geographic Coordinates"><i class="fas fa-map-marker-alt" aria-label="Has Geographic Coordinates"></i></span>':"")+'</td><td class="has-text-centered">'+(s.mapSVG?'<span data-tooltip="Has Image"><i class="fas fa-image" aria-label="Has Image"></i></span>':"")+"</td>"+`<td class="has-text-right">\n <a href="${e.urlPrefix}/lots?mapId=${s.mapId}">${s.lotCount}</a>\n </td>`+"</tr>"))}if(t.innerHTML="",0===m)t.innerHTML=`<div class="message is-info">\n <p class="message-body">There are no ${e.escapedAliases.maps} that meet the search criteria.</p>\n </div>`;else{const a=document.createElement("table");a.className="table is-fullwidth is-striped is-hoverable has-sticky-header",a.innerHTML=`<thead><tr>\n <th>${e.escapedAliases.Map}</th>\n <th>Address</th>\n <th>Phone Number</th>\n <th class="has-text-centered">Coordinates</th>\n <th class="has-text-centered">Image</th>\n <th class="has-text-right">${e.escapedAliases.Lot} Count</th>\n </tr></thead>`,a.append(h),t.append(a)}}s.addEventListener("keyup",r),document.querySelector("#form--searchFilters").addEventListener("submit",e=>{e.preventDefault(),r()}),r()})();
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,a=exports.maps,s=document.querySelector("#searchFilter--map"),t=document.querySelector("#container--searchResults");function i(){var i,r,d,n,o,l,c,p,m,h,u,L;t.innerHTML=e.getLoadingParagraphHTML(`Loading ${e.escapedAliases.Maps}...`);let v=0;const f=document.createElement("tbody"),b=s.value.trim().toLowerCase().split(" ");for(const s of a){const a=`${null!==(i=s.mapName)&&void 0!==i?i:""} ${null!==(r=s.mapDescription)&&void 0!==r?r:""} ${null!==(d=s.mapAddress1)&&void 0!==d?d:""} ${null!==(n=s.mapAddress2)&&void 0!==n?n:""}`.toLowerCase();let t=!0;for(const e of b)if(!a.includes(e)){t=!1;break}t&&(v+=1,f.insertAdjacentHTML("beforeend",'<tr><td><a class="has-text-weight-bold" href="'+e.getMapURL(s.mapId)+'">'+cityssm.escapeHTML(""===s.mapName?"(No Name)":s.mapName)+'</a><br /><span class="is-size-7">'+cityssm.escapeHTML(null!==(o=s.mapDescription)&&void 0!==o?o:"")+"</span></td><td>"+(""===(null!==(l=s.mapAddress1)&&void 0!==l?l:"")?"":cityssm.escapeHTML(s.mapAddress1)+"<br />")+(""===(null!==(c=s.mapAddress2)&&void 0!==c?c:"")?"":cityssm.escapeHTML(s.mapAddress2)+"<br />")+(s.mapCity||s.mapProvince?cityssm.escapeHTML(null!==(p=s.mapCity)&&void 0!==p?p:"")+", "+cityssm.escapeHTML(null!==(m=s.mapProvince)&&void 0!==m?m:"")+"<br />":"")+(""===(null!==(h=s.mapPostalCode)&&void 0!==h?h:"")?"":cityssm.escapeHTML(s.mapPostalCode))+"</td><td>"+cityssm.escapeHTML(null!==(u=s.mapPhoneNumber)&&void 0!==u?u:"")+'</td><td class="has-text-centered">'+(s.mapLatitude&&s.mapLongitude?'<span data-tooltip="Has Geographic Coordinates"><i class="fas fa-map-marker-alt" aria-label="Has Geographic Coordinates"></i></span>':"")+'</td><td class="has-text-centered">'+(""===(null!==(L=s.mapSVG)&&void 0!==L?L:"")?"":'<span data-tooltip="Has Image"><i class="fas fa-image" aria-label="Has Image"></i></span>')+"</td>"+`<td class="has-text-right">\n <a href="${e.urlPrefix}/lots?mapId=${s.mapId}">${s.lotCount}</a>\n </td>`+"</tr>"))}if(t.innerHTML="",0===v)t.innerHTML=`<div class="message is-info">\n <p class="message-body">There are no ${e.escapedAliases.maps} that meet the search criteria.</p>\n </div>`;else{const a=document.createElement("table");a.className="table is-fullwidth is-striped is-hoverable has-sticky-header",a.innerHTML=`<thead><tr>\n <th>${e.escapedAliases.Map}</th>\n <th>Address</th>\n <th>Phone Number</th>\n <th class="has-text-centered">Coordinates</th>\n <th class="has-text-centered">Image</th>\n <th class="has-text-right">${e.escapedAliases.Lot} Count</th>\n </tr></thead>`,a.append(f),t.append(a)}}s.addEventListener("keyup",i),document.querySelector("#form--searchFilters").addEventListener("submit",e=>{e.preventDefault(),i()}),i()})();

View File

@ -1 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=document.querySelector("#map--leaflet");if(e){const t=[Number.parseFloat(e.dataset.mapLatitude),Number.parseFloat(e.dataset.mapLongitude)],a=L.map(e);a.setView(t,15),L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:19,attribution:"© OpenStreetMap"}).addTo(a),L.marker(t).addTo(a)}})();
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=document.querySelector("#map--leaflet");if(null!==e){const t=[Number.parseFloat(e.dataset.mapLatitude),Number.parseFloat(e.dataset.mapLongitude)],a=L.map(e);a.setView(t,15),L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:19,attribution:"© OpenStreetMap"}).addTo(a),L.marker(t).addTo(a)}})();

View File

@ -1 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,r=document.querySelector("#button--reopenWorkOrder");if(r){const o=r.dataset.workOrderId;r.addEventListener("click",()=>{bulmaJS.confirm({title:"Reopen Work Order",message:"Are you sure you want to remove the close date from this work order and reopen it?",contextualColorName:"warning",okButton:{text:"Yes, Reopen Work Order",callbackFunction:function(){cityssm.postJSON(e.urlPrefix+"/workOrders/doReopenWorkOrder",{workOrderId:o},r=>{var t;r.success?window.location.href=e.getWorkOrderURL(o,!0,!0):bulmaJS.alert({title:"Error Reopening Work Order",message:null!==(t=r.errorMessage)&&void 0!==t?t:"",contextualColorName:"danger"})})}}})})}})();
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,r=document.querySelector("#button--reopenWorkOrder");if(null!==r){const o=r.dataset.workOrderId;r.addEventListener("click",()=>{bulmaJS.confirm({title:"Reopen Work Order",message:"Are you sure you want to remove the close date from this work order and reopen it?",contextualColorName:"warning",okButton:{text:"Yes, Reopen Work Order",callbackFunction:function(){cityssm.postJSON(e.urlPrefix+"/workOrders/doReopenWorkOrder",{workOrderId:o},r=>{var t;r.success?window.location.href=e.getWorkOrderURL(o,!0,!0):bulmaJS.alert({title:"Error Reopening Work Order",message:null!==(t=r.errorMessage)&&void 0!==t?t:"",contextualColorName:"danger"})})}}})})}})();