linting
- increase prettier line length - more template strings - use optional chaining on search pages to reduce if statementsdeepsource-autofix-76c6eb20
parent
27b6fe2706
commit
f5f10a5d76
|
|
@ -3,5 +3,5 @@
|
||||||
"tabWidth": 4,
|
"tabWidth": 4,
|
||||||
"semi": true,
|
"semi": true,
|
||||||
"singleQuote": false,
|
"singleQuote": false,
|
||||||
"printWidth": 100
|
"printWidth": 110
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: "Database Cleaned Up Successfully",
|
title: "Database Cleaned Up Successfully",
|
||||||
message: responseJSON.inactivedRecordCount +
|
message: `${responseJSON.inactivedRecordCount} records inactivated,
|
||||||
" records inactivated, " +
|
${responseJSON.purgedRecordCount} permanently deleted.`,
|
||||||
responseJSON.purgedRecordCount +
|
|
||||||
" permanently deleted.",
|
|
||||||
contextualColorName: "success"
|
contextualColorName: "success"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,11 +25,8 @@ declare const bulmaJS: BulmaJS;
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: "Database Cleaned Up Successfully",
|
title: "Database Cleaned Up Successfully",
|
||||||
message:
|
message: `${responseJSON.inactivedRecordCount} records inactivated,
|
||||||
responseJSON.inactivedRecordCount +
|
${responseJSON.purgedRecordCount} permanently deleted.`,
|
||||||
" records inactivated, " +
|
|
||||||
responseJSON.purgedRecordCount +
|
|
||||||
" permanently deleted.",
|
|
||||||
contextualColorName: "success"
|
contextualColorName: "success"
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -8,18 +8,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
delete exports.feeCategories;
|
delete exports.feeCategories;
|
||||||
function renderFeeCategories() {
|
function renderFeeCategories() {
|
||||||
if (feeCategories.length === 0) {
|
if (feeCategories.length === 0) {
|
||||||
feeCategoriesContainerElement.innerHTML =
|
feeCategoriesContainerElement.innerHTML = `<div class="message is-warning">
|
||||||
'<div class="message is-warning">' +
|
<p class="message-body">There are no available fees.</p>
|
||||||
'<p class="message-body">There are no available fees.</p>' +
|
</div>`;
|
||||||
"</div>";
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
feeCategoriesContainerElement.innerHTML = "";
|
feeCategoriesContainerElement.innerHTML = "";
|
||||||
for (const feeCategory of feeCategories) {
|
for (const feeCategory of feeCategories) {
|
||||||
const feeCategoryContainerElement = document.createElement("section");
|
const feeCategoryContainerElement = document.createElement("section");
|
||||||
feeCategoryContainerElement.className = "panel container--feeCategory";
|
feeCategoryContainerElement.className = "panel container--feeCategory";
|
||||||
feeCategoryContainerElement.dataset.feeCategoryId =
|
feeCategoryContainerElement.dataset.feeCategoryId = feeCategory.feeCategoryId.toString();
|
||||||
feeCategory.feeCategoryId.toString();
|
|
||||||
feeCategoryContainerElement.innerHTML =
|
feeCategoryContainerElement.innerHTML =
|
||||||
'<div class="panel-heading">' +
|
'<div class="panel-heading">' +
|
||||||
'<div class="columns">' +
|
'<div class="columns">' +
|
||||||
|
|
@ -89,9 +87,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
"</p>" +
|
"</p>" +
|
||||||
(hasTagsBlock
|
(hasTagsBlock
|
||||||
? '<p class="tags">' +
|
? '<p class="tags">' +
|
||||||
(fee.isRequired
|
(fee.isRequired ? '<span class="tag is-warning">Required</span>' : "") +
|
||||||
? '<span class="tag is-warning">Required</span>'
|
|
||||||
: "") +
|
|
||||||
(fee.occupancyTypeId
|
(fee.occupancyTypeId
|
||||||
? ' <span class="tag has-tooltip-bottom" data-tooltip="' +
|
? ' <span class="tag has-tooltip-bottom" data-tooltip="' +
|
||||||
cityssm.escapeHTML(exports.aliases.occupancy) +
|
cityssm.escapeHTML(exports.aliases.occupancy) +
|
||||||
|
|
@ -116,10 +112,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
? cityssm.escapeHTML(fee.feeFunction) +
|
? cityssm.escapeHTML(fee.feeFunction) +
|
||||||
"<br />" +
|
"<br />" +
|
||||||
"<small>Fee Function</small>"
|
"<small>Fee Function</small>"
|
||||||
: "$" +
|
: "$" + fee.feeAmount.toFixed(2) + "<br />" + "<small>Fee</small>") +
|
||||||
fee.feeAmount.toFixed(2) +
|
|
||||||
"<br />" +
|
|
||||||
"<small>Fee</small>") +
|
|
||||||
"</div>") +
|
"</div>") +
|
||||||
('<div class="column has-text-centered">' +
|
('<div class="column has-text-centered">' +
|
||||||
(fee.taxPercentage
|
(fee.taxPercentage
|
||||||
|
|
@ -181,19 +174,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
cityssm.openHtmlModal("adminFees-addFeeCategory", {
|
cityssm.openHtmlModal("adminFees-addFeeCategory", {
|
||||||
onshown: (modalElement, closeModalFunction) => {
|
onshown(modalElement, closeModalFunction) {
|
||||||
bulmaJS.toggleHtmlClipped();
|
bulmaJS.toggleHtmlClipped();
|
||||||
modalElement.querySelector("#feeCategoryAdd--feeCategory").focus();
|
modalElement.querySelector("#feeCategoryAdd--feeCategory").focus();
|
||||||
addCloseModalFunction = closeModalFunction;
|
addCloseModalFunction = closeModalFunction;
|
||||||
modalElement.querySelector("form").addEventListener("submit", doAddFeeCategory);
|
modalElement.querySelector("form").addEventListener("submit", doAddFeeCategory);
|
||||||
},
|
},
|
||||||
onremoved: () => {
|
onremoved() {
|
||||||
bulmaJS.toggleHtmlClipped();
|
bulmaJS.toggleHtmlClipped();
|
||||||
|
document.querySelector("#button--addFeeCategory").focus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
function openEditFeeCategory(clickEvent) {
|
function openEditFeeCategory(clickEvent) {
|
||||||
const feeCategoryId = Number.parseInt(clickEvent.currentTarget.closest(".container--feeCategory").dataset.feeCategoryId, 10);
|
const feeCategoryId = Number.parseInt(clickEvent.currentTarget.closest(".container--feeCategory")
|
||||||
|
.dataset.feeCategoryId, 10);
|
||||||
const feeCategory = feeCategories.find((currentFeeCategory) => {
|
const feeCategory = feeCategories.find((currentFeeCategory) => {
|
||||||
return currentFeeCategory.feeCategoryId === feeCategoryId;
|
return currentFeeCategory.feeCategoryId === feeCategoryId;
|
||||||
});
|
});
|
||||||
|
|
@ -217,8 +212,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
}
|
}
|
||||||
cityssm.openHtmlModal("adminFees-editFeeCategory", {
|
cityssm.openHtmlModal("adminFees-editFeeCategory", {
|
||||||
onshow(modalElement) {
|
onshow(modalElement) {
|
||||||
modalElement.querySelector("#feeCategoryEdit--feeCategoryId").value = feeCategory.feeCategoryId.toString();
|
modalElement.querySelector("#feeCategoryEdit--feeCategoryId").value =
|
||||||
modalElement.querySelector("#feeCategoryEdit--feeCategory").value = feeCategory.feeCategory;
|
feeCategory.feeCategoryId.toString();
|
||||||
|
modalElement.querySelector("#feeCategoryEdit--feeCategory").value =
|
||||||
|
feeCategory.feeCategory;
|
||||||
},
|
},
|
||||||
onshown(modalElement, closeModalFunction) {
|
onshown(modalElement, closeModalFunction) {
|
||||||
bulmaJS.toggleHtmlClipped();
|
bulmaJS.toggleHtmlClipped();
|
||||||
|
|
@ -232,7 +229,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function confirmDeleteFeeCategory(clickEvent) {
|
function confirmDeleteFeeCategory(clickEvent) {
|
||||||
const feeCategoryId = Number.parseInt(clickEvent.currentTarget.closest(".container--feeCategory").dataset.feeCategoryId, 10);
|
const feeCategoryId = Number.parseInt(clickEvent.currentTarget.closest(".container--feeCategory")
|
||||||
|
.dataset.feeCategoryId, 10);
|
||||||
function doDelete() {
|
function doDelete() {
|
||||||
cityssm.postJSON(los.urlPrefix + "/admin/doDeleteFeeCategory", {
|
cityssm.postJSON(los.urlPrefix + "/admin/doDeleteFeeCategory", {
|
||||||
feeCategoryId
|
feeCategoryId
|
||||||
|
|
@ -262,13 +260,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
}
|
}
|
||||||
function moveFeeCategory(clickEvent) {
|
function moveFeeCategory(clickEvent) {
|
||||||
const buttonElement = clickEvent.currentTarget;
|
const buttonElement = clickEvent.currentTarget;
|
||||||
const feeCategoryId = Number.parseInt(buttonElement.closest(".container--feeCategory").dataset
|
const feeCategoryId = buttonElement.closest(".container--feeCategory").dataset
|
||||||
.feeCategoryId, 10);
|
.feeCategoryId;
|
||||||
cityssm.postJSON(los.urlPrefix +
|
cityssm.postJSON(los.urlPrefix +
|
||||||
"/admin/" +
|
"/admin/" +
|
||||||
(buttonElement.dataset.direction === "up"
|
(buttonElement.dataset.direction === "up" ? "doMoveFeeCategoryUp" : "doMoveFeeCategoryDown"), {
|
||||||
? "doMoveFeeCategoryUp"
|
|
||||||
: "doMoveFeeCategoryDown"), {
|
|
||||||
feeCategoryId,
|
feeCategoryId,
|
||||||
moveToEnd: clickEvent.shiftKey ? "1" : "0"
|
moveToEnd: clickEvent.shiftKey ? "1" : "0"
|
||||||
}, (responseJSON) => {
|
}, (responseJSON) => {
|
||||||
|
|
@ -289,7 +285,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
* Fees
|
* Fees
|
||||||
*/
|
*/
|
||||||
function openAddFee(clickEvent) {
|
function openAddFee(clickEvent) {
|
||||||
const feeCategoryId = Number.parseInt(clickEvent.currentTarget.closest(".container--feeCategory").dataset.feeCategoryId, 10);
|
const feeCategoryId = Number.parseInt(clickEvent.currentTarget.closest(".container--feeCategory")
|
||||||
|
.dataset.feeCategoryId, 10);
|
||||||
let addCloseModalFunction;
|
let addCloseModalFunction;
|
||||||
function doAddFee(submitEvent) {
|
function doAddFee(submitEvent) {
|
||||||
submitEvent.preventDefault();
|
submitEvent.preventDefault();
|
||||||
|
|
@ -372,7 +369,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
});
|
});
|
||||||
modalElement.querySelector("#feeAdd--includeQuantity").addEventListener("change", () => {
|
modalElement.querySelector("#feeAdd--includeQuantity").addEventListener("change", () => {
|
||||||
modalElement.querySelector("#feeAdd--quantityUnit").disabled =
|
modalElement.querySelector("#feeAdd--quantityUnit").disabled =
|
||||||
modalElement.querySelector("#feeAdd--includeQuantity").value === "";
|
modalElement.querySelector("#feeAdd--includeQuantity")
|
||||||
|
.value === "";
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onremoved() {
|
onremoved() {
|
||||||
|
|
@ -384,8 +382,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
clickEvent.preventDefault();
|
clickEvent.preventDefault();
|
||||||
const feeContainerElement = clickEvent.currentTarget.closest(".container--fee");
|
const feeContainerElement = clickEvent.currentTarget.closest(".container--fee");
|
||||||
const feeId = Number.parseInt(feeContainerElement.dataset.feeId, 10);
|
const feeId = Number.parseInt(feeContainerElement.dataset.feeId, 10);
|
||||||
const feeCategoryId = Number.parseInt(feeContainerElement.closest(".container--feeCategory").dataset
|
const feeCategoryId = Number.parseInt(feeContainerElement.closest(".container--feeCategory").dataset.feeCategoryId);
|
||||||
.feeCategoryId);
|
|
||||||
const feeCategory = feeCategories.find((currentFeeCategory) => {
|
const feeCategory = feeCategories.find((currentFeeCategory) => {
|
||||||
return currentFeeCategory.feeCategoryId === feeCategoryId;
|
return currentFeeCategory.feeCategoryId === feeCategoryId;
|
||||||
});
|
});
|
||||||
|
|
@ -470,9 +467,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function toggleQuantityFields() {
|
function toggleQuantityFields() {
|
||||||
|
const includeQuanitityValue = editModalElement.querySelector("#feeEdit--includeQuantity").value;
|
||||||
editModalElement.querySelector("#feeEdit--quantityUnit").disabled =
|
editModalElement.querySelector("#feeEdit--quantityUnit").disabled =
|
||||||
editModalElement.querySelector("#feeEdit--includeQuantity")
|
includeQuanitityValue === "";
|
||||||
.value === "";
|
|
||||||
}
|
}
|
||||||
cityssm.openHtmlModal("adminFees-editFee", {
|
cityssm.openHtmlModal("adminFees-editFee", {
|
||||||
onshow(modalElement) {
|
onshow(modalElement) {
|
||||||
|
|
@ -489,9 +486,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
}
|
}
|
||||||
feeCategoryElement.append(optionElement);
|
feeCategoryElement.append(optionElement);
|
||||||
}
|
}
|
||||||
modalElement.querySelector("#feeEdit--feeName").value =
|
modalElement.querySelector("#feeEdit--feeName").value = fee.feeName;
|
||||||
fee.feeName;
|
modalElement.querySelector("#feeEdit--feeDescription").value =
|
||||||
modalElement.querySelector("#feeEdit--feeDescription").value = fee.feeDescription;
|
fee.feeDescription;
|
||||||
const occupancyTypeElement = modalElement.querySelector("#feeEdit--occupancyTypeId");
|
const occupancyTypeElement = modalElement.querySelector("#feeEdit--occupancyTypeId");
|
||||||
for (const occupancyType of exports.occupancyTypes) {
|
for (const occupancyType of exports.occupancyTypes) {
|
||||||
const optionElement = document.createElement("option");
|
const optionElement = document.createElement("option");
|
||||||
|
|
@ -512,12 +509,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
}
|
}
|
||||||
lotTypeElement.append(optionElement);
|
lotTypeElement.append(optionElement);
|
||||||
}
|
}
|
||||||
modalElement.querySelector("#feeEdit--feeAmount").value =
|
modalElement.querySelector("#feeEdit--feeAmount").value = fee.feeAmount
|
||||||
fee.feeAmount ? fee.feeAmount.toFixed(2) : "";
|
? fee.feeAmount.toFixed(2)
|
||||||
modalElement.querySelector("#feeEdit--feeFunction").addEventListener("change", toggleFeeFields);
|
: "";
|
||||||
|
modalElement
|
||||||
|
.querySelector("#feeEdit--feeFunction")
|
||||||
|
.addEventListener("change", toggleFeeFields);
|
||||||
toggleFeeFields();
|
toggleFeeFields();
|
||||||
modalElement.querySelector("#feeEdit--taxAmount").value =
|
modalElement.querySelector("#feeEdit--taxAmount").value = fee.taxAmount
|
||||||
fee.taxAmount ? fee.taxAmount.toFixed(2) : "";
|
? fee.taxAmount.toFixed(2)
|
||||||
|
: "";
|
||||||
const taxPercentageElement = modalElement.querySelector("#feeEdit--taxPercentage");
|
const taxPercentageElement = modalElement.querySelector("#feeEdit--taxPercentage");
|
||||||
taxPercentageElement.value = fee.taxPercentage ? fee.taxPercentage.toString() : "";
|
taxPercentageElement.value = fee.taxPercentage ? fee.taxPercentage.toString() : "";
|
||||||
taxPercentageElement.addEventListener("keyup", toggleTaxFields);
|
taxPercentageElement.addEventListener("keyup", toggleTaxFields);
|
||||||
|
|
@ -540,9 +541,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
editCloseModalFunction = closeModalFunction;
|
editCloseModalFunction = closeModalFunction;
|
||||||
modalElement.querySelector("form").addEventListener("submit", doUpdateFee);
|
modalElement.querySelector("form").addEventListener("submit", doUpdateFee);
|
||||||
bulmaJS.init(modalElement);
|
bulmaJS.init(modalElement);
|
||||||
modalElement
|
modalElement.querySelector(".button--deleteFee").addEventListener("click", confirmDeleteFee);
|
||||||
.querySelector(".button--deleteFee")
|
|
||||||
.addEventListener("click", confirmDeleteFee);
|
|
||||||
},
|
},
|
||||||
onremoved: () => {
|
onremoved: () => {
|
||||||
bulmaJS.toggleHtmlClipped();
|
bulmaJS.toggleHtmlClipped();
|
||||||
|
|
@ -552,7 +551,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
function moveFee(clickEvent) {
|
function moveFee(clickEvent) {
|
||||||
const buttonElement = clickEvent.currentTarget;
|
const buttonElement = clickEvent.currentTarget;
|
||||||
const feeContainerElement = buttonElement.closest(".container--fee");
|
const feeContainerElement = buttonElement.closest(".container--fee");
|
||||||
const feeId = Number.parseInt(feeContainerElement.dataset.feeId, 10);
|
const feeId = feeContainerElement.dataset.feeId;
|
||||||
cityssm.postJSON(los.urlPrefix +
|
cityssm.postJSON(los.urlPrefix +
|
||||||
"/admin/" +
|
"/admin/" +
|
||||||
(buttonElement.dataset.direction === "up" ? "doMoveFeeUp" : "doMoveFeeDown"), {
|
(buttonElement.dataset.direction === "up" ? "doMoveFeeUp" : "doMoveFeeDown"), {
|
||||||
|
|
|
||||||
|
|
@ -13,19 +13,16 @@ declare const bulmaJS: BulmaJS;
|
||||||
(() => {
|
(() => {
|
||||||
const los = exports.los as globalTypes.LOS;
|
const los = exports.los as globalTypes.LOS;
|
||||||
|
|
||||||
const feeCategoriesContainerElement = document.querySelector(
|
const feeCategoriesContainerElement = document.querySelector("#container--feeCategories") as HTMLElement;
|
||||||
"#container--feeCategories"
|
|
||||||
) as HTMLElement;
|
|
||||||
|
|
||||||
let feeCategories: recordTypes.FeeCategory[] = exports.feeCategories;
|
let feeCategories: recordTypes.FeeCategory[] = exports.feeCategories;
|
||||||
delete exports.feeCategories;
|
delete exports.feeCategories;
|
||||||
|
|
||||||
function renderFeeCategories(): void {
|
function renderFeeCategories(): void {
|
||||||
if (feeCategories.length === 0) {
|
if (feeCategories.length === 0) {
|
||||||
feeCategoriesContainerElement.innerHTML =
|
feeCategoriesContainerElement.innerHTML = `<div class="message is-warning">
|
||||||
'<div class="message is-warning">' +
|
<p class="message-body">There are no available fees.</p>
|
||||||
'<p class="message-body">There are no available fees.</p>' +
|
</div>`;
|
||||||
"</div>";
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -37,8 +34,7 @@ declare const bulmaJS: BulmaJS;
|
||||||
|
|
||||||
feeCategoryContainerElement.className = "panel container--feeCategory";
|
feeCategoryContainerElement.className = "panel container--feeCategory";
|
||||||
|
|
||||||
feeCategoryContainerElement.dataset.feeCategoryId =
|
feeCategoryContainerElement.dataset.feeCategoryId = feeCategory.feeCategoryId!.toString();
|
||||||
feeCategory.feeCategoryId!.toString();
|
|
||||||
|
|
||||||
feeCategoryContainerElement.innerHTML =
|
feeCategoryContainerElement.innerHTML =
|
||||||
'<div class="panel-heading">' +
|
'<div class="panel-heading">' +
|
||||||
|
|
@ -119,9 +115,7 @@ declare const bulmaJS: BulmaJS;
|
||||||
"</p>" +
|
"</p>" +
|
||||||
(hasTagsBlock
|
(hasTagsBlock
|
||||||
? '<p class="tags">' +
|
? '<p class="tags">' +
|
||||||
(fee.isRequired
|
(fee.isRequired ? '<span class="tag is-warning">Required</span>' : "") +
|
||||||
? '<span class="tag is-warning">Required</span>'
|
|
||||||
: "") +
|
|
||||||
(fee.occupancyTypeId
|
(fee.occupancyTypeId
|
||||||
? ' <span class="tag has-tooltip-bottom" data-tooltip="' +
|
? ' <span class="tag has-tooltip-bottom" data-tooltip="' +
|
||||||
cityssm.escapeHTML(exports.aliases.occupancy) +
|
cityssm.escapeHTML(exports.aliases.occupancy) +
|
||||||
|
|
@ -146,10 +140,7 @@ declare const bulmaJS: BulmaJS;
|
||||||
? cityssm.escapeHTML(fee.feeFunction) +
|
? cityssm.escapeHTML(fee.feeFunction) +
|
||||||
"<br />" +
|
"<br />" +
|
||||||
"<small>Fee Function</small>"
|
"<small>Fee Function</small>"
|
||||||
: "$" +
|
: "$" + fee.feeAmount!.toFixed(2) + "<br />" + "<small>Fee</small>") +
|
||||||
fee.feeAmount!.toFixed(2) +
|
|
||||||
"<br />" +
|
|
||||||
"<small>Fee</small>") +
|
|
||||||
"</div>") +
|
"</div>") +
|
||||||
('<div class="column has-text-centered">' +
|
('<div class="column has-text-centered">' +
|
||||||
(fee.taxPercentage
|
(fee.taxPercentage
|
||||||
|
|
@ -167,10 +158,7 @@ declare const bulmaJS: BulmaJS;
|
||||||
"</div>" +
|
"</div>" +
|
||||||
"</div>") +
|
"</div>") +
|
||||||
('<div class="column is-narrow">' +
|
('<div class="column is-narrow">' +
|
||||||
los.getMoveUpDownButtonFieldHTML(
|
los.getMoveUpDownButtonFieldHTML("button--moveFeeUp", "button--moveFeeDown") +
|
||||||
"button--moveFeeUp",
|
|
||||||
"button--moveFeeDown"
|
|
||||||
) +
|
|
||||||
"</div>" +
|
"</div>" +
|
||||||
"</div>") +
|
"</div>") +
|
||||||
"</div>";
|
"</div>";
|
||||||
|
|
@ -198,15 +186,11 @@ declare const bulmaJS: BulmaJS;
|
||||||
.addEventListener("click", openAddFee);
|
.addEventListener("click", openAddFee);
|
||||||
|
|
||||||
(
|
(
|
||||||
feeCategoryContainerElement.querySelector(
|
feeCategoryContainerElement.querySelector(".button--moveFeeCategoryUp") as HTMLButtonElement
|
||||||
".button--moveFeeCategoryUp"
|
|
||||||
) as HTMLButtonElement
|
|
||||||
).addEventListener("click", moveFeeCategory);
|
).addEventListener("click", moveFeeCategory);
|
||||||
|
|
||||||
(
|
(
|
||||||
feeCategoryContainerElement.querySelector(
|
feeCategoryContainerElement.querySelector(".button--moveFeeCategoryDown") as HTMLButtonElement
|
||||||
".button--moveFeeCategoryDown"
|
|
||||||
) as HTMLButtonElement
|
|
||||||
).addEventListener("click", moveFeeCategory);
|
).addEventListener("click", moveFeeCategory);
|
||||||
|
|
||||||
feeCategoriesContainerElement.append(feeCategoryContainerElement);
|
feeCategoriesContainerElement.append(feeCategoryContainerElement);
|
||||||
|
|
@ -247,28 +231,24 @@ declare const bulmaJS: BulmaJS;
|
||||||
};
|
};
|
||||||
|
|
||||||
cityssm.openHtmlModal("adminFees-addFeeCategory", {
|
cityssm.openHtmlModal("adminFees-addFeeCategory", {
|
||||||
onshown: (modalElement, closeModalFunction) => {
|
onshown(modalElement, closeModalFunction) {
|
||||||
bulmaJS.toggleHtmlClipped();
|
bulmaJS.toggleHtmlClipped();
|
||||||
(
|
(modalElement.querySelector("#feeCategoryAdd--feeCategory") as HTMLInputElement).focus();
|
||||||
modalElement.querySelector("#feeCategoryAdd--feeCategory") as HTMLInputElement
|
|
||||||
).focus();
|
|
||||||
|
|
||||||
addCloseModalFunction = closeModalFunction;
|
addCloseModalFunction = closeModalFunction;
|
||||||
modalElement.querySelector("form")!.addEventListener("submit", doAddFeeCategory);
|
modalElement.querySelector("form")!.addEventListener("submit", doAddFeeCategory);
|
||||||
},
|
},
|
||||||
onremoved: () => {
|
onremoved() {
|
||||||
bulmaJS.toggleHtmlClipped();
|
bulmaJS.toggleHtmlClipped();
|
||||||
|
(document.querySelector("#button--addFeeCategory") as HTMLButtonElement).focus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function openEditFeeCategory(clickEvent: Event): void {
|
function openEditFeeCategory(clickEvent: Event): void {
|
||||||
const feeCategoryId = Number.parseInt(
|
const feeCategoryId = Number.parseInt(
|
||||||
(
|
((clickEvent.currentTarget as HTMLElement).closest(".container--feeCategory") as HTMLElement)
|
||||||
(clickEvent.currentTarget as HTMLElement).closest(
|
.dataset.feeCategoryId!,
|
||||||
".container--feeCategory"
|
|
||||||
) as HTMLElement
|
|
||||||
).dataset.feeCategoryId!,
|
|
||||||
10
|
10
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -306,14 +286,10 @@ declare const bulmaJS: BulmaJS;
|
||||||
|
|
||||||
cityssm.openHtmlModal("adminFees-editFeeCategory", {
|
cityssm.openHtmlModal("adminFees-editFeeCategory", {
|
||||||
onshow(modalElement) {
|
onshow(modalElement) {
|
||||||
(
|
(modalElement.querySelector("#feeCategoryEdit--feeCategoryId") as HTMLInputElement).value =
|
||||||
modalElement.querySelector(
|
feeCategory.feeCategoryId!.toString();
|
||||||
"#feeCategoryEdit--feeCategoryId"
|
(modalElement.querySelector("#feeCategoryEdit--feeCategory") as HTMLInputElement).value =
|
||||||
) as HTMLInputElement
|
feeCategory.feeCategory!;
|
||||||
).value = feeCategory.feeCategoryId!.toString();
|
|
||||||
(
|
|
||||||
modalElement.querySelector("#feeCategoryEdit--feeCategory") as HTMLInputElement
|
|
||||||
).value = feeCategory.feeCategory!;
|
|
||||||
},
|
},
|
||||||
onshown(modalElement, closeModalFunction) {
|
onshown(modalElement, closeModalFunction) {
|
||||||
bulmaJS.toggleHtmlClipped();
|
bulmaJS.toggleHtmlClipped();
|
||||||
|
|
@ -322,9 +298,7 @@ declare const bulmaJS: BulmaJS;
|
||||||
|
|
||||||
modalElement.querySelector("form")!.addEventListener("submit", doUpdateFeeCategory);
|
modalElement.querySelector("form")!.addEventListener("submit", doUpdateFeeCategory);
|
||||||
|
|
||||||
(
|
(modalElement.querySelector("#feeCategoryEdit--feeCategory") as HTMLInputElement).focus();
|
||||||
modalElement.querySelector("#feeCategoryEdit--feeCategory") as HTMLInputElement
|
|
||||||
).focus();
|
|
||||||
},
|
},
|
||||||
onremoved: () => {
|
onremoved: () => {
|
||||||
bulmaJS.toggleHtmlClipped();
|
bulmaJS.toggleHtmlClipped();
|
||||||
|
|
@ -334,11 +308,8 @@ declare const bulmaJS: BulmaJS;
|
||||||
|
|
||||||
function confirmDeleteFeeCategory(clickEvent: Event): void {
|
function confirmDeleteFeeCategory(clickEvent: Event): void {
|
||||||
const feeCategoryId = Number.parseInt(
|
const feeCategoryId = Number.parseInt(
|
||||||
(
|
((clickEvent.currentTarget as HTMLElement).closest(".container--feeCategory") as HTMLElement)
|
||||||
(clickEvent.currentTarget as HTMLElement).closest(
|
.dataset.feeCategoryId!,
|
||||||
".container--feeCategory"
|
|
||||||
) as HTMLElement
|
|
||||||
).dataset.feeCategoryId!,
|
|
||||||
10
|
10
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -381,18 +352,13 @@ declare const bulmaJS: BulmaJS;
|
||||||
function moveFeeCategory(clickEvent: MouseEvent): void {
|
function moveFeeCategory(clickEvent: MouseEvent): void {
|
||||||
const buttonElement = clickEvent.currentTarget as HTMLButtonElement;
|
const buttonElement = clickEvent.currentTarget as HTMLButtonElement;
|
||||||
|
|
||||||
const feeCategoryId = Number.parseInt(
|
const feeCategoryId = (buttonElement.closest(".container--feeCategory") as HTMLElement).dataset
|
||||||
(buttonElement.closest(".container--feeCategory") as HTMLElement).dataset
|
.feeCategoryId!;
|
||||||
.feeCategoryId!,
|
|
||||||
10
|
|
||||||
);
|
|
||||||
|
|
||||||
cityssm.postJSON(
|
cityssm.postJSON(
|
||||||
los.urlPrefix +
|
los.urlPrefix +
|
||||||
"/admin/" +
|
"/admin/" +
|
||||||
(buttonElement.dataset.direction === "up"
|
(buttonElement.dataset.direction === "up" ? "doMoveFeeCategoryUp" : "doMoveFeeCategoryDown"),
|
||||||
? "doMoveFeeCategoryUp"
|
|
||||||
: "doMoveFeeCategoryDown"),
|
|
||||||
{
|
{
|
||||||
feeCategoryId,
|
feeCategoryId,
|
||||||
moveToEnd: clickEvent.shiftKey ? "1" : "0"
|
moveToEnd: clickEvent.shiftKey ? "1" : "0"
|
||||||
|
|
@ -422,11 +388,8 @@ declare const bulmaJS: BulmaJS;
|
||||||
|
|
||||||
function openAddFee(clickEvent: Event): void {
|
function openAddFee(clickEvent: Event): void {
|
||||||
const feeCategoryId = Number.parseInt(
|
const feeCategoryId = Number.parseInt(
|
||||||
(
|
((clickEvent.currentTarget as HTMLElement).closest(".container--feeCategory") as HTMLElement)
|
||||||
(clickEvent.currentTarget as HTMLElement).closest(
|
.dataset.feeCategoryId!,
|
||||||
".container--feeCategory"
|
|
||||||
) as HTMLElement
|
|
||||||
).dataset.feeCategoryId!,
|
|
||||||
10
|
10
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -487,9 +450,7 @@ declare const bulmaJS: BulmaJS;
|
||||||
occupancyTypeElement.append(optionElement);
|
occupancyTypeElement.append(optionElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
const lotTypeElement = modalElement.querySelector(
|
const lotTypeElement = modalElement.querySelector("#feeAdd--lotTypeId") as HTMLSelectElement;
|
||||||
"#feeAdd--lotTypeId"
|
|
||||||
) as HTMLSelectElement;
|
|
||||||
|
|
||||||
for (const lotType of exports.lotTypes as recordTypes.LotType[]) {
|
for (const lotType of exports.lotTypes as recordTypes.LotType[]) {
|
||||||
const optionElement = document.createElement("option");
|
const optionElement = document.createElement("option");
|
||||||
|
|
@ -513,12 +474,13 @@ declare const bulmaJS: BulmaJS;
|
||||||
|
|
||||||
(modalElement.querySelector("#feeAdd--feeName") as HTMLInputElement).focus();
|
(modalElement.querySelector("#feeAdd--feeName") as HTMLInputElement).focus();
|
||||||
|
|
||||||
(
|
(modalElement.querySelector("#feeAdd--feeFunction") as HTMLInputElement).addEventListener(
|
||||||
modalElement.querySelector("#feeAdd--feeFunction") as HTMLInputElement
|
"change",
|
||||||
).addEventListener("change", () => {
|
() => {
|
||||||
const feeAmountElement = modalElement.querySelector(
|
const feeAmountElement = modalElement.querySelector(
|
||||||
"#feeAdd--feeAmount"
|
"#feeAdd--feeAmount"
|
||||||
) as HTMLInputElement;
|
) as HTMLInputElement;
|
||||||
|
|
||||||
const feeFunctionElement = modalElement.querySelector(
|
const feeFunctionElement = modalElement.querySelector(
|
||||||
"#feeAdd--feeFunction"
|
"#feeAdd--feeFunction"
|
||||||
) as HTMLSelectElement;
|
) as HTMLSelectElement;
|
||||||
|
|
@ -534,14 +496,14 @@ declare const bulmaJS: BulmaJS;
|
||||||
feeAmountElement.classList.remove("is-success");
|
feeAmountElement.classList.remove("is-success");
|
||||||
feeAmountElement.disabled = true;
|
feeAmountElement.disabled = true;
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
(
|
modalElement.querySelector("#feeAdd--taxPercentage")!.addEventListener("keyup", () => {
|
||||||
modalElement.querySelector("#feeAdd--taxPercentage") as HTMLInputElement
|
|
||||||
).addEventListener("keyup", () => {
|
|
||||||
const taxAmountElement = modalElement.querySelector(
|
const taxAmountElement = modalElement.querySelector(
|
||||||
"#feeAdd--taxAmount"
|
"#feeAdd--taxAmount"
|
||||||
) as HTMLInputElement;
|
) as HTMLInputElement;
|
||||||
|
|
||||||
const taxPercentageElement = modalElement.querySelector(
|
const taxPercentageElement = modalElement.querySelector(
|
||||||
"#feeAdd--taxPercentage"
|
"#feeAdd--taxPercentage"
|
||||||
) as HTMLInputElement;
|
) as HTMLInputElement;
|
||||||
|
|
@ -559,17 +521,10 @@ declare const bulmaJS: BulmaJS;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
(
|
modalElement.querySelector("#feeAdd--includeQuantity")!.addEventListener("change", () => {
|
||||||
modalElement.querySelector("#feeAdd--includeQuantity") as HTMLSelectElement
|
(modalElement.querySelector("#feeAdd--quantityUnit") as HTMLInputElement).disabled =
|
||||||
).addEventListener("change", () => {
|
(modalElement.querySelector("#feeAdd--includeQuantity") as HTMLSelectElement)
|
||||||
(
|
.value === "";
|
||||||
modalElement.querySelector("#feeAdd--quantityUnit") as HTMLInputElement
|
|
||||||
).disabled =
|
|
||||||
(
|
|
||||||
modalElement.querySelector(
|
|
||||||
"#feeAdd--includeQuantity"
|
|
||||||
) as HTMLSelectElement
|
|
||||||
).value === "";
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onremoved() {
|
onremoved() {
|
||||||
|
|
@ -587,8 +542,7 @@ declare const bulmaJS: BulmaJS;
|
||||||
|
|
||||||
const feeId = Number.parseInt(feeContainerElement.dataset.feeId!, 10);
|
const feeId = Number.parseInt(feeContainerElement.dataset.feeId!, 10);
|
||||||
const feeCategoryId = Number.parseInt(
|
const feeCategoryId = Number.parseInt(
|
||||||
(feeContainerElement.closest(".container--feeCategory") as HTMLElement).dataset
|
(feeContainerElement.closest(".container--feeCategory") as HTMLElement).dataset.feeCategoryId!
|
||||||
.feeCategoryId!
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const feeCategory = feeCategories.find((currentFeeCategory) => {
|
const feeCategory = feeCategories.find((currentFeeCategory) => {
|
||||||
|
|
@ -713,11 +667,12 @@ declare const bulmaJS: BulmaJS;
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleQuantityFields() {
|
function toggleQuantityFields() {
|
||||||
(
|
const includeQuanitityValue = (
|
||||||
editModalElement.querySelector("#feeEdit--quantityUnit") as HTMLInputElement
|
editModalElement.querySelector("#feeEdit--includeQuantity") as HTMLSelectElement
|
||||||
).disabled =
|
).value;
|
||||||
(editModalElement.querySelector("#feeEdit--includeQuantity") as HTMLSelectElement)
|
|
||||||
.value === "";
|
(editModalElement.querySelector("#feeEdit--quantityUnit") as HTMLInputElement).disabled =
|
||||||
|
includeQuanitityValue === "";
|
||||||
}
|
}
|
||||||
|
|
||||||
cityssm.openHtmlModal("adminFees-editFee", {
|
cityssm.openHtmlModal("adminFees-editFee", {
|
||||||
|
|
@ -743,11 +698,9 @@ declare const bulmaJS: BulmaJS;
|
||||||
feeCategoryElement.append(optionElement);
|
feeCategoryElement.append(optionElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
(modalElement.querySelector("#feeEdit--feeName") as HTMLInputElement).value =
|
(modalElement.querySelector("#feeEdit--feeName") as HTMLInputElement).value = fee.feeName!;
|
||||||
fee.feeName!;
|
(modalElement.querySelector("#feeEdit--feeDescription") as HTMLTextAreaElement).value =
|
||||||
(
|
fee.feeDescription!;
|
||||||
modalElement.querySelector("#feeEdit--feeDescription") as HTMLTextAreaElement
|
|
||||||
).value = fee.feeDescription!;
|
|
||||||
|
|
||||||
const occupancyTypeElement = modalElement.querySelector(
|
const occupancyTypeElement = modalElement.querySelector(
|
||||||
"#feeEdit--occupancyTypeId"
|
"#feeEdit--occupancyTypeId"
|
||||||
|
|
@ -765,9 +718,7 @@ declare const bulmaJS: BulmaJS;
|
||||||
occupancyTypeElement.append(optionElement);
|
occupancyTypeElement.append(optionElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
const lotTypeElement = modalElement.querySelector(
|
const lotTypeElement = modalElement.querySelector("#feeEdit--lotTypeId") as HTMLSelectElement;
|
||||||
"#feeEdit--lotTypeId"
|
|
||||||
) as HTMLSelectElement;
|
|
||||||
|
|
||||||
for (const lotType of exports.lotTypes as recordTypes.LotType[]) {
|
for (const lotType of exports.lotTypes as recordTypes.LotType[]) {
|
||||||
const optionElement = document.createElement("option");
|
const optionElement = document.createElement("option");
|
||||||
|
|
@ -781,16 +732,19 @@ declare const bulmaJS: BulmaJS;
|
||||||
lotTypeElement.append(optionElement);
|
lotTypeElement.append(optionElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
(modalElement.querySelector("#feeEdit--feeAmount") as HTMLInputElement).value =
|
(modalElement.querySelector("#feeEdit--feeAmount") as HTMLInputElement).value = fee.feeAmount
|
||||||
fee.feeAmount ? fee.feeAmount.toFixed(2) : "";
|
? fee.feeAmount.toFixed(2)
|
||||||
(
|
: "";
|
||||||
modalElement.querySelector("#feeEdit--feeFunction") as HTMLSelectElement
|
|
||||||
).addEventListener("change", toggleFeeFields);
|
modalElement
|
||||||
|
.querySelector("#feeEdit--feeFunction")!
|
||||||
|
.addEventListener("change", toggleFeeFields);
|
||||||
|
|
||||||
toggleFeeFields();
|
toggleFeeFields();
|
||||||
|
|
||||||
(modalElement.querySelector("#feeEdit--taxAmount") as HTMLInputElement).value =
|
(modalElement.querySelector("#feeEdit--taxAmount") as HTMLInputElement).value = fee.taxAmount
|
||||||
fee.taxAmount ? fee.taxAmount.toFixed(2) : "";
|
? fee.taxAmount.toFixed(2)
|
||||||
|
: "";
|
||||||
|
|
||||||
const taxPercentageElement = modalElement.querySelector(
|
const taxPercentageElement = modalElement.querySelector(
|
||||||
"#feeEdit--taxPercentage"
|
"#feeEdit--taxPercentage"
|
||||||
|
|
@ -816,9 +770,7 @@ declare const bulmaJS: BulmaJS;
|
||||||
toggleQuantityFields();
|
toggleQuantityFields();
|
||||||
|
|
||||||
if (fee.isRequired) {
|
if (fee.isRequired) {
|
||||||
(
|
(modalElement.querySelector("#feeEdit--isRequired") as HTMLSelectElement).value = "1";
|
||||||
modalElement.querySelector("#feeEdit--isRequired") as HTMLSelectElement
|
|
||||||
).value = "1";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
los.populateAliases(modalElement);
|
los.populateAliases(modalElement);
|
||||||
|
|
@ -832,9 +784,7 @@ declare const bulmaJS: BulmaJS;
|
||||||
|
|
||||||
bulmaJS.init(modalElement);
|
bulmaJS.init(modalElement);
|
||||||
|
|
||||||
modalElement
|
modalElement.querySelector(".button--deleteFee")!.addEventListener("click", confirmDeleteFee);
|
||||||
.querySelector(".button--deleteFee")!
|
|
||||||
.addEventListener("click", confirmDeleteFee);
|
|
||||||
},
|
},
|
||||||
onremoved: () => {
|
onremoved: () => {
|
||||||
bulmaJS.toggleHtmlClipped();
|
bulmaJS.toggleHtmlClipped();
|
||||||
|
|
@ -847,7 +797,7 @@ declare const bulmaJS: BulmaJS;
|
||||||
|
|
||||||
const feeContainerElement = buttonElement.closest(".container--fee") as HTMLElement;
|
const feeContainerElement = buttonElement.closest(".container--fee") as HTMLElement;
|
||||||
|
|
||||||
const feeId = Number.parseInt(feeContainerElement.dataset.feeId!, 10);
|
const feeId = feeContainerElement.dataset.feeId!;
|
||||||
|
|
||||||
cityssm.postJSON(
|
cityssm.postJSON(
|
||||||
los.urlPrefix +
|
los.urlPrefix +
|
||||||
|
|
|
||||||
|
|
@ -78,24 +78,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const lotFieldsContainerElement = document.querySelector("#container--lotFields");
|
const lotFieldsContainerElement = document.querySelector("#container--lotFields");
|
||||||
lotTypeIdElement.addEventListener("change", () => {
|
lotTypeIdElement.addEventListener("change", () => {
|
||||||
if (lotTypeIdElement.value === "") {
|
if (lotTypeIdElement.value === "") {
|
||||||
lotFieldsContainerElement.innerHTML =
|
lotFieldsContainerElement.innerHTML = `<div class="message is-info">
|
||||||
'<div class="message is-info">' +
|
<p class="message-body">Select the ${los.escapedAliases.lot} type to load the available fields.</p>
|
||||||
'<p class="message-body">Select the ' +
|
</div>`;
|
||||||
exports.aliases.lot.toLowerCase() +
|
|
||||||
" type to load the available fields.</p>" +
|
|
||||||
"</div>";
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
cityssm.postJSON(los.urlPrefix + "/lots/doGetLotTypeFields", {
|
cityssm.postJSON(los.urlPrefix + "/lots/doGetLotTypeFields", {
|
||||||
lotTypeId: lotTypeIdElement.value
|
lotTypeId: lotTypeIdElement.value
|
||||||
}, (responseJSON) => {
|
}, (responseJSON) => {
|
||||||
if (responseJSON.lotTypeFields.length === 0) {
|
if (responseJSON.lotTypeFields.length === 0) {
|
||||||
lotFieldsContainerElement.innerHTML =
|
lotFieldsContainerElement.innerHTML = `<div class="message is-info">
|
||||||
'<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 ' +
|
</div>`;
|
||||||
exports.aliases.lot.toLowerCase() +
|
|
||||||
" type.</p>" +
|
|
||||||
"</div>";
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
lotFieldsContainerElement.innerHTML = "";
|
lotFieldsContainerElement.innerHTML = "";
|
||||||
|
|
@ -106,11 +100,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const fieldId = "lot--" + fieldName;
|
const fieldId = "lot--" + fieldName;
|
||||||
const fieldElement = document.createElement("div");
|
const fieldElement = document.createElement("div");
|
||||||
fieldElement.className = "field";
|
fieldElement.className = "field";
|
||||||
fieldElement.innerHTML =
|
fieldElement.innerHTML = `<label class="label" for="${fieldId}"></label>
|
||||||
'<label class="label" for="' +
|
<div class="control"></div>`;
|
||||||
fieldId +
|
|
||||||
'"></label>' +
|
|
||||||
'<div class="control"></div>';
|
|
||||||
fieldElement.querySelector("label").textContent =
|
fieldElement.querySelector("label").textContent =
|
||||||
lotTypeField.lotTypeField;
|
lotTypeField.lotTypeField;
|
||||||
if (lotTypeField.lotTypeFieldValues === "") {
|
if (lotTypeField.lotTypeFieldValues === "") {
|
||||||
|
|
@ -128,14 +119,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
fieldElement.querySelector(".control").append(inputElement);
|
fieldElement.querySelector(".control").append(inputElement);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fieldElement.querySelector(".control").innerHTML =
|
fieldElement.querySelector(".control").innerHTML = `<div class="select is-fullwidth">
|
||||||
'<div class="select is-fullwidth"><select id="' +
|
<select id="${fieldId}" name="${fieldName}"><option value="">(Not Set)</option></select>
|
||||||
fieldId +
|
</div>`;
|
||||||
'" name="' +
|
|
||||||
fieldName +
|
|
||||||
'">' +
|
|
||||||
'<option value="">(Not Set)</option>' +
|
|
||||||
"</select></div>";
|
|
||||||
const selectElement = fieldElement.querySelector("select");
|
const selectElement = fieldElement.querySelector("select");
|
||||||
selectElement.required = lotTypeField.isRequired;
|
selectElement.required = lotTypeField.isRequired;
|
||||||
const optionValues = lotTypeField.lotTypeFieldValues.split("\n");
|
const optionValues = lotTypeField.lotTypeFieldValues.split("\n");
|
||||||
|
|
@ -148,9 +134,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
}
|
}
|
||||||
lotFieldsContainerElement.append(fieldElement);
|
lotFieldsContainerElement.append(fieldElement);
|
||||||
}
|
}
|
||||||
lotFieldsContainerElement.insertAdjacentHTML("beforeend", '<input name="lotTypeFieldIds" type="hidden" value="' +
|
lotFieldsContainerElement.insertAdjacentHTML("beforeend", `<input name="lotTypeFieldIds" type="hidden"
|
||||||
lotTypeFieldIds.slice(1) +
|
value="${lotTypeFieldIds.slice(1)}" />`);
|
||||||
'" />');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -160,10 +145,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
if (lotTypeIdElement.value !== originalLotTypeId) {
|
if (lotTypeIdElement.value !== originalLotTypeId) {
|
||||||
bulmaJS.confirm({
|
bulmaJS.confirm({
|
||||||
title: "Confirm Change",
|
title: "Confirm Change",
|
||||||
message: "Are you sure you want to change the " +
|
message: `Are you sure you want to change the ${los.escapedAliases.lot} type?\n
|
||||||
exports.aliases.lot.toLowerCase() +
|
This change affects the additional fields associated with this record.`,
|
||||||
" type?\n" +
|
|
||||||
"This change affects the additional fields associated with this record.",
|
|
||||||
contextualColorName: "warning",
|
contextualColorName: "warning",
|
||||||
okButton: {
|
okButton: {
|
||||||
text: "Yes, Keep the Change",
|
text: "Yes, Keep the Change",
|
||||||
|
|
@ -271,22 +254,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
function renderLotComments() {
|
function renderLotComments() {
|
||||||
const containerElement = document.querySelector("#container--lotComments");
|
const containerElement = document.querySelector("#container--lotComments");
|
||||||
if (lotComments.length === 0) {
|
if (lotComments.length === 0) {
|
||||||
containerElement.innerHTML =
|
containerElement.innerHTML = `<div class="message is-info">
|
||||||
'<div class="message is-info">' +
|
<p class="message-body">There are no comments to display.</p>
|
||||||
'<p class="message-body">There are no comments to display.</p>' +
|
</div>`;
|
||||||
"</div>";
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const tableElement = document.createElement("table");
|
const tableElement = document.createElement("table");
|
||||||
tableElement.className = "table is-fullwidth is-striped is-hoverable";
|
tableElement.className = "table is-fullwidth is-striped is-hoverable";
|
||||||
tableElement.innerHTML =
|
tableElement.innerHTML = `<thead><tr>
|
||||||
"<thead><tr>" +
|
<th>Commentor</th>
|
||||||
"<th>Commentor</th>" +
|
<th>Comment Date</th>
|
||||||
"<th>Comment Date</th>" +
|
<th>Comment</th>
|
||||||
"<th>Comment</th>" +
|
<th class="is-hidden-print"><span class="is-sr-only">Options</span></th>
|
||||||
'<th class="is-hidden-print"><span class="is-sr-only">Options</span></th>' +
|
</tr></thead>
|
||||||
"</tr></thead>" +
|
<tbody></tbody>`;
|
||||||
"<tbody></tbody>";
|
|
||||||
for (const lotComment of lotComments) {
|
for (const lotComment of lotComments) {
|
||||||
const tableRowElement = document.createElement("tr");
|
const tableRowElement = document.createElement("tr");
|
||||||
tableRowElement.dataset.lotCommentId = lotComment.lotCommentId.toString();
|
tableRowElement.dataset.lotCommentId = lotComment.lotCommentId.toString();
|
||||||
|
|
|
||||||
|
|
@ -113,12 +113,9 @@ declare const bulmaJS: BulmaJS;
|
||||||
|
|
||||||
lotTypeIdElement.addEventListener("change", () => {
|
lotTypeIdElement.addEventListener("change", () => {
|
||||||
if (lotTypeIdElement.value === "") {
|
if (lotTypeIdElement.value === "") {
|
||||||
lotFieldsContainerElement.innerHTML =
|
lotFieldsContainerElement.innerHTML = `<div class="message is-info">
|
||||||
'<div class="message is-info">' +
|
<p class="message-body">Select the ${los.escapedAliases.lot} type to load the available fields.</p>
|
||||||
'<p class="message-body">Select the ' +
|
</div>`;
|
||||||
exports.aliases.lot.toLowerCase() +
|
|
||||||
" type to load the available fields.</p>" +
|
|
||||||
"</div>";
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -130,12 +127,9 @@ declare const bulmaJS: BulmaJS;
|
||||||
},
|
},
|
||||||
(responseJSON: { lotTypeFields: recordTypes.LotTypeField[] }) => {
|
(responseJSON: { lotTypeFields: recordTypes.LotTypeField[] }) => {
|
||||||
if (responseJSON.lotTypeFields.length === 0) {
|
if (responseJSON.lotTypeFields.length === 0) {
|
||||||
lotFieldsContainerElement.innerHTML =
|
lotFieldsContainerElement.innerHTML = `<div class="message is-info">
|
||||||
'<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 ' +
|
</div>`;
|
||||||
exports.aliases.lot.toLowerCase() +
|
|
||||||
" type.</p>" +
|
|
||||||
"</div>";
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -153,11 +147,8 @@ declare const bulmaJS: BulmaJS;
|
||||||
|
|
||||||
const fieldElement = document.createElement("div");
|
const fieldElement = document.createElement("div");
|
||||||
fieldElement.className = "field";
|
fieldElement.className = "field";
|
||||||
fieldElement.innerHTML =
|
fieldElement.innerHTML = `<label class="label" for="${fieldId}"></label>
|
||||||
'<label class="label" for="' +
|
<div class="control"></div>`;
|
||||||
fieldId +
|
|
||||||
'"></label>' +
|
|
||||||
'<div class="control"></div>';
|
|
||||||
|
|
||||||
(fieldElement.querySelector("label") as HTMLLabelElement).textContent =
|
(fieldElement.querySelector("label") as HTMLLabelElement).textContent =
|
||||||
lotTypeField.lotTypeField as string;
|
lotTypeField.lotTypeField as string;
|
||||||
|
|
@ -181,18 +172,13 @@ declare const bulmaJS: BulmaJS;
|
||||||
inputElement.pattern = lotTypeField.pattern;
|
inputElement.pattern = lotTypeField.pattern;
|
||||||
}
|
}
|
||||||
|
|
||||||
(fieldElement.querySelector(".control") as HTMLElement).append(
|
fieldElement.querySelector(".control")!.append(inputElement);
|
||||||
inputElement
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
(fieldElement.querySelector(".control") as HTMLElement).innerHTML =
|
fieldElement.querySelector(
|
||||||
'<div class="select is-fullwidth"><select id="' +
|
".control"
|
||||||
fieldId +
|
)!.innerHTML = `<div class="select is-fullwidth">
|
||||||
'" name="' +
|
<select id="${fieldId}" name="${fieldName}"><option value="">(Not Set)</option></select>
|
||||||
fieldName +
|
</div>`;
|
||||||
'">' +
|
|
||||||
'<option value="">(Not Set)</option>' +
|
|
||||||
"</select></div>";
|
|
||||||
|
|
||||||
const selectElement = fieldElement.querySelector(
|
const selectElement = fieldElement.querySelector(
|
||||||
"select"
|
"select"
|
||||||
|
|
@ -217,9 +203,8 @@ declare const bulmaJS: BulmaJS;
|
||||||
|
|
||||||
lotFieldsContainerElement.insertAdjacentHTML(
|
lotFieldsContainerElement.insertAdjacentHTML(
|
||||||
"beforeend",
|
"beforeend",
|
||||||
'<input name="lotTypeFieldIds" type="hidden" value="' +
|
`<input name="lotTypeFieldIds" type="hidden"
|
||||||
lotTypeFieldIds.slice(1) +
|
value="${lotTypeFieldIds.slice(1)}" />`
|
||||||
'" />'
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
@ -231,11 +216,8 @@ declare const bulmaJS: BulmaJS;
|
||||||
if (lotTypeIdElement.value !== originalLotTypeId) {
|
if (lotTypeIdElement.value !== originalLotTypeId) {
|
||||||
bulmaJS.confirm({
|
bulmaJS.confirm({
|
||||||
title: "Confirm Change",
|
title: "Confirm Change",
|
||||||
message:
|
message: `Are you sure you want to change the ${los.escapedAliases.lot} type?\n
|
||||||
"Are you sure you want to change the " +
|
This change affects the additional fields associated with this record.`,
|
||||||
exports.aliases.lot.toLowerCase() +
|
|
||||||
" type?\n" +
|
|
||||||
"This change affects the additional fields associated with this record.",
|
|
||||||
contextualColorName: "warning",
|
contextualColorName: "warning",
|
||||||
okButton: {
|
okButton: {
|
||||||
text: "Yes, Keep the Change",
|
text: "Yes, Keep the Change",
|
||||||
|
|
@ -304,6 +286,7 @@ declare const bulmaJS: BulmaJS;
|
||||||
|
|
||||||
(modalElement.querySelector("#lotCommentEdit--lotId") as HTMLInputElement).value =
|
(modalElement.querySelector("#lotCommentEdit--lotId") as HTMLInputElement).value =
|
||||||
lotId;
|
lotId;
|
||||||
|
|
||||||
(
|
(
|
||||||
modalElement.querySelector("#lotCommentEdit--lotCommentId") as HTMLInputElement
|
modalElement.querySelector("#lotCommentEdit--lotCommentId") as HTMLInputElement
|
||||||
).value = lotCommentId.toString();
|
).value = lotCommentId.toString();
|
||||||
|
|
@ -336,6 +319,7 @@ declare const bulmaJS: BulmaJS;
|
||||||
|
|
||||||
los.initializeDatePickers(modalElement);
|
los.initializeDatePickers(modalElement);
|
||||||
// los.initializeTimePickers(modalElement);
|
// los.initializeTimePickers(modalElement);
|
||||||
|
|
||||||
(
|
(
|
||||||
modalElement.querySelector("#lotCommentEdit--lotComment") as HTMLTextAreaElement
|
modalElement.querySelector("#lotCommentEdit--lotComment") as HTMLTextAreaElement
|
||||||
).focus();
|
).focus();
|
||||||
|
|
@ -398,23 +382,21 @@ declare const bulmaJS: BulmaJS;
|
||||||
const containerElement = document.querySelector("#container--lotComments") as HTMLElement;
|
const containerElement = document.querySelector("#container--lotComments") as HTMLElement;
|
||||||
|
|
||||||
if (lotComments.length === 0) {
|
if (lotComments.length === 0) {
|
||||||
containerElement.innerHTML =
|
containerElement.innerHTML = `<div class="message is-info">
|
||||||
'<div class="message is-info">' +
|
<p class="message-body">There are no comments to display.</p>
|
||||||
'<p class="message-body">There are no comments to display.</p>' +
|
</div>`;
|
||||||
"</div>";
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const tableElement = document.createElement("table");
|
const tableElement = document.createElement("table");
|
||||||
tableElement.className = "table is-fullwidth is-striped is-hoverable";
|
tableElement.className = "table is-fullwidth is-striped is-hoverable";
|
||||||
tableElement.innerHTML =
|
tableElement.innerHTML = `<thead><tr>
|
||||||
"<thead><tr>" +
|
<th>Commentor</th>
|
||||||
"<th>Commentor</th>" +
|
<th>Comment Date</th>
|
||||||
"<th>Comment Date</th>" +
|
<th>Comment</th>
|
||||||
"<th>Comment</th>" +
|
<th class="is-hidden-print"><span class="is-sr-only">Options</span></th>
|
||||||
'<th class="is-hidden-print"><span class="is-sr-only">Options</span></th>' +
|
</tr></thead>
|
||||||
"</tr></thead>" +
|
<tbody></tbody>`;
|
||||||
"<tbody></tbody>";
|
|
||||||
|
|
||||||
for (const lotComment of lotComments) {
|
for (const lotComment of lotComments) {
|
||||||
const tableRowElement = document.createElement("tr");
|
const tableRowElement = document.createElement("tr");
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const limit = Number.parseInt(document.querySelector("#searchFilter--limit").value, 10);
|
const limit = Number.parseInt(document.querySelector("#searchFilter--limit").value, 10);
|
||||||
const offsetElement = document.querySelector("#searchFilter--offset");
|
const offsetElement = document.querySelector("#searchFilter--offset");
|
||||||
function renderLotOccupancies(responseJSON) {
|
function renderLotOccupancies(responseJSON) {
|
||||||
|
var _a, _b;
|
||||||
if (responseJSON.lotOccupancies.length === 0) {
|
if (responseJSON.lotOccupancies.length === 0) {
|
||||||
searchResultsContainerElement.innerHTML = `<div class="message is-info">
|
searchResultsContainerElement.innerHTML = `<div class="message is-info">
|
||||||
<p class="message-body">
|
<p class="message-body">
|
||||||
|
|
@ -23,34 +24,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
if (lotOccupancy.occupancyStartDateString <= nowDateString &&
|
if (lotOccupancy.occupancyStartDateString <= nowDateString &&
|
||||||
(lotOccupancy.occupancyEndDateString === "" ||
|
(lotOccupancy.occupancyEndDateString === "" ||
|
||||||
lotOccupancy.occupancyEndDateString >= nowDateString)) {
|
lotOccupancy.occupancyEndDateString >= nowDateString)) {
|
||||||
occupancyTimeHTML =
|
occupancyTimeHTML = `<span class="has-tooltip-right" data-tooltip="Current ${los.escapedAliases.Occupancy}">
|
||||||
'<span class="has-tooltip-right" data-tooltip="Current ' +
|
<i class="fas fa-play" aria-label="Current ${los.escapedAliases.Occupancy}"></i>
|
||||||
los.escapedAliases.Occupancy +
|
</span>`;
|
||||||
'">' +
|
|
||||||
('<i class="fas fa-play" aria-label="Current ' +
|
|
||||||
los.escapedAliases.Occupancy +
|
|
||||||
'"></i>') +
|
|
||||||
"</span>";
|
|
||||||
}
|
}
|
||||||
else if (lotOccupancy.occupancyStartDateString > nowDateString) {
|
else if (lotOccupancy.occupancyStartDateString > nowDateString) {
|
||||||
occupancyTimeHTML =
|
occupancyTimeHTML = `<span class="has-tooltip-right" data-tooltip="Future ${los.escapedAliases.Occupancy}">
|
||||||
'<span class="has-tooltip-right" data-tooltip="Future ' +
|
<i class="fas fa-fast-forward" aria-label="Future ${los.escapedAliases.Occupancy}"></i>
|
||||||
los.escapedAliases.Occupancy +
|
</span>`;
|
||||||
'">' +
|
|
||||||
('<i class="fas fa-fast-forward" aria-label="Future ' +
|
|
||||||
los.escapedAliases.Occupancy +
|
|
||||||
'"></i>') +
|
|
||||||
"</span>";
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
occupancyTimeHTML =
|
occupancyTimeHTML = `<span class="has-tooltip-right" data-tooltip="Past ${los.escapedAliases.Occupancy}">
|
||||||
'<span class="has-tooltip-right" data-tooltip="Past ' +
|
<i class="fas fa-stop" aria-label="Past ${los.escapedAliases.Occupancy}"></i>
|
||||||
los.escapedAliases.Occupancy +
|
</span>`;
|
||||||
'">' +
|
|
||||||
('<i class="fas fa-stop" aria-label="Past ' +
|
|
||||||
los.escapedAliases.Occupancy +
|
|
||||||
'"></i>') +
|
|
||||||
"</span>";
|
|
||||||
}
|
}
|
||||||
let occupantsHTML = "";
|
let occupantsHTML = "";
|
||||||
for (const occupant of lotOccupancy.lotOccupancyOccupants) {
|
for (const occupant of lotOccupancy.lotOccupancyOccupants) {
|
||||||
|
|
@ -86,9 +72,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
'">' +
|
'">' +
|
||||||
cityssm.escapeHTML(lotOccupancy.lotName) +
|
cityssm.escapeHTML(lotOccupancy.lotName) +
|
||||||
"</a>"
|
"</a>"
|
||||||
: '<span class="has-text-grey">(No ' +
|
: '<span class="has-text-grey">(No ' + los.escapedAliases.Lot + ")</span>") +
|
||||||
los.escapedAliases.Lot +
|
|
||||||
")</span>") +
|
|
||||||
"<br />" +
|
"<br />" +
|
||||||
('<span class="is-size-7">' +
|
('<span class="is-size-7">' +
|
||||||
cityssm.escapeHTML(lotOccupancy.mapName || "") +
|
cityssm.escapeHTML(lotOccupancy.mapName || "") +
|
||||||
|
|
@ -129,16 +113,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
<table>`;
|
<table>`;
|
||||||
searchResultsContainerElement.querySelector("table").append(resultsTbodyElement);
|
searchResultsContainerElement.querySelector("table").append(resultsTbodyElement);
|
||||||
searchResultsContainerElement.insertAdjacentHTML("beforeend", los.getSearchResultsPagerHTML(limit, responseJSON.offset, responseJSON.count));
|
searchResultsContainerElement.insertAdjacentHTML("beforeend", los.getSearchResultsPagerHTML(limit, responseJSON.offset, responseJSON.count));
|
||||||
if (responseJSON.offset > 0) {
|
(_a = searchResultsContainerElement
|
||||||
searchResultsContainerElement
|
.querySelector("button[data-page='previous']")) === null || _a === void 0 ? void 0 : _a.addEventListener("click", previousAndGetLotOccupancies);
|
||||||
.querySelector("button[data-page='previous']")
|
(_b = searchResultsContainerElement
|
||||||
.addEventListener("click", previousAndGetLotOccupancies);
|
.querySelector("button[data-page='next']")) === null || _b === void 0 ? void 0 : _b.addEventListener("click", nextAndGetLotOccupancies);
|
||||||
}
|
|
||||||
if (limit + responseJSON.offset < responseJSON.count) {
|
|
||||||
searchResultsContainerElement
|
|
||||||
.querySelector("button[data-page='next']")
|
|
||||||
.addEventListener("click", nextAndGetLotOccupancies);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
function getLotOccupancies() {
|
function getLotOccupancies() {
|
||||||
searchResultsContainerElement.innerHTML = los.getLoadingParagraphHTML(`Loading ${exports.aliases.occupancies}...`);
|
searchResultsContainerElement.innerHTML = los.getLoadingParagraphHTML(`Loading ${exports.aliases.occupancies}...`);
|
||||||
|
|
|
||||||
|
|
@ -10,18 +10,15 @@ declare const cityssm: cityssmGlobal;
|
||||||
(() => {
|
(() => {
|
||||||
const los = exports.los as globalTypes.LOS;
|
const los = exports.los as globalTypes.LOS;
|
||||||
|
|
||||||
const searchFilterFormElement = document.querySelector(
|
const searchFilterFormElement = document.querySelector("#form--searchFilters") as HTMLFormElement;
|
||||||
"#form--searchFilters"
|
|
||||||
) as HTMLFormElement;
|
|
||||||
|
|
||||||
const searchResultsContainerElement = document.querySelector(
|
const searchResultsContainerElement = document.querySelector("#container--searchResults") as HTMLElement;
|
||||||
"#container--searchResults"
|
|
||||||
) as HTMLElement;
|
|
||||||
|
|
||||||
const limit = Number.parseInt(
|
const limit = Number.parseInt(
|
||||||
(document.querySelector("#searchFilter--limit") as HTMLInputElement).value,
|
(document.querySelector("#searchFilter--limit") as HTMLInputElement).value,
|
||||||
10
|
10
|
||||||
);
|
);
|
||||||
|
|
||||||
const offsetElement = document.querySelector("#searchFilter--offset") as HTMLInputElement;
|
const offsetElement = document.querySelector("#searchFilter--offset") as HTMLInputElement;
|
||||||
|
|
||||||
function renderLotOccupancies(responseJSON: {
|
function renderLotOccupancies(responseJSON: {
|
||||||
|
|
@ -51,32 +48,17 @@ declare const cityssm: cityssmGlobal;
|
||||||
(lotOccupancy.occupancyEndDateString === "" ||
|
(lotOccupancy.occupancyEndDateString === "" ||
|
||||||
lotOccupancy.occupancyEndDateString! >= nowDateString)
|
lotOccupancy.occupancyEndDateString! >= nowDateString)
|
||||||
) {
|
) {
|
||||||
occupancyTimeHTML =
|
occupancyTimeHTML = `<span class="has-tooltip-right" data-tooltip="Current ${los.escapedAliases.Occupancy}">
|
||||||
'<span class="has-tooltip-right" data-tooltip="Current ' +
|
<i class="fas fa-play" aria-label="Current ${los.escapedAliases.Occupancy}"></i>
|
||||||
los.escapedAliases.Occupancy +
|
</span>`;
|
||||||
'">' +
|
|
||||||
('<i class="fas fa-play" aria-label="Current ' +
|
|
||||||
los.escapedAliases.Occupancy +
|
|
||||||
'"></i>') +
|
|
||||||
"</span>";
|
|
||||||
} else if (lotOccupancy.occupancyStartDateString! > nowDateString) {
|
} else if (lotOccupancy.occupancyStartDateString! > nowDateString) {
|
||||||
occupancyTimeHTML =
|
occupancyTimeHTML = `<span class="has-tooltip-right" data-tooltip="Future ${los.escapedAliases.Occupancy}">
|
||||||
'<span class="has-tooltip-right" data-tooltip="Future ' +
|
<i class="fas fa-fast-forward" aria-label="Future ${los.escapedAliases.Occupancy}"></i>
|
||||||
los.escapedAliases.Occupancy +
|
</span>`;
|
||||||
'">' +
|
|
||||||
('<i class="fas fa-fast-forward" aria-label="Future ' +
|
|
||||||
los.escapedAliases.Occupancy +
|
|
||||||
'"></i>') +
|
|
||||||
"</span>";
|
|
||||||
} else {
|
} else {
|
||||||
occupancyTimeHTML =
|
occupancyTimeHTML = `<span class="has-tooltip-right" data-tooltip="Past ${los.escapedAliases.Occupancy}">
|
||||||
'<span class="has-tooltip-right" data-tooltip="Past ' +
|
<i class="fas fa-stop" aria-label="Past ${los.escapedAliases.Occupancy}"></i>
|
||||||
los.escapedAliases.Occupancy +
|
</span>`;
|
||||||
'">' +
|
|
||||||
('<i class="fas fa-stop" aria-label="Past ' +
|
|
||||||
los.escapedAliases.Occupancy +
|
|
||||||
'"></i>') +
|
|
||||||
"</span>";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let occupantsHTML = "";
|
let occupantsHTML = "";
|
||||||
|
|
@ -117,9 +99,7 @@ declare const cityssm: cityssmGlobal;
|
||||||
'">' +
|
'">' +
|
||||||
cityssm.escapeHTML(lotOccupancy.lotName) +
|
cityssm.escapeHTML(lotOccupancy.lotName) +
|
||||||
"</a>"
|
"</a>"
|
||||||
: '<span class="has-text-grey">(No ' +
|
: '<span class="has-text-grey">(No ' + los.escapedAliases.Lot + ")</span>") +
|
||||||
los.escapedAliases.Lot +
|
|
||||||
")</span>") +
|
|
||||||
"<br />" +
|
"<br />" +
|
||||||
('<span class="is-size-7">' +
|
('<span class="is-size-7">' +
|
||||||
cityssm.escapeHTML(lotOccupancy.mapName || "") +
|
cityssm.escapeHTML(lotOccupancy.mapName || "") +
|
||||||
|
|
@ -168,17 +148,13 @@ declare const cityssm: cityssmGlobal;
|
||||||
los.getSearchResultsPagerHTML(limit, responseJSON.offset, responseJSON.count)
|
los.getSearchResultsPagerHTML(limit, responseJSON.offset, responseJSON.count)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (responseJSON.offset > 0) {
|
|
||||||
searchResultsContainerElement
|
searchResultsContainerElement
|
||||||
.querySelector("button[data-page='previous']")!
|
.querySelector("button[data-page='previous']")
|
||||||
.addEventListener("click", previousAndGetLotOccupancies);
|
?.addEventListener("click", previousAndGetLotOccupancies);
|
||||||
}
|
|
||||||
|
|
||||||
if (limit + responseJSON.offset < responseJSON.count) {
|
|
||||||
searchResultsContainerElement
|
searchResultsContainerElement
|
||||||
.querySelector("button[data-page='next']")!
|
.querySelector("button[data-page='next']")
|
||||||
.addEventListener("click", nextAndGetLotOccupancies);
|
?.addEventListener("click", nextAndGetLotOccupancies);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getLotOccupancies() {
|
function getLotOccupancies() {
|
||||||
|
|
@ -199,10 +175,7 @@ declare const cityssm: cityssmGlobal;
|
||||||
}
|
}
|
||||||
|
|
||||||
function previousAndGetLotOccupancies() {
|
function previousAndGetLotOccupancies() {
|
||||||
offsetElement.value = Math.max(
|
offsetElement.value = Math.max(Number.parseInt(offsetElement.value, 10) - limit, 0).toString();
|
||||||
Number.parseInt(offsetElement.value, 10) - limit,
|
|
||||||
0
|
|
||||||
).toString();
|
|
||||||
getLotOccupancies();
|
getLotOccupancies();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const limit = Number.parseInt(document.querySelector("#searchFilter--limit").value, 10);
|
const limit = Number.parseInt(document.querySelector("#searchFilter--limit").value, 10);
|
||||||
const offsetElement = document.querySelector("#searchFilter--offset");
|
const offsetElement = document.querySelector("#searchFilter--offset");
|
||||||
function renderLots(responseJSON) {
|
function renderLots(responseJSON) {
|
||||||
|
var _a, _b;
|
||||||
if (responseJSON.lots.length === 0) {
|
if (responseJSON.lots.length === 0) {
|
||||||
searchResultsContainerElement.innerHTML =
|
searchResultsContainerElement.innerHTML =
|
||||||
'<div class="message is-info">' +
|
'<div class="message is-info">' +
|
||||||
|
|
@ -62,16 +63,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
<table>`;
|
<table>`;
|
||||||
searchResultsContainerElement.insertAdjacentHTML("beforeend", los.getSearchResultsPagerHTML(limit, responseJSON.offset, responseJSON.count));
|
searchResultsContainerElement.insertAdjacentHTML("beforeend", los.getSearchResultsPagerHTML(limit, responseJSON.offset, responseJSON.count));
|
||||||
searchResultsContainerElement.querySelector("table").append(resultsTbodyElement);
|
searchResultsContainerElement.querySelector("table").append(resultsTbodyElement);
|
||||||
if (responseJSON.offset > 0) {
|
(_a = searchResultsContainerElement
|
||||||
searchResultsContainerElement
|
.querySelector("button[data-page='previous']")) === null || _a === void 0 ? void 0 : _a.addEventListener("click", previousAndGetLots);
|
||||||
.querySelector("button[data-page='previous']")
|
(_b = searchResultsContainerElement
|
||||||
.addEventListener("click", previousAndGetLots);
|
.querySelector("button[data-page='next']")) === null || _b === void 0 ? void 0 : _b.addEventListener("click", nextAndGetLots);
|
||||||
}
|
|
||||||
if (limit + responseJSON.offset < responseJSON.count) {
|
|
||||||
searchResultsContainerElement
|
|
||||||
.querySelector("button[data-page='next']")
|
|
||||||
.addEventListener("click", nextAndGetLots);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
function getLots() {
|
function getLots() {
|
||||||
searchResultsContainerElement.innerHTML = los.getLoadingParagraphHTML(`Loading ${los.escapedAliases.Lots}...`);
|
searchResultsContainerElement.innerHTML = los.getLoadingParagraphHTML(`Loading ${los.escapedAliases.Lots}...`);
|
||||||
|
|
|
||||||
|
|
@ -10,13 +10,9 @@ declare const cityssm: cityssmGlobal;
|
||||||
(() => {
|
(() => {
|
||||||
const los = exports.los as globalTypes.LOS;
|
const los = exports.los as globalTypes.LOS;
|
||||||
|
|
||||||
const searchFilterFormElement = document.querySelector(
|
const searchFilterFormElement = document.querySelector("#form--searchFilters") as HTMLFormElement;
|
||||||
"#form--searchFilters"
|
|
||||||
) as HTMLFormElement;
|
|
||||||
|
|
||||||
const searchResultsContainerElement = document.querySelector(
|
const searchResultsContainerElement = document.querySelector("#container--searchResults") as HTMLElement;
|
||||||
"#container--searchResults"
|
|
||||||
) as HTMLElement;
|
|
||||||
|
|
||||||
const limit = Number.parseInt(
|
const limit = Number.parseInt(
|
||||||
(document.querySelector("#searchFilter--limit") as HTMLInputElement).value,
|
(document.querySelector("#searchFilter--limit") as HTMLInputElement).value,
|
||||||
|
|
@ -24,11 +20,7 @@ declare const cityssm: cityssmGlobal;
|
||||||
);
|
);
|
||||||
const offsetElement = document.querySelector("#searchFilter--offset") as HTMLInputElement;
|
const offsetElement = document.querySelector("#searchFilter--offset") as HTMLInputElement;
|
||||||
|
|
||||||
function renderLots(responseJSON: {
|
function renderLots(responseJSON: { count: number; offset: number; lots: recordTypes.Lot[] }): void {
|
||||||
count: number;
|
|
||||||
offset: number;
|
|
||||||
lots: recordTypes.Lot[];
|
|
||||||
}): void {
|
|
||||||
if (responseJSON.lots.length === 0) {
|
if (responseJSON.lots.length === 0) {
|
||||||
searchResultsContainerElement.innerHTML =
|
searchResultsContainerElement.innerHTML =
|
||||||
'<div class="message is-info">' +
|
'<div class="message is-info">' +
|
||||||
|
|
@ -96,17 +88,13 @@ declare const cityssm: cityssmGlobal;
|
||||||
|
|
||||||
searchResultsContainerElement.querySelector("table")!.append(resultsTbodyElement);
|
searchResultsContainerElement.querySelector("table")!.append(resultsTbodyElement);
|
||||||
|
|
||||||
if (responseJSON.offset > 0) {
|
|
||||||
searchResultsContainerElement
|
searchResultsContainerElement
|
||||||
.querySelector("button[data-page='previous']")!
|
.querySelector("button[data-page='previous']")
|
||||||
.addEventListener("click", previousAndGetLots);
|
?.addEventListener("click", previousAndGetLots);
|
||||||
}
|
|
||||||
|
|
||||||
if (limit + responseJSON.offset < responseJSON.count) {
|
|
||||||
searchResultsContainerElement
|
searchResultsContainerElement
|
||||||
.querySelector("button[data-page='next']")!
|
.querySelector("button[data-page='next']")
|
||||||
.addEventListener("click", nextAndGetLots);
|
?.addEventListener("click", nextAndGetLots);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getLots(): void {
|
function getLots(): void {
|
||||||
|
|
@ -123,10 +111,7 @@ declare const cityssm: cityssmGlobal;
|
||||||
}
|
}
|
||||||
|
|
||||||
function previousAndGetLots(): void {
|
function previousAndGetLots(): void {
|
||||||
offsetElement.value = Math.max(
|
offsetElement.value = Math.max(Number.parseInt(offsetElement.value, 10) - limit, 0).toString();
|
||||||
Number.parseInt(offsetElement.value, 10) - limit,
|
|
||||||
0
|
|
||||||
).toString();
|
|
||||||
getLots();
|
getLots();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const limit = Number.parseInt(document.querySelector("#searchFilter--limit").value, 10);
|
const limit = Number.parseInt(document.querySelector("#searchFilter--limit").value, 10);
|
||||||
const offsetElement = document.querySelector("#searchFilter--offset");
|
const offsetElement = document.querySelector("#searchFilter--offset");
|
||||||
function renderWorkOrders(responseJSON) {
|
function renderWorkOrders(responseJSON) {
|
||||||
|
var _a, _b;
|
||||||
if (responseJSON.workOrders.length === 0) {
|
if (responseJSON.workOrders.length === 0) {
|
||||||
searchResultsContainerElement.innerHTML =
|
searchResultsContainerElement.innerHTML =
|
||||||
'<div class="message is-info">' +
|
'<div class="message is-info">' +
|
||||||
|
|
@ -65,9 +66,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
cityssm.escapeHTML(workOrder.workOrderDescription || "") +
|
cityssm.escapeHTML(workOrder.workOrderDescription || "") +
|
||||||
"</span>" +
|
"</span>" +
|
||||||
"</td>") +
|
"</td>") +
|
||||||
('<td class="is-nowrap"><span class="is-size-7">' +
|
('<td class="is-nowrap"><span class="is-size-7">' + relatedHTML + "</span></td>") +
|
||||||
relatedHTML +
|
|
||||||
"</span></td>") +
|
|
||||||
('<td class="is-nowrap">' +
|
('<td class="is-nowrap">' +
|
||||||
('<span class="has-tooltip-left" data-tooltip="' +
|
('<span class="has-tooltip-left" data-tooltip="' +
|
||||||
los.escapedAliases.WorkOrderOpenDate +
|
los.escapedAliases.WorkOrderOpenDate +
|
||||||
|
|
@ -125,20 +124,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
"<table>";
|
"<table>";
|
||||||
searchResultsContainerElement.insertAdjacentHTML("beforeend", los.getSearchResultsPagerHTML(limit, responseJSON.offset, responseJSON.count));
|
searchResultsContainerElement.insertAdjacentHTML("beforeend", los.getSearchResultsPagerHTML(limit, responseJSON.offset, responseJSON.count));
|
||||||
searchResultsContainerElement.querySelector("table").append(resultsTbodyElement);
|
searchResultsContainerElement.querySelector("table").append(resultsTbodyElement);
|
||||||
if (responseJSON.offset > 0) {
|
(_a = searchResultsContainerElement
|
||||||
searchResultsContainerElement
|
.querySelector("button[data-page='previous']")) === null || _a === void 0 ? void 0 : _a.addEventListener("click", previousAndGetWorkOrders);
|
||||||
.querySelector("button[data-page='previous']")
|
(_b = searchResultsContainerElement
|
||||||
.addEventListener("click", previousAndGetWorkOrders);
|
.querySelector("button[data-page='next']")) === null || _b === void 0 ? void 0 : _b.addEventListener("click", nextAndGetWorkOrders);
|
||||||
}
|
|
||||||
if (limit + responseJSON.offset < responseJSON.count) {
|
|
||||||
searchResultsContainerElement
|
|
||||||
.querySelector("button[data-page='next']")
|
|
||||||
.addEventListener("click", nextAndGetWorkOrders);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
function getWorkOrders() {
|
function getWorkOrders() {
|
||||||
searchResultsContainerElement.innerHTML =
|
searchResultsContainerElement.innerHTML = los.getLoadingParagraphHTML("Loading Work Orders...");
|
||||||
los.getLoadingParagraphHTML("Loading Work Orders...");
|
|
||||||
cityssm.postJSON(los.urlPrefix + "/workOrders/doSearchWorkOrders", searchFilterFormElement, renderWorkOrders);
|
cityssm.postJSON(los.urlPrefix + "/workOrders/doSearchWorkOrders", searchFilterFormElement, renderWorkOrders);
|
||||||
}
|
}
|
||||||
function resetOffsetAndGetWorkOrders() {
|
function resetOffsetAndGetWorkOrders() {
|
||||||
|
|
|
||||||
|
|
@ -11,15 +11,11 @@ declare const cityssm: cityssmGlobal;
|
||||||
|
|
||||||
const workOrderPrints: string[] = exports.workOrderPrints;
|
const workOrderPrints: string[] = exports.workOrderPrints;
|
||||||
|
|
||||||
const searchFilterFormElement = document.querySelector(
|
const searchFilterFormElement = document.querySelector("#form--searchFilters") as HTMLFormElement;
|
||||||
"#form--searchFilters"
|
|
||||||
) as HTMLFormElement;
|
|
||||||
|
|
||||||
los.initializeDatePickers(searchFilterFormElement);
|
los.initializeDatePickers(searchFilterFormElement);
|
||||||
|
|
||||||
const searchResultsContainerElement = document.querySelector(
|
const searchResultsContainerElement = document.querySelector("#container--searchResults") as HTMLElement;
|
||||||
"#container--searchResults"
|
|
||||||
) as HTMLElement;
|
|
||||||
|
|
||||||
const limit = Number.parseInt(
|
const limit = Number.parseInt(
|
||||||
(document.querySelector("#searchFilter--limit") as HTMLInputElement).value,
|
(document.querySelector("#searchFilter--limit") as HTMLInputElement).value,
|
||||||
|
|
@ -96,9 +92,7 @@ declare const cityssm: cityssmGlobal;
|
||||||
cityssm.escapeHTML(workOrder.workOrderDescription || "") +
|
cityssm.escapeHTML(workOrder.workOrderDescription || "") +
|
||||||
"</span>" +
|
"</span>" +
|
||||||
"</td>") +
|
"</td>") +
|
||||||
('<td class="is-nowrap"><span class="is-size-7">' +
|
('<td class="is-nowrap"><span class="is-size-7">' + relatedHTML + "</span></td>") +
|
||||||
relatedHTML +
|
|
||||||
"</span></td>") +
|
|
||||||
('<td class="is-nowrap">' +
|
('<td class="is-nowrap">' +
|
||||||
('<span class="has-tooltip-left" data-tooltip="' +
|
('<span class="has-tooltip-left" data-tooltip="' +
|
||||||
los.escapedAliases.WorkOrderOpenDate +
|
los.escapedAliases.WorkOrderOpenDate +
|
||||||
|
|
@ -164,22 +158,17 @@ declare const cityssm: cityssmGlobal;
|
||||||
|
|
||||||
searchResultsContainerElement.querySelector("table")!.append(resultsTbodyElement);
|
searchResultsContainerElement.querySelector("table")!.append(resultsTbodyElement);
|
||||||
|
|
||||||
if (responseJSON.offset > 0) {
|
|
||||||
searchResultsContainerElement
|
searchResultsContainerElement
|
||||||
.querySelector("button[data-page='previous']")!
|
.querySelector("button[data-page='previous']")
|
||||||
.addEventListener("click", previousAndGetWorkOrders);
|
?.addEventListener("click", previousAndGetWorkOrders);
|
||||||
}
|
|
||||||
|
|
||||||
if (limit + responseJSON.offset < responseJSON.count) {
|
|
||||||
searchResultsContainerElement
|
searchResultsContainerElement
|
||||||
.querySelector("button[data-page='next']")!
|
.querySelector("button[data-page='next']")
|
||||||
.addEventListener("click", nextAndGetWorkOrders);
|
?.addEventListener("click", nextAndGetWorkOrders);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWorkOrders() {
|
function getWorkOrders() {
|
||||||
searchResultsContainerElement.innerHTML =
|
searchResultsContainerElement.innerHTML = los.getLoadingParagraphHTML("Loading Work Orders...");
|
||||||
los.getLoadingParagraphHTML("Loading Work Orders...");
|
|
||||||
|
|
||||||
cityssm.postJSON(
|
cityssm.postJSON(
|
||||||
los.urlPrefix + "/workOrders/doSearchWorkOrders",
|
los.urlPrefix + "/workOrders/doSearchWorkOrders",
|
||||||
|
|
@ -194,10 +183,7 @@ declare const cityssm: cityssmGlobal;
|
||||||
}
|
}
|
||||||
|
|
||||||
function previousAndGetWorkOrders() {
|
function previousAndGetWorkOrders() {
|
||||||
offsetElement.value = Math.max(
|
offsetElement.value = Math.max(Number.parseInt(offsetElement.value, 10) - limit, 0).toString();
|
||||||
Number.parseInt(offsetElement.value, 10) - limit,
|
|
||||||
0
|
|
||||||
).toString();
|
|
||||||
getWorkOrders();
|
getWorkOrders();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,a=()=>{cityssm.postJSON(e.urlPrefix+"/admin/doCleanupDatabase",{},e=>{e.success?bulmaJS.alert({title:"Database Cleaned Up Successfully",message:e.inactivedRecordCount+" records inactivated, "+e.purgedRecordCount+" permanently deleted.",contextualColorName:"success"}):bulmaJS.alert({title:"Error Cleaning Database",message:e.errorMessage||"",contextualColorName:"danger"})})};document.querySelector("#button--cleanupDatabase").addEventListener("click",()=>{bulmaJS.confirm({title:"Cleanup Database",message:"Are you sure you want to cleanup up the database?",okButton:{text:"Yes, Cleanup Database",callbackFunction:a}})})})();
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,a=()=>{cityssm.postJSON(e.urlPrefix+"/admin/doCleanupDatabase",{},e=>{e.success?bulmaJS.alert({title:"Database Cleaned Up Successfully",message:`${e.inactivedRecordCount} records inactivated,\n ${e.purgedRecordCount} permanently deleted.`,contextualColorName:"success"}):bulmaJS.alert({title:"Error Cleaning Database",message:e.errorMessage||"",contextualColorName:"danger"})})};document.querySelector("#button--cleanupDatabase").addEventListener("click",()=>{bulmaJS.confirm({title:"Cleanup Database",message:"Are you sure you want to cleanup up the database?",okButton:{text:"Yes, Cleanup Database",callbackFunction:a}})})})();
|
||||||
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 t=exports.los,e=document.querySelector("#form--searchFilters"),a=document.querySelector("#container--searchResults"),s=Number.parseInt(document.querySelector("#searchFilter--limit").value,10),c=document.querySelector("#searchFilter--offset");function n(e){if(0===e.lotOccupancies.length)return void(a.innerHTML=`<div class="message is-info">\n <p class="message-body">\n There are no ${t.escapedAliases.occupancy} records that meet the search criteria.\n </p>\n </div>`);const c=document.createElement("tbody"),n=cityssm.dateToString(new Date);for(const a of e.lotOccupancies){let e="";e=a.occupancyStartDateString<=n&&(""===a.occupancyEndDateString||a.occupancyEndDateString>=n)?'<span class="has-tooltip-right" data-tooltip="Current '+t.escapedAliases.Occupancy+'"><i class="fas fa-play" aria-label="Current '+t.escapedAliases.Occupancy+'"></i></span>':a.occupancyStartDateString>n?'<span class="has-tooltip-right" data-tooltip="Future '+t.escapedAliases.Occupancy+'"><i class="fas fa-fast-forward" aria-label="Future '+t.escapedAliases.Occupancy+'"></i></span>':'<span class="has-tooltip-right" data-tooltip="Past '+t.escapedAliases.Occupancy+'"><i class="fas fa-stop" aria-label="Past '+t.escapedAliases.Occupancy+'"></i></span>';let s="";for(const t of a.lotOccupancyOccupants)s+='<span class="has-tooltip-left" data-tooltip="'+cityssm.escapeHTML(t.lotOccupantType||"")+'"><i class="fas fa-fw fa-'+cityssm.escapeHTML(t.fontAwesomeIconClass||"user")+'" aria-hidden="true"></i> '+cityssm.escapeHTML(t.occupantName||"")+"</span><br />";c.insertAdjacentHTML("beforeend",'<tr><td class="has-width-1">'+e+'</td><td><a class="has-text-weight-bold" href="'+t.urlPrefix+"/lotOccupancies/"+a.lotOccupancyId+'">'+cityssm.escapeHTML(a.occupancyType)+"</a></td><td>"+(a.lotName?'<a class="has-tooltip-right" data-tooltip="'+cityssm.escapeHTML(a.lotType||"")+'" href="'+t.urlPrefix+"/lots/"+a.lotId+'">'+cityssm.escapeHTML(a.lotName)+"</a>":'<span class="has-text-grey">(No '+t.escapedAliases.Lot+")</span>")+'<br /><span class="is-size-7">'+cityssm.escapeHTML(a.mapName||"")+"</span></td><td>"+a.occupancyStartDateString+"</td><td>"+(a.occupancyEndDate?a.occupancyEndDateString:'<span class="has-text-grey">(No End Date)</span>')+"</td><td>"+s+"</td><td>"+(a.printEJS?'<a class="button is-small" data-tooltip="Print" href="'+t.urlPrefix+"/print/"+a.printEJS+"/?lotOccupancyId="+a.lotOccupancyId+'" target="_blank"><i class="fas fa-print" aria-label="Print"></i></a>':"")+"</td></tr>")}a.innerHTML=`<table class="table is-fullwidth is-striped is-hoverable has-sticky-header">\n <thead><tr>\n <th class="has-width-1"></th>\n <th>${t.escapedAliases.Occupancy} Type</th>\n <th>${t.escapedAliases.Lot}</th>\n <th>${t.escapedAliases.OccupancyStartDate}</th>\n <th>End Date</th>\n <th>${t.escapedAliases.Occupants}</th>\n <th class="has-width-1"><span class="is-sr-only">Print</span></th>\n </tr></thead>\n <table>`,a.querySelector("table").append(c),a.insertAdjacentHTML("beforeend",t.getSearchResultsPagerHTML(s,e.offset,e.count)),e.offset>0&&a.querySelector("button[data-page='previous']").addEventListener("click",o),s+e.offset<e.count&&a.querySelector("button[data-page='next']").addEventListener("click",l)}function r(){a.innerHTML=t.getLoadingParagraphHTML(`Loading ${exports.aliases.occupancies}...`),cityssm.postJSON(t.urlPrefix+"/lotOccupancies/doSearchLotOccupancies",e,n)}function i(){c.value="0",r()}function o(){c.value=Math.max(Number.parseInt(c.value,10)-s,0).toString(),r()}function l(){c.value=(Number.parseInt(c.value,10)+s).toString(),r()}const p=e.querySelectorAll("input, select");for(const t of p)t.addEventListener("change",i);e.addEventListener("submit",t=>{t.preventDefault(),i()}),r()})();
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const t=exports.los,e=document.querySelector("#form--searchFilters"),a=document.querySelector("#container--searchResults"),s=Number.parseInt(document.querySelector("#searchFilter--limit").value,10),c=document.querySelector("#searchFilter--offset");function n(e){var c,n;if(0===e.lotOccupancies.length)return void(a.innerHTML=`<div class="message is-info">\n <p class="message-body">\n There are no ${t.escapedAliases.occupancy} records that meet the search criteria.\n </p>\n </div>`);const i=document.createElement("tbody"),r=cityssm.dateToString(new Date);for(const a of e.lotOccupancies){let e="";e=a.occupancyStartDateString<=r&&(""===a.occupancyEndDateString||a.occupancyEndDateString>=r)?`<span class="has-tooltip-right" data-tooltip="Current ${t.escapedAliases.Occupancy}">\n <i class="fas fa-play" aria-label="Current ${t.escapedAliases.Occupancy}"></i>\n </span>`:a.occupancyStartDateString>r?`<span class="has-tooltip-right" data-tooltip="Future ${t.escapedAliases.Occupancy}">\n <i class="fas fa-fast-forward" aria-label="Future ${t.escapedAliases.Occupancy}"></i>\n </span>`:`<span class="has-tooltip-right" data-tooltip="Past ${t.escapedAliases.Occupancy}">\n <i class="fas fa-stop" aria-label="Past ${t.escapedAliases.Occupancy}"></i>\n </span>`;let s="";for(const t of a.lotOccupancyOccupants)s+='<span class="has-tooltip-left" data-tooltip="'+cityssm.escapeHTML(t.lotOccupantType||"")+'"><i class="fas fa-fw fa-'+cityssm.escapeHTML(t.fontAwesomeIconClass||"user")+'" aria-hidden="true"></i> '+cityssm.escapeHTML(t.occupantName||"")+"</span><br />";i.insertAdjacentHTML("beforeend",'<tr><td class="has-width-1">'+e+'</td><td><a class="has-text-weight-bold" href="'+t.urlPrefix+"/lotOccupancies/"+a.lotOccupancyId+'">'+cityssm.escapeHTML(a.occupancyType)+"</a></td><td>"+(a.lotName?'<a class="has-tooltip-right" data-tooltip="'+cityssm.escapeHTML(a.lotType||"")+'" href="'+t.urlPrefix+"/lots/"+a.lotId+'">'+cityssm.escapeHTML(a.lotName)+"</a>":'<span class="has-text-grey">(No '+t.escapedAliases.Lot+")</span>")+'<br /><span class="is-size-7">'+cityssm.escapeHTML(a.mapName||"")+"</span></td><td>"+a.occupancyStartDateString+"</td><td>"+(a.occupancyEndDate?a.occupancyEndDateString:'<span class="has-text-grey">(No End Date)</span>')+"</td><td>"+s+"</td><td>"+(a.printEJS?'<a class="button is-small" data-tooltip="Print" href="'+t.urlPrefix+"/print/"+a.printEJS+"/?lotOccupancyId="+a.lotOccupancyId+'" target="_blank"><i class="fas fa-print" aria-label="Print"></i></a>':"")+"</td></tr>")}a.innerHTML=`<table class="table is-fullwidth is-striped is-hoverable has-sticky-header">\n <thead><tr>\n <th class="has-width-1"></th>\n <th>${t.escapedAliases.Occupancy} Type</th>\n <th>${t.escapedAliases.Lot}</th>\n <th>${t.escapedAliases.OccupancyStartDate}</th>\n <th>End Date</th>\n <th>${t.escapedAliases.Occupants}</th>\n <th class="has-width-1"><span class="is-sr-only">Print</span></th>\n </tr></thead>\n <table>`,a.querySelector("table").append(i),a.insertAdjacentHTML("beforeend",t.getSearchResultsPagerHTML(s,e.offset,e.count)),null===(c=a.querySelector("button[data-page='previous']"))||void 0===c||c.addEventListener("click",l),null===(n=a.querySelector("button[data-page='next']"))||void 0===n||n.addEventListener("click",o)}function i(){a.innerHTML=t.getLoadingParagraphHTML(`Loading ${exports.aliases.occupancies}...`),cityssm.postJSON(t.urlPrefix+"/lotOccupancies/doSearchLotOccupancies",e,n)}function r(){c.value="0",i()}function l(){c.value=Math.max(Number.parseInt(c.value,10)-s,0).toString(),i()}function o(){c.value=(Number.parseInt(c.value,10)+s).toString(),i()}const p=e.querySelectorAll("input, select");for(const t of p)t.addEventListener("change",r);e.addEventListener("submit",t=>{t.preventDefault(),r()}),i()})();
|
||||||
|
|
@ -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),r=document.querySelector("#searchFilter--offset");function n(t){if(0===t.lots.length)return void(s.innerHTML='<div class="message is-info"><p class="message-body">There are no '+e.escapedAliases.lots+" that meet the search criteria.</p></div>");const r=document.createElement("tbody");for(const s of t.lots)r.insertAdjacentHTML("beforeend",'<tr><td><a class="has-text-weight-bold" href="'+e.urlPrefix+"/lots/"+s.lotId+'">'+cityssm.escapeHTML(s.lotName||"")+'</a></td><td><a href="'+e.urlPrefix+"/maps/"+s.mapId+'">'+(s.mapName?cityssm.escapeHTML(s.mapName):'<span class="has-text-grey">(No Name)</span>')+"</a></td><td>"+cityssm.escapeHTML(s.lotType||"")+"</td><td>"+(s.lotStatusId?cityssm.escapeHTML(s.lotStatus||""):'<span class="has-text-grey">(No Status)</span>')+"<br />"+(s.lotOccupancyCount>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(r),t.offset>0&&s.querySelector("button[data-page='previous']").addEventListener("click",l),a+t.offset<t.count&&s.querySelector("button[data-page='next']").addEventListener("click",i)}function o(){s.innerHTML=e.getLoadingParagraphHTML(`Loading ${e.escapedAliases.Lots}...`),cityssm.postJSON(e.urlPrefix+"/lots/doSearchLots",t,n)}function c(){r.value="0",o()}function l(){r.value=Math.max(Number.parseInt(r.value,10)-a,0).toString(),o()}function i(){r.value=(Number.parseInt(r.value,10)+a).toString(),o()}const d=t.querySelectorAll("input, select");for(const e of d)e.addEventListener("change",c);t.addEventListener("submit",e=>{e.preventDefault(),c()}),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),r=document.querySelector("#searchFilter--offset");function n(t){var r,n;if(0===t.lots.length)return void(s.innerHTML='<div class="message is-info"><p class="message-body">There are no '+e.escapedAliases.lots+" that meet the search criteria.</p></div>");const o=document.createElement("tbody");for(const s of t.lots)o.insertAdjacentHTML("beforeend",'<tr><td><a class="has-text-weight-bold" href="'+e.urlPrefix+"/lots/"+s.lotId+'">'+cityssm.escapeHTML(s.lotName||"")+'</a></td><td><a href="'+e.urlPrefix+"/maps/"+s.mapId+'">'+(s.mapName?cityssm.escapeHTML(s.mapName):'<span class="has-text-grey">(No Name)</span>')+"</a></td><td>"+cityssm.escapeHTML(s.lotType||"")+"</td><td>"+(s.lotStatusId?cityssm.escapeHTML(s.lotStatus||""):'<span class="has-text-grey">(No Status)</span>')+"<br />"+(s.lotOccupancyCount>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(o),null===(r=s.querySelector("button[data-page='previous']"))||void 0===r||r.addEventListener("click",l),null===(n=s.querySelector("button[data-page='next']"))||void 0===n||n.addEventListener("click",i)}function o(){s.innerHTML=e.getLoadingParagraphHTML(`Loading ${e.escapedAliases.Lots}...`),cityssm.postJSON(e.urlPrefix+"/lots/doSearchLots",t,n)}function c(){r.value="0",o()}function l(){r.value=Math.max(Number.parseInt(r.value,10)-a,0).toString(),o()}function i(){r.value=(Number.parseInt(r.value,10)+a).toString(),o()}const d=t.querySelectorAll("input, select");for(const e of d)e.addEventListener("change",c);t.addEventListener("submit",e=>{e.preventDefault(),c()}),o()})();
|
||||||
|
|
@ -1 +1 @@
|
||||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,t=exports.workOrderPrints,s=document.querySelector("#form--searchFilters");e.initializeDatePickers(s);const r=document.querySelector("#container--searchResults"),a=Number.parseInt(document.querySelector("#searchFilter--limit").value,10),o=document.querySelector("#searchFilter--offset");function i(s){if(0===s.workOrders.length)return void(r.innerHTML='<div class="message is-info"><p class="message-body">There are no work orders that meet the search criteria.</p></div>');const o=document.createElement("tbody");for(const r of s.workOrders){let s="";for(const t of r.workOrderLots)s+='<span class="has-tooltip-left" data-tooltip="'+cityssm.escapeHTML(t.mapName||"")+'"><i class="fas fa-fw fa-vector-square" aria-label="'+e.escapedAliases.Lot+'"></i> '+cityssm.escapeHTML(t.lotName||"(No "+exports.aliases.Lot+" Name)")+"</span><br />";for(const t of r.workOrderLotOccupancies)for(const r of t.lotOccupancyOccupants)s+='<span class="has-tooltip-left" data-tooltip="'+cityssm.escapeHTML(r.lotOccupantType||"")+'"><i class="fas fa-fw fa-'+cityssm.escapeHTML(r.fontAwesomeIconClass||"user")+'" aria-label="'+e.escapedAliases.occupant+'"></i> '+cityssm.escapeHTML(r.occupantName||"(No Name)")+"</span><br />";o.insertAdjacentHTML("beforeend",'<tr><td><a class="has-text-weight-bold" href="'+e.urlPrefix+"/workOrders/"+r.workOrderId+'">'+(r.workOrderNumber.trim()?cityssm.escapeHTML(r.workOrderNumber||""):"(No Number)")+"</a></td><td>"+cityssm.escapeHTML(r.workOrderType||"")+'<br /><span class="is-size-7">'+cityssm.escapeHTML(r.workOrderDescription||"")+'</span></td><td class="is-nowrap"><span class="is-size-7">'+s+'</span></td><td class="is-nowrap"><span class="has-tooltip-left" data-tooltip="'+e.escapedAliases.WorkOrderOpenDate+'"><i class="fas fa-fw fa-play" aria-label="'+e.escapedAliases.WorkOrderOpenDate+'"></i> '+r.workOrderOpenDateString+'</span><br /><span class="has-tooltip-left" data-tooltip="'+e.escapedAliases.WorkOrderCloseDate+'"><i class="fas fa-fw fa-stop" aria-label="'+e.escapedAliases.WorkOrderCloseDate+'"></i> '+(r.workOrderCloseDate?r.workOrderCloseDateString:'<span class="has-text-grey">(No '+e.escapedAliases.WorkOrderCloseDate+")</span>")+"</span></td><td>"+(0===r.workOrderMilestoneCount?"-":r.workOrderMilestoneCompletionCount+" / "+r.workOrderMilestoneCount)+"</td>"+(t.length>0?'<td><a class="button is-small" data-tooltip="Print" href="'+e.urlPrefix+"/print/"+t[0]+"/?workOrderId="+r.workOrderId+'" target="_blank"><i class="fas fa-print" aria-label="Print"></i></a></td>':"")+"</tr>")}r.innerHTML='<table class="table is-fullwidth is-striped is-hoverable has-sticky-header"><thead><tr><th>Work Order Number</th><th>Description</th><th>Related</th><th>Date</th><th class="has-tooltip-bottom" data-tooltip="Completed / Total Milestones">Progress</th>'+(t.length>0?'<th class="has-width-1"></th>':"")+"</tr></thead><table>",r.insertAdjacentHTML("beforeend",e.getSearchResultsPagerHTML(a,s.offset,s.count)),r.querySelector("table").append(o),s.offset>0&&r.querySelector("button[data-page='previous']").addEventListener("click",c),a+s.offset<s.count&&r.querySelector("button[data-page='next']").addEventListener("click",d)}function l(){r.innerHTML=e.getLoadingParagraphHTML("Loading Work Orders..."),cityssm.postJSON(e.urlPrefix+"/workOrders/doSearchWorkOrders",s,i)}function n(){o.value="0",l()}function c(){o.value=Math.max(Number.parseInt(o.value,10)-a,0).toString(),l()}function d(){o.value=(Number.parseInt(o.value,10)+a).toString(),l()}const p=s.querySelectorAll("input, select");for(const e of p)e.addEventListener("change",n);s.addEventListener("submit",e=>{e.preventDefault(),n()}),l()})();
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,t=exports.workOrderPrints,s=document.querySelector("#form--searchFilters");e.initializeDatePickers(s);const r=document.querySelector("#container--searchResults"),a=Number.parseInt(document.querySelector("#searchFilter--limit").value,10),o=document.querySelector("#searchFilter--offset");function i(s){var o,i;if(0===s.workOrders.length)return void(r.innerHTML='<div class="message is-info"><p class="message-body">There are no work orders that meet the search criteria.</p></div>');const l=document.createElement("tbody");for(const r of s.workOrders){let s="";for(const t of r.workOrderLots)s+='<span class="has-tooltip-left" data-tooltip="'+cityssm.escapeHTML(t.mapName||"")+'"><i class="fas fa-fw fa-vector-square" aria-label="'+e.escapedAliases.Lot+'"></i> '+cityssm.escapeHTML(t.lotName||"(No "+exports.aliases.Lot+" Name)")+"</span><br />";for(const t of r.workOrderLotOccupancies)for(const r of t.lotOccupancyOccupants)s+='<span class="has-tooltip-left" data-tooltip="'+cityssm.escapeHTML(r.lotOccupantType||"")+'"><i class="fas fa-fw fa-'+cityssm.escapeHTML(r.fontAwesomeIconClass||"user")+'" aria-label="'+e.escapedAliases.occupant+'"></i> '+cityssm.escapeHTML(r.occupantName||"(No Name)")+"</span><br />";l.insertAdjacentHTML("beforeend",'<tr><td><a class="has-text-weight-bold" href="'+e.urlPrefix+"/workOrders/"+r.workOrderId+'">'+(r.workOrderNumber.trim()?cityssm.escapeHTML(r.workOrderNumber||""):"(No Number)")+"</a></td><td>"+cityssm.escapeHTML(r.workOrderType||"")+'<br /><span class="is-size-7">'+cityssm.escapeHTML(r.workOrderDescription||"")+'</span></td><td class="is-nowrap"><span class="is-size-7">'+s+'</span></td><td class="is-nowrap"><span class="has-tooltip-left" data-tooltip="'+e.escapedAliases.WorkOrderOpenDate+'"><i class="fas fa-fw fa-play" aria-label="'+e.escapedAliases.WorkOrderOpenDate+'"></i> '+r.workOrderOpenDateString+'</span><br /><span class="has-tooltip-left" data-tooltip="'+e.escapedAliases.WorkOrderCloseDate+'"><i class="fas fa-fw fa-stop" aria-label="'+e.escapedAliases.WorkOrderCloseDate+'"></i> '+(r.workOrderCloseDate?r.workOrderCloseDateString:'<span class="has-text-grey">(No '+e.escapedAliases.WorkOrderCloseDate+")</span>")+"</span></td><td>"+(0===r.workOrderMilestoneCount?"-":r.workOrderMilestoneCompletionCount+" / "+r.workOrderMilestoneCount)+"</td>"+(t.length>0?'<td><a class="button is-small" data-tooltip="Print" href="'+e.urlPrefix+"/print/"+t[0]+"/?workOrderId="+r.workOrderId+'" target="_blank"><i class="fas fa-print" aria-label="Print"></i></a></td>':"")+"</tr>")}r.innerHTML='<table class="table is-fullwidth is-striped is-hoverable has-sticky-header"><thead><tr><th>Work Order Number</th><th>Description</th><th>Related</th><th>Date</th><th class="has-tooltip-bottom" data-tooltip="Completed / Total Milestones">Progress</th>'+(t.length>0?'<th class="has-width-1"></th>':"")+"</tr></thead><table>",r.insertAdjacentHTML("beforeend",e.getSearchResultsPagerHTML(a,s.offset,s.count)),r.querySelector("table").append(l),null===(o=r.querySelector("button[data-page='previous']"))||void 0===o||o.addEventListener("click",c),null===(i=r.querySelector("button[data-page='next']"))||void 0===i||i.addEventListener("click",d)}function l(){r.innerHTML=e.getLoadingParagraphHTML("Loading Work Orders..."),cityssm.postJSON(e.urlPrefix+"/workOrders/doSearchWorkOrders",s,i)}function n(){o.value="0",l()}function c(){o.value=Math.max(Number.parseInt(o.value,10)-a,0).toString(),l()}function d(){o.value=(Number.parseInt(o.value,10)+a).toString(),l()}const p=s.querySelectorAll("input, select");for(const e of p)e.addEventListener("change",n);s.addEventListener("submit",e=>{e.preventDefault(),n()}),l()})();
|
||||||
Loading…
Reference in New Issue