linting
parent
5aeb485d07
commit
cd400e0aa8
|
|
@ -3,14 +3,14 @@
|
|||
import type { BulmaJS } from '@cityssm/bulma-js/types.js'
|
||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
|
||||
|
||||
import type * as globalTypes from '../types/globalTypes.js'
|
||||
import type { LOS } from '../types/globalTypes.js'
|
||||
|
||||
declare const cityssm: cityssmGlobal
|
||||
declare const bulmaJS: BulmaJS
|
||||
|
||||
declare const exports: Record<string, unknown>
|
||||
;(() => {
|
||||
const los = exports.los as globalTypes.LOS
|
||||
const los = exports.los as LOS
|
||||
|
||||
function doBackup(): void {
|
||||
cityssm.postJSON(
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
import type { BulmaJS } from '@cityssm/bulma-js/types.js'
|
||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
|
||||
|
||||
import type * as globalTypes from '../types/globalTypes.js'
|
||||
import type { LOS } from '../types/globalTypes.js'
|
||||
import type * as recordTypes from '../types/recordTypes.js'
|
||||
|
||||
declare const cityssm: cityssmGlobal
|
||||
|
|
@ -12,7 +12,7 @@ declare const bulmaJS: BulmaJS
|
|||
|
||||
declare const exports: Record<string, unknown>
|
||||
;(() => {
|
||||
const los = exports.los as globalTypes.LOS
|
||||
const los = exports.los as LOS
|
||||
|
||||
const feeCategoriesContainerElement = document.querySelector(
|
||||
'#container--feeCategories'
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
import type { BulmaJS } from '@cityssm/bulma-js/types.js'
|
||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
|
||||
|
||||
import type * as globalTypes from '../types/globalTypes.js'
|
||||
import type { LOS } from '../types/globalTypes.js'
|
||||
import type * as recordTypes from '../types/recordTypes.js'
|
||||
|
||||
declare const cityssm: cityssmGlobal
|
||||
|
|
@ -23,7 +23,7 @@ type ResponseJSON =
|
|||
errorMessage: string
|
||||
}
|
||||
;(() => {
|
||||
const los = exports.los as globalTypes.LOS
|
||||
const los = exports.los as LOS
|
||||
|
||||
const containerElement = document.querySelector(
|
||||
'#container--lotTypes'
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
import type { BulmaJS } from '@cityssm/bulma-js/types.js'
|
||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
|
||||
|
||||
import type * as globalTypes from '../types/globalTypes.js'
|
||||
import type { LOS } from '../types/globalTypes.js'
|
||||
import type * as recordTypes from '../types/recordTypes.js'
|
||||
|
||||
declare const cityssm: cityssmGlobal
|
||||
|
|
@ -24,7 +24,7 @@ type ResponseJSON =
|
|||
errorMessage: string
|
||||
}
|
||||
;(() => {
|
||||
const los = exports.los as globalTypes.LOS
|
||||
const los = exports.los as LOS
|
||||
|
||||
const occupancyTypesContainerElement = document.querySelector(
|
||||
'#container--occupancyTypes'
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
|
||||
import type * as globalTypes from '../types/globalTypes.js'
|
||||
import type { LOS } from '../types/globalTypes.js'
|
||||
|
||||
declare const exports: Record<string, unknown>
|
||||
;(() => {
|
||||
const los = exports.los as globalTypes.LOS
|
||||
const los = exports.los as LOS
|
||||
|
||||
const workOrderNumberCircleElements: NodeListOf<HTMLElement> =
|
||||
document.querySelectorAll('.fa-circle[data-work-order-number]')
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
var _a;
|
||||
var _a, _b;
|
||||
const los = exports.los;
|
||||
const lotId = document.querySelector('#lot--lotId')
|
||||
.value;
|
||||
|
|
@ -24,7 +25,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
const formElement = document.querySelector('#form--lot');
|
||||
function updateLot(formEvent) {
|
||||
formEvent.preventDefault();
|
||||
cityssm.postJSON(los.urlPrefix + '/lots/' + (isCreate ? 'doCreateLot' : 'doUpdateLot'), formElement, (rawResponseJSON) => {
|
||||
cityssm.postJSON(`${los.urlPrefix}/lots/${isCreate ? 'doCreateLot' : 'doUpdateLot'}`, formElement, (rawResponseJSON) => {
|
||||
var _a;
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.success) {
|
||||
|
|
@ -34,14 +35,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
message: los.escapedAliases.Lot + ' Updated Successfully',
|
||||
message: `${los.escapedAliases.Lot} Updated Successfully`,
|
||||
contextualColorName: 'success'
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
title: 'Error Updating ' + los.escapedAliases.Lot,
|
||||
title: `Error Updating ${los.escapedAliases.Lot}`,
|
||||
message: (_a = responseJSON.errorMessage) !== null && _a !== void 0 ? _a : '',
|
||||
contextualColorName: 'danger'
|
||||
});
|
||||
|
|
@ -58,7 +59,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
.querySelector('#button--deleteLot')) === null || _a === void 0 ? void 0 : _a.addEventListener('click', (clickEvent) => {
|
||||
clickEvent.preventDefault();
|
||||
function doDelete() {
|
||||
cityssm.postJSON(los.urlPrefix + '/lots/doDeleteLot', {
|
||||
cityssm.postJSON(`${los.urlPrefix}/lots/doDeleteLot`, {
|
||||
lotId
|
||||
}, (rawResponseJSON) => {
|
||||
var _a;
|
||||
|
|
@ -77,7 +78,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
});
|
||||
}
|
||||
bulmaJS.confirm({
|
||||
title: 'Delete ' + los.escapedAliases.Lot,
|
||||
title: `Delete ${los.escapedAliases.Lot}`,
|
||||
message: `Are you sure you want to delete this ${los.escapedAliases.lot}?`,
|
||||
contextualColorName: 'warning',
|
||||
okButton: {
|
||||
|
|
@ -92,19 +93,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
const lotFieldsContainerElement = document.querySelector('#container--lotFields');
|
||||
lotTypeIdElement.addEventListener('change', () => {
|
||||
if (lotTypeIdElement.value === '') {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
lotFieldsContainerElement.innerHTML = `<div class="message is-info">
|
||||
<p class="message-body">Select the ${los.escapedAliases.lot} type to load the available fields.</p>
|
||||
</div>`;
|
||||
return;
|
||||
}
|
||||
cityssm.postJSON(los.urlPrefix + '/lots/doGetLotTypeFields', {
|
||||
cityssm.postJSON(`${los.urlPrefix}/lots/doGetLotTypeFields`, {
|
||||
lotTypeId: lotTypeIdElement.value
|
||||
}, (rawResponseJSON) => {
|
||||
var _a;
|
||||
var _a, _b;
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.lotTypeFields.length === 0) {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
lotFieldsContainerElement.innerHTML = `<div class="message is-info">
|
||||
<p class="message-body">There are no additional fields for this ${los.escapedAliases.lot} type.</p>
|
||||
<p class="message-body">
|
||||
There are no additional fields for this ${los.escapedAliases.lot} type.
|
||||
</p>
|
||||
</div>`;
|
||||
return;
|
||||
}
|
||||
|
|
@ -112,10 +117,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
let lotTypeFieldIds = '';
|
||||
for (const lotTypeField of responseJSON.lotTypeFields) {
|
||||
lotTypeFieldIds += ',' + lotTypeField.lotTypeFieldId.toString();
|
||||
const fieldName = 'lotFieldValue_' + lotTypeField.lotTypeFieldId.toString();
|
||||
const fieldId = 'lot--' + fieldName;
|
||||
const fieldName = `lotFieldValue_${lotTypeField.lotTypeFieldId.toString()}`;
|
||||
const fieldId = `lot--${fieldName}`;
|
||||
const fieldElement = document.createElement('div');
|
||||
fieldElement.className = 'field';
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
fieldElement.innerHTML = `<label class="label" for="${fieldId}"></label>
|
||||
<div class="control"></div>`;
|
||||
fieldElement.querySelector('label').textContent = lotTypeField.lotTypeField;
|
||||
|
|
@ -131,12 +137,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
if (((_a = lotTypeField.pattern) !== null && _a !== void 0 ? _a : '') !== '') {
|
||||
inputElement.pattern = lotTypeField.pattern;
|
||||
}
|
||||
fieldElement.querySelector('.control').append(inputElement);
|
||||
(_b = fieldElement.querySelector('.control')) === null || _b === void 0 ? void 0 : _b.append(inputElement);
|
||||
}
|
||||
else {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
;
|
||||
fieldElement.querySelector('.control').innerHTML = `<div class="select is-fullwidth">
|
||||
<select id="${fieldId}" name="${fieldName}"><option value="">(Not Set)</option></select>
|
||||
</div>`;
|
||||
<select id="${fieldId}" name="${fieldName}"><option value="">(Not Set)</option></select>
|
||||
</div>`;
|
||||
const selectElement = fieldElement.querySelector('select');
|
||||
selectElement.required = lotTypeField.isRequired;
|
||||
const optionValues = lotTypeField.lotTypeFieldValues.split('\n');
|
||||
|
|
@ -150,7 +158,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
lotFieldsContainerElement.append(fieldElement);
|
||||
}
|
||||
lotFieldsContainerElement.insertAdjacentHTML('beforeend', `<input name="lotTypeFieldIds" type="hidden"
|
||||
value="${lotTypeFieldIds.slice(1)}" />`);
|
||||
value="${cityssm.escapeHTML(lotTypeFieldIds.slice(1))}" />`);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
@ -161,17 +169,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
bulmaJS.confirm({
|
||||
title: 'Confirm Change',
|
||||
message: `Are you sure you want to change the ${los.escapedAliases.lot} type?\n
|
||||
This change affects the additional fields associated with this record.`,
|
||||
This change affects the additional fields associated with this record.`,
|
||||
contextualColorName: 'warning',
|
||||
okButton: {
|
||||
text: 'Yes, Keep the Change',
|
||||
callbackFunction: () => {
|
||||
callbackFunction() {
|
||||
refreshAfterSave = true;
|
||||
}
|
||||
},
|
||||
cancelButton: {
|
||||
text: 'Revert the Change',
|
||||
callbackFunction: () => {
|
||||
callbackFunction() {
|
||||
lotTypeIdElement.value = originalLotTypeId;
|
||||
}
|
||||
}
|
||||
|
|
@ -183,8 +191,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
let lotComments = exports.lotComments;
|
||||
delete exports.lotComments;
|
||||
function openEditLotComment(clickEvent) {
|
||||
const lotCommentId = Number.parseInt(clickEvent.currentTarget.closest('tr').dataset
|
||||
.lotCommentId, 10);
|
||||
var _a, _b;
|
||||
const lotCommentId = Number.parseInt((_b = (_a = clickEvent.currentTarget.closest('tr')) === null || _a === void 0 ? void 0 : _a.dataset.lotCommentId) !== null && _b !== void 0 ? _b : '', 10);
|
||||
const lotComment = lotComments.find((currentLotComment) => {
|
||||
return currentLotComment.lotCommentId === lotCommentId;
|
||||
});
|
||||
|
|
@ -192,7 +200,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
let editCloseModalFunction;
|
||||
function editComment(submitEvent) {
|
||||
submitEvent.preventDefault();
|
||||
cityssm.postJSON(los.urlPrefix + '/lots/doUpdateLotComment', editFormElement, (rawResponseJSON) => {
|
||||
cityssm.postJSON(`${los.urlPrefix}/lots/doUpdateLotComment`, editFormElement, (rawResponseJSON) => {
|
||||
var _a;
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.success) {
|
||||
|
|
@ -210,21 +218,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
});
|
||||
}
|
||||
cityssm.openHtmlModal('lot-editComment', {
|
||||
onshow: (modalElement) => {
|
||||
onshow(modalElement) {
|
||||
var _a, _b, _c, _d;
|
||||
los.populateAliases(modalElement);
|
||||
modalElement.querySelector('#lotCommentEdit--lotId').value = lotId;
|
||||
modalElement.querySelector('#lotCommentEdit--lotCommentId').value = lotCommentId.toString();
|
||||
modalElement.querySelector('#lotCommentEdit--lotComment').value = lotComment.lotComment;
|
||||
modalElement.querySelector('#lotCommentEdit--lotComment').value = (_a = lotComment.lotComment) !== null && _a !== void 0 ? _a : '';
|
||||
const lotCommentDateStringElement = modalElement.querySelector('#lotCommentEdit--lotCommentDateString');
|
||||
lotCommentDateStringElement.value = lotComment.lotCommentDateString;
|
||||
lotCommentDateStringElement.value =
|
||||
(_b = lotComment.lotCommentDateString) !== null && _b !== void 0 ? _b : '';
|
||||
const currentDateString = cityssm.dateToString(new Date());
|
||||
lotCommentDateStringElement.max =
|
||||
lotComment.lotCommentDateString <= currentDateString
|
||||
? currentDateString
|
||||
: lotComment.lotCommentDateString;
|
||||
modalElement.querySelector('#lotCommentEdit--lotCommentTimeString').value = lotComment.lotCommentTimeString;
|
||||
: (_c = lotComment.lotCommentDateString) !== null && _c !== void 0 ? _c : '';
|
||||
modalElement.querySelector('#lotCommentEdit--lotCommentTimeString').value = (_d = lotComment.lotCommentTimeString) !== null && _d !== void 0 ? _d : '';
|
||||
},
|
||||
onshown: (modalElement, closeModalFunction) => {
|
||||
onshown(modalElement, closeModalFunction) {
|
||||
bulmaJS.toggleHtmlClipped();
|
||||
los.initializeDatePickers(modalElement);
|
||||
modalElement.querySelector('#lotCommentEdit--lotComment').focus();
|
||||
|
|
@ -232,16 +242,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
editFormElement.addEventListener('submit', editComment);
|
||||
editCloseModalFunction = closeModalFunction;
|
||||
},
|
||||
onremoved: () => {
|
||||
onremoved() {
|
||||
bulmaJS.toggleHtmlClipped();
|
||||
}
|
||||
});
|
||||
}
|
||||
function deleteLotComment(clickEvent) {
|
||||
const lotCommentId = Number.parseInt(clickEvent.currentTarget.closest('tr').dataset
|
||||
.lotCommentId, 10);
|
||||
var _a, _b;
|
||||
const lotCommentId = Number.parseInt((_b = (_a = clickEvent.currentTarget.closest('tr')) === null || _a === void 0 ? void 0 : _a.dataset.lotCommentId) !== null && _b !== void 0 ? _b : '', 10);
|
||||
function doDelete() {
|
||||
cityssm.postJSON(los.urlPrefix + '/lots/doDeleteLotComment', {
|
||||
cityssm.postJSON(`${los.urlPrefix}/lots/doDeleteLotComment`, {
|
||||
lotId,
|
||||
lotCommentId
|
||||
}, (rawResponseJSON) => {
|
||||
|
|
@ -271,57 +281,52 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
});
|
||||
}
|
||||
function renderLotComments() {
|
||||
var _a, _b;
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
const containerElement = document.querySelector('#container--lotComments');
|
||||
if (lotComments.length === 0) {
|
||||
containerElement.innerHTML = `<div class="message is-info">
|
||||
<p class="message-body">There are no comments to display.</p>
|
||||
</div>`;
|
||||
<p class="message-body">There are no comments to display.</p>
|
||||
</div>`;
|
||||
return;
|
||||
}
|
||||
const tableElement = document.createElement('table');
|
||||
tableElement.className = 'table is-fullwidth is-striped is-hoverable';
|
||||
tableElement.innerHTML = `<thead><tr>
|
||||
<th>Commentor</th>
|
||||
<th>Comment Date</th>
|
||||
<th>Comment</th>
|
||||
<th class="is-hidden-print"><span class="is-sr-only">Options</span></th>
|
||||
</tr></thead>
|
||||
<tbody></tbody>`;
|
||||
<th>Commentor</th>
|
||||
<th>Comment Date</th>
|
||||
<th>Comment</th>
|
||||
<th class="is-hidden-print"><span class="is-sr-only">Options</span></th>
|
||||
</tr></thead>
|
||||
<tbody></tbody>`;
|
||||
for (const lotComment of lotComments) {
|
||||
const tableRowElement = document.createElement('tr');
|
||||
tableRowElement.dataset.lotCommentId = lotComment.lotCommentId.toString();
|
||||
tableRowElement.innerHTML =
|
||||
'<td>' +
|
||||
cityssm.escapeHTML((_a = lotComment.recordCreate_userName) !== null && _a !== void 0 ? _a : '') +
|
||||
'</td>' +
|
||||
'<td>' +
|
||||
lotComment.lotCommentDateString +
|
||||
(lotComment.lotCommentTime === 0
|
||||
? ''
|
||||
: ' ' + lotComment.lotCommentTimePeriodString) +
|
||||
'</td>' +
|
||||
'<td>' +
|
||||
cityssm.escapeHTML((_b = lotComment.lotComment) !== null && _b !== void 0 ? _b : '') +
|
||||
'</td>' +
|
||||
('<td class="is-hidden-print">' +
|
||||
'<div class="buttons are-small is-justify-content-end">' +
|
||||
('<button class="button is-primary button--edit" type="button">' +
|
||||
'<span class="icon is-small"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>' +
|
||||
' <span>Edit</span>' +
|
||||
'</button>') +
|
||||
('<button class="button is-light is-danger button--delete" data-tooltip="Delete Comment" type="button" aria-label="Delete">' +
|
||||
'<i class="fas fa-trash" aria-hidden="true"></i>' +
|
||||
'</button>') +
|
||||
'</div>' +
|
||||
'</td>');
|
||||
tableRowElement
|
||||
.querySelector('.button--edit')
|
||||
.addEventListener('click', openEditLotComment);
|
||||
tableRowElement
|
||||
.querySelector('.button--delete')
|
||||
.addEventListener('click', deleteLotComment);
|
||||
tableElement.querySelector('tbody').append(tableRowElement);
|
||||
tableRowElement.dataset.lotCommentId = (_a = lotComment.lotCommentId) === null || _a === void 0 ? void 0 : _a.toString();
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
tableRowElement.innerHTML = `<td>
|
||||
${cityssm.escapeHTML((_b = lotComment.recordCreate_userName) !== null && _b !== void 0 ? _b : '')}
|
||||
</td><td>
|
||||
${lotComment.lotCommentDateString}
|
||||
${lotComment.lotCommentTime === 0
|
||||
? ''
|
||||
: ' ' + lotComment.lotCommentTimePeriodString}
|
||||
</td><td>
|
||||
${cityssm.escapeHTML((_c = lotComment.lotComment) !== null && _c !== void 0 ? _c : '')}
|
||||
</td><td class="is-hidden-print">
|
||||
<div class="buttons are-small is-justify-content-end">
|
||||
<button class="button is-primary button--edit" type="button">
|
||||
<span class="icon is-small"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>
|
||||
<span>Edit</span>
|
||||
</button>
|
||||
<button class="button is-light is-danger button--delete" data-tooltip="Delete Comment" type="button" aria-label="Delete">
|
||||
<i class="fas fa-trash" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
</td>`;
|
||||
(_d = tableRowElement
|
||||
.querySelector('.button--edit')) === null || _d === void 0 ? void 0 : _d.addEventListener('click', openEditLotComment);
|
||||
(_e = tableRowElement
|
||||
.querySelector('.button--delete')) === null || _e === void 0 ? void 0 : _e.addEventListener('click', deleteLotComment);
|
||||
(_f = tableElement.querySelector('tbody')) === null || _f === void 0 ? void 0 : _f.append(tableRowElement);
|
||||
}
|
||||
containerElement.innerHTML = '';
|
||||
containerElement.append(tableElement);
|
||||
|
|
@ -330,7 +335,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
let addCommentCloseModalFunction;
|
||||
function doAddComment(formEvent) {
|
||||
formEvent.preventDefault();
|
||||
cityssm.postJSON(los.urlPrefix + '/lots/doAddLotComment', formEvent.currentTarget, (rawResponseJSON) => {
|
||||
cityssm.postJSON(`${los.urlPrefix}/lots/doAddLotComment`, formEvent.currentTarget, (rawResponseJSON) => {
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.success) {
|
||||
lotComments = responseJSON.lotComments;
|
||||
|
|
@ -341,11 +346,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}
|
||||
cityssm.openHtmlModal('lot-addComment', {
|
||||
onshow(modalElement) {
|
||||
var _a;
|
||||
los.populateAliases(modalElement);
|
||||
modalElement.querySelector('#lotCommentAdd--lotId').value = lotId;
|
||||
modalElement
|
||||
.querySelector('form')
|
||||
.addEventListener('submit', doAddComment);
|
||||
(_a = modalElement
|
||||
.querySelector('form')) === null || _a === void 0 ? void 0 : _a.addEventListener('submit', doAddComment);
|
||||
},
|
||||
onshown(modalElement, closeModalFunction) {
|
||||
bulmaJS.toggleHtmlClipped();
|
||||
|
|
@ -359,9 +364,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
});
|
||||
}
|
||||
if (!isCreate) {
|
||||
document
|
||||
.querySelector('#lotComments--add')
|
||||
.addEventListener('click', openAddCommentModal);
|
||||
(_b = document
|
||||
.querySelector('#lotComments--add')) === null || _b === void 0 ? void 0 : _b.addEventListener('click', openAddCommentModal);
|
||||
renderLotComments();
|
||||
}
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -1,16 +1,18 @@
|
|||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
|
||||
import type * as globalTypes from '../types/globalTypes'
|
||||
import type * as recordTypes from '../types/recordTypes'
|
||||
import type { BulmaJS } from '@cityssm/bulma-js/types.js'
|
||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
|
||||
|
||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types'
|
||||
|
||||
import type { BulmaJS } from '@cityssm/bulma-js/types'
|
||||
import type { LOS } from '../types/globalTypes.js'
|
||||
import type * as recordTypes from '../types/recordTypes.js'
|
||||
|
||||
declare const cityssm: cityssmGlobal
|
||||
declare const bulmaJS: BulmaJS
|
||||
|
||||
declare const exports: Record<string, unknown>
|
||||
;(() => {
|
||||
const los = exports.los as globalTypes.LOS
|
||||
const los = exports.los as LOS
|
||||
|
||||
const lotId = (document.querySelector('#lot--lotId') as HTMLInputElement)
|
||||
.value
|
||||
|
|
@ -40,7 +42,7 @@ declare const bulmaJS: BulmaJS
|
|||
formEvent.preventDefault()
|
||||
|
||||
cityssm.postJSON(
|
||||
los.urlPrefix + '/lots/' + (isCreate ? 'doCreateLot' : 'doUpdateLot'),
|
||||
`${los.urlPrefix}/lots/${isCreate ? 'doCreateLot' : 'doUpdateLot'}`,
|
||||
formElement,
|
||||
(rawResponseJSON) => {
|
||||
const responseJSON = rawResponseJSON as {
|
||||
|
|
@ -56,13 +58,13 @@ declare const bulmaJS: BulmaJS
|
|||
window.location.href = los.getLotURL(responseJSON.lotId, true, true)
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
message: los.escapedAliases.Lot + ' Updated Successfully',
|
||||
message: `${los.escapedAliases.Lot} Updated Successfully`,
|
||||
contextualColorName: 'success'
|
||||
})
|
||||
}
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
title: 'Error Updating ' + los.escapedAliases.Lot,
|
||||
title: `Error Updating ${los.escapedAliases.Lot}`,
|
||||
message: responseJSON.errorMessage ?? '',
|
||||
contextualColorName: 'danger'
|
||||
})
|
||||
|
|
@ -88,7 +90,7 @@ declare const bulmaJS: BulmaJS
|
|||
|
||||
function doDelete(): void {
|
||||
cityssm.postJSON(
|
||||
los.urlPrefix + '/lots/doDeleteLot',
|
||||
`${los.urlPrefix}/lots/doDeleteLot`,
|
||||
{
|
||||
lotId
|
||||
},
|
||||
|
|
@ -113,7 +115,7 @@ declare const bulmaJS: BulmaJS
|
|||
}
|
||||
|
||||
bulmaJS.confirm({
|
||||
title: 'Delete ' + los.escapedAliases.Lot,
|
||||
title: `Delete ${los.escapedAliases.Lot}`,
|
||||
message: `Are you sure you want to delete this ${los.escapedAliases.lot}?`,
|
||||
contextualColorName: 'warning',
|
||||
okButton: {
|
||||
|
|
@ -136,6 +138,7 @@ declare const bulmaJS: BulmaJS
|
|||
|
||||
lotTypeIdElement.addEventListener('change', () => {
|
||||
if (lotTypeIdElement.value === '') {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
lotFieldsContainerElement.innerHTML = `<div class="message is-info">
|
||||
<p class="message-body">Select the ${los.escapedAliases.lot} type to load the available fields.</p>
|
||||
</div>`
|
||||
|
|
@ -144,7 +147,7 @@ declare const bulmaJS: BulmaJS
|
|||
}
|
||||
|
||||
cityssm.postJSON(
|
||||
los.urlPrefix + '/lots/doGetLotTypeFields',
|
||||
`${los.urlPrefix}/lots/doGetLotTypeFields`,
|
||||
{
|
||||
lotTypeId: lotTypeIdElement.value
|
||||
},
|
||||
|
|
@ -154,8 +157,11 @@ declare const bulmaJS: BulmaJS
|
|||
}
|
||||
|
||||
if (responseJSON.lotTypeFields.length === 0) {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
lotFieldsContainerElement.innerHTML = `<div class="message is-info">
|
||||
<p class="message-body">There are no additional fields for this ${los.escapedAliases.lot} type.</p>
|
||||
<p class="message-body">
|
||||
There are no additional fields for this ${los.escapedAliases.lot} type.
|
||||
</p>
|
||||
</div>`
|
||||
|
||||
return
|
||||
|
|
@ -168,13 +174,14 @@ declare const bulmaJS: BulmaJS
|
|||
for (const lotTypeField of responseJSON.lotTypeFields) {
|
||||
lotTypeFieldIds += ',' + lotTypeField.lotTypeFieldId.toString()
|
||||
|
||||
const fieldName =
|
||||
'lotFieldValue_' + lotTypeField.lotTypeFieldId.toString()
|
||||
const fieldName = `lotFieldValue_${lotTypeField.lotTypeFieldId.toString()}`
|
||||
|
||||
const fieldId = 'lot--' + fieldName
|
||||
const fieldId = `lot--${fieldName}`
|
||||
|
||||
const fieldElement = document.createElement('div')
|
||||
fieldElement.className = 'field'
|
||||
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
fieldElement.innerHTML = `<label class="label" for="${fieldId}"></label>
|
||||
<div class="control"></div>`
|
||||
;(
|
||||
|
|
@ -200,13 +207,14 @@ declare const bulmaJS: BulmaJS
|
|||
inputElement.pattern = lotTypeField.pattern!
|
||||
}
|
||||
|
||||
fieldElement.querySelector('.control')!.append(inputElement)
|
||||
fieldElement.querySelector('.control')?.append(inputElement)
|
||||
} else {
|
||||
fieldElement.querySelector(
|
||||
'.control'
|
||||
)!.innerHTML = `<div class="select is-fullwidth">
|
||||
<select id="${fieldId}" name="${fieldName}"><option value="">(Not Set)</option></select>
|
||||
</div>`
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
;(
|
||||
fieldElement.querySelector('.control') as HTMLElement
|
||||
).innerHTML = `<div class="select is-fullwidth">
|
||||
<select id="${fieldId}" name="${fieldName}"><option value="">(Not Set)</option></select>
|
||||
</div>`
|
||||
|
||||
const selectElement = fieldElement.querySelector(
|
||||
'select'
|
||||
|
|
@ -232,7 +240,7 @@ declare const bulmaJS: BulmaJS
|
|||
lotFieldsContainerElement.insertAdjacentHTML(
|
||||
'beforeend',
|
||||
`<input name="lotTypeFieldIds" type="hidden"
|
||||
value="${lotTypeFieldIds.slice(1)}" />`
|
||||
value="${cityssm.escapeHTML(lotTypeFieldIds.slice(1))}" />`
|
||||
)
|
||||
}
|
||||
)
|
||||
|
|
@ -245,17 +253,17 @@ declare const bulmaJS: BulmaJS
|
|||
bulmaJS.confirm({
|
||||
title: 'Confirm Change',
|
||||
message: `Are you sure you want to change the ${los.escapedAliases.lot} type?\n
|
||||
This change affects the additional fields associated with this record.`,
|
||||
This change affects the additional fields associated with this record.`,
|
||||
contextualColorName: 'warning',
|
||||
okButton: {
|
||||
text: 'Yes, Keep the Change',
|
||||
callbackFunction: () => {
|
||||
callbackFunction() {
|
||||
refreshAfterSave = true
|
||||
}
|
||||
},
|
||||
cancelButton: {
|
||||
text: 'Revert the Change',
|
||||
callbackFunction: () => {
|
||||
callbackFunction() {
|
||||
lotTypeIdElement.value = originalLotTypeId
|
||||
}
|
||||
}
|
||||
|
|
@ -266,19 +274,19 @@ declare const bulmaJS: BulmaJS
|
|||
|
||||
// Comments
|
||||
|
||||
let lotComments: recordTypes.LotComment[] = exports.lotComments
|
||||
let lotComments = exports.lotComments as recordTypes.LotComment[]
|
||||
delete exports.lotComments
|
||||
|
||||
function openEditLotComment(clickEvent: Event): void {
|
||||
const lotCommentId = Number.parseInt(
|
||||
(clickEvent.currentTarget as HTMLElement).closest('tr')!.dataset
|
||||
.lotCommentId!,
|
||||
(clickEvent.currentTarget as HTMLElement).closest('tr')?.dataset
|
||||
.lotCommentId ?? '',
|
||||
10
|
||||
)
|
||||
|
||||
const lotComment = lotComments.find((currentLotComment) => {
|
||||
return currentLotComment.lotCommentId === lotCommentId
|
||||
})!
|
||||
}) as recordTypes.LotComment
|
||||
|
||||
let editFormElement: HTMLFormElement
|
||||
let editCloseModalFunction: () => void
|
||||
|
|
@ -287,17 +295,17 @@ declare const bulmaJS: BulmaJS
|
|||
submitEvent.preventDefault()
|
||||
|
||||
cityssm.postJSON(
|
||||
los.urlPrefix + '/lots/doUpdateLotComment',
|
||||
`${los.urlPrefix}/lots/doUpdateLotComment`,
|
||||
editFormElement,
|
||||
(rawResponseJSON) => {
|
||||
const responseJSON = rawResponseJSON as {
|
||||
success: boolean
|
||||
errorMessage?: string
|
||||
lotComments?: recordTypes.LotComment[]
|
||||
lotComments: recordTypes.LotComment[]
|
||||
}
|
||||
|
||||
if (responseJSON.success) {
|
||||
lotComments = responseJSON.lotComments!
|
||||
lotComments = responseJSON.lotComments
|
||||
editCloseModalFunction()
|
||||
renderLotComments()
|
||||
} else {
|
||||
|
|
@ -312,7 +320,7 @@ declare const bulmaJS: BulmaJS
|
|||
}
|
||||
|
||||
cityssm.openHtmlModal('lot-editComment', {
|
||||
onshow: (modalElement) => {
|
||||
onshow(modalElement) {
|
||||
los.populateAliases(modalElement)
|
||||
;(
|
||||
modalElement.querySelector(
|
||||
|
|
@ -328,27 +336,28 @@ declare const bulmaJS: BulmaJS
|
|||
modalElement.querySelector(
|
||||
'#lotCommentEdit--lotComment'
|
||||
) as HTMLInputElement
|
||||
).value = lotComment.lotComment!
|
||||
).value = lotComment.lotComment ?? ''
|
||||
|
||||
const lotCommentDateStringElement = modalElement.querySelector(
|
||||
'#lotCommentEdit--lotCommentDateString'
|
||||
) as HTMLInputElement
|
||||
|
||||
lotCommentDateStringElement.value = lotComment.lotCommentDateString!
|
||||
lotCommentDateStringElement.value =
|
||||
lotComment.lotCommentDateString ?? ''
|
||||
|
||||
const currentDateString = cityssm.dateToString(new Date())
|
||||
|
||||
lotCommentDateStringElement.max =
|
||||
lotComment.lotCommentDateString! <= currentDateString
|
||||
? currentDateString
|
||||
: lotComment.lotCommentDateString!
|
||||
: lotComment.lotCommentDateString ?? ''
|
||||
;(
|
||||
modalElement.querySelector(
|
||||
'#lotCommentEdit--lotCommentTimeString'
|
||||
) as HTMLInputElement
|
||||
).value = lotComment.lotCommentTimeString!
|
||||
).value = lotComment.lotCommentTimeString ?? ''
|
||||
},
|
||||
onshown: (modalElement, closeModalFunction) => {
|
||||
onshown(modalElement, closeModalFunction) {
|
||||
bulmaJS.toggleHtmlClipped()
|
||||
|
||||
los.initializeDatePickers(modalElement)
|
||||
|
|
@ -359,12 +368,12 @@ declare const bulmaJS: BulmaJS
|
|||
) as HTMLTextAreaElement
|
||||
).focus()
|
||||
|
||||
editFormElement = modalElement.querySelector('form')!
|
||||
editFormElement = modalElement.querySelector('form') as HTMLFormElement
|
||||
editFormElement.addEventListener('submit', editComment)
|
||||
|
||||
editCloseModalFunction = closeModalFunction
|
||||
},
|
||||
onremoved: () => {
|
||||
onremoved() {
|
||||
bulmaJS.toggleHtmlClipped()
|
||||
}
|
||||
})
|
||||
|
|
@ -372,14 +381,14 @@ declare const bulmaJS: BulmaJS
|
|||
|
||||
function deleteLotComment(clickEvent: Event): void {
|
||||
const lotCommentId = Number.parseInt(
|
||||
(clickEvent.currentTarget as HTMLElement).closest('tr')!.dataset
|
||||
.lotCommentId!,
|
||||
(clickEvent.currentTarget as HTMLElement).closest('tr')?.dataset
|
||||
.lotCommentId ?? '',
|
||||
10
|
||||
)
|
||||
|
||||
function doDelete(): void {
|
||||
cityssm.postJSON(
|
||||
los.urlPrefix + '/lots/doDeleteLotComment',
|
||||
`${los.urlPrefix}/lots/doDeleteLotComment`,
|
||||
{
|
||||
lotId,
|
||||
lotCommentId
|
||||
|
|
@ -423,59 +432,58 @@ declare const bulmaJS: BulmaJS
|
|||
|
||||
if (lotComments.length === 0) {
|
||||
containerElement.innerHTML = `<div class="message is-info">
|
||||
<p class="message-body">There are no comments to display.</p>
|
||||
</div>`
|
||||
<p class="message-body">There are no comments to display.</p>
|
||||
</div>`
|
||||
return
|
||||
}
|
||||
|
||||
const tableElement = document.createElement('table')
|
||||
tableElement.className = 'table is-fullwidth is-striped is-hoverable'
|
||||
tableElement.innerHTML = `<thead><tr>
|
||||
<th>Commentor</th>
|
||||
<th>Comment Date</th>
|
||||
<th>Comment</th>
|
||||
<th class="is-hidden-print"><span class="is-sr-only">Options</span></th>
|
||||
</tr></thead>
|
||||
<tbody></tbody>`
|
||||
<th>Commentor</th>
|
||||
<th>Comment Date</th>
|
||||
<th>Comment</th>
|
||||
<th class="is-hidden-print"><span class="is-sr-only">Options</span></th>
|
||||
</tr></thead>
|
||||
<tbody></tbody>`
|
||||
|
||||
for (const lotComment of lotComments) {
|
||||
const tableRowElement = document.createElement('tr')
|
||||
tableRowElement.dataset.lotCommentId = lotComment.lotCommentId!.toString()
|
||||
tableRowElement.dataset.lotCommentId = lotComment.lotCommentId?.toString()
|
||||
|
||||
tableRowElement.innerHTML =
|
||||
'<td>' +
|
||||
cityssm.escapeHTML(lotComment.recordCreate_userName ?? '') +
|
||||
'</td>' +
|
||||
'<td>' +
|
||||
lotComment.lotCommentDateString! +
|
||||
(lotComment.lotCommentTime === 0
|
||||
? ''
|
||||
: ' ' + lotComment.lotCommentTimePeriodString!) +
|
||||
'</td>' +
|
||||
'<td>' +
|
||||
cityssm.escapeHTML(lotComment.lotComment ?? '') +
|
||||
'</td>' +
|
||||
('<td class="is-hidden-print">' +
|
||||
'<div class="buttons are-small is-justify-content-end">' +
|
||||
('<button class="button is-primary button--edit" type="button">' +
|
||||
'<span class="icon is-small"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>' +
|
||||
' <span>Edit</span>' +
|
||||
'</button>') +
|
||||
('<button class="button is-light is-danger button--delete" data-tooltip="Delete Comment" type="button" aria-label="Delete">' +
|
||||
'<i class="fas fa-trash" aria-hidden="true"></i>' +
|
||||
'</button>') +
|
||||
'</div>' +
|
||||
'</td>')
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
tableRowElement.innerHTML = `<td>
|
||||
${cityssm.escapeHTML(lotComment.recordCreate_userName ?? '')}
|
||||
</td><td>
|
||||
${lotComment.lotCommentDateString}
|
||||
${
|
||||
lotComment.lotCommentTime === 0
|
||||
? ''
|
||||
: ' ' + lotComment.lotCommentTimePeriodString
|
||||
}
|
||||
</td><td>
|
||||
${cityssm.escapeHTML(lotComment.lotComment ?? '')}
|
||||
</td><td class="is-hidden-print">
|
||||
<div class="buttons are-small is-justify-content-end">
|
||||
<button class="button is-primary button--edit" type="button">
|
||||
<span class="icon is-small"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>
|
||||
<span>Edit</span>
|
||||
</button>
|
||||
<button class="button is-light is-danger button--delete" data-tooltip="Delete Comment" type="button" aria-label="Delete">
|
||||
<i class="fas fa-trash" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
</td>`
|
||||
|
||||
tableRowElement
|
||||
.querySelector('.button--edit')!
|
||||
.addEventListener('click', openEditLotComment)
|
||||
.querySelector('.button--edit')
|
||||
?.addEventListener('click', openEditLotComment)
|
||||
|
||||
tableRowElement
|
||||
.querySelector('.button--delete')!
|
||||
.addEventListener('click', deleteLotComment)
|
||||
.querySelector('.button--delete')
|
||||
?.addEventListener('click', deleteLotComment)
|
||||
|
||||
tableElement.querySelector('tbody')!.append(tableRowElement)
|
||||
tableElement.querySelector('tbody')?.append(tableRowElement)
|
||||
}
|
||||
|
||||
containerElement.innerHTML = ''
|
||||
|
|
@ -489,16 +497,16 @@ declare const bulmaJS: BulmaJS
|
|||
formEvent.preventDefault()
|
||||
|
||||
cityssm.postJSON(
|
||||
los.urlPrefix + '/lots/doAddLotComment',
|
||||
`${los.urlPrefix}/lots/doAddLotComment`,
|
||||
formEvent.currentTarget,
|
||||
(rawResponseJSON) => {
|
||||
const responseJSON = rawResponseJSON as {
|
||||
success: boolean
|
||||
lotComments?: recordTypes.LotComment[]
|
||||
lotComments: recordTypes.LotComment[]
|
||||
}
|
||||
|
||||
if (responseJSON.success) {
|
||||
lotComments = responseJSON.lotComments!
|
||||
lotComments = responseJSON.lotComments
|
||||
renderLotComments()
|
||||
addCommentCloseModalFunction()
|
||||
}
|
||||
|
|
@ -515,8 +523,8 @@ declare const bulmaJS: BulmaJS
|
|||
) as HTMLInputElement
|
||||
).value = lotId
|
||||
modalElement
|
||||
.querySelector('form')!
|
||||
.addEventListener('submit', doAddComment)
|
||||
.querySelector('form')
|
||||
?.addEventListener('submit', doAddComment)
|
||||
},
|
||||
onshown(modalElement, closeModalFunction) {
|
||||
bulmaJS.toggleHtmlClipped()
|
||||
|
|
@ -538,8 +546,8 @@ declare const bulmaJS: BulmaJS
|
|||
|
||||
if (!isCreate) {
|
||||
document
|
||||
.querySelector('#lotComments--add')!
|
||||
.addEventListener('click', openAddCommentModal)
|
||||
.querySelector('#lotComments--add')
|
||||
?.addEventListener('click', openAddCommentModal)
|
||||
renderLotComments()
|
||||
}
|
||||
})()
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
const los = exports.los;
|
||||
|
|
@ -8,9 +9,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
const limit = Number.parseInt(document.querySelector('#searchFilter--limit').value, 10);
|
||||
const offsetElement = document.querySelector('#searchFilter--offset');
|
||||
function renderLotOccupancies(rawResponseJSON) {
|
||||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
||||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.lotOccupancies.length === 0) {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
searchResultsContainerElement.innerHTML = `<div class="message is-info">
|
||||
<p class="message-body">
|
||||
There are no ${los.escapedAliases.occupancy} records that meet the search criteria.
|
||||
|
|
@ -40,30 +42,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
</span>`;
|
||||
}
|
||||
let occupantsHTML = '';
|
||||
for (const occupant of lotOccupancy.lotOccupancyOccupants) {
|
||||
occupantsHTML +=
|
||||
'<li class="has-tooltip-left" data-tooltip="' +
|
||||
cityssm.escapeHTML((_a = occupant.lotOccupantType) !== null && _a !== void 0 ? _a : '') +
|
||||
'">' +
|
||||
('<span class="fa-li"><i class="fas fa-fw fa-' +
|
||||
cityssm.escapeHTML(((_b = occupant.fontAwesomeIconClass) !== null && _b !== void 0 ? _b : '') === ''
|
||||
? 'user'
|
||||
: occupant.fontAwesomeIconClass) +
|
||||
'" aria-hidden="true"></i></span> ') +
|
||||
cityssm.escapeHTML((_c = occupant.occupantName) !== null && _c !== void 0 ? _c : '') +
|
||||
' ' +
|
||||
cityssm.escapeHTML((_d = occupant.occupantFamilyName) !== null && _d !== void 0 ? _d : '') +
|
||||
'</li>';
|
||||
for (const occupant of (_a = lotOccupancy.lotOccupancyOccupants) !== null && _a !== void 0 ? _a : []) {
|
||||
occupantsHTML += `<li class="has-tooltip-left" data-tooltip="${cityssm.escapeHTML((_b = occupant.lotOccupantType) !== null && _b !== void 0 ? _b : '')}">
|
||||
<span class="fa-li">
|
||||
<i class="fas fa-fw fa-${cityssm.escapeHTML(((_c = occupant.fontAwesomeIconClass) !== null && _c !== void 0 ? _c : '') === ''
|
||||
? 'user'
|
||||
: (_d = occupant.fontAwesomeIconClass) !== null && _d !== void 0 ? _d : '')}" aria-hidden="true"></i>
|
||||
</span>
|
||||
${cityssm.escapeHTML((_e = occupant.occupantName) !== null && _e !== void 0 ? _e : '')}
|
||||
${cityssm.escapeHTML((_f = occupant.occupantFamilyName) !== null && _f !== void 0 ? _f : '')}
|
||||
</li>`;
|
||||
}
|
||||
const feeTotal = ((_f = (_e = lotOccupancy.lotOccupancyFees) === null || _e === void 0 ? void 0 : _e.reduce((soFar, currentFee) => {
|
||||
const feeTotal = ((_h = (_g = lotOccupancy.lotOccupancyFees) === null || _g === void 0 ? void 0 : _g.reduce((soFar, currentFee) => {
|
||||
var _a, _b, _c;
|
||||
return (soFar +
|
||||
(((_a = currentFee.feeAmount) !== null && _a !== void 0 ? _a : 0) + ((_b = currentFee.taxAmount) !== null && _b !== void 0 ? _b : 0)) *
|
||||
((_c = currentFee.quantity) !== null && _c !== void 0 ? _c : 0));
|
||||
}, 0)) !== null && _f !== void 0 ? _f : 0).toFixed(2);
|
||||
const transactionTotal = ((_h = (_g = lotOccupancy.lotOccupancyTransactions) === null || _g === void 0 ? void 0 : _g.reduce((soFar, currentTransaction) => {
|
||||
return soFar + currentTransaction.transactionAmount;
|
||||
}, 0)) !== null && _h !== void 0 ? _h : 0).toFixed(2);
|
||||
const transactionTotal = ((_k = (_j = lotOccupancy.lotOccupancyTransactions) === null || _j === void 0 ? void 0 : _j.reduce((soFar, currentTransaction) => {
|
||||
return soFar + currentTransaction.transactionAmount;
|
||||
}, 0)) !== null && _k !== void 0 ? _k : 0).toFixed(2);
|
||||
let feeIconHTML = '';
|
||||
if (feeTotal !== '0.00' || transactionTotal !== '0.00') {
|
||||
feeIconHTML = `<span class="icon"
|
||||
|
|
@ -74,60 +72,42 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
: 'has-text-danger'}" aria-hidden="true"></i>
|
||||
</span>`;
|
||||
}
|
||||
resultsTbodyElement.insertAdjacentHTML('beforeend', '<tr>' +
|
||||
('<td class="has-width-1">' + occupancyTimeHTML + '</td>') +
|
||||
('<td>' +
|
||||
'<a class="has-text-weight-bold" href="' +
|
||||
los.getLotOccupancyURL(lotOccupancy.lotOccupancyId) +
|
||||
'">' +
|
||||
cityssm.escapeHTML(lotOccupancy.occupancyType) +
|
||||
'</a><br />' +
|
||||
`<span class="is-size-7">#${lotOccupancy.lotOccupancyId}</span>` +
|
||||
'</td>') +
|
||||
('<td>' +
|
||||
(((_j = lotOccupancy.lotId) !== null && _j !== void 0 ? _j : -1) === -1
|
||||
? '<span class="has-text-grey">(No ' +
|
||||
los.escapedAliases.Lot +
|
||||
')</span>'
|
||||
: '<a class="has-tooltip-right" data-tooltip="' +
|
||||
cityssm.escapeHTML((_k = lotOccupancy.lotType) !== null && _k !== void 0 ? _k : '') +
|
||||
'" href="' +
|
||||
los.getLotURL(lotOccupancy.lotId) +
|
||||
'">' +
|
||||
cityssm.escapeHTML(lotOccupancy.lotName) +
|
||||
'</a>') +
|
||||
'<br />' +
|
||||
('<span class="is-size-7">' +
|
||||
cityssm.escapeHTML((_l = lotOccupancy.mapName) !== null && _l !== void 0 ? _l : '') +
|
||||
'</span>') +
|
||||
'</td>') +
|
||||
('<td>' + lotOccupancy.occupancyStartDateString + '</td>') +
|
||||
('<td>' +
|
||||
(lotOccupancy.occupancyEndDate
|
||||
? lotOccupancy.occupancyEndDateString
|
||||
: '<span class="has-text-grey">(No End Date)</span>') +
|
||||
'</td>') +
|
||||
('<td>' +
|
||||
(occupantsHTML === ''
|
||||
? ''
|
||||
: '<ul class="fa-ul ml-5">' + occupantsHTML + '</ul>') +
|
||||
'</td>') +
|
||||
('<td>' + feeIconHTML + '</td>') +
|
||||
'<td>' +
|
||||
(lotOccupancy.printEJS
|
||||
? '<a class="button is-small" data-tooltip="Print" href="' +
|
||||
los.urlPrefix +
|
||||
'/print/' +
|
||||
lotOccupancy.printEJS +
|
||||
'/?lotOccupancyId=' +
|
||||
lotOccupancy.lotOccupancyId.toString() +
|
||||
'" target="_blank">' +
|
||||
'<i class="fas fa-print" aria-label="Print"></i>' +
|
||||
'</a>'
|
||||
: '') +
|
||||
'</td>' +
|
||||
'</tr>');
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
resultsTbodyElement.insertAdjacentHTML('beforeend', `<tr>
|
||||
<td class="has-width-1">
|
||||
${occupancyTimeHTML}
|
||||
</td><td>
|
||||
<a class="has-text-weight-bold"
|
||||
href="${los.getLotOccupancyURL(lotOccupancy.lotOccupancyId)}">
|
||||
${cityssm.escapeHTML((_l = lotOccupancy.occupancyType) !== null && _l !== void 0 ? _l : '')}
|
||||
</a><br />
|
||||
<span class="is-size-7">#${lotOccupancy.lotOccupancyId}</span>
|
||||
</td><td>
|
||||
${((_m = lotOccupancy.lotId) !== null && _m !== void 0 ? _m : -1) === -1
|
||||
? `<span class="has-text-grey">(No ${los.escapedAliases.Lot})</span>`
|
||||
: `<a class="has-tooltip-right" data-tooltip="${cityssm.escapeHTML((_o = lotOccupancy.lotType) !== null && _o !== void 0 ? _o : '')}" href="${los.getLotURL(lotOccupancy.lotId)}">${cityssm.escapeHTML((_p = lotOccupancy.lotName) !== null && _p !== void 0 ? _p : '')}</a>`}<br />
|
||||
<span class="is-size-7">${cityssm.escapeHTML((_q = lotOccupancy.mapName) !== null && _q !== void 0 ? _q : '')}</span>
|
||||
</td><td>
|
||||
${lotOccupancy.occupancyStartDateString}
|
||||
</td><td>
|
||||
${lotOccupancy.occupancyEndDate
|
||||
? lotOccupancy.occupancyEndDateString
|
||||
: '<span class="has-text-grey">(No End Date)</span>'}
|
||||
</td><td>
|
||||
${occupantsHTML === ''
|
||||
? ''
|
||||
: `<ul class="fa-ul ml-5">${occupantsHTML}</ul>`}
|
||||
</td><td>
|
||||
${feeIconHTML}
|
||||
</td><td>
|
||||
${lotOccupancy.printEJS
|
||||
? `<a class="button is-small" data-tooltip="Print"
|
||||
href="${los.urlPrefix}/print/${lotOccupancy.printEJS}/?lotOccupancyId=${lotOccupancy.lotOccupancyId.toString()}" target="_blank">
|
||||
<i class="fas fa-print" aria-label="Print"></i>
|
||||
</a>`
|
||||
: ''}</td></tr>`);
|
||||
}
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
searchResultsContainerElement.innerHTML = `<table class="table is-fullwidth is-striped is-hoverable has-sticky-header">
|
||||
<thead><tr>
|
||||
<th class="has-width-1"></th>
|
||||
|
|
@ -140,18 +120,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
<th class="has-width-1"><span class="is-sr-only">Print</span></th>
|
||||
</tr></thead>
|
||||
<table>`;
|
||||
searchResultsContainerElement
|
||||
.querySelector('table')
|
||||
.append(resultsTbodyElement);
|
||||
(_r = searchResultsContainerElement
|
||||
.querySelector('table')) === null || _r === void 0 ? void 0 : _r.append(resultsTbodyElement);
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
searchResultsContainerElement.insertAdjacentHTML('beforeend', los.getSearchResultsPagerHTML(limit, responseJSON.offset, responseJSON.count));
|
||||
(_m = searchResultsContainerElement
|
||||
.querySelector("button[data-page='previous']")) === null || _m === void 0 ? void 0 : _m.addEventListener('click', previousAndGetLotOccupancies);
|
||||
(_o = searchResultsContainerElement
|
||||
.querySelector("button[data-page='next']")) === null || _o === void 0 ? void 0 : _o.addEventListener('click', nextAndGetLotOccupancies);
|
||||
(_s = searchResultsContainerElement
|
||||
.querySelector("button[data-page='previous']")) === null || _s === void 0 ? void 0 : _s.addEventListener('click', previousAndGetLotOccupancies);
|
||||
(_t = searchResultsContainerElement
|
||||
.querySelector("button[data-page='next']")) === null || _t === void 0 ? void 0 : _t.addEventListener('click', nextAndGetLotOccupancies);
|
||||
}
|
||||
function getLotOccupancies() {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
searchResultsContainerElement.innerHTML = los.getLoadingParagraphHTML(`Loading ${los.escapedAliases.Occupancies}...`);
|
||||
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doSearchLotOccupancies', searchFilterFormElement, renderLotOccupancies);
|
||||
cityssm.postJSON(`${los.urlPrefix}/lotOccupancies/doSearchLotOccupancies`, searchFilterFormElement, renderLotOccupancies);
|
||||
}
|
||||
function resetOffsetAndGetLotOccupancies() {
|
||||
offsetElement.value = '0';
|
||||
|
|
|
|||
|
|
@ -1,13 +1,16 @@
|
|||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
|
||||
import type * as globalTypes from '../types/globalTypes'
|
||||
import type * as recordTypes from '../types/recordTypes'
|
||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
|
||||
|
||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types'
|
||||
import type { LOS } from '../types/globalTypes.js'
|
||||
import type * as recordTypes from '../types/recordTypes.js'
|
||||
|
||||
declare const cityssm: cityssmGlobal
|
||||
|
||||
declare const exports: Record<string, unknown>
|
||||
;(() => {
|
||||
const los = exports.los as globalTypes.LOS
|
||||
const los = exports.los as LOS
|
||||
|
||||
const searchFilterFormElement = document.querySelector(
|
||||
'#form--searchFilters'
|
||||
|
|
@ -34,6 +37,7 @@ declare const cityssm: cityssmGlobal
|
|||
}
|
||||
|
||||
if (responseJSON.lotOccupancies.length === 0) {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
searchResultsContainerElement.innerHTML = `<div class="message is-info">
|
||||
<p class="message-body">
|
||||
There are no ${los.escapedAliases.occupancy} records that meet the search criteria.
|
||||
|
|
@ -70,22 +74,18 @@ declare const cityssm: cityssmGlobal
|
|||
|
||||
let occupantsHTML = ''
|
||||
|
||||
for (const occupant of lotOccupancy.lotOccupancyOccupants!) {
|
||||
occupantsHTML +=
|
||||
'<li class="has-tooltip-left" data-tooltip="' +
|
||||
cityssm.escapeHTML(occupant.lotOccupantType ?? '') +
|
||||
'">' +
|
||||
('<span class="fa-li"><i class="fas fa-fw fa-' +
|
||||
cityssm.escapeHTML(
|
||||
for (const occupant of lotOccupancy.lotOccupancyOccupants ?? []) {
|
||||
occupantsHTML += `<li class="has-tooltip-left" data-tooltip="${cityssm.escapeHTML(occupant.lotOccupantType ?? '')}">
|
||||
<span class="fa-li">
|
||||
<i class="fas fa-fw fa-${cityssm.escapeHTML(
|
||||
(occupant.fontAwesomeIconClass ?? '') === ''
|
||||
? 'user'
|
||||
: occupant.fontAwesomeIconClass!
|
||||
) +
|
||||
'" aria-hidden="true"></i></span> ') +
|
||||
cityssm.escapeHTML(occupant.occupantName ?? '') +
|
||||
' ' +
|
||||
cityssm.escapeHTML(occupant.occupantFamilyName ?? '') +
|
||||
'</li>'
|
||||
: occupant.fontAwesomeIconClass ?? ''
|
||||
)}" aria-hidden="true"></i>
|
||||
</span>
|
||||
${cityssm.escapeHTML(occupant.occupantName ?? '')}
|
||||
${cityssm.escapeHTML(occupant.occupantFamilyName ?? '')}
|
||||
</li>`
|
||||
}
|
||||
|
||||
const feeTotal = (
|
||||
|
|
@ -121,64 +121,54 @@ declare const cityssm: cityssmGlobal
|
|||
</span>`
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
resultsTbodyElement.insertAdjacentHTML(
|
||||
'beforeend',
|
||||
'<tr>' +
|
||||
('<td class="has-width-1">' + occupancyTimeHTML + '</td>') +
|
||||
('<td>' +
|
||||
'<a class="has-text-weight-bold" href="' +
|
||||
los.getLotOccupancyURL(lotOccupancy.lotOccupancyId) +
|
||||
'">' +
|
||||
cityssm.escapeHTML(lotOccupancy.occupancyType as string) +
|
||||
'</a><br />' +
|
||||
`<span class="is-size-7">#${lotOccupancy.lotOccupancyId!}</span>` +
|
||||
'</td>') +
|
||||
('<td>' +
|
||||
((lotOccupancy.lotId ?? -1) === -1
|
||||
? '<span class="has-text-grey">(No ' +
|
||||
los.escapedAliases.Lot +
|
||||
')</span>'
|
||||
: '<a class="has-tooltip-right" data-tooltip="' +
|
||||
cityssm.escapeHTML(lotOccupancy.lotType ?? '') +
|
||||
'" href="' +
|
||||
los.getLotURL(lotOccupancy.lotId) +
|
||||
'">' +
|
||||
cityssm.escapeHTML(lotOccupancy.lotName!) +
|
||||
'</a>') +
|
||||
'<br />' +
|
||||
('<span class="is-size-7">' +
|
||||
cityssm.escapeHTML(lotOccupancy.mapName ?? '') +
|
||||
'</span>') +
|
||||
'</td>') +
|
||||
('<td>' + lotOccupancy.occupancyStartDateString! + '</td>') +
|
||||
('<td>' +
|
||||
(lotOccupancy.occupancyEndDate
|
||||
? lotOccupancy.occupancyEndDateString!
|
||||
: '<span class="has-text-grey">(No End Date)</span>') +
|
||||
'</td>') +
|
||||
('<td>' +
|
||||
(occupantsHTML === ''
|
||||
? ''
|
||||
: '<ul class="fa-ul ml-5">' + occupantsHTML + '</ul>') +
|
||||
'</td>') +
|
||||
('<td>' + feeIconHTML + '</td>') +
|
||||
'<td>' +
|
||||
(lotOccupancy.printEJS
|
||||
? '<a class="button is-small" data-tooltip="Print" href="' +
|
||||
los.urlPrefix +
|
||||
'/print/' +
|
||||
lotOccupancy.printEJS +
|
||||
'/?lotOccupancyId=' +
|
||||
lotOccupancy.lotOccupancyId!.toString() +
|
||||
'" target="_blank">' +
|
||||
'<i class="fas fa-print" aria-label="Print"></i>' +
|
||||
'</a>'
|
||||
: '') +
|
||||
'</td>' +
|
||||
'</tr>'
|
||||
`<tr>
|
||||
<td class="has-width-1">
|
||||
${occupancyTimeHTML}
|
||||
</td><td>
|
||||
<a class="has-text-weight-bold"
|
||||
href="${los.getLotOccupancyURL(lotOccupancy.lotOccupancyId)}">
|
||||
${cityssm.escapeHTML(lotOccupancy.occupancyType ?? '')}
|
||||
</a><br />
|
||||
<span class="is-size-7">#${lotOccupancy.lotOccupancyId}</span>
|
||||
</td><td>
|
||||
${
|
||||
(lotOccupancy.lotId ?? -1) === -1
|
||||
? `<span class="has-text-grey">(No ${los.escapedAliases.Lot})</span>`
|
||||
: `<a class="has-tooltip-right" data-tooltip="${cityssm.escapeHTML(lotOccupancy.lotType ?? '')}" href="${los.getLotURL(lotOccupancy.lotId)}">${cityssm.escapeHTML(lotOccupancy.lotName ?? '')}</a>`
|
||||
}<br />
|
||||
<span class="is-size-7">${cityssm.escapeHTML(lotOccupancy.mapName ?? '')}</span>
|
||||
</td><td>
|
||||
${lotOccupancy.occupancyStartDateString}
|
||||
</td><td>
|
||||
${
|
||||
lotOccupancy.occupancyEndDate
|
||||
? lotOccupancy.occupancyEndDateString
|
||||
: '<span class="has-text-grey">(No End Date)</span>'
|
||||
}
|
||||
</td><td>
|
||||
${
|
||||
occupantsHTML === ''
|
||||
? ''
|
||||
: `<ul class="fa-ul ml-5">${occupantsHTML}</ul>`
|
||||
}
|
||||
</td><td>
|
||||
${feeIconHTML}
|
||||
</td><td>
|
||||
${
|
||||
lotOccupancy.printEJS
|
||||
? `<a class="button is-small" data-tooltip="Print"
|
||||
href="${los.urlPrefix}/print/${lotOccupancy.printEJS}/?lotOccupancyId=${lotOccupancy.lotOccupancyId.toString()}" target="_blank">
|
||||
<i class="fas fa-print" aria-label="Print"></i>
|
||||
</a>`
|
||||
: ''
|
||||
}</td></tr>`
|
||||
)
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
searchResultsContainerElement.innerHTML = `<table class="table is-fullwidth is-striped is-hoverable has-sticky-header">
|
||||
<thead><tr>
|
||||
<th class="has-width-1"></th>
|
||||
|
|
@ -193,9 +183,10 @@ declare const cityssm: cityssmGlobal
|
|||
<table>`
|
||||
|
||||
searchResultsContainerElement
|
||||
.querySelector('table')!
|
||||
.append(resultsTbodyElement)
|
||||
.querySelector('table')
|
||||
?.append(resultsTbodyElement)
|
||||
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
searchResultsContainerElement.insertAdjacentHTML(
|
||||
'beforeend',
|
||||
los.getSearchResultsPagerHTML(
|
||||
|
|
@ -215,12 +206,13 @@ declare const cityssm: cityssmGlobal
|
|||
}
|
||||
|
||||
function getLotOccupancies(): void {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
searchResultsContainerElement.innerHTML = los.getLoadingParagraphHTML(
|
||||
`Loading ${los.escapedAliases.Occupancies}...`
|
||||
)
|
||||
|
||||
cityssm.postJSON(
|
||||
los.urlPrefix + '/lotOccupancies/doSearchLotOccupancies',
|
||||
`${los.urlPrefix}/lotOccupancies/doSearchLotOccupancies`,
|
||||
searchFilterFormElement,
|
||||
renderLotOccupancies
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
const los = exports.los;
|
||||
|
|
@ -7,9 +8,11 @@ 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 renderLots(responseJSON) {
|
||||
var _a, _b, _c, _d, _e;
|
||||
function renderLots(rawResponseJSON) {
|
||||
var _a, _b, _c, _d, _e, _f, _g;
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.lots.length === 0) {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
searchResultsContainerElement.innerHTML = `<div class="message is-info">
|
||||
<p class="message-body">There are no ${los.escapedAliases.lots} that meet the search criteria.</p>
|
||||
</div>`;
|
||||
|
|
@ -17,53 +20,50 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}
|
||||
const resultsTbodyElement = document.createElement('tbody');
|
||||
for (const lot of responseJSON.lots) {
|
||||
resultsTbodyElement.insertAdjacentHTML('beforeend', '<tr>' +
|
||||
('<td>' +
|
||||
'<a class="has-text-weight-bold" href="' +
|
||||
los.getLotURL(lot.lotId) +
|
||||
'">' +
|
||||
cityssm.escapeHTML((_a = lot.lotName) !== null && _a !== void 0 ? _a : '') +
|
||||
'</a>' +
|
||||
'</td>') +
|
||||
('<td>' +
|
||||
'<a href="' +
|
||||
los.getMapURL(lot.mapId) +
|
||||
'">' +
|
||||
(lot.mapName
|
||||
? cityssm.escapeHTML(lot.mapName)
|
||||
: '<span class="has-text-grey">(No Name)</span>') +
|
||||
'</a>' +
|
||||
'</td>') +
|
||||
('<td>' + cityssm.escapeHTML((_b = lot.lotType) !== null && _b !== void 0 ? _b : '') + '</td>') +
|
||||
('<td>' +
|
||||
(lot.lotStatusId
|
||||
? cityssm.escapeHTML(lot.lotStatus)
|
||||
: '<span class="has-text-grey">(No Status)</span>') +
|
||||
'<br />' +
|
||||
(((_c = lot.lotOccupancyCount) !== null && _c !== void 0 ? _c : 0) > 0
|
||||
? '<span class="is-size-7">Currently Occupied</span>'
|
||||
: '') +
|
||||
'</td>') +
|
||||
'</tr>');
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
resultsTbodyElement.insertAdjacentHTML('beforeend', `<tr>
|
||||
<td>
|
||||
<a class="has-text-weight-bold" href="${los.getLotURL(lot.lotId)}">
|
||||
${cityssm.escapeHTML((_a = lot.lotName) !== null && _a !== void 0 ? _a : '')}
|
||||
</a>
|
||||
</td><td>
|
||||
<a href="${los.getMapURL(lot.mapId)}">
|
||||
${lot.mapName
|
||||
? cityssm.escapeHTML(lot.mapName)
|
||||
: '<span class="has-text-grey">(No Name)</span>'}
|
||||
</a>
|
||||
</td><td>
|
||||
${cityssm.escapeHTML((_b = lot.lotType) !== null && _b !== void 0 ? _b : '')}
|
||||
</td><td>
|
||||
${lot.lotStatusId
|
||||
? cityssm.escapeHTML((_c = lot.lotStatus) !== null && _c !== void 0 ? _c : '')
|
||||
: '<span class="has-text-grey">(No Status)</span>'}<br />
|
||||
${((_d = lot.lotOccupancyCount) !== null && _d !== void 0 ? _d : 0) > 0
|
||||
? '<span class="is-size-7">Currently Occupied</span>'
|
||||
: ''}
|
||||
</td>
|
||||
</tr>`);
|
||||
}
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
searchResultsContainerElement.innerHTML = `<table class="table is-fullwidth is-striped is-hoverable has-sticky-header">
|
||||
<thead><tr>
|
||||
<th>${los.escapedAliases.Lot}</th>
|
||||
<th>${los.escapedAliases.Map}</th>
|
||||
<th>${los.escapedAliases.Lot} Type</th>
|
||||
<th>Status</th>
|
||||
</tr></thead>
|
||||
<table>`;
|
||||
<thead><tr>
|
||||
<th>${los.escapedAliases.Lot}</th>
|
||||
<th>${los.escapedAliases.Map}</th>
|
||||
<th>${los.escapedAliases.Lot} Type</th>
|
||||
<th>Status</th>
|
||||
</tr></thead>
|
||||
<table>`;
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
searchResultsContainerElement.insertAdjacentHTML('beforeend', los.getSearchResultsPagerHTML(limit, responseJSON.offset, responseJSON.count));
|
||||
searchResultsContainerElement
|
||||
.querySelector('table')
|
||||
.append(resultsTbodyElement);
|
||||
(_d = searchResultsContainerElement
|
||||
.querySelector("button[data-page='previous']")) === null || _d === void 0 ? void 0 : _d.addEventListener('click', previousAndGetLots);
|
||||
(_e = searchResultsContainerElement
|
||||
.querySelector("button[data-page='next']")) === null || _e === void 0 ? void 0 : _e.addEventListener('click', nextAndGetLots);
|
||||
.querySelector('table')) === null || _e === void 0 ? void 0 : _e.append(resultsTbodyElement);
|
||||
(_f = searchResultsContainerElement
|
||||
.querySelector("button[data-page='previous']")) === null || _f === void 0 ? void 0 : _f.addEventListener('click', previousAndGetLots);
|
||||
(_g = searchResultsContainerElement
|
||||
.querySelector("button[data-page='next']")) === null || _g === void 0 ? void 0 : _g.addEventListener('click', nextAndGetLots);
|
||||
}
|
||||
function getLots() {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
searchResultsContainerElement.innerHTML = los.getLoadingParagraphHTML(`Loading ${los.escapedAliases.Lots}...`);
|
||||
cityssm.postJSON(los.urlPrefix + '/lots/doSearchLots', searchFilterFormElement, renderLots);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,16 @@
|
|||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
|
||||
import type * as globalTypes from '../types/globalTypes'
|
||||
import type * as recordTypes from '../types/recordTypes'
|
||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
|
||||
|
||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types'
|
||||
import type { LOS } from '../types/globalTypes.js'
|
||||
import type * as recordTypes from '../types/recordTypes.js'
|
||||
|
||||
declare const cityssm: cityssmGlobal
|
||||
|
||||
declare const exports: Record<string, unknown>
|
||||
;(() => {
|
||||
const los = exports.los as globalTypes.LOS
|
||||
const los = exports.los as LOS
|
||||
|
||||
const searchFilterFormElement = document.querySelector(
|
||||
'#form--searchFilters'
|
||||
|
|
@ -25,12 +28,15 @@ declare const cityssm: cityssmGlobal
|
|||
'#searchFilter--offset'
|
||||
) as HTMLInputElement
|
||||
|
||||
function renderLots(responseJSON: {
|
||||
count: number
|
||||
offset: number
|
||||
lots: recordTypes.Lot[]
|
||||
}): void {
|
||||
function renderLots(rawResponseJSON): void {
|
||||
const responseJSON = rawResponseJSON as {
|
||||
count: number
|
||||
offset: number
|
||||
lots: recordTypes.Lot[]
|
||||
}
|
||||
|
||||
if (responseJSON.lots.length === 0) {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
searchResultsContainerElement.innerHTML = `<div class="message is-info">
|
||||
<p class="message-body">There are no ${los.escapedAliases.lots} that meet the search criteria.</p>
|
||||
</div>`
|
||||
|
|
@ -41,48 +47,51 @@ declare const cityssm: cityssmGlobal
|
|||
const resultsTbodyElement = document.createElement('tbody')
|
||||
|
||||
for (const lot of responseJSON.lots) {
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
resultsTbodyElement.insertAdjacentHTML(
|
||||
'beforeend',
|
||||
'<tr>' +
|
||||
('<td>' +
|
||||
'<a class="has-text-weight-bold" href="' +
|
||||
los.getLotURL(lot.lotId) +
|
||||
'">' +
|
||||
cityssm.escapeHTML(lot.lotName ?? '') +
|
||||
'</a>' +
|
||||
'</td>') +
|
||||
('<td>' +
|
||||
'<a href="' +
|
||||
los.getMapURL(lot.mapId) +
|
||||
'">' +
|
||||
(lot.mapName
|
||||
? cityssm.escapeHTML(lot.mapName)
|
||||
: '<span class="has-text-grey">(No Name)</span>') +
|
||||
'</a>' +
|
||||
'</td>') +
|
||||
('<td>' + cityssm.escapeHTML(lot.lotType ?? '') + '</td>') +
|
||||
('<td>' +
|
||||
(lot.lotStatusId
|
||||
? cityssm.escapeHTML(lot.lotStatus!)
|
||||
: '<span class="has-text-grey">(No Status)</span>') +
|
||||
'<br />' +
|
||||
((lot.lotOccupancyCount ?? 0) > 0
|
||||
? '<span class="is-size-7">Currently Occupied</span>'
|
||||
: '') +
|
||||
'</td>') +
|
||||
'</tr>'
|
||||
`<tr>
|
||||
<td>
|
||||
<a class="has-text-weight-bold" href="${los.getLotURL(lot.lotId)}">
|
||||
${cityssm.escapeHTML(lot.lotName ?? '')}
|
||||
</a>
|
||||
</td><td>
|
||||
<a href="${los.getMapURL(lot.mapId)}">
|
||||
${
|
||||
lot.mapName
|
||||
? cityssm.escapeHTML(lot.mapName)
|
||||
: '<span class="has-text-grey">(No Name)</span>'
|
||||
}
|
||||
</a>
|
||||
</td><td>
|
||||
${cityssm.escapeHTML(lot.lotType ?? '')}
|
||||
</td><td>
|
||||
${
|
||||
lot.lotStatusId
|
||||
? cityssm.escapeHTML(lot.lotStatus ?? '')
|
||||
: '<span class="has-text-grey">(No Status)</span>'
|
||||
}<br />
|
||||
${
|
||||
(lot.lotOccupancyCount ?? 0) > 0
|
||||
? '<span class="is-size-7">Currently Occupied</span>'
|
||||
: ''
|
||||
}
|
||||
</td>
|
||||
</tr>`
|
||||
)
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
searchResultsContainerElement.innerHTML = `<table class="table is-fullwidth is-striped is-hoverable has-sticky-header">
|
||||
<thead><tr>
|
||||
<th>${los.escapedAliases.Lot}</th>
|
||||
<th>${los.escapedAliases.Map}</th>
|
||||
<th>${los.escapedAliases.Lot} Type</th>
|
||||
<th>Status</th>
|
||||
</tr></thead>
|
||||
<table>`
|
||||
<thead><tr>
|
||||
<th>${los.escapedAliases.Lot}</th>
|
||||
<th>${los.escapedAliases.Map}</th>
|
||||
<th>${los.escapedAliases.Lot} Type</th>
|
||||
<th>Status</th>
|
||||
</tr></thead>
|
||||
<table>`
|
||||
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
searchResultsContainerElement.insertAdjacentHTML(
|
||||
'beforeend',
|
||||
los.getSearchResultsPagerHTML(
|
||||
|
|
@ -93,8 +102,8 @@ declare const cityssm: cityssmGlobal
|
|||
)
|
||||
|
||||
searchResultsContainerElement
|
||||
.querySelector('table')!
|
||||
.append(resultsTbodyElement)
|
||||
.querySelector('table')
|
||||
?.append(resultsTbodyElement)
|
||||
|
||||
searchResultsContainerElement
|
||||
.querySelector("button[data-page='previous']")
|
||||
|
|
@ -106,6 +115,7 @@ declare const cityssm: cityssmGlobal
|
|||
}
|
||||
|
||||
function getLots(): void {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
searchResultsContainerElement.innerHTML = los.getLoadingParagraphHTML(
|
||||
`Loading ${los.escapedAliases.Lots}...`
|
||||
)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import type { BulmaJS } from '@cityssm/bulma-js/types.js'
|
|||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
|
||||
import type { Options as BulmaCalendarOptions } from 'bulma-calendar'
|
||||
|
||||
import type * as globalTypes from '../types/globalTypes.js'
|
||||
import type { LOS } from '../types/globalTypes.js'
|
||||
|
||||
type RandomColorHue =
|
||||
| 'red'
|
||||
|
|
@ -492,7 +492,7 @@ declare const exports: Record<string, unknown> & {
|
|||
* Declare LOS
|
||||
*/
|
||||
|
||||
const los: globalTypes.LOS = {
|
||||
const los: LOS = {
|
||||
urlPrefix,
|
||||
apiKey: document.querySelector('main')?.dataset.apiKey ?? '',
|
||||
dynamicsGPIntegrationIsEnabled,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
var _a;
|
||||
|
|
@ -22,7 +23,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}
|
||||
function updateMap(formEvent) {
|
||||
formEvent.preventDefault();
|
||||
cityssm.postJSON(los.urlPrefix + '/maps/' + (isCreate ? 'doCreateMap' : 'doUpdateMap'), mapForm, (rawResponseJSON) => {
|
||||
cityssm.postJSON(`${los.urlPrefix}/maps/${isCreate ? 'doCreateMap' : 'doUpdateMap'}`, mapForm, (rawResponseJSON) => {
|
||||
var _a;
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.success) {
|
||||
|
|
@ -32,14 +33,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
message: los.escapedAliases.Map + ' Updated Successfully',
|
||||
message: `${los.escapedAliases.Map} Updated Successfully`,
|
||||
contextualColorName: 'success'
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
title: 'Error Updating ' + los.escapedAliases.Map,
|
||||
title: `Error Updating ${los.escapedAliases.Map}`,
|
||||
message: (_a = responseJSON.errorMessage) !== null && _a !== void 0 ? _a : '',
|
||||
contextualColorName: 'danger'
|
||||
});
|
||||
|
|
@ -55,7 +56,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
.querySelector('#button--deleteMap')) === null || _a === void 0 ? void 0 : _a.addEventListener('click', (clickEvent) => {
|
||||
clickEvent.preventDefault();
|
||||
function doDelete() {
|
||||
cityssm.postJSON(los.urlPrefix + '/maps/doDeleteMap', {
|
||||
cityssm.postJSON(`${los.urlPrefix}/maps/doDeleteMap`, {
|
||||
mapId
|
||||
}, (rawResponseJSON) => {
|
||||
var _a;
|
||||
|
|
@ -65,7 +66,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
title: 'Error Deleting ' + los.escapedAliases.Map,
|
||||
title: `Error Deleting ${los.escapedAliases.Map}`,
|
||||
message: (_a = responseJSON.errorMessage) !== null && _a !== void 0 ? _a : '',
|
||||
contextualColorName: 'danger'
|
||||
});
|
||||
|
|
@ -73,7 +74,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
});
|
||||
}
|
||||
bulmaJS.confirm({
|
||||
title: 'Delete ' + los.escapedAliases.Map,
|
||||
title: `Delete ${los.escapedAliases.Map}`,
|
||||
message: `Are you sure you want to delete this ${los.escapedAliases.map} and all related ${los.escapedAliases.lots}?`,
|
||||
contextualColorName: 'warning',
|
||||
okButton: {
|
||||
|
|
|
|||
|
|
@ -1,14 +1,17 @@
|
|||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
|
||||
import type * as globalTypes from '../types/globalTypes'
|
||||
import type { BulmaJS } from '@cityssm/bulma-js/types.js'
|
||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
|
||||
|
||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types'
|
||||
import type { BulmaJS } from '@cityssm/bulma-js/types'
|
||||
import type { LOS } from '../types/globalTypes.js'
|
||||
|
||||
declare const cityssm: cityssmGlobal
|
||||
declare const bulmaJS: BulmaJS
|
||||
|
||||
declare const exports: Record<string, unknown>
|
||||
;(() => {
|
||||
const los = exports.los as globalTypes.LOS
|
||||
const los = exports.los as LOS
|
||||
|
||||
const mapId = (document.querySelector('#map--mapId') as HTMLInputElement)
|
||||
.value
|
||||
|
|
@ -34,7 +37,7 @@ declare const bulmaJS: BulmaJS
|
|||
formEvent.preventDefault()
|
||||
|
||||
cityssm.postJSON(
|
||||
los.urlPrefix + '/maps/' + (isCreate ? 'doCreateMap' : 'doUpdateMap'),
|
||||
`${los.urlPrefix}/maps/${isCreate ? 'doCreateMap' : 'doUpdateMap'}`,
|
||||
mapForm,
|
||||
(rawResponseJSON) => {
|
||||
const responseJSON = rawResponseJSON as {
|
||||
|
|
@ -50,13 +53,13 @@ declare const bulmaJS: BulmaJS
|
|||
window.location.href = los.getMapURL(responseJSON.mapId, true)
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
message: los.escapedAliases.Map + ' Updated Successfully',
|
||||
message: `${los.escapedAliases.Map} Updated Successfully`,
|
||||
contextualColorName: 'success'
|
||||
})
|
||||
}
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
title: 'Error Updating ' + los.escapedAliases.Map,
|
||||
title: `Error Updating ${los.escapedAliases.Map}`,
|
||||
message: responseJSON.errorMessage ?? '',
|
||||
contextualColorName: 'danger'
|
||||
})
|
||||
|
|
@ -81,7 +84,7 @@ declare const bulmaJS: BulmaJS
|
|||
|
||||
function doDelete(): void {
|
||||
cityssm.postJSON(
|
||||
los.urlPrefix + '/maps/doDeleteMap',
|
||||
`${los.urlPrefix}/maps/doDeleteMap`,
|
||||
{
|
||||
mapId
|
||||
},
|
||||
|
|
@ -95,7 +98,7 @@ declare const bulmaJS: BulmaJS
|
|||
window.location.href = los.getMapURL()
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
title: 'Error Deleting ' + los.escapedAliases.Map,
|
||||
title: `Error Deleting ${los.escapedAliases.Map}`,
|
||||
message: responseJSON.errorMessage ?? '',
|
||||
contextualColorName: 'danger'
|
||||
})
|
||||
|
|
@ -105,7 +108,7 @@ declare const bulmaJS: BulmaJS
|
|||
}
|
||||
|
||||
bulmaJS.confirm({
|
||||
title: 'Delete ' + los.escapedAliases.Map,
|
||||
title: `Delete ${los.escapedAliases.Map}`,
|
||||
message: `Are you sure you want to delete this ${los.escapedAliases.map} and all related ${los.escapedAliases.lots}?`,
|
||||
contextualColorName: 'warning',
|
||||
okButton: {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,16 @@
|
|||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
var _a;
|
||||
const los = exports.los;
|
||||
const maps = exports.maps;
|
||||
const searchFilterElement = document.querySelector('#searchFilter--map');
|
||||
const searchResultsContainerElement = document.querySelector('#container--searchResults');
|
||||
function renderResults() {
|
||||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
||||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
searchResultsContainerElement.innerHTML = los.getLoadingParagraphHTML(`Loading ${los.escapedAliases.Maps}...`);
|
||||
let searchResultCount = 0;
|
||||
const searchResultsTbodyElement = document.createElement('tbody');
|
||||
|
|
@ -28,52 +31,48 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
continue;
|
||||
}
|
||||
searchResultCount += 1;
|
||||
searchResultsTbodyElement.insertAdjacentHTML('beforeend', '<tr>' +
|
||||
('<td>' +
|
||||
'<a class="has-text-weight-bold" href="' +
|
||||
los.getMapURL(map.mapId) +
|
||||
'">' +
|
||||
cityssm.escapeHTML(map.mapName === '' ? '(No Name)' : map.mapName) +
|
||||
'</a><br />' +
|
||||
'<span class="is-size-7">' +
|
||||
cityssm.escapeHTML((_e = map.mapDescription) !== null && _e !== void 0 ? _e : '') +
|
||||
'</span>' +
|
||||
'</td>') +
|
||||
('<td>' +
|
||||
(((_f = map.mapAddress1) !== null && _f !== void 0 ? _f : '') === ''
|
||||
? ''
|
||||
: cityssm.escapeHTML((_g = map.mapAddress1) !== null && _g !== void 0 ? _g : '') + '<br />') +
|
||||
(((_h = map.mapAddress2) !== null && _h !== void 0 ? _h : '') === ''
|
||||
? ''
|
||||
: cityssm.escapeHTML((_j = map.mapAddress2) !== null && _j !== void 0 ? _j : '') + '<br />') +
|
||||
(map.mapCity || map.mapProvince
|
||||
? cityssm.escapeHTML((_k = map.mapCity) !== null && _k !== void 0 ? _k : '') +
|
||||
', ' +
|
||||
cityssm.escapeHTML((_l = map.mapProvince) !== null && _l !== void 0 ? _l : '') +
|
||||
'<br />'
|
||||
: '') +
|
||||
(((_m = map.mapPostalCode) !== null && _m !== void 0 ? _m : '') === ''
|
||||
? ''
|
||||
: cityssm.escapeHTML((_o = map.mapPostalCode) !== null && _o !== void 0 ? _o : '')) +
|
||||
'</td>') +
|
||||
('<td>' + cityssm.escapeHTML((_p = map.mapPhoneNumber) !== null && _p !== void 0 ? _p : '') + '</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">' +
|
||||
(((_q = map.mapSVG) !== null && _q !== void 0 ? _q : '') === ''
|
||||
? ''
|
||||
: '<span data-tooltip="Has Image"><i class="fas fa-image" aria-label="Has Image"></i></span>') +
|
||||
'</td>' +
|
||||
`<td class="has-text-right">
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
searchResultsTbodyElement.insertAdjacentHTML('beforeend', `<tr>
|
||||
<td>
|
||||
<a class="has-text-weight-bold" href="${los.getMapURL(map.mapId)}">
|
||||
${cityssm.escapeHTML(((_e = map.mapName) !== null && _e !== void 0 ? _e : '') === '' ? '(No Name)' : (_f = map.mapName) !== null && _f !== void 0 ? _f : '')}
|
||||
</a><br />
|
||||
<span class="is-size-7">
|
||||
${cityssm.escapeHTML((_g = map.mapDescription) !== null && _g !== void 0 ? _g : '')}
|
||||
</span>
|
||||
</td><td>
|
||||
${((_h = map.mapAddress1) !== null && _h !== void 0 ? _h : '') === ''
|
||||
? ''
|
||||
: `${cityssm.escapeHTML((_j = map.mapAddress1) !== null && _j !== void 0 ? _j : '')}<br />`}
|
||||
${((_k = map.mapAddress2) !== null && _k !== void 0 ? _k : '') === ''
|
||||
? ''
|
||||
: `${cityssm.escapeHTML((_l = map.mapAddress2) !== null && _l !== void 0 ? _l : '')}<br />`}
|
||||
${map.mapCity || map.mapProvince
|
||||
? `${cityssm.escapeHTML((_m = map.mapCity) !== null && _m !== void 0 ? _m : '')}, ${cityssm.escapeHTML((_o = map.mapProvince) !== null && _o !== void 0 ? _o : '')}<br />`
|
||||
: ''}
|
||||
${((_p = map.mapPostalCode) !== null && _p !== void 0 ? _p : '') === ''
|
||||
? ''
|
||||
: cityssm.escapeHTML((_q = map.mapPostalCode) !== null && _q !== void 0 ? _q : '')}
|
||||
</td><td>
|
||||
${cityssm.escapeHTML((_r = map.mapPhoneNumber) !== null && _r !== void 0 ? _r : '')}
|
||||
</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">
|
||||
${((_s = map.mapSVG) !== null && _s !== void 0 ? _s : '') === ''
|
||||
? ''
|
||||
: '<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>` +
|
||||
'</tr>');
|
||||
</td>
|
||||
</tr>`);
|
||||
}
|
||||
searchResultsContainerElement.innerHTML = '';
|
||||
if (searchResultCount === 0) {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
searchResultsContainerElement.innerHTML = `<div class="message is-info">
|
||||
<p class="message-body">There are no ${los.escapedAliases.maps} that meet the search criteria.</p>
|
||||
</div>`;
|
||||
|
|
@ -82,6 +81,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
const searchResultsTableElement = document.createElement('table');
|
||||
searchResultsTableElement.className =
|
||||
'table is-fullwidth is-striped is-hoverable has-sticky-header';
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
searchResultsTableElement.innerHTML = `<thead><tr>
|
||||
<th>${los.escapedAliases.Map}</th>
|
||||
<th>Address</th>
|
||||
|
|
@ -95,9 +95,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}
|
||||
}
|
||||
searchFilterElement.addEventListener('keyup', renderResults);
|
||||
document
|
||||
.querySelector('#form--searchFilters')
|
||||
.addEventListener('submit', (formEvent) => {
|
||||
(_a = document
|
||||
.querySelector('#form--searchFilters')) === null || _a === void 0 ? void 0 : _a.addEventListener('submit', (formEvent) => {
|
||||
formEvent.preventDefault();
|
||||
renderResults();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,15 +1,18 @@
|
|||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
|
||||
import type * as globalTypes from '../types/globalTypes'
|
||||
import type * as recordTypes from '../types/recordTypes'
|
||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
|
||||
|
||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types'
|
||||
import type { LOS } from '../types/globalTypes.js'
|
||||
import type * as recordTypes from '../types/recordTypes.js'
|
||||
|
||||
declare const cityssm: cityssmGlobal
|
||||
;(() => {
|
||||
const los = exports.los as globalTypes.LOS
|
||||
|
||||
const maps: recordTypes.MapRecord[] = exports.maps
|
||||
declare const exports: Record<string, unknown>
|
||||
;(() => {
|
||||
const los = exports.los as LOS
|
||||
|
||||
const maps = exports.maps as recordTypes.MapRecord[]
|
||||
|
||||
const searchFilterElement = document.querySelector(
|
||||
'#searchFilter--map'
|
||||
|
|
@ -20,6 +23,7 @@ declare const cityssm: cityssmGlobal
|
|||
) as HTMLElement
|
||||
|
||||
function renderResults(): void {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
searchResultsContainerElement.innerHTML = los.getLoadingParagraphHTML(
|
||||
`Loading ${los.escapedAliases.Maps}...`
|
||||
)
|
||||
|
|
@ -52,61 +56,67 @@ declare const cityssm: cityssmGlobal
|
|||
|
||||
searchResultCount += 1
|
||||
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
searchResultsTbodyElement.insertAdjacentHTML(
|
||||
'beforeend',
|
||||
'<tr>' +
|
||||
('<td>' +
|
||||
'<a class="has-text-weight-bold" href="' +
|
||||
los.getMapURL(map.mapId) +
|
||||
'">' +
|
||||
cityssm.escapeHTML(
|
||||
map.mapName! === '' ? '(No Name)' : map.mapName!
|
||||
) +
|
||||
'</a><br />' +
|
||||
'<span class="is-size-7">' +
|
||||
cityssm.escapeHTML(map.mapDescription ?? '') +
|
||||
'</span>' +
|
||||
'</td>') +
|
||||
('<td>' +
|
||||
((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 ?? '')) +
|
||||
'</td>') +
|
||||
('<td>' + cityssm.escapeHTML(map.mapPhoneNumber ?? '') + '</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>') +
|
||||
'</td>' +
|
||||
`<td class="has-text-right">
|
||||
<a href="${
|
||||
los.urlPrefix
|
||||
}/lots?mapId=${map.mapId!}">${map.lotCount!}</a>
|
||||
</td>` +
|
||||
'</tr>'
|
||||
`<tr>
|
||||
<td>
|
||||
<a class="has-text-weight-bold" href="${los.getMapURL(map.mapId)}">
|
||||
${cityssm.escapeHTML(
|
||||
(map.mapName ?? '') === '' ? '(No Name)' : map.mapName ?? ''
|
||||
)}
|
||||
</a><br />
|
||||
<span class="is-size-7">
|
||||
${cityssm.escapeHTML(map.mapDescription ?? '')}
|
||||
</span>
|
||||
</td><td>
|
||||
${
|
||||
(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 ?? '')
|
||||
}
|
||||
</td><td>
|
||||
${cityssm.escapeHTML(map.mapPhoneNumber ?? '')}
|
||||
</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>'
|
||||
}
|
||||
</td><td class="has-text-right">
|
||||
<a href="${los.urlPrefix}/lots?mapId=${map.mapId}">${map.lotCount}</a>
|
||||
</td>
|
||||
</tr>`
|
||||
)
|
||||
}
|
||||
|
||||
searchResultsContainerElement.innerHTML = ''
|
||||
|
||||
if (searchResultCount === 0) {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
searchResultsContainerElement.innerHTML = `<div class="message is-info">
|
||||
<p class="message-body">There are no ${los.escapedAliases.maps} that meet the search criteria.</p>
|
||||
</div>`
|
||||
|
|
@ -116,6 +126,7 @@ declare const cityssm: cityssmGlobal
|
|||
searchResultsTableElement.className =
|
||||
'table is-fullwidth is-striped is-hoverable has-sticky-header'
|
||||
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
searchResultsTableElement.innerHTML = `<thead><tr>
|
||||
<th>${los.escapedAliases.Map}</th>
|
||||
<th>Address</th>
|
||||
|
|
@ -134,8 +145,8 @@ declare const cityssm: cityssmGlobal
|
|||
searchFilterElement.addEventListener('keyup', renderResults)
|
||||
|
||||
document
|
||||
.querySelector('#form--searchFilters')!
|
||||
.addEventListener('submit', (formEvent) => {
|
||||
.querySelector('#form--searchFilters')
|
||||
?.addEventListener('submit', (formEvent) => {
|
||||
formEvent.preventDefault()
|
||||
renderResults()
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
const los = exports.los;
|
||||
|
|
@ -8,7 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
const workOrderMilestoneDateStringElement = workOrderSearchFiltersFormElement.querySelector('#searchFilter--workOrderMilestoneDateString');
|
||||
const milestoneCalendarContainerElement = document.querySelector('#container--milestoneCalendar');
|
||||
function renderMilestones(workOrderMilestones) {
|
||||
var _a, _b, _c, _d, _e, _f, _g, _h;
|
||||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
||||
if (workOrderMilestones.length === 0) {
|
||||
milestoneCalendarContainerElement.innerHTML = `<div class="message is-info">
|
||||
<p class="message-body">There are no milestones that meet the search criteria.</p>
|
||||
|
|
@ -27,11 +28,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
currentPanelElement = document.createElement('div');
|
||||
currentPanelElement.className = 'panel';
|
||||
currentPanelElement.innerHTML = `<h2 class="panel-heading">
|
||||
${milestone.workOrderMilestoneDate === 0
|
||||
${cityssm.escapeHTML(milestone.workOrderMilestoneDate === 0
|
||||
? 'No Set Date'
|
||||
: milestone.workOrderMilestoneDateString}
|
||||
: (_a = milestone.workOrderMilestoneDateString) !== null && _a !== void 0 ? _a : '')}
|
||||
</h2>`;
|
||||
currentPanelDateString = milestone.workOrderMilestoneDateString;
|
||||
currentPanelDateString = (_b = milestone.workOrderMilestoneDateString) !== null && _b !== void 0 ? _b : '';
|
||||
}
|
||||
const panelBlockElement = document.createElement('div');
|
||||
panelBlockElement.className = 'panel-block is-block';
|
||||
|
|
@ -41,70 +42,57 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
panelBlockElement.classList.add('has-background-warning-light');
|
||||
}
|
||||
let lotOccupancyHTML = '';
|
||||
for (const lot of milestone.workOrderLots) {
|
||||
for (const lot of (_c = milestone.workOrderLots) !== null && _c !== void 0 ? _c : []) {
|
||||
lotOccupancyHTML += `<li class="has-tooltip-left"
|
||||
data-tooltip="${cityssm.escapeHTML((_a = lot.mapName) !== null && _a !== void 0 ? _a : '')}">
|
||||
data-tooltip="${cityssm.escapeHTML((_d = lot.mapName) !== null && _d !== void 0 ? _d : '')}">
|
||||
<span class="fa-li">
|
||||
<i class="fas fa-vector-square"
|
||||
aria-label="${los.escapedAliases.Lot}"></i>
|
||||
</span>
|
||||
${cityssm.escapeHTML((_b = lot.lotName) !== null && _b !== void 0 ? _b : '')}
|
||||
${cityssm.escapeHTML((_e = lot.lotName) !== null && _e !== void 0 ? _e : '')}
|
||||
</li>`;
|
||||
}
|
||||
for (const lotOccupancy of milestone.workOrderLotOccupancies) {
|
||||
for (const occupant of lotOccupancy.lotOccupancyOccupants) {
|
||||
for (const lotOccupancy of (_f = milestone.workOrderLotOccupancies) !== null && _f !== void 0 ? _f : []) {
|
||||
for (const occupant of (_g = lotOccupancy.lotOccupancyOccupants) !== null && _g !== void 0 ? _g : []) {
|
||||
lotOccupancyHTML += `<li class="has-tooltip-left"
|
||||
data-tooltip="${cityssm.escapeHTML((_c = occupant.lotOccupantType) !== null && _c !== void 0 ? _c : '')}">
|
||||
data-tooltip="${cityssm.escapeHTML((_h = occupant.lotOccupantType) !== null && _h !== void 0 ? _h : '')}">
|
||||
<span class="fa-li">
|
||||
<i class="fas fa-user"
|
||||
aria-label="${los.escapedAliases.Occupancy}"></i>
|
||||
</span>
|
||||
${cityssm.escapeHTML((_d = occupant.occupantName) !== null && _d !== void 0 ? _d : '')}
|
||||
${cityssm.escapeHTML((_e = occupant.occupantFamilyName) !== null && _e !== void 0 ? _e : '')}
|
||||
${cityssm.escapeHTML((_j = occupant.occupantName) !== null && _j !== void 0 ? _j : '')}
|
||||
${cityssm.escapeHTML((_k = occupant.occupantFamilyName) !== null && _k !== void 0 ? _k : '')}
|
||||
</li>`;
|
||||
}
|
||||
}
|
||||
panelBlockElement.innerHTML =
|
||||
'<div class="columns">' +
|
||||
('<div class="column is-narrow">' +
|
||||
'<span class="icon is-small">' +
|
||||
(milestone.workOrderMilestoneCompletionDate
|
||||
? '<i class="fas fa-check" aria-label="Completed"></i>'
|
||||
: '<i class="far fa-square has-text-grey" aria-label="Incomplete"></i>') +
|
||||
'</span>' +
|
||||
'</div>') +
|
||||
('<div class="column">' +
|
||||
(milestone.workOrderMilestoneTime === 0
|
||||
? ''
|
||||
: milestone.workOrderMilestoneTimePeriodString + '<br />') +
|
||||
(milestone.workOrderMilestoneTypeId
|
||||
? '<strong>' +
|
||||
cityssm.escapeHTML(milestone.workOrderMilestoneType) +
|
||||
'</strong><br />'
|
||||
: '') +
|
||||
'<span class="is-size-7">' +
|
||||
cityssm.escapeHTML(milestone.workOrderMilestoneDescription) +
|
||||
'</span>' +
|
||||
'</div>') +
|
||||
('<div class="column">' +
|
||||
'<i class="fas fa-circle" style="color:' +
|
||||
los.getRandomColor((_f = milestone.workOrderNumber) !== null && _f !== void 0 ? _f : '') +
|
||||
'" aria-hidden="true"></i>' +
|
||||
' <a class="has-text-weight-bold" href="' +
|
||||
los.getWorkOrderURL(milestone.workOrderId) +
|
||||
'">' +
|
||||
cityssm.escapeHTML((_g = milestone.workOrderNumber) !== null && _g !== void 0 ? _g : '') +
|
||||
'</a><br />' +
|
||||
'<span class="is-size-7">' +
|
||||
cityssm.escapeHTML((_h = milestone.workOrderDescription) !== null && _h !== void 0 ? _h : '') +
|
||||
'</span>' +
|
||||
'</div>') +
|
||||
('<div class="column is-size-7">' +
|
||||
(lotOccupancyHTML === ''
|
||||
? ''
|
||||
: '<ul class="fa-ul ml-4">' + lotOccupancyHTML + '</ul>') +
|
||||
'</div>') +
|
||||
'</div>';
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
panelBlockElement.innerHTML = `<div class="columns">
|
||||
<div class="column is-narrow">
|
||||
<span class="icon is-small">
|
||||
${milestone.workOrderMilestoneCompletionDate
|
||||
? '<i class="fas fa-check" aria-label="Completed"></i>'
|
||||
: '<i class="far fa-square has-text-grey" aria-label="Incomplete"></i>'}
|
||||
</span>
|
||||
</div><div class="column">
|
||||
${milestone.workOrderMilestoneTime === 0
|
||||
? ''
|
||||
: `${milestone.workOrderMilestoneTimePeriodString}<br />`}
|
||||
${milestone.workOrderMilestoneTypeId
|
||||
? `<strong>${cityssm.escapeHTML((_l = milestone.workOrderMilestoneType) !== null && _l !== void 0 ? _l : '')}</strong><br />`
|
||||
: ''}
|
||||
<span class="is-size-7">
|
||||
${cityssm.escapeHTML((_m = milestone.workOrderMilestoneDescription) !== null && _m !== void 0 ? _m : '')}
|
||||
</span>
|
||||
</div><div class="column">
|
||||
<i class="fas fa-circle" style="color:${los.getRandomColor((_o = milestone.workOrderNumber) !== null && _o !== void 0 ? _o : '')}" aria-hidden="true"></i>
|
||||
<a class="has-text-weight-bold" href="${los.getWorkOrderURL(milestone.workOrderId)}">
|
||||
${cityssm.escapeHTML((_p = milestone.workOrderNumber) !== null && _p !== void 0 ? _p : '')}
|
||||
</a><br />
|
||||
<span class="is-size-7">${cityssm.escapeHTML((_q = milestone.workOrderDescription) !== null && _q !== void 0 ? _q : '')}</span>
|
||||
</div><div class="column is-size-7">
|
||||
${lotOccupancyHTML === ''
|
||||
? ''
|
||||
: '<ul class="fa-ul ml-4">' + lotOccupancyHTML + '</ul>'}</div></div>`;
|
||||
currentPanelElement.append(panelBlockElement);
|
||||
}
|
||||
milestoneCalendarContainerElement.append(currentPanelElement);
|
||||
|
|
@ -113,14 +101,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
if (event) {
|
||||
event.preventDefault();
|
||||
}
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
milestoneCalendarContainerElement.innerHTML = los.getLoadingParagraphHTML('Loading Milestones...');
|
||||
cityssm.postJSON(los.urlPrefix + '/workOrders/doGetWorkOrderMilestones', workOrderSearchFiltersFormElement, (responseJSON) => {
|
||||
cityssm.postJSON(`${los.urlPrefix}/workOrders/doGetWorkOrderMilestones`, workOrderSearchFiltersFormElement, (responseJSON) => {
|
||||
renderMilestones(responseJSON.workOrderMilestones);
|
||||
});
|
||||
}
|
||||
workOrderMilestoneDateFilterElement.addEventListener('change', () => {
|
||||
workOrderMilestoneDateStringElement.closest('fieldset').disabled =
|
||||
workOrderMilestoneDateFilterElement.value !== 'date';
|
||||
;
|
||||
workOrderMilestoneDateStringElement.closest('fieldset').disabled = workOrderMilestoneDateFilterElement.value !== 'date';
|
||||
getMilestones();
|
||||
});
|
||||
los.initializeDatePickers(workOrderSearchFiltersFormElement);
|
||||
|
|
|
|||
|
|
@ -1,12 +1,16 @@
|
|||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
|
||||
import type * as recordTypes from '../types/recordTypes'
|
||||
import type * as globalTypes from '../types/globalTypes'
|
||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types'
|
||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
|
||||
|
||||
import type { LOS } from '../types/globalTypes.js'
|
||||
import type * as recordTypes from '../types/recordTypes.js'
|
||||
|
||||
declare const cityssm: cityssmGlobal
|
||||
|
||||
declare const exports: Record<string, unknown>
|
||||
;(() => {
|
||||
const los = exports.los as globalTypes.LOS
|
||||
const los = exports.los as LOS
|
||||
|
||||
const workOrderSearchFiltersFormElement = document.querySelector(
|
||||
'#form--searchFilters'
|
||||
|
|
@ -53,14 +57,14 @@ declare const cityssm: cityssmGlobal
|
|||
currentPanelElement.className = 'panel'
|
||||
|
||||
currentPanelElement.innerHTML = `<h2 class="panel-heading">
|
||||
${
|
||||
${cityssm.escapeHTML(
|
||||
milestone.workOrderMilestoneDate === 0
|
||||
? 'No Set Date'
|
||||
: milestone.workOrderMilestoneDateString!
|
||||
}
|
||||
: milestone.workOrderMilestoneDateString ?? ''
|
||||
)}
|
||||
</h2>`
|
||||
|
||||
currentPanelDateString = milestone.workOrderMilestoneDateString!
|
||||
currentPanelDateString = milestone.workOrderMilestoneDateString ?? ''
|
||||
}
|
||||
|
||||
const panelBlockElement = document.createElement('div')
|
||||
|
|
@ -77,7 +81,7 @@ declare const cityssm: cityssmGlobal
|
|||
|
||||
let lotOccupancyHTML = ''
|
||||
|
||||
for (const lot of milestone.workOrderLots!) {
|
||||
for (const lot of milestone.workOrderLots ?? []) {
|
||||
lotOccupancyHTML += `<li class="has-tooltip-left"
|
||||
data-tooltip="${cityssm.escapeHTML(lot.mapName ?? '')}">
|
||||
<span class="fa-li">
|
||||
|
|
@ -88,8 +92,8 @@ declare const cityssm: cityssmGlobal
|
|||
</li>`
|
||||
}
|
||||
|
||||
for (const lotOccupancy of milestone.workOrderLotOccupancies!) {
|
||||
for (const occupant of lotOccupancy.lotOccupancyOccupants!) {
|
||||
for (const lotOccupancy of milestone.workOrderLotOccupancies ?? []) {
|
||||
for (const occupant of lotOccupancy.lotOccupancyOccupants ?? []) {
|
||||
lotOccupancyHTML += `<li class="has-tooltip-left"
|
||||
data-tooltip="${cityssm.escapeHTML(
|
||||
occupant.lotOccupantType ?? ''
|
||||
|
|
@ -104,51 +108,46 @@ declare const cityssm: cityssmGlobal
|
|||
}
|
||||
}
|
||||
|
||||
panelBlockElement.innerHTML =
|
||||
'<div class="columns">' +
|
||||
('<div class="column is-narrow">' +
|
||||
'<span class="icon is-small">' +
|
||||
(milestone.workOrderMilestoneCompletionDate
|
||||
? '<i class="fas fa-check" aria-label="Completed"></i>'
|
||||
: '<i class="far fa-square has-text-grey" aria-label="Incomplete"></i>') +
|
||||
'</span>' +
|
||||
'</div>') +
|
||||
('<div class="column">' +
|
||||
(milestone.workOrderMilestoneTime === 0
|
||||
? ''
|
||||
: milestone.workOrderMilestoneTimePeriodString! + '<br />') +
|
||||
(milestone.workOrderMilestoneTypeId
|
||||
? '<strong>' +
|
||||
cityssm.escapeHTML(milestone.workOrderMilestoneType!) +
|
||||
'</strong><br />'
|
||||
: '') +
|
||||
'<span class="is-size-7">' +
|
||||
cityssm.escapeHTML(milestone.workOrderMilestoneDescription!) +
|
||||
'</span>' +
|
||||
'</div>') +
|
||||
('<div class="column">' +
|
||||
'<i class="fas fa-circle" style="color:' +
|
||||
los.getRandomColor(milestone.workOrderNumber ?? '') +
|
||||
'" aria-hidden="true"></i>' +
|
||||
' <a class="has-text-weight-bold" href="' +
|
||||
los.getWorkOrderURL(milestone.workOrderId) +
|
||||
'">' +
|
||||
cityssm.escapeHTML(milestone.workOrderNumber ?? '') +
|
||||
'</a><br />' +
|
||||
'<span class="is-size-7">' +
|
||||
cityssm.escapeHTML(milestone.workOrderDescription ?? '') +
|
||||
'</span>' +
|
||||
'</div>') +
|
||||
('<div class="column is-size-7">' +
|
||||
(lotOccupancyHTML === ''
|
||||
? ''
|
||||
: '<ul class="fa-ul ml-4">' + lotOccupancyHTML + '</ul>') +
|
||||
'</div>') +
|
||||
'</div>'
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
panelBlockElement.innerHTML = `<div class="columns">
|
||||
<div class="column is-narrow">
|
||||
<span class="icon is-small">
|
||||
${
|
||||
milestone.workOrderMilestoneCompletionDate
|
||||
? '<i class="fas fa-check" aria-label="Completed"></i>'
|
||||
: '<i class="far fa-square has-text-grey" aria-label="Incomplete"></i>'
|
||||
}
|
||||
</span>
|
||||
</div><div class="column">
|
||||
${
|
||||
milestone.workOrderMilestoneTime === 0
|
||||
? ''
|
||||
: `${milestone.workOrderMilestoneTimePeriodString}<br />`
|
||||
}
|
||||
${
|
||||
milestone.workOrderMilestoneTypeId
|
||||
? `<strong>${cityssm.escapeHTML(milestone.workOrderMilestoneType ?? '')}</strong><br />`
|
||||
: ''
|
||||
}
|
||||
<span class="is-size-7">
|
||||
${cityssm.escapeHTML(milestone.workOrderMilestoneDescription ?? '')}
|
||||
</span>
|
||||
</div><div class="column">
|
||||
<i class="fas fa-circle" style="color:${los.getRandomColor(milestone.workOrderNumber ?? '')}" aria-hidden="true"></i>
|
||||
<a class="has-text-weight-bold" href="${los.getWorkOrderURL(milestone.workOrderId)}">
|
||||
${cityssm.escapeHTML(milestone.workOrderNumber ?? '')}
|
||||
</a><br />
|
||||
<span class="is-size-7">${cityssm.escapeHTML(milestone.workOrderDescription ?? '')}</span>
|
||||
</div><div class="column is-size-7">
|
||||
${
|
||||
lotOccupancyHTML === ''
|
||||
? ''
|
||||
: '<ul class="fa-ul ml-4">' + lotOccupancyHTML + '</ul>'
|
||||
}</div></div>`
|
||||
;(currentPanelElement as HTMLElement).append(panelBlockElement)
|
||||
}
|
||||
|
||||
milestoneCalendarContainerElement.append(currentPanelElement!)
|
||||
milestoneCalendarContainerElement.append(currentPanelElement as HTMLElement)
|
||||
}
|
||||
|
||||
function getMilestones(event?: Event): void {
|
||||
|
|
@ -156,12 +155,13 @@ declare const cityssm: cityssmGlobal
|
|||
event.preventDefault()
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
milestoneCalendarContainerElement.innerHTML = los.getLoadingParagraphHTML(
|
||||
'Loading Milestones...'
|
||||
)
|
||||
|
||||
cityssm.postJSON(
|
||||
los.urlPrefix + '/workOrders/doGetWorkOrderMilestones',
|
||||
`${los.urlPrefix}/workOrders/doGetWorkOrderMilestones`,
|
||||
workOrderSearchFiltersFormElement,
|
||||
(responseJSON) => {
|
||||
renderMilestones(
|
||||
|
|
@ -176,8 +176,11 @@ declare const cityssm: cityssmGlobal
|
|||
}
|
||||
|
||||
workOrderMilestoneDateFilterElement.addEventListener('change', () => {
|
||||
workOrderMilestoneDateStringElement.closest('fieldset')!.disabled =
|
||||
workOrderMilestoneDateFilterElement.value !== 'date'
|
||||
;(
|
||||
workOrderMilestoneDateStringElement.closest(
|
||||
'fieldset'
|
||||
) as HTMLFieldSetElement
|
||||
).disabled = workOrderMilestoneDateFilterElement.value !== 'date'
|
||||
getMilestones()
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
|
||||
import type * as globalTypes from '../types/globalTypes.js'
|
||||
import type { LOS } from '../types/globalTypes.js'
|
||||
|
||||
declare const exports: Record<string, unknown>
|
||||
;(() => {
|
||||
const los = exports.los as globalTypes.LOS
|
||||
const los = exports.los as LOS
|
||||
|
||||
const workOrderTypeIdsElement = document.querySelector(
|
||||
'#icsFilters--workOrderTypeIds'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
const los = exports.los;
|
||||
|
|
@ -10,7 +11,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
const limit = Number.parseInt(document.querySelector('#searchFilter--limit').value, 10);
|
||||
const offsetElement = document.querySelector('#searchFilter--offset');
|
||||
function renderWorkOrders(rawResponseJSON) {
|
||||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
||||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.workOrders.length === 0) {
|
||||
searchResultsContainerElement.innerHTML = `<div class="message is-info">
|
||||
|
|
@ -21,101 +22,86 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
const resultsTbodyElement = document.createElement('tbody');
|
||||
for (const workOrder of responseJSON.workOrders) {
|
||||
let relatedHTML = '';
|
||||
for (const lot of workOrder.workOrderLots) {
|
||||
for (const lot of (_a = workOrder.workOrderLots) !== null && _a !== void 0 ? _a : []) {
|
||||
relatedHTML += `<li class="has-tooltip-left"
|
||||
data-tooltip="${cityssm.escapeHTML((_a = lot.mapName) !== null && _a !== void 0 ? _a : '')}">
|
||||
data-tooltip="${cityssm.escapeHTML((_b = lot.mapName) !== null && _b !== void 0 ? _b : '')}">
|
||||
<span class="fa-li">
|
||||
<i class="fas fa-fw fa-vector-square"
|
||||
aria-label="${los.escapedAliases.Lot}"></i>
|
||||
</span>
|
||||
${cityssm.escapeHTML(((_b = lot.lotName) !== null && _b !== void 0 ? _b : '') === ''
|
||||
? '(No ' + los.escapedAliases.Lot + ' Name)'
|
||||
: lot.lotName)}
|
||||
${cityssm.escapeHTML(((_c = lot.lotName) !== null && _c !== void 0 ? _c : '') === ''
|
||||
? `(No ${los.escapedAliases.Lot} Name)`
|
||||
: (_d = lot.lotName) !== null && _d !== void 0 ? _d : '')}
|
||||
</li>`;
|
||||
}
|
||||
for (const occupancy of workOrder.workOrderLotOccupancies) {
|
||||
for (const occupant of occupancy.lotOccupancyOccupants) {
|
||||
for (const occupancy of (_e = workOrder.workOrderLotOccupancies) !== null && _e !== void 0 ? _e : []) {
|
||||
for (const occupant of (_f = occupancy.lotOccupancyOccupants) !== null && _f !== void 0 ? _f : []) {
|
||||
relatedHTML += `<li class="has-tooltip-left"
|
||||
data-tooltip="${cityssm.escapeHTML((_c = occupant.lotOccupantType) !== null && _c !== void 0 ? _c : '')}">
|
||||
data-tooltip="${cityssm.escapeHTML((_g = occupant.lotOccupantType) !== null && _g !== void 0 ? _g : '')}">
|
||||
<span class="fa-li">
|
||||
<i class="fas fa-fw fa-${cityssm.escapeHTML(((_d = occupant.fontAwesomeIconClass) !== null && _d !== void 0 ? _d : '') === ''
|
||||
<i class="fas fa-fw fa-${cityssm.escapeHTML(((_h = occupant.fontAwesomeIconClass) !== null && _h !== void 0 ? _h : '') === ''
|
||||
? 'user'
|
||||
: occupant.fontAwesomeIconClass)}" aria-label="${los.escapedAliases.occupant}"></i></span>
|
||||
${cityssm.escapeHTML(((_e = occupant.occupantName) !== null && _e !== void 0 ? _e : '') === '' &&
|
||||
((_f = occupant.occupantFamilyName) !== null && _f !== void 0 ? _f : '') === ''
|
||||
: (_j = occupant.fontAwesomeIconClass) !== null && _j !== void 0 ? _j : '')}" aria-label="${los.escapedAliases.occupant}"></i></span>
|
||||
${cityssm.escapeHTML(((_k = occupant.occupantName) !== null && _k !== void 0 ? _k : '') === '' &&
|
||||
((_l = occupant.occupantFamilyName) !== null && _l !== void 0 ? _l : '') === ''
|
||||
? '(No Name)'
|
||||
: occupant.occupantName + ' ' + occupant.occupantFamilyName)}
|
||||
: `${occupant.occupantName} ${occupant.occupantFamilyName}`)}
|
||||
</li>`;
|
||||
}
|
||||
}
|
||||
resultsTbodyElement.insertAdjacentHTML('beforeend', '<tr>' +
|
||||
('<td>' +
|
||||
'<a class="has-text-weight-bold" href="' +
|
||||
los.getWorkOrderURL(workOrder.workOrderId) +
|
||||
'">' +
|
||||
(workOrder.workOrderNumber.trim() === ''
|
||||
? '(No Number)'
|
||||
: cityssm.escapeHTML((_g = workOrder.workOrderNumber) !== null && _g !== void 0 ? _g : '')) +
|
||||
'</a>' +
|
||||
'</td>') +
|
||||
`<td>
|
||||
${cityssm.escapeHTML((_h = workOrder.workOrderType) !== null && _h !== void 0 ? _h : '')}<br />
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
resultsTbodyElement.insertAdjacentHTML('beforeend', `<tr>
|
||||
<td>
|
||||
<a class="has-text-weight-bold" href="${los.getWorkOrderURL(workOrder.workOrderId)}">
|
||||
${((_m = workOrder.workOrderNumber) === null || _m === void 0 ? void 0 : _m.trim()) === ''
|
||||
? '(No Number)'
|
||||
: cityssm.escapeHTML((_o = workOrder.workOrderNumber) !== null && _o !== void 0 ? _o : '')}
|
||||
</a>
|
||||
</td><td>
|
||||
${cityssm.escapeHTML((_p = workOrder.workOrderType) !== null && _p !== void 0 ? _p : '')}<br />
|
||||
<span class="is-size-7">
|
||||
${cityssm.escapeHTML((_j = workOrder.workOrderDescription) !== null && _j !== void 0 ? _j : '')}
|
||||
${cityssm.escapeHTML((_q = workOrder.workOrderDescription) !== null && _q !== void 0 ? _q : '')}
|
||||
</span>
|
||||
</td>` +
|
||||
('<td>' +
|
||||
(relatedHTML === ''
|
||||
? ''
|
||||
: '<ul class="fa-ul ml-5 is-size-7">' + relatedHTML + '</ul>') +
|
||||
'</td>') +
|
||||
('<td>' +
|
||||
'<ul class="fa-ul ml-5 is-size-7">' +
|
||||
`<li class="has-tooltip-left"
|
||||
data-tooltip="${los.escapedAliases.WorkOrderOpenDate}">
|
||||
<span class="fa-li">
|
||||
<i class="fas fa-fw fa-play"
|
||||
aria-label="${los.escapedAliases.WorkOrderOpenDate}"></i>
|
||||
</span>
|
||||
${workOrder.workOrderOpenDateString}
|
||||
</li>` +
|
||||
('<li class="has-tooltip-left" data-tooltip="' +
|
||||
los.escapedAliases.WorkOrderCloseDate +
|
||||
'">' +
|
||||
'<span class="fa-li">' +
|
||||
'<i class="fas fa-fw fa-stop" aria-label="' +
|
||||
los.escapedAliases.WorkOrderCloseDate +
|
||||
'"></i></span> ' +
|
||||
(workOrder.workOrderCloseDate
|
||||
? workOrder.workOrderCloseDateString
|
||||
: '<span class="has-text-grey">(No ' +
|
||||
los.escapedAliases.WorkOrderCloseDate +
|
||||
')</span>') +
|
||||
'</li>') +
|
||||
'</ul>' +
|
||||
'</td>') +
|
||||
('<td>' +
|
||||
(workOrder.workOrderMilestoneCount === 0
|
||||
? '-'
|
||||
: workOrder.workOrderMilestoneCompletionCount.toString() +
|
||||
' / ' +
|
||||
workOrder.workOrderMilestoneCount.toString()) +
|
||||
'</td>') +
|
||||
(workOrderPrints.length > 0
|
||||
? '<td>' +
|
||||
'<a class="button is-small" data-tooltip="Print" href="' +
|
||||
los.urlPrefix +
|
||||
'/print/' +
|
||||
workOrderPrints[0] +
|
||||
'/?workOrderId=' +
|
||||
workOrder.workOrderId.toString() +
|
||||
'" target="_blank">' +
|
||||
'<i class="fas fa-print" aria-label="Print"></i>' +
|
||||
'</a>' +
|
||||
'</td>'
|
||||
: '') +
|
||||
'</tr>');
|
||||
</td><td>
|
||||
${relatedHTML === ''
|
||||
? ''
|
||||
: '<ul class="fa-ul ml-5 is-size-7">' + relatedHTML + '</ul>'}
|
||||
</td><td>
|
||||
<ul class="fa-ul ml-5 is-size-7">
|
||||
<li class="has-tooltip-left"
|
||||
data-tooltip="${los.escapedAliases.WorkOrderOpenDate}">
|
||||
<span class="fa-li">
|
||||
<i class="fas fa-fw fa-play" aria-label="${los.escapedAliases.WorkOrderOpenDate}"></i>
|
||||
</span>
|
||||
${workOrder.workOrderOpenDateString}
|
||||
</li>
|
||||
<li class="has-tooltip-left" data-tooltip="${los.escapedAliases.WorkOrderCloseDate}">
|
||||
<span class="fa-li">
|
||||
<i class="fas fa-fw fa-stop" aria-label="${los.escapedAliases.WorkOrderCloseDate}"></i>
|
||||
</span>
|
||||
${workOrder.workOrderCloseDate
|
||||
? workOrder.workOrderCloseDateString
|
||||
: `<span class="has-text-grey">(No ${los.escapedAliases.WorkOrderCloseDate})</span>`}
|
||||
</li>
|
||||
</ul>
|
||||
</td><td>
|
||||
${workOrder.workOrderMilestoneCount === 0
|
||||
? '-'
|
||||
: ((_r = workOrder.workOrderMilestoneCompletionCount) !== null && _r !== void 0 ? _r : '').toString() +
|
||||
' / ' +
|
||||
((_s = workOrder.workOrderMilestoneCount) !== null && _s !== void 0 ? _s : '').toString()}
|
||||
</td>
|
||||
${workOrderPrints.length > 0
|
||||
? `<td>
|
||||
<a class="button is-small" data-tooltip="Print"
|
||||
href="${los.urlPrefix}/print/${workOrderPrints[0]}/?workOrderId=${workOrder.workOrderId.toString()}"
|
||||
target="_blank">
|
||||
<i class="fas fa-print" aria-label="Print"></i>
|
||||
</a>
|
||||
</td>`
|
||||
: ''}</tr>`);
|
||||
}
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
searchResultsContainerElement.innerHTML = `<table class="table is-fullwidth is-striped is-hoverable has-sticky-header">
|
||||
<thead><tr>
|
||||
<th>Work Order Number</th>
|
||||
|
|
@ -126,18 +112,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
${workOrderPrints.length > 0 ? '<th class="has-width-1"></th>' : ''}
|
||||
</tr></thead>
|
||||
<table>`;
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
searchResultsContainerElement.insertAdjacentHTML('beforeend', los.getSearchResultsPagerHTML(limit, responseJSON.offset, responseJSON.count));
|
||||
searchResultsContainerElement
|
||||
.querySelector('table')
|
||||
.append(resultsTbodyElement);
|
||||
(_k = searchResultsContainerElement
|
||||
.querySelector("button[data-page='previous']")) === null || _k === void 0 ? void 0 : _k.addEventListener('click', previousAndGetWorkOrders);
|
||||
(_l = searchResultsContainerElement
|
||||
.querySelector("button[data-page='next']")) === null || _l === void 0 ? void 0 : _l.addEventListener('click', nextAndGetWorkOrders);
|
||||
(_t = searchResultsContainerElement
|
||||
.querySelector('table')) === null || _t === void 0 ? void 0 : _t.append(resultsTbodyElement);
|
||||
(_u = searchResultsContainerElement
|
||||
.querySelector("button[data-page='previous']")) === null || _u === void 0 ? void 0 : _u.addEventListener('click', previousAndGetWorkOrders);
|
||||
(_v = searchResultsContainerElement
|
||||
.querySelector("button[data-page='next']")) === null || _v === void 0 ? void 0 : _v.addEventListener('click', nextAndGetWorkOrders);
|
||||
}
|
||||
function getWorkOrders() {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
searchResultsContainerElement.innerHTML = los.getLoadingParagraphHTML('Loading Work Orders...');
|
||||
cityssm.postJSON(los.urlPrefix + '/workOrders/doSearchWorkOrders', searchFilterFormElement, renderWorkOrders);
|
||||
cityssm.postJSON(`${los.urlPrefix}/workOrders/doSearchWorkOrders`, searchFilterFormElement, renderWorkOrders);
|
||||
}
|
||||
function resetOffsetAndGetWorkOrders() {
|
||||
offsetElement.value = '0';
|
||||
|
|
@ -158,6 +145,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
searchFilterFormElement.addEventListener('submit', (formEvent) => {
|
||||
formEvent.preventDefault();
|
||||
});
|
||||
// eslint-disable-next-line no-secrets/no-secrets
|
||||
/*
|
||||
const workOrderOpenDateStringElement = document.querySelector("#searchFilter--workOrderOpenDateString") as HTMLInputElement;
|
||||
|
||||
|
|
@ -186,6 +174,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
|
||||
resetOffsetAndGetWorkOrders();
|
||||
});
|
||||
*/
|
||||
*/
|
||||
getWorkOrders();
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -1,14 +1,18 @@
|
|||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
|
||||
import type * as recordTypes from '../types/recordTypes'
|
||||
import type * as globalTypes from '../types/globalTypes'
|
||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types'
|
||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
|
||||
|
||||
import type { LOS } from '../types/globalTypes.js'
|
||||
import type * as recordTypes from '../types/recordTypes.js'
|
||||
|
||||
declare const cityssm: cityssmGlobal
|
||||
;(() => {
|
||||
const los = exports.los as globalTypes.LOS
|
||||
|
||||
const workOrderPrints: string[] = exports.workOrderPrints
|
||||
declare const exports: Record<string, unknown>
|
||||
;(() => {
|
||||
const los = exports.los as LOS
|
||||
|
||||
const workOrderPrints = exports.workOrderPrints as string[]
|
||||
|
||||
const searchFilterFormElement = document.querySelector(
|
||||
'#form--searchFilters'
|
||||
|
|
@ -49,7 +53,7 @@ declare const cityssm: cityssmGlobal
|
|||
for (const workOrder of responseJSON.workOrders) {
|
||||
let relatedHTML = ''
|
||||
|
||||
for (const lot of workOrder.workOrderLots!) {
|
||||
for (const lot of workOrder.workOrderLots ?? []) {
|
||||
relatedHTML += `<li class="has-tooltip-left"
|
||||
data-tooltip="${cityssm.escapeHTML(lot.mapName ?? '')}">
|
||||
<span class="fa-li">
|
||||
|
|
@ -58,14 +62,14 @@ declare const cityssm: cityssmGlobal
|
|||
</span>
|
||||
${cityssm.escapeHTML(
|
||||
(lot.lotName ?? '') === ''
|
||||
? '(No ' + los.escapedAliases.Lot + ' Name)'
|
||||
: lot.lotName!
|
||||
? `(No ${los.escapedAliases.Lot} Name)`
|
||||
: lot.lotName ?? ''
|
||||
)}
|
||||
</li>`
|
||||
}
|
||||
|
||||
for (const occupancy of workOrder.workOrderLotOccupancies!) {
|
||||
for (const occupant of occupancy.lotOccupancyOccupants!) {
|
||||
for (const occupancy of workOrder.workOrderLotOccupancies ?? []) {
|
||||
for (const occupant of occupancy.lotOccupancyOccupants ?? []) {
|
||||
relatedHTML += `<li class="has-tooltip-left"
|
||||
data-tooltip="${cityssm.escapeHTML(
|
||||
occupant.lotOccupantType ?? ''
|
||||
|
|
@ -74,90 +78,87 @@ declare const cityssm: cityssmGlobal
|
|||
<i class="fas fa-fw fa-${cityssm.escapeHTML(
|
||||
(occupant.fontAwesomeIconClass ?? '') === ''
|
||||
? 'user'
|
||||
: occupant.fontAwesomeIconClass!
|
||||
: occupant.fontAwesomeIconClass ?? ''
|
||||
)}" aria-label="${los.escapedAliases.occupant}"></i></span>
|
||||
${cityssm.escapeHTML(
|
||||
(occupant.occupantName ?? '') === '' &&
|
||||
(occupant.occupantFamilyName ?? '') === ''
|
||||
? '(No Name)'
|
||||
: occupant.occupantName! + ' ' + occupant.occupantFamilyName!
|
||||
: `${occupant.occupantName} ${occupant.occupantFamilyName}`
|
||||
)}
|
||||
</li>`
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
resultsTbodyElement.insertAdjacentHTML(
|
||||
'beforeend',
|
||||
'<tr>' +
|
||||
('<td>' +
|
||||
'<a class="has-text-weight-bold" href="' +
|
||||
los.getWorkOrderURL(workOrder.workOrderId) +
|
||||
'">' +
|
||||
(workOrder.workOrderNumber!.trim() === ''
|
||||
? '(No Number)'
|
||||
: cityssm.escapeHTML(workOrder.workOrderNumber ?? '')) +
|
||||
'</a>' +
|
||||
'</td>') +
|
||||
`<td>
|
||||
`<tr>
|
||||
<td>
|
||||
<a class="has-text-weight-bold" href="${los.getWorkOrderURL(workOrder.workOrderId)}">
|
||||
${
|
||||
workOrder.workOrderNumber?.trim() === ''
|
||||
? '(No Number)'
|
||||
: cityssm.escapeHTML(workOrder.workOrderNumber ?? '')
|
||||
}
|
||||
</a>
|
||||
</td><td>
|
||||
${cityssm.escapeHTML(workOrder.workOrderType ?? '')}<br />
|
||||
<span class="is-size-7">
|
||||
${cityssm.escapeHTML(workOrder.workOrderDescription ?? '')}
|
||||
</span>
|
||||
</td>` +
|
||||
('<td>' +
|
||||
(relatedHTML === ''
|
||||
? ''
|
||||
: '<ul class="fa-ul ml-5 is-size-7">' + relatedHTML + '</ul>') +
|
||||
'</td>') +
|
||||
('<td>' +
|
||||
'<ul class="fa-ul ml-5 is-size-7">' +
|
||||
`<li class="has-tooltip-left"
|
||||
data-tooltip="${los.escapedAliases.WorkOrderOpenDate}">
|
||||
<span class="fa-li">
|
||||
<i class="fas fa-fw fa-play"
|
||||
aria-label="${los.escapedAliases.WorkOrderOpenDate}"></i>
|
||||
</span>
|
||||
${workOrder.workOrderOpenDateString!}
|
||||
</li>` +
|
||||
('<li class="has-tooltip-left" data-tooltip="' +
|
||||
los.escapedAliases.WorkOrderCloseDate +
|
||||
'">' +
|
||||
'<span class="fa-li">' +
|
||||
'<i class="fas fa-fw fa-stop" aria-label="' +
|
||||
los.escapedAliases.WorkOrderCloseDate +
|
||||
'"></i></span> ' +
|
||||
(workOrder.workOrderCloseDate
|
||||
? workOrder.workOrderCloseDateString!
|
||||
: '<span class="has-text-grey">(No ' +
|
||||
los.escapedAliases.WorkOrderCloseDate +
|
||||
')</span>') +
|
||||
'</li>') +
|
||||
'</ul>' +
|
||||
'</td>') +
|
||||
('<td>' +
|
||||
(workOrder.workOrderMilestoneCount === 0
|
||||
? '-'
|
||||
: workOrder.workOrderMilestoneCompletionCount!.toString() +
|
||||
' / ' +
|
||||
workOrder.workOrderMilestoneCount!.toString()) +
|
||||
'</td>') +
|
||||
(workOrderPrints.length > 0
|
||||
? '<td>' +
|
||||
'<a class="button is-small" data-tooltip="Print" href="' +
|
||||
los.urlPrefix +
|
||||
'/print/' +
|
||||
workOrderPrints[0] +
|
||||
'/?workOrderId=' +
|
||||
workOrder.workOrderId!.toString() +
|
||||
'" target="_blank">' +
|
||||
'<i class="fas fa-print" aria-label="Print"></i>' +
|
||||
'</a>' +
|
||||
'</td>'
|
||||
: '') +
|
||||
'</tr>'
|
||||
</td><td>
|
||||
${
|
||||
relatedHTML === ''
|
||||
? ''
|
||||
: '<ul class="fa-ul ml-5 is-size-7">' + relatedHTML + '</ul>'
|
||||
}
|
||||
</td><td>
|
||||
<ul class="fa-ul ml-5 is-size-7">
|
||||
<li class="has-tooltip-left"
|
||||
data-tooltip="${los.escapedAliases.WorkOrderOpenDate}">
|
||||
<span class="fa-li">
|
||||
<i class="fas fa-fw fa-play" aria-label="${los.escapedAliases.WorkOrderOpenDate}"></i>
|
||||
</span>
|
||||
${workOrder.workOrderOpenDateString}
|
||||
</li>
|
||||
<li class="has-tooltip-left" data-tooltip="${los.escapedAliases.WorkOrderCloseDate}">
|
||||
<span class="fa-li">
|
||||
<i class="fas fa-fw fa-stop" aria-label="${los.escapedAliases.WorkOrderCloseDate}"></i>
|
||||
</span>
|
||||
${
|
||||
workOrder.workOrderCloseDate
|
||||
? workOrder.workOrderCloseDateString
|
||||
: `<span class="has-text-grey">(No ${los.escapedAliases.WorkOrderCloseDate})</span>`
|
||||
}
|
||||
</li>
|
||||
</ul>
|
||||
</td><td>
|
||||
${
|
||||
workOrder.workOrderMilestoneCount === 0
|
||||
? '-'
|
||||
: (
|
||||
workOrder.workOrderMilestoneCompletionCount ?? ''
|
||||
).toString() +
|
||||
' / ' +
|
||||
(workOrder.workOrderMilestoneCount ?? '').toString()
|
||||
}
|
||||
</td>
|
||||
${
|
||||
workOrderPrints.length > 0
|
||||
? `<td>
|
||||
<a class="button is-small" data-tooltip="Print"
|
||||
href="${los.urlPrefix}/print/${workOrderPrints[0]}/?workOrderId=${workOrder.workOrderId.toString()}"
|
||||
target="_blank">
|
||||
<i class="fas fa-print" aria-label="Print"></i>
|
||||
</a>
|
||||
</td>`
|
||||
: ''
|
||||
}</tr>`
|
||||
)
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
searchResultsContainerElement.innerHTML = `<table class="table is-fullwidth is-striped is-hoverable has-sticky-header">
|
||||
<thead><tr>
|
||||
<th>Work Order Number</th>
|
||||
|
|
@ -169,6 +170,7 @@ declare const cityssm: cityssmGlobal
|
|||
</tr></thead>
|
||||
<table>`
|
||||
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
searchResultsContainerElement.insertAdjacentHTML(
|
||||
'beforeend',
|
||||
los.getSearchResultsPagerHTML(
|
||||
|
|
@ -179,8 +181,8 @@ declare const cityssm: cityssmGlobal
|
|||
)
|
||||
|
||||
searchResultsContainerElement
|
||||
.querySelector('table')!
|
||||
.append(resultsTbodyElement)
|
||||
.querySelector('table')
|
||||
?.append(resultsTbodyElement)
|
||||
|
||||
searchResultsContainerElement
|
||||
.querySelector("button[data-page='previous']")
|
||||
|
|
@ -192,12 +194,13 @@ declare const cityssm: cityssmGlobal
|
|||
}
|
||||
|
||||
function getWorkOrders(): void {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
searchResultsContainerElement.innerHTML = los.getLoadingParagraphHTML(
|
||||
'Loading Work Orders...'
|
||||
)
|
||||
|
||||
cityssm.postJSON(
|
||||
los.urlPrefix + '/workOrders/doSearchWorkOrders',
|
||||
`${los.urlPrefix}/workOrders/doSearchWorkOrders`,
|
||||
searchFilterFormElement,
|
||||
renderWorkOrders
|
||||
)
|
||||
|
|
@ -234,6 +237,7 @@ declare const cityssm: cityssmGlobal
|
|||
formEvent.preventDefault()
|
||||
})
|
||||
|
||||
// eslint-disable-next-line no-secrets/no-secrets
|
||||
/*
|
||||
const workOrderOpenDateStringElement = document.querySelector("#searchFilter--workOrderOpenDateString") as HTMLInputElement;
|
||||
|
||||
|
|
@ -262,7 +266,7 @@ declare const cityssm: cityssmGlobal
|
|||
|
||||
resetOffsetAndGetWorkOrders();
|
||||
});
|
||||
*/
|
||||
*/
|
||||
|
||||
getWorkOrders()
|
||||
})()
|
||||
|
|
|
|||
|
|
@ -1,14 +1,16 @@
|
|||
"use strict";
|
||||
/* eslint-disable unicorn/prefer-module, @typescript-eslint/no-non-null-assertion */
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
var _a;
|
||||
const los = exports.los;
|
||||
const reopenWorkOrderButtonElement = document.querySelector('#button--reopenWorkOrder');
|
||||
if (reopenWorkOrderButtonElement !== null) {
|
||||
const workOrderId = reopenWorkOrderButtonElement.dataset.workOrderId;
|
||||
const workOrderId = (_a = reopenWorkOrderButtonElement.dataset.workOrderId) !== null && _a !== void 0 ? _a : '';
|
||||
reopenWorkOrderButtonElement.addEventListener('click', () => {
|
||||
function doReopen() {
|
||||
cityssm.postJSON(los.urlPrefix + '/workOrders/doReopenWorkOrder', {
|
||||
cityssm.postJSON(`${los.urlPrefix}/workOrders/doReopenWorkOrder`, {
|
||||
workOrderId
|
||||
}, (rawResponseJSON) => {
|
||||
var _a;
|
||||
|
|
|
|||
|
|
@ -1,26 +1,28 @@
|
|||
/* eslint-disable unicorn/prefer-module, @typescript-eslint/no-non-null-assertion */
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
|
||||
import type * as globalTypes from '../types/globalTypes'
|
||||
import type { BulmaJS } from '@cityssm/bulma-js/types.js'
|
||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
|
||||
|
||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types'
|
||||
|
||||
import type { BulmaJS } from '@cityssm/bulma-js/types'
|
||||
import type { LOS } from '../types/globalTypes.js'
|
||||
|
||||
declare const cityssm: cityssmGlobal
|
||||
declare const bulmaJS: BulmaJS
|
||||
|
||||
declare const exports: Record<string, unknown>
|
||||
;(() => {
|
||||
const los = exports.los as globalTypes.LOS
|
||||
const los = exports.los as LOS
|
||||
|
||||
const reopenWorkOrderButtonElement: HTMLButtonElement | null =
|
||||
document.querySelector('#button--reopenWorkOrder')
|
||||
|
||||
if (reopenWorkOrderButtonElement !== null) {
|
||||
const workOrderId = reopenWorkOrderButtonElement.dataset.workOrderId!
|
||||
const workOrderId = reopenWorkOrderButtonElement.dataset.workOrderId ?? ''
|
||||
|
||||
reopenWorkOrderButtonElement.addEventListener('click', () => {
|
||||
function doReopen(): void {
|
||||
cityssm.postJSON(
|
||||
los.urlPrefix + '/workOrders/doReopenWorkOrder',
|
||||
`${los.urlPrefix}/workOrders/doReopenWorkOrder`,
|
||||
{
|
||||
workOrderId
|
||||
},
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,t=document.querySelector("#form--searchFilters"),s=document.querySelector("#container--searchResults"),a=Number.parseInt(document.querySelector("#searchFilter--limit").value,10),n=document.querySelector("#searchFilter--offset");function r(t){var n,r,o,l,d;if(0===t.lots.length)return void(s.innerHTML=`<div class="message is-info">\n <p class="message-body">There are no ${e.escapedAliases.lots} that meet the search criteria.</p>\n </div>`);const u=document.createElement("tbody");for(const s of t.lots)u.insertAdjacentHTML("beforeend",'<tr><td><a class="has-text-weight-bold" href="'+e.getLotURL(s.lotId)+'">'+cityssm.escapeHTML(null!==(n=s.lotName)&&void 0!==n?n:"")+'</a></td><td><a href="'+e.getMapURL(s.mapId)+'">'+(s.mapName?cityssm.escapeHTML(s.mapName):'<span class="has-text-grey">(No Name)</span>')+"</a></td><td>"+cityssm.escapeHTML(null!==(r=s.lotType)&&void 0!==r?r:"")+"</td><td>"+(s.lotStatusId?cityssm.escapeHTML(s.lotStatus):'<span class="has-text-grey">(No Status)</span>')+"<br />"+((null!==(o=s.lotOccupancyCount)&&void 0!==o?o:0)>0?'<span class="is-size-7">Currently Occupied</span>':"")+"</td></tr>");s.innerHTML=`<table class="table is-fullwidth is-striped is-hoverable has-sticky-header">\n <thead><tr>\n <th>${e.escapedAliases.Lot}</th>\n <th>${e.escapedAliases.Map}</th>\n <th>${e.escapedAliases.Lot} Type</th>\n <th>Status</th>\n </tr></thead>\n <table>`,s.insertAdjacentHTML("beforeend",e.getSearchResultsPagerHTML(a,t.offset,t.count)),s.querySelector("table").append(u),null===(l=s.querySelector("button[data-page='previous']"))||void 0===l||l.addEventListener("click",c),null===(d=s.querySelector("button[data-page='next']"))||void 0===d||d.addEventListener("click",i)}function o(){s.innerHTML=e.getLoadingParagraphHTML(`Loading ${e.escapedAliases.Lots}...`),cityssm.postJSON(e.urlPrefix+"/lots/doSearchLots",t,r)}function l(){n.value="0",o()}function c(){n.value=Math.max(Number.parseInt(n.value,10)-a,0).toString(),o()}function i(){n.value=(Number.parseInt(n.value,10)+a).toString(),o()}const d=t.querySelectorAll("input, select");for(const e of d)e.addEventListener("change",l);t.addEventListener("submit",e=>{e.preventDefault()}),o()})();
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,t=document.querySelector("#form--searchFilters"),s=document.querySelector("#container--searchResults"),a=Number.parseInt(document.querySelector("#searchFilter--limit").value,10),n=document.querySelector("#searchFilter--offset");function r(t){var n,r,o,l,d,u,p;const h=t;if(0===h.lots.length)return void(s.innerHTML=`<div class="message is-info">\n <p class="message-body">There are no ${e.escapedAliases.lots} that meet the search criteria.</p>\n </div>`);const m=document.createElement("tbody");for(const t of h.lots)m.insertAdjacentHTML("beforeend",`<tr>\n <td>\n <a class="has-text-weight-bold" href="${e.getLotURL(t.lotId)}">\n ${cityssm.escapeHTML(null!==(n=t.lotName)&&void 0!==n?n:"")}\n </a>\n </td><td>\n <a href="${e.getMapURL(t.mapId)}">\n ${t.mapName?cityssm.escapeHTML(t.mapName):'<span class="has-text-grey">(No Name)</span>'}\n </a>\n </td><td>\n ${cityssm.escapeHTML(null!==(r=t.lotType)&&void 0!==r?r:"")}\n </td><td>\n ${t.lotStatusId?cityssm.escapeHTML(null!==(o=t.lotStatus)&&void 0!==o?o:""):'<span class="has-text-grey">(No Status)</span>'}<br />\n ${(null!==(l=t.lotOccupancyCount)&&void 0!==l?l:0)>0?'<span class="is-size-7">Currently Occupied</span>':""}\n </td>\n </tr>`);s.innerHTML=`<table class="table is-fullwidth is-striped is-hoverable has-sticky-header">\n <thead><tr>\n <th>${e.escapedAliases.Lot}</th>\n <th>${e.escapedAliases.Map}</th>\n <th>${e.escapedAliases.Lot} Type</th>\n <th>Status</th>\n </tr></thead>\n <table>`,s.insertAdjacentHTML("beforeend",e.getSearchResultsPagerHTML(a,h.offset,h.count)),null===(d=s.querySelector("table"))||void 0===d||d.append(m),null===(u=s.querySelector("button[data-page='previous']"))||void 0===u||u.addEventListener("click",c),null===(p=s.querySelector("button[data-page='next']"))||void 0===p||p.addEventListener("click",i)}function o(){s.innerHTML=e.getLoadingParagraphHTML(`Loading ${e.escapedAliases.Lots}...`),cityssm.postJSON(e.urlPrefix+"/lots/doSearchLots",t,r)}function l(){n.value="0",o()}function c(){n.value=Math.max(Number.parseInt(n.value,10)-a,0).toString(),o()}function i(){n.value=(Number.parseInt(n.value,10)+a).toString(),o()}const d=t.querySelectorAll("input, select");for(const e of d)e.addEventListener("change",l);t.addEventListener("submit",e=>{e.preventDefault()}),o()})();
|
||||
|
|
@ -1 +1 @@
|
|||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{var e;const t=exports.los,a=document.querySelector("#map--mapId").value,s=""===a,o=document.querySelector("#form--map");function l(){var e;t.setUnsavedChanges(),null===(e=document.querySelector("button[type='submit'][form='form--map']"))||void 0===e||e.classList.remove("is-light")}o.addEventListener("submit",function(e){e.preventDefault(),cityssm.postJSON(t.urlPrefix+"/maps/"+(s?"doCreateMap":"doUpdateMap"),o,e=>{var a;const o=e;o.success?(function(){var e;t.clearUnsavedChanges(),null===(e=document.querySelector("button[type='submit'][form='form--map']"))||void 0===e||e.classList.add("is-light")}(),s?window.location.href=t.getMapURL(o.mapId,!0):bulmaJS.alert({message:t.escapedAliases.Map+" Updated Successfully",contextualColorName:"success"})):bulmaJS.alert({title:"Error Updating "+t.escapedAliases.Map,message:null!==(a=o.errorMessage)&&void 0!==a?a:"",contextualColorName:"danger"})})});const r=o.querySelectorAll("input, select");for(const e of r)e.addEventListener("change",l);null===(e=document.querySelector("#button--deleteMap"))||void 0===e||e.addEventListener("click",e=>{e.preventDefault(),bulmaJS.confirm({title:"Delete "+t.escapedAliases.Map,message:`Are you sure you want to delete this ${t.escapedAliases.map} and all related ${t.escapedAliases.lots}?`,contextualColorName:"warning",okButton:{text:`Yes, Delete ${t.escapedAliases.Map}`,callbackFunction:function(){cityssm.postJSON(t.urlPrefix+"/maps/doDeleteMap",{mapId:a},e=>{var a;const s=e;s.success?window.location.href=t.getMapURL():bulmaJS.alert({title:"Error Deleting "+t.escapedAliases.Map,message:null!==(a=s.errorMessage)&&void 0!==a?a:"",contextualColorName:"danger"})})}}})})})();
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{var e;const t=exports.los,a=document.querySelector("#map--mapId").value,s=""===a,o=document.querySelector("#form--map");function l(){var e;t.setUnsavedChanges(),null===(e=document.querySelector("button[type='submit'][form='form--map']"))||void 0===e||e.classList.remove("is-light")}o.addEventListener("submit",function(e){e.preventDefault(),cityssm.postJSON(`${t.urlPrefix}/maps/${s?"doCreateMap":"doUpdateMap"}`,o,e=>{var a;const o=e;o.success?(function(){var e;t.clearUnsavedChanges(),null===(e=document.querySelector("button[type='submit'][form='form--map']"))||void 0===e||e.classList.add("is-light")}(),s?window.location.href=t.getMapURL(o.mapId,!0):bulmaJS.alert({message:`${t.escapedAliases.Map} Updated Successfully`,contextualColorName:"success"})):bulmaJS.alert({title:`Error Updating ${t.escapedAliases.Map}`,message:null!==(a=o.errorMessage)&&void 0!==a?a:"",contextualColorName:"danger"})})});const r=o.querySelectorAll("input, select");for(const e of r)e.addEventListener("change",l);null===(e=document.querySelector("#button--deleteMap"))||void 0===e||e.addEventListener("click",e=>{e.preventDefault(),bulmaJS.confirm({title:`Delete ${t.escapedAliases.Map}`,message:`Are you sure you want to delete this ${t.escapedAliases.map} and all related ${t.escapedAliases.lots}?`,contextualColorName:"warning",okButton:{text:`Yes, Delete ${t.escapedAliases.Map}`,callbackFunction:function(){cityssm.postJSON(`${t.urlPrefix}/maps/doDeleteMap`,{mapId:a},e=>{var a;const s=e;s.success?window.location.href=t.getMapURL():bulmaJS.alert({title:`Error Deleting ${t.escapedAliases.Map}`,message:null!==(a=s.errorMessage)&&void 0!==a?a:"",contextualColorName:"danger"})})}}})})})();
|
||||
|
|
@ -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 i(){var i,d,n,r,o,l,c,p,m,h,u,v,L,f,b;t.innerHTML=e.getLoadingParagraphHTML(`Loading ${e.escapedAliases.Maps}...`);let y=0;const H=document.createElement("tbody"),M=s.value.trim().toLowerCase().split(" ");for(const s of a){const a=`${null!==(i=s.mapName)&&void 0!==i?i:""} ${null!==(d=s.mapDescription)&&void 0!==d?d:""} ${null!==(n=s.mapAddress1)&&void 0!==n?n:""} ${null!==(r=s.mapAddress2)&&void 0!==r?r:""}`.toLowerCase();let t=!0;for(const e of M)if(!a.includes(e)){t=!1;break}t&&(y+=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>"+(""===(null!==(l=s.mapAddress1)&&void 0!==l?l:"")?"":cityssm.escapeHTML(null!==(c=s.mapAddress1)&&void 0!==c?c:"")+"<br />")+(""===(null!==(p=s.mapAddress2)&&void 0!==p?p:"")?"":cityssm.escapeHTML(null!==(m=s.mapAddress2)&&void 0!==m?m:"")+"<br />")+(s.mapCity||s.mapProvince?cityssm.escapeHTML(null!==(h=s.mapCity)&&void 0!==h?h:"")+", "+cityssm.escapeHTML(null!==(u=s.mapProvince)&&void 0!==u?u:"")+"<br />":"")+(""===(null!==(v=s.mapPostalCode)&&void 0!==v?v:"")?"":cityssm.escapeHTML(null!==(L=s.mapPostalCode)&&void 0!==L?L:""))+"</td><td>"+cityssm.escapeHTML(null!==(f=s.mapPhoneNumber)&&void 0!==f?f:"")+'</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!==(b=s.mapSVG)&&void 0!==b?b:"")?"":'<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===y)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",i),document.querySelector("#form--searchFilters").addEventListener("submit",e=>{e.preventDefault(),i()}),i()})();
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{var e;const a=exports.los,s=exports.maps,t=document.querySelector("#searchFilter--map"),n=document.querySelector("#container--searchResults");function i(){var e,i,d,l,r,o,c,p,m,u,h,v,$,L,f,b,y;n.innerHTML=a.getLoadingParagraphHTML(`Loading ${a.escapedAliases.Maps}...`);let H=0;const M=document.createElement("tbody"),g=t.value.trim().toLowerCase().split(" ");for(const t of s){const s=`${null!==(e=t.mapName)&&void 0!==e?e:""} ${null!==(i=t.mapDescription)&&void 0!==i?i:""} ${null!==(d=t.mapAddress1)&&void 0!==d?d:""} ${null!==(l=t.mapAddress2)&&void 0!==l?l:""}`.toLowerCase();let n=!0;for(const e of g)if(!s.includes(e)){n=!1;break}n&&(H+=1,M.insertAdjacentHTML("beforeend",`<tr>\n <td>\n <a class="has-text-weight-bold" href="${a.getMapURL(t.mapId)}">\n ${cityssm.escapeHTML(""===(null!==(r=t.mapName)&&void 0!==r?r:"")?"(No Name)":null!==(o=t.mapName)&&void 0!==o?o:"")}\n </a><br />\n <span class="is-size-7">\n ${cityssm.escapeHTML(null!==(c=t.mapDescription)&&void 0!==c?c:"")}\n </span>\n </td><td>\n ${""===(null!==(p=t.mapAddress1)&&void 0!==p?p:"")?"":`${cityssm.escapeHTML(null!==(m=t.mapAddress1)&&void 0!==m?m:"")}<br />`}\n ${""===(null!==(u=t.mapAddress2)&&void 0!==u?u:"")?"":`${cityssm.escapeHTML(null!==(h=t.mapAddress2)&&void 0!==h?h:"")}<br />`}\n ${t.mapCity||t.mapProvince?`${cityssm.escapeHTML(null!==(v=t.mapCity)&&void 0!==v?v:"")}, ${cityssm.escapeHTML(null!==($=t.mapProvince)&&void 0!==$?$:"")}<br />`:""}\n ${""===(null!==(L=t.mapPostalCode)&&void 0!==L?L:"")?"":cityssm.escapeHTML(null!==(f=t.mapPostalCode)&&void 0!==f?f:"")}\n </td><td>\n ${cityssm.escapeHTML(null!==(b=t.mapPhoneNumber)&&void 0!==b?b:"")}\n </td><td class="has-text-centered">\n ${t.mapLatitude&&t.mapLongitude?'<span data-tooltip="Has Geographic Coordinates">\n <i class="fas fa-map-marker-alt" aria-label="Has Geographic Coordinates"></i>\n </span>':""}\n </td><td class="has-text-centered">\n ${""===(null!==(y=t.mapSVG)&&void 0!==y?y:"")?"":'<span data-tooltip="Has Image"><i class="fas fa-image" aria-label="Has Image"></i></span>'}\n </td><td class="has-text-right">\n <a href="${a.urlPrefix}/lots?mapId=${t.mapId}">${t.lotCount}</a>\n </td>\n </tr>`))}if(n.innerHTML="",0===H)n.innerHTML=`<div class="message is-info">\n <p class="message-body">There are no ${a.escapedAliases.maps} that meet the search criteria.</p>\n </div>`;else{const e=document.createElement("table");e.className="table is-fullwidth is-striped is-hoverable has-sticky-header",e.innerHTML=`<thead><tr>\n <th>${a.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">${a.escapedAliases.Lot} Count</th>\n </tr></thead>`,e.append(M),n.append(e)}}t.addEventListener("keyup",i),null===(e=document.querySelector("#form--searchFilters"))||void 0===e||e.addEventListener("submit",e=>{e.preventDefault(),i()}),i()})();
|
||||
|
|
@ -1 +1 @@
|
|||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,s=document.querySelector("#form--searchFilters"),r=s.querySelector("#searchFilter--workOrderMilestoneDateFilter"),a=s.querySelector("#searchFilter--workOrderMilestoneDateString"),t=document.querySelector("#container--milestoneCalendar");function i(r){r&&r.preventDefault(),t.innerHTML=e.getLoadingParagraphHTML("Loading Milestones..."),cityssm.postJSON(e.urlPrefix+"/workOrders/doGetWorkOrderMilestones",s,s=>{!function(s){var r,a,i,n,o,l,c,d;if(0===s.length)return void(t.innerHTML='<div class="message is-info">\n <p class="message-body">There are no milestones that meet the search criteria.</p>\n </div>');t.innerHTML="";const p=cityssm.dateToString(new Date);let m,u="x";for(const M of s){u!==M.workOrderMilestoneDateString&&(m&&t.append(m),(m=document.createElement("div")).className="panel",m.innerHTML=`<h2 class="panel-heading">\n ${0===M.workOrderMilestoneDate?"No Set Date":M.workOrderMilestoneDateString}\n </h2>`,u=M.workOrderMilestoneDateString);const s=document.createElement("div");s.className="panel-block is-block",!M.workOrderMilestoneCompletionDate&&""!==M.workOrderMilestoneDateString&&M.workOrderMilestoneDateString<p&&s.classList.add("has-background-warning-light");let f="";for(const s of M.workOrderLots)f+=`<li class="has-tooltip-left"\n data-tooltip="${cityssm.escapeHTML(null!==(r=s.mapName)&&void 0!==r?r:"")}">\n <span class="fa-li">\n <i class="fas fa-vector-square"\n aria-label="${e.escapedAliases.Lot}"></i>\n </span>\n ${cityssm.escapeHTML(null!==(a=s.lotName)&&void 0!==a?a:"")}\n </li>`;for(const s of M.workOrderLotOccupancies)for(const r of s.lotOccupancyOccupants)f+=`<li class="has-tooltip-left"\n data-tooltip="${cityssm.escapeHTML(null!==(i=r.lotOccupantType)&&void 0!==i?i:"")}">\n <span class="fa-li">\n <i class="fas fa-user"\n aria-label="${e.escapedAliases.Occupancy}"></i>\n </span>\n ${cityssm.escapeHTML(null!==(n=r.occupantName)&&void 0!==n?n:"")}\n ${cityssm.escapeHTML(null!==(o=r.occupantFamilyName)&&void 0!==o?o:"")}\n </li>`;s.innerHTML='<div class="columns"><div class="column is-narrow"><span class="icon is-small">'+(M.workOrderMilestoneCompletionDate?'<i class="fas fa-check" aria-label="Completed"></i>':'<i class="far fa-square has-text-grey" aria-label="Incomplete"></i>')+'</span></div><div class="column">'+(0===M.workOrderMilestoneTime?"":M.workOrderMilestoneTimePeriodString+"<br />")+(M.workOrderMilestoneTypeId?"<strong>"+cityssm.escapeHTML(M.workOrderMilestoneType)+"</strong><br />":"")+'<span class="is-size-7">'+cityssm.escapeHTML(M.workOrderMilestoneDescription)+'</span></div><div class="column"><i class="fas fa-circle" style="color:'+e.getRandomColor(null!==(l=M.workOrderNumber)&&void 0!==l?l:"")+'" aria-hidden="true"></i> <a class="has-text-weight-bold" href="'+e.getWorkOrderURL(M.workOrderId)+'">'+cityssm.escapeHTML(null!==(c=M.workOrderNumber)&&void 0!==c?c:"")+'</a><br /><span class="is-size-7">'+cityssm.escapeHTML(null!==(d=M.workOrderDescription)&&void 0!==d?d:"")+'</span></div><div class="column is-size-7">'+(""===f?"":'<ul class="fa-ul ml-4">'+f+"</ul>")+"</div></div>",m.append(s)}t.append(m)}(s.workOrderMilestones)})}r.addEventListener("change",()=>{a.closest("fieldset").disabled="date"!==r.value,i()}),e.initializeDatePickers(s),a.addEventListener("change",i),s.addEventListener("submit",i),i()})();
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,s=document.querySelector("#form--searchFilters"),n=s.querySelector("#searchFilter--workOrderMilestoneDateFilter"),r=s.querySelector("#searchFilter--workOrderMilestoneDateString"),a=document.querySelector("#container--milestoneCalendar");function i(n){n&&n.preventDefault(),a.innerHTML=e.getLoadingParagraphHTML("Loading Milestones..."),cityssm.postJSON(`${e.urlPrefix}/workOrders/doGetWorkOrderMilestones`,s,s=>{!function(s){var n,r,i,t,l,o,c,d,p,u,m,v,M,f,O;if(0===s.length)return void(a.innerHTML='<div class="message is-info">\n <p class="message-body">There are no milestones that meet the search criteria.</p>\n </div>');a.innerHTML="";const k=cityssm.dateToString(new Date);let g,w="x";for(const y of s){w!==y.workOrderMilestoneDateString&&(g&&a.append(g),(g=document.createElement("div")).className="panel",g.innerHTML=`<h2 class="panel-heading">\n ${cityssm.escapeHTML(0===y.workOrderMilestoneDate?"No Set Date":null!==(n=y.workOrderMilestoneDateString)&&void 0!==n?n:"")}\n </h2>`,w=null!==(r=y.workOrderMilestoneDateString)&&void 0!==r?r:"");const s=document.createElement("div");s.className="panel-block is-block",!y.workOrderMilestoneCompletionDate&&""!==y.workOrderMilestoneDateString&&y.workOrderMilestoneDateString<k&&s.classList.add("has-background-warning-light");let L="";for(const s of null!==(i=y.workOrderLots)&&void 0!==i?i:[])L+=`<li class="has-tooltip-left"\n data-tooltip="${cityssm.escapeHTML(null!==(t=s.mapName)&&void 0!==t?t:"")}">\n <span class="fa-li">\n <i class="fas fa-vector-square"\n aria-label="${e.escapedAliases.Lot}"></i>\n </span>\n ${cityssm.escapeHTML(null!==(l=s.lotName)&&void 0!==l?l:"")}\n </li>`;for(const s of null!==(o=y.workOrderLotOccupancies)&&void 0!==o?o:[])for(const n of null!==(c=s.lotOccupancyOccupants)&&void 0!==c?c:[])L+=`<li class="has-tooltip-left"\n data-tooltip="${cityssm.escapeHTML(null!==(d=n.lotOccupantType)&&void 0!==d?d:"")}">\n <span class="fa-li">\n <i class="fas fa-user"\n aria-label="${e.escapedAliases.Occupancy}"></i>\n </span>\n ${cityssm.escapeHTML(null!==(p=n.occupantName)&&void 0!==p?p:"")}\n ${cityssm.escapeHTML(null!==(u=n.occupantFamilyName)&&void 0!==u?u:"")}\n </li>`;s.innerHTML=`<div class="columns">\n <div class="column is-narrow">\n <span class="icon is-small">\n ${y.workOrderMilestoneCompletionDate?'<i class="fas fa-check" aria-label="Completed"></i>':'<i class="far fa-square has-text-grey" aria-label="Incomplete"></i>'}\n </span>\n </div><div class="column">\n ${0===y.workOrderMilestoneTime?"":`${y.workOrderMilestoneTimePeriodString}<br />`}\n ${y.workOrderMilestoneTypeId?`<strong>${cityssm.escapeHTML(null!==(m=y.workOrderMilestoneType)&&void 0!==m?m:"")}</strong><br />`:""}\n <span class="is-size-7">\n ${cityssm.escapeHTML(null!==(v=y.workOrderMilestoneDescription)&&void 0!==v?v:"")}\n </span>\n </div><div class="column">\n <i class="fas fa-circle" style="color:${e.getRandomColor(null!==(M=y.workOrderNumber)&&void 0!==M?M:"")}" aria-hidden="true"></i>\n <a class="has-text-weight-bold" href="${e.getWorkOrderURL(y.workOrderId)}">\n ${cityssm.escapeHTML(null!==(f=y.workOrderNumber)&&void 0!==f?f:"")}\n </a><br />\n <span class="is-size-7">${cityssm.escapeHTML(null!==(O=y.workOrderDescription)&&void 0!==O?O:"")}</span>\n </div><div class="column is-size-7">\n ${""===L?"":'<ul class="fa-ul ml-4">'+L+"</ul>"}</div></div>`,g.append(s)}a.append(g)}(s.workOrderMilestones)})}n.addEventListener("change",()=>{r.closest("fieldset").disabled="date"!==n.value,i()}),e.initializeDatePickers(s),r.addEventListener("change",i),s.addEventListener("submit",i),i()})();
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
"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;const n=r;n.success?window.location.href=e.getWorkOrderURL(o,!0,!0):bulmaJS.alert({title:"Error Reopening Work Order",message:null!==(t=n.errorMessage)&&void 0!==t?t:"",contextualColorName:"danger"})})}}})})}})();
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{var e;const r=exports.los,o=document.querySelector("#button--reopenWorkOrder");if(null!==o){const t=null!==(e=o.dataset.workOrderId)&&void 0!==e?e:"";o.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(`${r.urlPrefix}/workOrders/doReopenWorkOrder`,{workOrderId:t},e=>{var o;const n=e;n.success?window.location.href=r.getWorkOrderURL(t,!0,!0):bulmaJS.alert({title:"Error Reopening Work Order",message:null!==(o=n.errorMessage)&&void 0!==o?o:"",contextualColorName:"danger"})})}}})})}})();
|
||||
Loading…
Reference in New Issue