include lotOccupancyId in result tables

deepsource-autofix-76c6eb20
Dan Gowans 2023-02-27 14:00:16 -05:00
parent 95fd36be87
commit 37984ed2f3
10 changed files with 690 additions and 643 deletions

View File

@ -7,8 +7,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
const searchResultsContainerElement = document.querySelector('#container--searchResults');
const limit = Number.parseInt(document.querySelector('#searchFilter--limit').value, 10);
const offsetElement = document.querySelector('#searchFilter--offset');
function renderLotOccupancies(responseJSON) {
function renderLotOccupancies(rawResponseJSON) {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
const responseJSON = rawResponseJSON;
if (responseJSON.lotOccupancies.length === 0) {
searchResultsContainerElement.innerHTML = `<div class="message is-info">
<p class="message-body">
@ -80,7 +81,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
los.getLotOccupancyURL(lotOccupancy.lotOccupancyId) +
'">' +
cityssm.escapeHTML(lotOccupancy.occupancyType) +
'</a>' +
'</a><br />' +
`<span class="is-size-7">#${lotOccupancy.lotOccupancyId}</span>` +
'</td>') +
('<td>' +
(((_j = lotOccupancy.lotId) !== null && _j !== void 0 ? _j : -1) === -1
@ -114,7 +116,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
'/print/' +
lotOccupancy.printEJS +
'/?lotOccupancyId=' +
lotOccupancy.lotOccupancyId +
lotOccupancy.lotOccupancyId.toString() +
'" target="_blank">' +
'<i class="fas fa-print" aria-label="Print"></i>' +
'</a>'

View File

@ -26,11 +26,13 @@ declare const cityssm: cityssmGlobal
'#searchFilter--offset'
) as HTMLInputElement
function renderLotOccupancies(responseJSON: {
function renderLotOccupancies(rawResponseJSON: unknown): void {
const responseJSON = rawResponseJSON as {
count: number
offset: number
lotOccupancies: recordTypes.LotOccupancy[]
}): void {
}
if (responseJSON.lotOccupancies.length === 0) {
searchResultsContainerElement.innerHTML = `<div class="message is-info">
<p class="message-body">
@ -128,7 +130,8 @@ declare const cityssm: cityssmGlobal
los.getLotOccupancyURL(lotOccupancy.lotOccupancyId) +
'">' +
cityssm.escapeHTML(lotOccupancy.occupancyType as string) +
'</a>' +
'</a><br />' +
`<span class="is-size-7">#${lotOccupancy.lotOccupancyId!}</span>` +
'</td>') +
('<td>' +
((lotOccupancy.lotId ?? -1) === -1
@ -162,7 +165,7 @@ declare const cityssm: cityssmGlobal
'/print/' +
lotOccupancy.printEJS +
'/?lotOccupancyId=' +
lotOccupancy.lotOccupancyId +
lotOccupancy.lotOccupancyId!.toString() +
'" target="_blank">' +
'<i class="fas fa-print" aria-label="Print"></i>' +
'</a>'

View File

@ -150,8 +150,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
cityssm.postJSON(los.urlPrefix + '/workOrders/doDeleteWorkOrderLotOccupancy', {
workOrderId,
lotOccupancyId
}, (responseJSON) => {
}, (rawResponseJSON) => {
var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) {
workOrderLotOccupancies = responseJSON.workOrderLotOccupancies;
renderRelatedLotsAndOccupancies();
@ -179,8 +180,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
cityssm.postJSON(los.urlPrefix + '/workOrders/doAddWorkOrderLot', {
workOrderId,
lotId
}, (responseJSON) => {
}, (rawResponseJSON) => {
var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) {
workOrderLots = responseJSON.workOrderLots;
renderRelatedLotsAndOccupancies();
@ -192,7 +194,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
contextualColorName: 'danger'
});
}
if (callbackFunction) {
if (callbackFunction !== undefined) {
callbackFunction(responseJSON.success);
}
});
@ -201,8 +203,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
cityssm.postJSON(los.urlPrefix + '/workOrders/doAddWorkOrderLotOccupancy', {
workOrderId,
lotOccupancyId
}, (responseJSON) => {
}, (rawResponseJSON) => {
var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) {
workOrderLotOccupancies = responseJSON.workOrderLotOccupancies;
renderRelatedLotsAndOccupancies();
@ -214,7 +217,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
contextualColorName: 'danger'
});
}
if (callbackFunction) {
if (callbackFunction !== undefined) {
callbackFunction(responseJSON.success);
}
});
@ -271,7 +274,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
los.getLotOccupancyURL(lotOccupancy.lotOccupancyId) +
'">' +
cityssm.escapeHTML((_a = lotOccupancy.occupancyType) !== null && _a !== void 0 ? _a : '') +
'</a>' +
'</a><br />' +
`<span class="is-size-7">#${lotOccupancy.lotOccupancyId}</span>` +
'</td>');
if (lotOccupancy.lotId) {
rowElement.insertAdjacentHTML('beforeend', '<td>' +
@ -280,7 +284,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
? ''
: ' <button class="button is-small is-light is-success button--addLot"' +
' data-lot-id="' +
lotOccupancy.lotId +
lotOccupancy.lotId.toString() +
'"' +
' data-tooltip="Add ' +
los.escapedAliases.Lot +
@ -348,8 +352,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
let editCloseModalFunction;
function doUpdateLotStatus(submitEvent) {
submitEvent.preventDefault();
cityssm.postJSON(los.urlPrefix + '/workOrders/doUpdateLotStatus', submitEvent.currentTarget, (responseJSON) => {
cityssm.postJSON(los.urlPrefix + '/workOrders/doUpdateLotStatus', submitEvent.currentTarget, (rawResponseJSON) => {
var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) {
workOrderLots = responseJSON.workOrderLots;
renderRelatedLotsAndOccupancies();
@ -411,8 +416,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
cityssm.postJSON(los.urlPrefix + '/workOrders/doDeleteWorkOrderLot', {
workOrderId,
lotId
}, (responseJSON) => {
}, (rawResponseJSON) => {
var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) {
workOrderLots = responseJSON.workOrderLots;
renderRelatedLotsAndOccupancies();
@ -468,21 +474,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
cityssm.escapeHTML((_a = lot.lotName) !== null && _a !== void 0 ? _a : '') +
'</a>' +
'</td>' +
('<td>' + cityssm.escapeHTML((_b = lot.mapName) !== null && _b !== void 0 ? _b : '') + '</td>') +
('<td>' + cityssm.escapeHTML((_c = lot.lotType) !== null && _c !== void 0 ? _c : '') + '</td>') +
`<td>${cityssm.escapeHTML((_b = lot.mapName) !== null && _b !== void 0 ? _b : '')}</td>` +
`<td>${cityssm.escapeHTML((_c = lot.lotType) !== null && _c !== void 0 ? _c : '')}</td>` +
('<td>' +
(lot.lotStatusId
? cityssm.escapeHTML((_d = lot.lotStatus) !== null && _d !== void 0 ? _d : '')
: '<span class="has-text-grey">(No Status)</span>') +
'</td>') +
('<td class="is-nowrap">' +
'<button class="button is-small is-light is-info button--editLotStatus" data-tooltip="Update Status" type="button">' +
'<i class="fas fa-pencil-alt" aria-hidden="true"></i>' +
'</button>' +
' <button class="button is-small is-light is-danger button--deleteLot" data-tooltip="Delete Relationship" type="button">' +
'<i class="fas fa-trash" aria-hidden="true"></i>' +
'</button>' +
'</td>');
`<td class="is-nowrap">
<button class="button is-small is-light is-info button--editLotStatus" data-tooltip="Update Status" type="button">
<i class="fas fa-pencil-alt" aria-hidden="true"></i>
</button>
<button class="button is-small is-light is-danger button--deleteLot" data-tooltip="Delete Relationship" type="button">
<i class="fas fa-trash" aria-hidden="true"></i>
</button>
</td>`;
rowElement
.querySelector('.button--editLotStatus')
.addEventListener('click', openEditLotStatus);
@ -516,8 +522,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
}
searchResultsContainerElement.innerHTML =
los.getLoadingParagraphHTML('Searching...');
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doSearchLotOccupancies', searchFormElement, (responseJSON) => {
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doSearchLotOccupancies', searchFormElement, (rawResponseJSON) => {
var _a, _b;
const responseJSON = rawResponseJSON;
if (responseJSON.lotOccupancies.length === 0) {
searchResultsContainerElement.innerHTML = `<div class="message is-info">
<p class="message-body">There are no records that meet the search criteria.</p>
@ -540,15 +547,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
rowElement.className = 'container--lotOccupancy';
rowElement.dataset.lotOccupancyId =
lotOccupancy.lotOccupancyId.toString();
rowElement.innerHTML =
'<td class="has-text-centered">' +
'<button class="button is-small is-success button--addLotOccupancy" data-tooltip="Add" type="button" aria-label="Add">' +
'<i class="fas fa-plus" aria-hidden="true"></i>' +
'</button>' +
'</td>' +
('<td class="has-text-weight-bold">' +
cityssm.escapeHTML((_a = lotOccupancy.occupancyType) !== null && _a !== void 0 ? _a : '') +
'</td>');
rowElement.innerHTML = `<td class="has-text-centered">
<button class="button is-small is-success button--addLotOccupancy" data-tooltip="Add" type="button" aria-label="Add">
<i class="fas fa-plus" aria-hidden="true"></i>
</button>
</td>
<td class="has-text-weight-bold">
${cityssm.escapeHTML((_a = lotOccupancy.occupancyType) !== null && _a !== void 0 ? _a : '')}
</td>`;
if (lotOccupancy.lotId) {
rowElement.insertAdjacentHTML('beforeend', '<td>' +
cityssm.escapeHTML((_b = lotOccupancy.lotName) !== null && _b !== void 0 ? _b : '') +
@ -625,8 +631,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
}
searchResultsContainerElement.innerHTML =
los.getLoadingParagraphHTML('Searching...');
cityssm.postJSON(los.urlPrefix + '/lots/doSearchLots', searchFormElement, (responseJSON) => {
cityssm.postJSON(los.urlPrefix + '/lots/doSearchLots', searchFormElement, (rawResponseJSON) => {
var _a, _b, _c, _d;
const responseJSON = rawResponseJSON;
if (responseJSON.lots.length === 0) {
searchResultsContainerElement.innerHTML =
'<div class="message is-info">' +

View File

@ -13,8 +13,9 @@ function deleteLotOccupancy(clickEvent) {
cityssm.postJSON(los.urlPrefix + '/workOrders/doDeleteWorkOrderLotOccupancy', {
workOrderId,
lotOccupancyId
}, (responseJSON) => {
}, (rawResponseJSON) => {
var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) {
workOrderLotOccupancies = responseJSON.workOrderLotOccupancies;
renderRelatedLotsAndOccupancies();
@ -42,8 +43,9 @@ function addLot(lotId, callbackFunction) {
cityssm.postJSON(los.urlPrefix + '/workOrders/doAddWorkOrderLot', {
workOrderId,
lotId
}, (responseJSON) => {
}, (rawResponseJSON) => {
var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) {
workOrderLots = responseJSON.workOrderLots;
renderRelatedLotsAndOccupancies();
@ -55,7 +57,7 @@ function addLot(lotId, callbackFunction) {
contextualColorName: 'danger'
});
}
if (callbackFunction) {
if (callbackFunction !== undefined) {
callbackFunction(responseJSON.success);
}
});
@ -64,8 +66,9 @@ function addLotOccupancy(lotOccupancyId, callbackFunction) {
cityssm.postJSON(los.urlPrefix + '/workOrders/doAddWorkOrderLotOccupancy', {
workOrderId,
lotOccupancyId
}, (responseJSON) => {
}, (rawResponseJSON) => {
var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) {
workOrderLotOccupancies = responseJSON.workOrderLotOccupancies;
renderRelatedLotsAndOccupancies();
@ -77,7 +80,7 @@ function addLotOccupancy(lotOccupancyId, callbackFunction) {
contextualColorName: 'danger'
});
}
if (callbackFunction) {
if (callbackFunction !== undefined) {
callbackFunction(responseJSON.success);
}
});
@ -134,7 +137,8 @@ function renderRelatedOccupancies() {
los.getLotOccupancyURL(lotOccupancy.lotOccupancyId) +
'">' +
cityssm.escapeHTML((_a = lotOccupancy.occupancyType) !== null && _a !== void 0 ? _a : '') +
'</a>' +
'</a><br />' +
`<span class="is-size-7">#${lotOccupancy.lotOccupancyId}</span>` +
'</td>');
if (lotOccupancy.lotId) {
rowElement.insertAdjacentHTML('beforeend', '<td>' +
@ -143,7 +147,7 @@ function renderRelatedOccupancies() {
? ''
: ' <button class="button is-small is-light is-success button--addLot"' +
' data-lot-id="' +
lotOccupancy.lotId +
lotOccupancy.lotId.toString() +
'"' +
' data-tooltip="Add ' +
los.escapedAliases.Lot +
@ -211,8 +215,9 @@ function openEditLotStatus(clickEvent) {
let editCloseModalFunction;
function doUpdateLotStatus(submitEvent) {
submitEvent.preventDefault();
cityssm.postJSON(los.urlPrefix + '/workOrders/doUpdateLotStatus', submitEvent.currentTarget, (responseJSON) => {
cityssm.postJSON(los.urlPrefix + '/workOrders/doUpdateLotStatus', submitEvent.currentTarget, (rawResponseJSON) => {
var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) {
workOrderLots = responseJSON.workOrderLots;
renderRelatedLotsAndOccupancies();
@ -274,8 +279,9 @@ function deleteLot(clickEvent) {
cityssm.postJSON(los.urlPrefix + '/workOrders/doDeleteWorkOrderLot', {
workOrderId,
lotId
}, (responseJSON) => {
}, (rawResponseJSON) => {
var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) {
workOrderLots = responseJSON.workOrderLots;
renderRelatedLotsAndOccupancies();
@ -331,21 +337,21 @@ function renderRelatedLots() {
cityssm.escapeHTML((_a = lot.lotName) !== null && _a !== void 0 ? _a : '') +
'</a>' +
'</td>' +
('<td>' + cityssm.escapeHTML((_b = lot.mapName) !== null && _b !== void 0 ? _b : '') + '</td>') +
('<td>' + cityssm.escapeHTML((_c = lot.lotType) !== null && _c !== void 0 ? _c : '') + '</td>') +
`<td>${cityssm.escapeHTML((_b = lot.mapName) !== null && _b !== void 0 ? _b : '')}</td>` +
`<td>${cityssm.escapeHTML((_c = lot.lotType) !== null && _c !== void 0 ? _c : '')}</td>` +
('<td>' +
(lot.lotStatusId
? cityssm.escapeHTML((_d = lot.lotStatus) !== null && _d !== void 0 ? _d : '')
: '<span class="has-text-grey">(No Status)</span>') +
'</td>') +
('<td class="is-nowrap">' +
'<button class="button is-small is-light is-info button--editLotStatus" data-tooltip="Update Status" type="button">' +
'<i class="fas fa-pencil-alt" aria-hidden="true"></i>' +
'</button>' +
' <button class="button is-small is-light is-danger button--deleteLot" data-tooltip="Delete Relationship" type="button">' +
'<i class="fas fa-trash" aria-hidden="true"></i>' +
'</button>' +
'</td>');
`<td class="is-nowrap">
<button class="button is-small is-light is-info button--editLotStatus" data-tooltip="Update Status" type="button">
<i class="fas fa-pencil-alt" aria-hidden="true"></i>
</button>
<button class="button is-small is-light is-danger button--deleteLot" data-tooltip="Delete Relationship" type="button">
<i class="fas fa-trash" aria-hidden="true"></i>
</button>
</td>`;
rowElement
.querySelector('.button--editLotStatus')
.addEventListener('click', openEditLotStatus);
@ -379,8 +385,9 @@ function doAddLotOccupancy(clickEvent) {
}
searchResultsContainerElement.innerHTML =
los.getLoadingParagraphHTML('Searching...');
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doSearchLotOccupancies', searchFormElement, (responseJSON) => {
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doSearchLotOccupancies', searchFormElement, (rawResponseJSON) => {
var _a, _b;
const responseJSON = rawResponseJSON;
if (responseJSON.lotOccupancies.length === 0) {
searchResultsContainerElement.innerHTML = `<div class="message is-info">
<p class="message-body">There are no records that meet the search criteria.</p>
@ -403,15 +410,14 @@ function doAddLotOccupancy(clickEvent) {
rowElement.className = 'container--lotOccupancy';
rowElement.dataset.lotOccupancyId =
lotOccupancy.lotOccupancyId.toString();
rowElement.innerHTML =
'<td class="has-text-centered">' +
'<button class="button is-small is-success button--addLotOccupancy" data-tooltip="Add" type="button" aria-label="Add">' +
'<i class="fas fa-plus" aria-hidden="true"></i>' +
'</button>' +
'</td>' +
('<td class="has-text-weight-bold">' +
cityssm.escapeHTML((_a = lotOccupancy.occupancyType) !== null && _a !== void 0 ? _a : '') +
'</td>');
rowElement.innerHTML = `<td class="has-text-centered">
<button class="button is-small is-success button--addLotOccupancy" data-tooltip="Add" type="button" aria-label="Add">
<i class="fas fa-plus" aria-hidden="true"></i>
</button>
</td>
<td class="has-text-weight-bold">
${cityssm.escapeHTML((_a = lotOccupancy.occupancyType) !== null && _a !== void 0 ? _a : '')}
</td>`;
if (lotOccupancy.lotId) {
rowElement.insertAdjacentHTML('beforeend', '<td>' +
cityssm.escapeHTML((_b = lotOccupancy.lotName) !== null && _b !== void 0 ? _b : '') +
@ -488,8 +494,9 @@ function doAddLot(clickEvent) {
}
searchResultsContainerElement.innerHTML =
los.getLoadingParagraphHTML('Searching...');
cityssm.postJSON(los.urlPrefix + '/lots/doSearchLots', searchFormElement, (responseJSON) => {
cityssm.postJSON(los.urlPrefix + '/lots/doSearchLots', searchFormElement, (rawResponseJSON) => {
var _a, _b, _c, _d;
const responseJSON = rawResponseJSON;
if (responseJSON.lots.length === 0) {
searchResultsContainerElement.innerHTML =
'<div class="message is-info">' +

View File

@ -35,11 +35,13 @@ function deleteLotOccupancy(clickEvent: Event): void {
workOrderId,
lotOccupancyId
},
(responseJSON: {
(rawResponseJSON) => {
const responseJSON = rawResponseJSON as {
success: boolean
errorMessage?: string
workOrderLotOccupancies?: recordTypes.LotOccupancy[]
}) => {
}
if (responseJSON.success) {
workOrderLotOccupancies = responseJSON.workOrderLotOccupancies!
renderRelatedLotsAndOccupancies()
@ -67,7 +69,7 @@ function deleteLotOccupancy(clickEvent: Event): void {
function addLot(
lotId: number | string,
callbackFunction?: (success?: boolean) => void
callbackFunction?: (success: boolean) => void
): void {
cityssm.postJSON(
los.urlPrefix + '/workOrders/doAddWorkOrderLot',
@ -75,11 +77,13 @@ function addLot(
workOrderId,
lotId
},
(responseJSON: {
(rawResponseJSON) => {
const responseJSON = rawResponseJSON as {
success: boolean
errorMessage?: string
workOrderLots?: recordTypes.Lot[]
}) => {
}
if (responseJSON.success) {
workOrderLots = responseJSON.workOrderLots!
renderRelatedLotsAndOccupancies()
@ -91,7 +95,7 @@ function addLot(
})
}
if (callbackFunction) {
if (callbackFunction !== undefined) {
callbackFunction(responseJSON.success)
}
}
@ -108,11 +112,13 @@ function addLotOccupancy(
workOrderId,
lotOccupancyId
},
(responseJSON: {
(rawResponseJSON) => {
const responseJSON = rawResponseJSON as {
success: boolean
errorMessage?: string
workOrderLotOccupancies?: recordTypes.LotOccupancy[]
}) => {
}
if (responseJSON.success) {
workOrderLotOccupancies = responseJSON.workOrderLotOccupancies!
renderRelatedLotsAndOccupancies()
@ -124,7 +130,7 @@ function addLotOccupancy(
})
}
if (callbackFunction) {
if (callbackFunction !== undefined) {
callbackFunction(responseJSON.success)
}
}
@ -201,7 +207,8 @@ function renderRelatedOccupancies(): void {
los.getLotOccupancyURL(lotOccupancy.lotOccupancyId) +
'">' +
cityssm.escapeHTML(lotOccupancy.occupancyType ?? '') +
'</a>' +
'</a><br />' +
`<span class="is-size-7">#${lotOccupancy.lotOccupancyId!}</span>` +
'</td>')
if (lotOccupancy.lotId) {
@ -213,7 +220,7 @@ function renderRelatedOccupancies(): void {
? ''
: ' <button class="button is-small is-light is-success button--addLot"' +
' data-lot-id="' +
lotOccupancy.lotId +
lotOccupancy.lotId.toString() +
'"' +
' data-tooltip="Add ' +
los.escapedAliases.Lot +
@ -310,11 +317,13 @@ function openEditLotStatus(clickEvent: Event): void {
cityssm.postJSON(
los.urlPrefix + '/workOrders/doUpdateLotStatus',
submitEvent.currentTarget,
(responseJSON: {
(rawResponseJSON) => {
const responseJSON = rawResponseJSON as {
success: boolean
errorMessage?: string
workOrderLots?: recordTypes.Lot[]
}) => {
}
if (responseJSON.success) {
workOrderLots = responseJSON.workOrderLots!
renderRelatedLotsAndOccupancies()
@ -407,11 +416,13 @@ function deleteLot(clickEvent: Event): void {
workOrderId,
lotId
},
(responseJSON: {
(rawResponseJSON) => {
const responseJSON = rawResponseJSON as {
success: boolean
errorMessage?: string
workOrderLots?: recordTypes.Lot[]
}) => {
}
if (responseJSON.success) {
workOrderLots = responseJSON.workOrderLots!
renderRelatedLotsAndOccupancies()
@ -481,21 +492,21 @@ function renderRelatedLots(): void {
cityssm.escapeHTML(lot.lotName ?? '') +
'</a>' +
'</td>' +
('<td>' + cityssm.escapeHTML(lot.mapName ?? '') + '</td>') +
('<td>' + cityssm.escapeHTML(lot.lotType ?? '') + '</td>') +
`<td>${cityssm.escapeHTML(lot.mapName ?? '')}</td>` +
`<td>${cityssm.escapeHTML(lot.lotType ?? '')}</td>` +
('<td>' +
(lot.lotStatusId
? cityssm.escapeHTML(lot.lotStatus ?? '')
: '<span class="has-text-grey">(No Status)</span>') +
'</td>') +
('<td class="is-nowrap">' +
'<button class="button is-small is-light is-info button--editLotStatus" data-tooltip="Update Status" type="button">' +
'<i class="fas fa-pencil-alt" aria-hidden="true"></i>' +
'</button>' +
' <button class="button is-small is-light is-danger button--deleteLot" data-tooltip="Delete Relationship" type="button">' +
'<i class="fas fa-trash" aria-hidden="true"></i>' +
'</button>' +
'</td>')
`<td class="is-nowrap">
<button class="button is-small is-light is-info button--editLotStatus" data-tooltip="Update Status" type="button">
<i class="fas fa-pencil-alt" aria-hidden="true"></i>
</button>
<button class="button is-small is-light is-danger button--deleteLot" data-tooltip="Delete Relationship" type="button">
<i class="fas fa-trash" aria-hidden="true"></i>
</button>
</td>`
rowElement
.querySelector('.button--editLotStatus')!
@ -545,7 +556,11 @@ document
cityssm.postJSON(
los.urlPrefix + '/lotOccupancies/doSearchLotOccupancies',
searchFormElement,
(responseJSON: { lotOccupancies: recordTypes.LotOccupancy[] }) => {
(rawResponseJSON) => {
const responseJSON = rawResponseJSON as {
lotOccupancies: recordTypes.LotOccupancy[]
}
if (responseJSON.lotOccupancies.length === 0) {
searchResultsContainerElement.innerHTML = `<div class="message is-info">
<p class="message-body">There are no records that meet the search criteria.</p>
@ -572,15 +587,14 @@ document
rowElement.dataset.lotOccupancyId =
lotOccupancy.lotOccupancyId!.toString()
rowElement.innerHTML =
'<td class="has-text-centered">' +
'<button class="button is-small is-success button--addLotOccupancy" data-tooltip="Add" type="button" aria-label="Add">' +
'<i class="fas fa-plus" aria-hidden="true"></i>' +
'</button>' +
'</td>' +
('<td class="has-text-weight-bold">' +
cityssm.escapeHTML(lotOccupancy.occupancyType ?? '') +
'</td>')
rowElement.innerHTML = `<td class="has-text-centered">
<button class="button is-small is-success button--addLotOccupancy" data-tooltip="Add" type="button" aria-label="Add">
<i class="fas fa-plus" aria-hidden="true"></i>
</button>
</td>
<td class="has-text-weight-bold">
${cityssm.escapeHTML(lotOccupancy.occupancyType ?? '')}
</td>`
if (lotOccupancy.lotId) {
rowElement.insertAdjacentHTML(
@ -715,7 +729,9 @@ document.querySelector('#button--addLot')?.addEventListener('click', () => {
cityssm.postJSON(
los.urlPrefix + '/lots/doSearchLots',
searchFormElement,
(responseJSON: { lots: recordTypes.Lot[] }) => {
(rawResponseJSON) => {
const responseJSON = rawResponseJSON as { lots: recordTypes.Lot[] }
if (responseJSON.lots.length === 0) {
searchResultsContainerElement.innerHTML =
'<div class="message is-info">' +

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -338,8 +338,6 @@
</div>
</div>
</div>
</form>
<% if (isCreate) { %>
@ -396,7 +394,10 @@
<div class="panel-block is-block">
<% if (lot.lotOccupancies.length === 0) { %>
<div class="message is-info">
<p class="message-body">There are no <%= configFunctions.getProperty("aliases.occupancy").toLowerCase() %> records asscociated with this <%= configFunctions.getProperty("aliases.lot") %>.</p>
<p class="message-body">
There are no <%= configFunctions.getProperty("aliases.occupancy").toLowerCase() %> records
asscociated with this <%= configFunctions.getProperty("aliases.lot") %>.
</p>
</div>
<% } else { %>
<table class="table is-fullwidth is-striped is-hoverable">
@ -424,7 +425,10 @@
<td>
<a class="has-text-weight-bold" href="<%= urlPrefix %>/lotOccupancies/<%= lotOccupancy.lotOccupancyId %>">
<%= lotOccupancy.occupancyType %>
</a>
</a><br />
<span class="is-size-7">
#<%= lotOccupancy.lotOccupancyId %>
</span>
</td>
<td><%= lotOccupancy.occupancyStartDateString %></td>
<td>

View File

@ -151,8 +151,10 @@
<div class="panel-block is-block">
<% if (lot.lotOccupancies.length === 0) { %>
<div class="message is-info">
<p class="message-body">There are no occupancy records asscociated with this
<%= configFunctions.getProperty("aliases.lot") %>.</p>
<p class="message-body">
There are no occupancy records asscociated with this
<%= configFunctions.getProperty("aliases.lot") %>.
</p>
</div>
<% } else { %>
<table class="table is-fullwidth is-striped is-hoverable">
@ -181,7 +183,8 @@
<a class="has-text-weight-bold"
href="<%= urlPrefix %>/lotOccupancies/<%= lotOccupancy.lotOccupancyId %>">
<%= lotOccupancy.occupancyType %>
</a>
</a><br />
<span class="is-size-7">#<%= lotOccupancy.lotOccupancyId %></span>
</td>
<td><%= lotOccupancy.occupancyStartDateString %></td>
<td>

View File

@ -113,7 +113,9 @@
<% if (workOrder.workOrderCloseDate) { %>
<%= workOrder.workOrderCloseDateString %>
<% } else { %>
<span class="has-text-grey">(No <%= configFunctions.getProperty("aliases.workOrderCloseDate") %>)</span>
<span class="has-text-grey">
(No <%= configFunctions.getProperty("aliases.workOrderCloseDate") %>)
</span>
<% } %>
</p>
</div>
@ -182,7 +184,10 @@
<a class="has-text-weight-bold"
href="<%= urlPrefix %>/lotOccupancies/<%= lotOccupancy.lotOccupancyId %>">
<%= lotOccupancy.occupancyType %>
</a>
</a><br />
<span class="is-size-7">
#<%= lotOccupancy.lotOccupancyId %>
</span>
</td>
<td>
<% if (lotOccupancy.lotId) { %>