deepsource-autofix-76c6eb20
Dan Gowans 2023-01-24 10:41:17 -05:00
parent ca47423bfc
commit c1d00559e5
4 changed files with 415 additions and 414 deletions

View File

@ -14,9 +14,9 @@ export async function updateWorkOrderMilestone(milestoneForm, requestSession) {
where workOrderMilestoneId = ?`)
.run(milestoneForm.workOrderMilestoneTypeId === ''
? undefined
: milestoneForm.workOrderMilestoneTypeId, dateStringToInteger(milestoneForm.workOrderMilestoneDateString), milestoneForm.workOrderMilestoneTimeString
? timeStringToInteger(milestoneForm.workOrderMilestoneTimeString)
: 0, milestoneForm.workOrderMilestoneDescription, requestSession.user.userName, rightNow.getTime(), milestoneForm.workOrderMilestoneId);
: milestoneForm.workOrderMilestoneTypeId, dateStringToInteger(milestoneForm.workOrderMilestoneDateString), (milestoneForm.workOrderMilestoneTimeString ?? '') === ''
? 0
: timeStringToInteger(milestoneForm.workOrderMilestoneTimeString), milestoneForm.workOrderMilestoneDescription, requestSession.user.userName, rightNow.getTime(), milestoneForm.workOrderMilestoneId);
database.release();
return result.changes > 0;
}

View File

@ -39,9 +39,9 @@ export async function updateWorkOrderMilestone(
? undefined
: milestoneForm.workOrderMilestoneTypeId,
dateStringToInteger(milestoneForm.workOrderMilestoneDateString),
milestoneForm.workOrderMilestoneTimeString
? timeStringToInteger(milestoneForm.workOrderMilestoneTimeString)
: 0,
(milestoneForm.workOrderMilestoneTimeString ?? '') === ''
? 0
: timeStringToInteger(milestoneForm.workOrderMilestoneTimeString!),
milestoneForm.workOrderMilestoneDescription,
requestSession.user!.userName,

View File

@ -1,7 +1,9 @@
"use strict";
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
let lotOccupancyOccupants;
let lotOccupancyOccupants = exports.lotOccupancyOccupants;
delete exports.lotOccupancyOccupants;
function openEditLotOccupancyOccupant(clickEvent) {
const lotOccupantIndex = Number.parseInt(clickEvent.currentTarget.closest('tr').dataset
.lotOccupantIndex, 10);
@ -192,7 +194,11 @@ function renderLotOccupancyOccupants() {
: cityssm.escapeHTML(lotOccupancyOccupant.occupantEmailAddress)) +
'</td>') +
('<td>' +
'<span data-tooltip="' + cityssm.escapeHTML(((_j = lotOccupancyOccupant.occupantCommentTitle) !== null && _j !== void 0 ? _j : '') === '' ? 'Comment' : lotOccupancyOccupant.occupantCommentTitle) + '">' +
'<span data-tooltip="' +
cityssm.escapeHTML(((_j = lotOccupancyOccupant.occupantCommentTitle) !== null && _j !== void 0 ? _j : '') === ''
? 'Comment'
: lotOccupancyOccupant.occupantCommentTitle) +
'">' +
cityssm.escapeHTML((_k = lotOccupancyOccupant.occupantComment) !== null && _k !== void 0 ? _k : '') +
'</span>' +
'</td>') +
@ -229,11 +235,10 @@ if (isCreate) {
});
}
else {
lotOccupancyOccupants = exports.lotOccupancyOccupants;
delete exports.lotOccupancyOccupants;
document
.querySelector('#button--addOccupant')
.addEventListener('click', () => {
renderLotOccupancyOccupants();
}
(_a = document
.querySelector('#button--addOccupant')) === null || _a === void 0 ? void 0 : _a.addEventListener('click', () => {
let addCloseModalFunction;
let addFormElement;
let searchFormElement;
@ -311,8 +316,7 @@ else {
'<br />' +
(((_c = occupant.occupantAddress2) !== null && _c !== void 0 ? _c : '') === ''
? ''
: cityssm.escapeHTML(occupant.occupantAddress2) +
'<br />') +
: cityssm.escapeHTML(occupant.occupantAddress2) + '<br />') +
cityssm.escapeHTML((_d = occupant.occupantCity) !== null && _d !== void 0 ? _d : '') +
', ' +
cityssm.escapeHTML((_e = occupant.occupantProvince) !== null && _e !== void 0 ? _e : '') +
@ -382,6 +386,4 @@ else {
bulmaJS.toggleHtmlClipped();
}
});
});
renderLotOccupancyOccupants();
}
});

View File

@ -16,7 +16,9 @@ declare const lotOccupancyId: string
declare const isCreate: boolean
declare const formElement: HTMLFormElement
let lotOccupancyOccupants: recordTypes.LotOccupancyOccupant[]
let lotOccupancyOccupants: recordTypes.LotOccupancyOccupant[] =
exports.lotOccupancyOccupants
delete exports.lotOccupancyOccupants
function openEditLotOccupancyOccupant(clickEvent: Event): void {
const lotOccupantIndex = Number.parseInt(
@ -316,7 +318,13 @@ function renderLotOccupancyOccupants(): void {
: cityssm.escapeHTML(lotOccupancyOccupant.occupantEmailAddress!)) +
'</td>') +
('<td>' +
'<span data-tooltip="' + cityssm.escapeHTML((lotOccupancyOccupant.occupantCommentTitle ?? '') === '' ? 'Comment' : lotOccupancyOccupant.occupantCommentTitle!) + '">' +
'<span data-tooltip="' +
cityssm.escapeHTML(
(lotOccupancyOccupant.occupantCommentTitle ?? '') === ''
? 'Comment'
: lotOccupancyOccupant.occupantCommentTitle!
) +
'">' +
cityssm.escapeHTML(lotOccupancyOccupant.occupantComment ?? '') +
'</span>' +
'</td>') +
@ -362,12 +370,12 @@ if (isCreate) {
}
})
} else {
lotOccupancyOccupants = exports.lotOccupancyOccupants
delete exports.lotOccupancyOccupants
renderLotOccupancyOccupants()
}
document
.querySelector('#button--addOccupant')!
.addEventListener('click', () => {
document
.querySelector('#button--addOccupant')
?.addEventListener('click', () => {
let addCloseModalFunction: () => void
let addFormElement: HTMLFormElement
@ -469,10 +477,7 @@ if (isCreate) {
const panelElement = document.createElement('div')
panelElement.className = 'panel'
for (const [
index,
occupant
] of pastOccupantSearchResults.entries()) {
for (const [index, occupant] of pastOccupantSearchResults.entries()) {
const panelBlockElement = document.createElement('a')
panelBlockElement.className = 'panel-block is-block'
panelBlockElement.dataset.index = index.toString()
@ -488,8 +493,7 @@ if (isCreate) {
'<br />' +
((occupant.occupantAddress2 ?? '') === ''
? ''
: cityssm.escapeHTML(occupant.occupantAddress2!) +
'<br />') +
: cityssm.escapeHTML(occupant.occupantAddress2!) + '<br />') +
cityssm.escapeHTML(occupant.occupantCity ?? '') +
', ' +
cityssm.escapeHTML(occupant.occupantProvince ?? '') +
@ -543,9 +547,7 @@ if (isCreate) {
lotOccupantTypeSelectElement.append(optionElement)
lotOccupantTypeCopySelectElement.append(
optionElement.cloneNode(true)
)
lotOccupantTypeCopySelectElement.append(optionElement.cloneNode(true))
}
;(
@ -611,6 +613,3 @@ if (isCreate) {
}
})
})
renderLotOccupancyOccupants()
}