linting
parent
991df98ff3
commit
da821b1d28
|
|
@ -297,7 +297,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
containerElement.innerHTML = "";
|
||||
if (lotTypes.length === 0) {
|
||||
containerElement.insertAdjacentHTML("afterbegin", `<div class="message is-warning>
|
||||
<p class="message-body">There are no active ${exports.aliases.lot.toLowerCase()} types.</p>
|
||||
<p class="message-body">There are no active ${los.escapedAliases.lot} types.</p>
|
||||
</div>`);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -472,7 +472,7 @@ declare const bulmaJS: BulmaJS;
|
|||
containerElement.insertAdjacentHTML(
|
||||
"afterbegin",
|
||||
`<div class="message is-warning>
|
||||
<p class="message-body">There are no active ${exports.aliases.lot.toLowerCase()} types.</p>
|
||||
<p class="message-body">There are no active ${los.escapedAliases.lot} types.</p>
|
||||
</div>`
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
var _a;
|
||||
const los = exports.los;
|
||||
const lotId = document.querySelector("#lot--lotId").value;
|
||||
const isCreate = lotId === "";
|
||||
|
|
@ -39,39 +40,35 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
formInputElement.addEventListener("change", los.setUnsavedChanges);
|
||||
}
|
||||
los.initializeUnlockFieldButtons(formElement);
|
||||
if (!isCreate) {
|
||||
document.querySelector("#button--deleteLot").addEventListener("click", (clickEvent) => {
|
||||
clickEvent.preventDefault();
|
||||
const doDelete = () => {
|
||||
cityssm.postJSON(los.urlPrefix + "/lots/doDeleteLot", {
|
||||
lotId
|
||||
}, (responseJSON) => {
|
||||
if (responseJSON.success) {
|
||||
cityssm.disableNavBlocker();
|
||||
window.location.href = los.urlPrefix + "/lots/?t=" + Date.now();
|
||||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
title: "Error Deleting " + exports.aliases.lot,
|
||||
message: responseJSON.errorMessage || "",
|
||||
contextualColorName: "danger"
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
bulmaJS.confirm({
|
||||
title: "Delete " + exports.aliases.lot,
|
||||
message: "Are you sure you want to delete this " +
|
||||
exports.aliases.lot.toLowerCase() +
|
||||
"?",
|
||||
contextualColorName: "warning",
|
||||
okButton: {
|
||||
text: "Yes, Delete " + exports.aliases.lot,
|
||||
callbackFunction: doDelete
|
||||
(_a = document.querySelector("#button--deleteLot")) === null || _a === void 0 ? void 0 : _a.addEventListener("click", (clickEvent) => {
|
||||
clickEvent.preventDefault();
|
||||
const doDelete = () => {
|
||||
cityssm.postJSON(los.urlPrefix + "/lots/doDeleteLot", {
|
||||
lotId
|
||||
}, (responseJSON) => {
|
||||
if (responseJSON.success) {
|
||||
cityssm.disableNavBlocker();
|
||||
window.location.href = los.urlPrefix + "/lots/?t=" + Date.now();
|
||||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
title: `Error Deleting ${los.escapedAliases.Lot}`,
|
||||
message: responseJSON.errorMessage || "",
|
||||
contextualColorName: "danger"
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
bulmaJS.confirm({
|
||||
title: "Delete " + exports.aliases.lot,
|
||||
message: `Are you sure you want to delete this ${los.escapedAliases.lot}?`,
|
||||
contextualColorName: "warning",
|
||||
okButton: {
|
||||
text: `Yes, Delete ${los.escapedAliases.Lot}`,
|
||||
callbackFunction: doDelete
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
// Lot Type
|
||||
const lotTypeIdElement = document.querySelector("#lot--lotTypeId");
|
||||
if (isCreate) {
|
||||
|
|
@ -194,10 +191,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
cityssm.openHtmlModal("lot-editComment", {
|
||||
onshow: (modalElement) => {
|
||||
los.populateAliases(modalElement);
|
||||
modalElement.querySelector("#lotCommentEdit--lotId").value =
|
||||
lotId;
|
||||
modalElement.querySelector("#lotCommentEdit--lotCommentId").value = lotCommentId.toString();
|
||||
modalElement.querySelector("#lotCommentEdit--lotComment").value = lotComment.lotComment;
|
||||
modalElement.querySelector("#lotCommentEdit--lotId").value = lotId;
|
||||
modalElement.querySelector("#lotCommentEdit--lotCommentId").value =
|
||||
lotCommentId.toString();
|
||||
modalElement.querySelector("#lotCommentEdit--lotComment").value =
|
||||
lotComment.lotComment;
|
||||
const lotCommentDateStringElement = modalElement.querySelector("#lotCommentEdit--lotCommentDateString");
|
||||
lotCommentDateStringElement.value = lotComment.lotCommentDateString;
|
||||
const currentDateString = cityssm.dateToString(new Date());
|
||||
|
|
@ -293,12 +291,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
"</button>") +
|
||||
"</div>" +
|
||||
"</td>");
|
||||
tableRowElement
|
||||
.querySelector(".button--edit")
|
||||
.addEventListener("click", openEditLotComment);
|
||||
tableRowElement
|
||||
.querySelector(".button--delete")
|
||||
.addEventListener("click", deleteLotComment);
|
||||
tableRowElement.querySelector(".button--edit").addEventListener("click", openEditLotComment);
|
||||
tableRowElement.querySelector(".button--delete").addEventListener("click", deleteLotComment);
|
||||
tableElement.querySelector("tbody").append(tableRowElement);
|
||||
}
|
||||
containerElement.innerHTML = "";
|
||||
|
|
@ -319,8 +313,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
cityssm.openHtmlModal("lot-addComment", {
|
||||
onshow(modalElement) {
|
||||
los.populateAliases(modalElement);
|
||||
modalElement.querySelector("#lotCommentAdd--lotId").value =
|
||||
lotId;
|
||||
modalElement.querySelector("#lotCommentAdd--lotId").value = lotId;
|
||||
modalElement.querySelector("form").addEventListener("submit", doAddComment);
|
||||
},
|
||||
onshown(modalElement, closeModalFunction) {
|
||||
|
|
|
|||
|
|
@ -62,54 +62,47 @@ declare const bulmaJS: BulmaJS;
|
|||
|
||||
los.initializeUnlockFieldButtons(formElement);
|
||||
|
||||
if (!isCreate) {
|
||||
document.querySelector("#button--deleteLot")!.addEventListener("click", (clickEvent) => {
|
||||
clickEvent.preventDefault();
|
||||
document.querySelector("#button--deleteLot")?.addEventListener("click", (clickEvent) => {
|
||||
clickEvent.preventDefault();
|
||||
|
||||
const doDelete = () => {
|
||||
cityssm.postJSON(
|
||||
los.urlPrefix + "/lots/doDeleteLot",
|
||||
{
|
||||
lotId
|
||||
},
|
||||
(responseJSON: { success: boolean; errorMessage?: string }) => {
|
||||
if (responseJSON.success) {
|
||||
cityssm.disableNavBlocker();
|
||||
window.location.href = los.urlPrefix + "/lots/?t=" + Date.now();
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
title: "Error Deleting " + exports.aliases.lot,
|
||||
message: responseJSON.errorMessage || "",
|
||||
contextualColorName: "danger"
|
||||
});
|
||||
}
|
||||
const doDelete = () => {
|
||||
cityssm.postJSON(
|
||||
los.urlPrefix + "/lots/doDeleteLot",
|
||||
{
|
||||
lotId
|
||||
},
|
||||
(responseJSON: { success: boolean; errorMessage?: string }) => {
|
||||
if (responseJSON.success) {
|
||||
cityssm.disableNavBlocker();
|
||||
window.location.href = los.urlPrefix + "/lots/?t=" + Date.now();
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
title: `Error Deleting ${los.escapedAliases.Lot}`,
|
||||
message: responseJSON.errorMessage || "",
|
||||
contextualColorName: "danger"
|
||||
});
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
bulmaJS.confirm({
|
||||
title: "Delete " + exports.aliases.lot,
|
||||
message:
|
||||
"Are you sure you want to delete this " +
|
||||
exports.aliases.lot.toLowerCase() +
|
||||
"?",
|
||||
contextualColorName: "warning",
|
||||
okButton: {
|
||||
text: "Yes, Delete " + exports.aliases.lot,
|
||||
callbackFunction: doDelete
|
||||
}
|
||||
});
|
||||
);
|
||||
};
|
||||
|
||||
bulmaJS.confirm({
|
||||
title: "Delete " + exports.aliases.lot,
|
||||
message: `Are you sure you want to delete this ${los.escapedAliases.lot}?`,
|
||||
contextualColorName: "warning",
|
||||
okButton: {
|
||||
text: `Yes, Delete ${los.escapedAliases.Lot}`,
|
||||
callbackFunction: doDelete
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Lot Type
|
||||
|
||||
const lotTypeIdElement = document.querySelector("#lot--lotTypeId") as HTMLSelectElement;
|
||||
|
||||
if (isCreate) {
|
||||
const lotFieldsContainerElement = document.querySelector(
|
||||
"#container--lotFields"
|
||||
) as HTMLElement;
|
||||
const lotFieldsContainerElement = document.querySelector("#container--lotFields") as HTMLElement;
|
||||
|
||||
lotTypeIdElement.addEventListener("change", () => {
|
||||
if (lotTypeIdElement.value === "") {
|
||||
|
|
@ -180,15 +173,11 @@ declare const bulmaJS: BulmaJS;
|
|||
<select id="${fieldId}" name="${fieldName}"><option value="">(Not Set)</option></select>
|
||||
</div>`;
|
||||
|
||||
const selectElement = fieldElement.querySelector(
|
||||
"select"
|
||||
) as HTMLSelectElement;
|
||||
const selectElement = fieldElement.querySelector("select") as HTMLSelectElement;
|
||||
|
||||
selectElement.required = lotTypeField.isRequired as boolean;
|
||||
|
||||
const optionValues = (lotTypeField.lotTypeFieldValues as string).split(
|
||||
"\n"
|
||||
);
|
||||
const optionValues = (lotTypeField.lotTypeFieldValues as string).split("\n");
|
||||
|
||||
for (const optionValue of optionValues) {
|
||||
const optionElement = document.createElement("option");
|
||||
|
|
@ -284,16 +273,13 @@ declare const bulmaJS: BulmaJS;
|
|||
onshow: (modalElement) => {
|
||||
los.populateAliases(modalElement);
|
||||
|
||||
(modalElement.querySelector("#lotCommentEdit--lotId") as HTMLInputElement).value =
|
||||
lotId;
|
||||
(modalElement.querySelector("#lotCommentEdit--lotId") as HTMLInputElement).value = lotId;
|
||||
|
||||
(
|
||||
modalElement.querySelector("#lotCommentEdit--lotCommentId") as HTMLInputElement
|
||||
).value = lotCommentId.toString();
|
||||
(modalElement.querySelector("#lotCommentEdit--lotCommentId") as HTMLInputElement).value =
|
||||
lotCommentId.toString();
|
||||
|
||||
(
|
||||
modalElement.querySelector("#lotCommentEdit--lotComment") as HTMLInputElement
|
||||
).value = lotComment.lotComment!;
|
||||
(modalElement.querySelector("#lotCommentEdit--lotComment") as HTMLInputElement).value =
|
||||
lotComment.lotComment!;
|
||||
|
||||
const lotCommentDateStringElement = modalElement.querySelector(
|
||||
"#lotCommentEdit--lotCommentDateString"
|
||||
|
|
@ -309,9 +295,7 @@ declare const bulmaJS: BulmaJS;
|
|||
: lotComment.lotCommentDateString!;
|
||||
|
||||
(
|
||||
modalElement.querySelector(
|
||||
"#lotCommentEdit--lotCommentTimeString"
|
||||
) as HTMLInputElement
|
||||
modalElement.querySelector("#lotCommentEdit--lotCommentTimeString") as HTMLInputElement
|
||||
).value = lotComment.lotCommentTimeString!;
|
||||
},
|
||||
onshown: (modalElement, closeModalFunction) => {
|
||||
|
|
@ -320,9 +304,7 @@ declare const bulmaJS: BulmaJS;
|
|||
los.initializeDatePickers(modalElement);
|
||||
// los.initializeTimePickers(modalElement);
|
||||
|
||||
(
|
||||
modalElement.querySelector("#lotCommentEdit--lotComment") as HTMLTextAreaElement
|
||||
).focus();
|
||||
(modalElement.querySelector("#lotCommentEdit--lotComment") as HTMLTextAreaElement).focus();
|
||||
|
||||
editFormElement = modalElement.querySelector("form")!;
|
||||
editFormElement.addEventListener("submit", editComment);
|
||||
|
|
@ -425,13 +407,9 @@ declare const bulmaJS: BulmaJS;
|
|||
"</div>" +
|
||||
"</td>");
|
||||
|
||||
tableRowElement
|
||||
.querySelector(".button--edit")!
|
||||
.addEventListener("click", openEditLotComment);
|
||||
tableRowElement.querySelector(".button--edit")!.addEventListener("click", openEditLotComment);
|
||||
|
||||
tableRowElement
|
||||
.querySelector(".button--delete")!
|
||||
.addEventListener("click", deleteLotComment);
|
||||
tableRowElement.querySelector(".button--delete")!.addEventListener("click", deleteLotComment);
|
||||
|
||||
tableElement.querySelector("tbody")!.append(tableRowElement);
|
||||
}
|
||||
|
|
@ -462,16 +440,13 @@ declare const bulmaJS: BulmaJS;
|
|||
cityssm.openHtmlModal("lot-addComment", {
|
||||
onshow(modalElement) {
|
||||
los.populateAliases(modalElement);
|
||||
(modalElement.querySelector("#lotCommentAdd--lotId") as HTMLInputElement).value =
|
||||
lotId;
|
||||
(modalElement.querySelector("#lotCommentAdd--lotId") as HTMLInputElement).value = lotId;
|
||||
modalElement.querySelector("form")!.addEventListener("submit", doAddComment);
|
||||
},
|
||||
onshown(modalElement, closeModalFunction) {
|
||||
bulmaJS.toggleHtmlClipped();
|
||||
addCommentCloseModalFunction = closeModalFunction;
|
||||
(
|
||||
modalElement.querySelector("#lotCommentAdd--lotComment") as HTMLTextAreaElement
|
||||
).focus();
|
||||
(modalElement.querySelector("#lotCommentAdd--lotComment") as HTMLTextAreaElement).focus();
|
||||
},
|
||||
onremoved() {
|
||||
bulmaJS.toggleHtmlClipped();
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}
|
||||
else {
|
||||
bulmaJS.confirm({
|
||||
title: "Copy " + los.escapedAliases.Occupancy + " Record as New",
|
||||
title: `Copy ${los.escapedAliases.Occupancy} Record as New`,
|
||||
message: "Are you sure you want to copy this record to a new record?",
|
||||
contextualColorName: "info",
|
||||
okButton: {
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}
|
||||
else {
|
||||
bulmaJS.confirm({
|
||||
title: "Copy " + los.escapedAliases.Occupancy + " Record as New",
|
||||
title: `Copy ${los.escapedAliases.Occupancy} Record as New`,
|
||||
message: "Are you sure you want to copy this record to a new record?",
|
||||
contextualColorName: "info",
|
||||
okButton: {
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ declare const bulmaJS: BulmaJS;
|
|||
});
|
||||
} else {
|
||||
bulmaJS.confirm({
|
||||
title: "Copy " + los.escapedAliases.Occupancy + " Record as New",
|
||||
title: `Copy ${los.escapedAliases.Occupancy} Record as New`,
|
||||
message: "Are you sure you want to copy this record to a new record?",
|
||||
contextualColorName: "info",
|
||||
okButton: {
|
||||
|
|
|
|||
|
|
@ -54,9 +54,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
('<td class="has-width-1">' + occupancyTimeHTML + "</td>") +
|
||||
("<td>" +
|
||||
'<a class="has-text-weight-bold" href="' +
|
||||
los.urlPrefix +
|
||||
"/lotOccupancies/" +
|
||||
lotOccupancy.lotOccupancyId +
|
||||
los.getLotOccupancyURL(lotOccupancy.lotOccupancyId) +
|
||||
'">' +
|
||||
cityssm.escapeHTML(lotOccupancy.occupancyType) +
|
||||
"</a>" +
|
||||
|
|
@ -66,9 +64,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
? '<a class="has-tooltip-right" data-tooltip="' +
|
||||
cityssm.escapeHTML(lotOccupancy.lotType || "") +
|
||||
'" href="' +
|
||||
los.urlPrefix +
|
||||
"/lots/" +
|
||||
lotOccupancy.lotId +
|
||||
los.getLotURL(lotOccupancy.lotId) +
|
||||
'">' +
|
||||
cityssm.escapeHTML(lotOccupancy.lotName) +
|
||||
"</a>"
|
||||
|
|
|
|||
|
|
@ -81,9 +81,7 @@ declare const cityssm: cityssmGlobal;
|
|||
('<td class="has-width-1">' + occupancyTimeHTML + "</td>") +
|
||||
("<td>" +
|
||||
'<a class="has-text-weight-bold" href="' +
|
||||
los.urlPrefix +
|
||||
"/lotOccupancies/" +
|
||||
lotOccupancy.lotOccupancyId +
|
||||
los.getLotOccupancyURL(lotOccupancy.lotOccupancyId!) +
|
||||
'">' +
|
||||
cityssm.escapeHTML(lotOccupancy.occupancyType as string) +
|
||||
"</a>" +
|
||||
|
|
@ -93,9 +91,7 @@ declare const cityssm: cityssmGlobal;
|
|||
? '<a class="has-tooltip-right" data-tooltip="' +
|
||||
cityssm.escapeHTML(lotOccupancy.lotType || "") +
|
||||
'" href="' +
|
||||
los.urlPrefix +
|
||||
"/lots/" +
|
||||
lotOccupancy.lotId +
|
||||
los.getLotURL(lotOccupancy.lotId!) +
|
||||
'">' +
|
||||
cityssm.escapeHTML(lotOccupancy.lotName) +
|
||||
"</a>"
|
||||
|
|
|
|||
|
|
@ -20,18 +20,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
resultsTbodyElement.insertAdjacentHTML("beforeend", "<tr>" +
|
||||
("<td>" +
|
||||
'<a class="has-text-weight-bold" href="' +
|
||||
los.urlPrefix +
|
||||
"/lots/" +
|
||||
lot.lotId +
|
||||
los.getLotURL(lot.lotId) +
|
||||
'">' +
|
||||
cityssm.escapeHTML(lot.lotName || "") +
|
||||
"</a>" +
|
||||
"</td>") +
|
||||
("<td>" +
|
||||
'<a href="' +
|
||||
los.urlPrefix +
|
||||
"/maps/" +
|
||||
lot.mapId +
|
||||
los.getMapURL(lot.mapId) +
|
||||
'">' +
|
||||
(lot.mapName
|
||||
? cityssm.escapeHTML(lot.mapName)
|
||||
|
|
|
|||
|
|
@ -37,18 +37,14 @@ declare const cityssm: cityssmGlobal;
|
|||
"<tr>" +
|
||||
("<td>" +
|
||||
'<a class="has-text-weight-bold" href="' +
|
||||
los.urlPrefix +
|
||||
"/lots/" +
|
||||
lot.lotId +
|
||||
los.getLotURL(lot.lotId) +
|
||||
'">' +
|
||||
cityssm.escapeHTML(lot.lotName || "") +
|
||||
"</a>" +
|
||||
"</td>") +
|
||||
("<td>" +
|
||||
'<a href="' +
|
||||
los.urlPrefix +
|
||||
"/maps/" +
|
||||
lot.mapId +
|
||||
los.getMapURL(lot.mapId!) +
|
||||
'">' +
|
||||
(lot.mapName
|
||||
? cityssm.escapeHTML(lot.mapName)
|
||||
|
|
|
|||
|
|
@ -19,6 +19,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
function hasUnsavedChanges() {
|
||||
return _hasUnsavedChanges;
|
||||
}
|
||||
/*
|
||||
* Mapping
|
||||
*/
|
||||
function highlightMap(mapContainerElement, mapKey, contextualClass) {
|
||||
// Search for ID
|
||||
let svgId = mapKey;
|
||||
|
|
@ -272,6 +275,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
WorkOrderCloseDate: cityssm.escapeHTML(exports.aliases.workOrderCloseDate),
|
||||
workOrderCloseDate: cityssm.escapeHTML(exports.aliases.workOrderCloseDate.toLowerCase())
|
||||
});
|
||||
/*
|
||||
* Colours
|
||||
*/
|
||||
const hues = ["red", "green", "orange", "blue", "pink", "yellow", "purple"];
|
||||
const luminosity = ["bright", "light", "dark"];
|
||||
function getRandomColor(seedString) {
|
||||
|
|
@ -343,11 +349,35 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
"</div>") +
|
||||
"</div>");
|
||||
}
|
||||
/*
|
||||
* URLs
|
||||
*/
|
||||
const urlPrefix = document.querySelector("main").dataset.urlPrefix;
|
||||
function getMapURL(mapId, edit = false, time = false) {
|
||||
return urlPrefix + "/maps/" + mapId + (edit ? "/edit" : "") + (time ? "/?t=" + Date.now() : "");
|
||||
}
|
||||
function getLotURL(lotId, edit = false, time = false) {
|
||||
return urlPrefix + "/lots/" + lotId + (edit ? "/edit" : "") + (time ? "/?t=" + Date.now() : "");
|
||||
}
|
||||
function getLotOccupancyURL(lotOccupancyId, edit = false, time = false) {
|
||||
return (urlPrefix +
|
||||
"/lotOccupancies/" +
|
||||
lotOccupancyId +
|
||||
(edit ? "/edit" : "") +
|
||||
(time ? "/?t=" + Date.now() : ""));
|
||||
}
|
||||
function getWorkOrderURL(workOrderId, edit = false, time = false) {
|
||||
return (urlPrefix +
|
||||
"/workOrders/" +
|
||||
workOrderId +
|
||||
(edit ? "/edit" : "") +
|
||||
(time ? "/?t=" + Date.now() : ""));
|
||||
}
|
||||
/*
|
||||
* Declare LOS
|
||||
*/
|
||||
const los = {
|
||||
urlPrefix: document.querySelector("main").dataset.urlPrefix,
|
||||
urlPrefix,
|
||||
apiKey: document.querySelector("main").dataset.apiKey,
|
||||
highlightMap,
|
||||
initializeUnlockFieldButtons,
|
||||
|
|
@ -360,7 +390,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
hasUnsavedChanges,
|
||||
getMoveUpDownButtonFieldHTML,
|
||||
getLoadingParagraphHTML,
|
||||
getSearchResultsPagerHTML
|
||||
getSearchResultsPagerHTML,
|
||||
getMapURL,
|
||||
getLotURL,
|
||||
getLotOccupancyURL,
|
||||
getWorkOrderURL
|
||||
};
|
||||
exports.los = los;
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -31,6 +31,10 @@ declare const bulmaJS: BulmaJS;
|
|||
return _hasUnsavedChanges;
|
||||
}
|
||||
|
||||
/*
|
||||
* Mapping
|
||||
*/
|
||||
|
||||
function highlightMap(
|
||||
mapContainerElement: HTMLElement,
|
||||
mapKey: string,
|
||||
|
|
@ -88,8 +92,7 @@ declare const bulmaJS: BulmaJS;
|
|||
}
|
||||
|
||||
function initializeUnlockFieldButtons(containerElement: HTMLElement): void {
|
||||
const unlockFieldButtonElements =
|
||||
containerElement.querySelectorAll(".is-unlock-field-button");
|
||||
const unlockFieldButtonElements = containerElement.querySelectorAll(".is-unlock-field-button");
|
||||
|
||||
for (const unlockFieldButtonElement of unlockFieldButtonElements) {
|
||||
unlockFieldButtonElement.addEventListener("click", unlockField);
|
||||
|
|
@ -265,9 +268,7 @@ declare const bulmaJS: BulmaJS;
|
|||
*/
|
||||
|
||||
function populateAliases(containerElement: HTMLElement): void {
|
||||
const aliasElements = containerElement.querySelectorAll(
|
||||
".alias"
|
||||
) as NodeListOf<HTMLElement>;
|
||||
const aliasElements = containerElement.querySelectorAll(".alias") as NodeListOf<HTMLElement>;
|
||||
|
||||
for (const aliasElement of aliasElements) {
|
||||
switch (aliasElement.dataset.alias) {
|
||||
|
|
@ -329,9 +330,7 @@ declare const bulmaJS: BulmaJS;
|
|||
occupants: cityssm.escapeHTML(exports.aliases.occupants.toLowerCase()),
|
||||
|
||||
ExternalReceiptNumber: cityssm.escapeHTML(exports.aliases.externalReceiptNumber),
|
||||
externalReceiptNumber: cityssm.escapeHTML(
|
||||
exports.aliases.externalReceiptNumber.toLowerCase()
|
||||
),
|
||||
externalReceiptNumber: cityssm.escapeHTML(exports.aliases.externalReceiptNumber.toLowerCase()),
|
||||
|
||||
OccupancyStartDate: cityssm.escapeHTML(exports.aliases.occupancyStartDate),
|
||||
occupancyStartDate: cityssm.escapeHTML(exports.aliases.occupancyStartDate.toLowerCase()),
|
||||
|
|
@ -343,6 +342,10 @@ declare const bulmaJS: BulmaJS;
|
|||
workOrderCloseDate: cityssm.escapeHTML(exports.aliases.workOrderCloseDate.toLowerCase())
|
||||
});
|
||||
|
||||
/*
|
||||
* Colours
|
||||
*/
|
||||
|
||||
const hues = ["red", "green", "orange", "blue", "pink", "yellow", "purple"];
|
||||
const luminosity = ["bright", "light", "dark"];
|
||||
|
||||
|
|
@ -357,9 +360,7 @@ declare const bulmaJS: BulmaJS;
|
|||
seed: actualSeedString + actualSeedString,
|
||||
hue: hues[actualSeedString.codePointAt(actualSeedString.length - 1)! % hues.length],
|
||||
luminosity:
|
||||
luminosity[
|
||||
actualSeedString.codePointAt(actualSeedString.length - 2)! % luminosity.length
|
||||
]
|
||||
luminosity[actualSeedString.codePointAt(actualSeedString.length - 2)! % luminosity.length]
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -431,12 +432,46 @@ declare const bulmaJS: BulmaJS;
|
|||
);
|
||||
}
|
||||
|
||||
/*
|
||||
* URLs
|
||||
*/
|
||||
|
||||
const urlPrefix = document.querySelector("main")!.dataset.urlPrefix!;
|
||||
|
||||
function getMapURL(mapId: number | string, edit = false, time = false) {
|
||||
return urlPrefix + "/maps/" + mapId + (edit ? "/edit" : "") + (time ? "/?t=" + Date.now() : "");
|
||||
}
|
||||
|
||||
function getLotURL(lotId: number | string, edit = false, time = false) {
|
||||
return urlPrefix + "/lots/" + lotId + (edit ? "/edit" : "") + (time ? "/?t=" + Date.now() : "");
|
||||
}
|
||||
|
||||
function getLotOccupancyURL(lotOccupancyId: number | string, edit = false, time = false) {
|
||||
return (
|
||||
urlPrefix +
|
||||
"/lotOccupancies/" +
|
||||
lotOccupancyId +
|
||||
(edit ? "/edit" : "") +
|
||||
(time ? "/?t=" + Date.now() : "")
|
||||
);
|
||||
}
|
||||
|
||||
function getWorkOrderURL(workOrderId: number | string, edit = false, time = false) {
|
||||
return (
|
||||
urlPrefix +
|
||||
"/workOrders/" +
|
||||
workOrderId +
|
||||
(edit ? "/edit" : "") +
|
||||
(time ? "/?t=" + Date.now() : "")
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
* Declare LOS
|
||||
*/
|
||||
|
||||
const los: globalTypes.LOS = {
|
||||
urlPrefix: document.querySelector("main")!.dataset.urlPrefix!,
|
||||
urlPrefix,
|
||||
apiKey: document.querySelector("main")!.dataset.apiKey!,
|
||||
highlightMap,
|
||||
initializeUnlockFieldButtons,
|
||||
|
|
@ -453,7 +488,12 @@ declare const bulmaJS: BulmaJS;
|
|||
|
||||
getMoveUpDownButtonFieldHTML,
|
||||
getLoadingParagraphHTML,
|
||||
getSearchResultsPagerHTML
|
||||
getSearchResultsPagerHTML,
|
||||
|
||||
getMapURL,
|
||||
getLotURL,
|
||||
getLotOccupancyURL,
|
||||
getWorkOrderURL
|
||||
};
|
||||
|
||||
exports.los = los;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
var _a;
|
||||
const los = exports.los;
|
||||
const mapId = document.querySelector("#map--mapId").value;
|
||||
const isCreate = mapId === "";
|
||||
|
|
@ -12,8 +13,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
if (responseJSON.success) {
|
||||
cityssm.disableNavBlocker();
|
||||
if (isCreate) {
|
||||
window.location.href =
|
||||
los.urlPrefix + "/maps/" + responseJSON.mapId + "/edit";
|
||||
window.location.href = los.urlPrefix + "/maps/" + responseJSON.mapId + "/edit";
|
||||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
|
|
@ -36,34 +36,32 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
for (const inputElement of inputElements) {
|
||||
inputElement.addEventListener("change", cityssm.enableNavBlocker);
|
||||
}
|
||||
if (!isCreate) {
|
||||
document.querySelector("#button--deleteMap").addEventListener("click", (clickEvent) => {
|
||||
clickEvent.preventDefault();
|
||||
function doDelete() {
|
||||
cityssm.postJSON(los.urlPrefix + "/maps/doDeleteMap", {
|
||||
mapId
|
||||
}, (responseJSON) => {
|
||||
if (responseJSON.success) {
|
||||
window.location.href = los.urlPrefix + "/maps?t=" + Date.now();
|
||||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
title: "Error Deleting " + exports.aliases.map,
|
||||
message: responseJSON.errorMessage || "",
|
||||
contextualColorName: "danger"
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
bulmaJS.confirm({
|
||||
title: "Delete " + exports.aliases.map,
|
||||
message: `Are you sure you want to delete this ${exports.aliases.map.toLowerCase()} and all related ${exports.aliases.lots.toLowerCase()}?`,
|
||||
contextualColorName: "warning",
|
||||
okButton: {
|
||||
text: `Yes, Delete ${exports.aliases.map}`,
|
||||
callbackFunction: doDelete
|
||||
(_a = document.querySelector("#button--deleteMap")) === null || _a === void 0 ? void 0 : _a.addEventListener("click", (clickEvent) => {
|
||||
clickEvent.preventDefault();
|
||||
function doDelete() {
|
||||
cityssm.postJSON(los.urlPrefix + "/maps/doDeleteMap", {
|
||||
mapId
|
||||
}, (responseJSON) => {
|
||||
if (responseJSON.success) {
|
||||
window.location.href = los.urlPrefix + "/maps?t=" + Date.now();
|
||||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
title: "Error Deleting " + exports.aliases.map,
|
||||
message: responseJSON.errorMessage || "",
|
||||
contextualColorName: "danger"
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
bulmaJS.confirm({
|
||||
title: "Delete " + exports.aliases.map,
|
||||
message: `Are you sure you want to delete this ${exports.aliases.map.toLowerCase()} and all related ${exports.aliases.lots.toLowerCase()}?`,
|
||||
contextualColorName: "warning",
|
||||
okButton: {
|
||||
text: `Yes, Delete ${exports.aliases.map}`,
|
||||
callbackFunction: doDelete
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -27,8 +27,7 @@ declare const bulmaJS: BulmaJS;
|
|||
cityssm.disableNavBlocker();
|
||||
|
||||
if (isCreate) {
|
||||
window.location.href =
|
||||
los.urlPrefix + "/maps/" + responseJSON.mapId + "/edit";
|
||||
window.location.href = los.urlPrefix + "/maps/" + responseJSON.mapId + "/edit";
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
message: exports.aliases.map + " Updated Successfully",
|
||||
|
|
@ -56,40 +55,37 @@ declare const bulmaJS: BulmaJS;
|
|||
inputElement.addEventListener("change", cityssm.enableNavBlocker);
|
||||
}
|
||||
|
||||
if (!isCreate) {
|
||||
document.querySelector("#button--deleteMap")!.addEventListener("click", (clickEvent) => {
|
||||
clickEvent.preventDefault();
|
||||
document.querySelector("#button--deleteMap")?.addEventListener("click", (clickEvent) => {
|
||||
clickEvent.preventDefault();
|
||||
|
||||
function doDelete() {
|
||||
cityssm.postJSON(
|
||||
los.urlPrefix + "/maps/doDeleteMap",
|
||||
{
|
||||
mapId
|
||||
},
|
||||
(responseJSON: { success: boolean; errorMessage?: string; }) => {
|
||||
if (responseJSON.success) {
|
||||
window.location.href = los.urlPrefix + "/maps?t=" + Date.now();
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
title: "Error Deleting " + exports.aliases.map,
|
||||
message: responseJSON.errorMessage || "",
|
||||
contextualColorName: "danger"
|
||||
});
|
||||
}
|
||||
function doDelete() {
|
||||
cityssm.postJSON(
|
||||
los.urlPrefix + "/maps/doDeleteMap",
|
||||
{
|
||||
mapId
|
||||
},
|
||||
(responseJSON: { success: boolean; errorMessage?: string }) => {
|
||||
if (responseJSON.success) {
|
||||
window.location.href = los.urlPrefix + "/maps?t=" + Date.now();
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
title: "Error Deleting " + exports.aliases.map,
|
||||
message: responseJSON.errorMessage || "",
|
||||
contextualColorName: "danger"
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
bulmaJS.confirm({
|
||||
title: "Delete " + exports.aliases.map,
|
||||
message:
|
||||
`Are you sure you want to delete this ${exports.aliases.map.toLowerCase()} and all related ${exports.aliases.lots.toLowerCase()}?`,
|
||||
contextualColorName: "warning",
|
||||
okButton: {
|
||||
text: `Yes, Delete ${exports.aliases.map}`,
|
||||
callbackFunction: doDelete
|
||||
}
|
||||
});
|
||||
);
|
||||
}
|
||||
|
||||
bulmaJS.confirm({
|
||||
title: "Delete " + exports.aliases.map,
|
||||
message: `Are you sure you want to delete this ${exports.aliases.map.toLowerCase()} and all related ${exports.aliases.lots.toLowerCase()}?`,
|
||||
contextualColorName: "warning",
|
||||
okButton: {
|
||||
text: `Yes, Delete ${exports.aliases.map}`,
|
||||
callbackFunction: doDelete
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
const searchFilterElement = document.querySelector("#searchFilter--map");
|
||||
const searchResultsContainerElement = document.querySelector("#container--searchResults");
|
||||
function renderResults() {
|
||||
searchResultsContainerElement.innerHTML = los.getLoadingParagraphHTML(`Loading ${exports.aliases.maps}...`);
|
||||
searchResultsContainerElement.innerHTML = los.getLoadingParagraphHTML(`Loading ${los.escapedAliases.Maps}...`);
|
||||
let searchResultCount = 0;
|
||||
const searchResultsTbodyElement = document.createElement("tbody");
|
||||
const filterStringSplit = searchFilterElement.value.trim().toLowerCase().split(" ");
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ declare const cityssm: cityssmGlobal;
|
|||
|
||||
function renderResults(): void {
|
||||
searchResultsContainerElement.innerHTML = los.getLoadingParagraphHTML(
|
||||
`Loading ${exports.aliases.maps}...`
|
||||
`Loading ${los.escapedAliases.Maps}...`
|
||||
);
|
||||
|
||||
let searchResultCount = 0;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
var _a, _b;
|
||||
const los = exports.los;
|
||||
const workOrderId = document.querySelector("#workOrderEdit--workOrderId").value;
|
||||
const isCreate = workOrderId === "";
|
||||
|
|
@ -14,8 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
if (responseJSON.success) {
|
||||
cityssm.disableNavBlocker();
|
||||
if (isCreate) {
|
||||
window.location.href =
|
||||
los.urlPrefix + "/workOrders/" + responseJSON.workOrderId + "/edit";
|
||||
window.location.href = los.getWorkOrderURL(responseJSON.workOrderId, true);
|
||||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
|
|
@ -73,19 +73,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
});
|
||||
}
|
||||
let workOrderMilestones;
|
||||
if (!isCreate) {
|
||||
document.querySelector("#button--closeWorkOrder").addEventListener("click", () => {
|
||||
const hasOpenMilestones = workOrderMilestones.some((milestone) => {
|
||||
return !milestone.workOrderMilestoneCompletionDate;
|
||||
});
|
||||
if (hasOpenMilestones) {
|
||||
bulmaJS.alert({
|
||||
title: "Outstanding Milestones",
|
||||
message: `You cannot close a work order with outstanding milestones.
|
||||
(_a = document.querySelector("#button--closeWorkOrder")) === null || _a === void 0 ? void 0 : _a.addEventListener("click", () => {
|
||||
const hasOpenMilestones = workOrderMilestones.some((milestone) => {
|
||||
return !milestone.workOrderMilestoneCompletionDate;
|
||||
});
|
||||
if (hasOpenMilestones) {
|
||||
bulmaJS.alert({
|
||||
title: "Outstanding Milestones",
|
||||
message: `You cannot close a work order with outstanding milestones.
|
||||
Either complete the outstanding milestones, or remove them from the work order.`,
|
||||
contextualColorName: "warning"
|
||||
});
|
||||
/*
|
||||
contextualColorName: "warning"
|
||||
});
|
||||
/*
|
||||
// Disable closing work orders with open milestones
|
||||
bulmaJS.confirm({
|
||||
title: "Close Work Order with Outstanding Milestones",
|
||||
|
|
@ -98,32 +97,31 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}
|
||||
});
|
||||
*/
|
||||
}
|
||||
else {
|
||||
bulmaJS.confirm({
|
||||
title: "Close Work Order",
|
||||
message: "Are you sure you want to close this work order?",
|
||||
contextualColorName: "info",
|
||||
okButton: {
|
||||
text: "Yes, Close Work Order",
|
||||
callbackFunction: doClose
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
document.querySelector("#button--deleteWorkOrder").addEventListener("click", (clickEvent) => {
|
||||
clickEvent.preventDefault();
|
||||
}
|
||||
else {
|
||||
bulmaJS.confirm({
|
||||
title: "Delete Work Order",
|
||||
message: "Are you sure you want to delete this work order?",
|
||||
contextualColorName: "warning",
|
||||
title: "Close Work Order",
|
||||
message: "Are you sure you want to close this work order?",
|
||||
contextualColorName: "info",
|
||||
okButton: {
|
||||
text: "Yes, Delete Work Order",
|
||||
callbackFunction: doDelete
|
||||
text: "Yes, Close Work Order",
|
||||
callbackFunction: doClose
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
(_b = document.querySelector("#button--deleteWorkOrder")) === null || _b === void 0 ? void 0 : _b.addEventListener("click", (clickEvent) => {
|
||||
clickEvent.preventDefault();
|
||||
bulmaJS.confirm({
|
||||
title: "Delete Work Order",
|
||||
message: "Are you sure you want to delete this work order?",
|
||||
contextualColorName: "warning",
|
||||
okButton: {
|
||||
text: "Yes, Delete Work Order",
|
||||
callbackFunction: doDelete
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
/*
|
||||
* Related Lots
|
||||
*/
|
||||
|
|
@ -660,6 +658,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
*/
|
||||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
var _a;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
let workOrderComments = exports.workOrderComments;
|
||||
delete exports.workOrderComments;
|
||||
|
|
@ -825,8 +824,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}
|
||||
});
|
||||
}
|
||||
(_a = document.querySelector("#workOrderComments--add")) === null || _a === void 0 ? void 0 : _a.addEventListener("click", openAddCommentModal);
|
||||
if (!isCreate) {
|
||||
document.querySelector("#workOrderComments--add").addEventListener("click", openAddCommentModal);
|
||||
renderWorkOrderComments();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
var _a, _b;
|
||||
const los = exports.los;
|
||||
const workOrderId = document.querySelector("#workOrderEdit--workOrderId").value;
|
||||
const isCreate = workOrderId === "";
|
||||
|
|
@ -14,8 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
if (responseJSON.success) {
|
||||
cityssm.disableNavBlocker();
|
||||
if (isCreate) {
|
||||
window.location.href =
|
||||
los.urlPrefix + "/workOrders/" + responseJSON.workOrderId + "/edit";
|
||||
window.location.href = los.getWorkOrderURL(responseJSON.workOrderId, true);
|
||||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
|
|
@ -73,19 +73,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
});
|
||||
}
|
||||
let workOrderMilestones;
|
||||
if (!isCreate) {
|
||||
document.querySelector("#button--closeWorkOrder").addEventListener("click", () => {
|
||||
const hasOpenMilestones = workOrderMilestones.some((milestone) => {
|
||||
return !milestone.workOrderMilestoneCompletionDate;
|
||||
});
|
||||
if (hasOpenMilestones) {
|
||||
bulmaJS.alert({
|
||||
title: "Outstanding Milestones",
|
||||
message: `You cannot close a work order with outstanding milestones.
|
||||
(_a = document.querySelector("#button--closeWorkOrder")) === null || _a === void 0 ? void 0 : _a.addEventListener("click", () => {
|
||||
const hasOpenMilestones = workOrderMilestones.some((milestone) => {
|
||||
return !milestone.workOrderMilestoneCompletionDate;
|
||||
});
|
||||
if (hasOpenMilestones) {
|
||||
bulmaJS.alert({
|
||||
title: "Outstanding Milestones",
|
||||
message: `You cannot close a work order with outstanding milestones.
|
||||
Either complete the outstanding milestones, or remove them from the work order.`,
|
||||
contextualColorName: "warning"
|
||||
});
|
||||
/*
|
||||
contextualColorName: "warning"
|
||||
});
|
||||
/*
|
||||
// Disable closing work orders with open milestones
|
||||
bulmaJS.confirm({
|
||||
title: "Close Work Order with Outstanding Milestones",
|
||||
|
|
@ -98,32 +97,31 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}
|
||||
});
|
||||
*/
|
||||
}
|
||||
else {
|
||||
bulmaJS.confirm({
|
||||
title: "Close Work Order",
|
||||
message: "Are you sure you want to close this work order?",
|
||||
contextualColorName: "info",
|
||||
okButton: {
|
||||
text: "Yes, Close Work Order",
|
||||
callbackFunction: doClose
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
document.querySelector("#button--deleteWorkOrder").addEventListener("click", (clickEvent) => {
|
||||
clickEvent.preventDefault();
|
||||
}
|
||||
else {
|
||||
bulmaJS.confirm({
|
||||
title: "Delete Work Order",
|
||||
message: "Are you sure you want to delete this work order?",
|
||||
contextualColorName: "warning",
|
||||
title: "Close Work Order",
|
||||
message: "Are you sure you want to close this work order?",
|
||||
contextualColorName: "info",
|
||||
okButton: {
|
||||
text: "Yes, Delete Work Order",
|
||||
callbackFunction: doDelete
|
||||
text: "Yes, Close Work Order",
|
||||
callbackFunction: doClose
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
(_b = document.querySelector("#button--deleteWorkOrder")) === null || _b === void 0 ? void 0 : _b.addEventListener("click", (clickEvent) => {
|
||||
clickEvent.preventDefault();
|
||||
bulmaJS.confirm({
|
||||
title: "Delete Work Order",
|
||||
message: "Are you sure you want to delete this work order?",
|
||||
contextualColorName: "warning",
|
||||
okButton: {
|
||||
text: "Yes, Delete Work Order",
|
||||
callbackFunction: doDelete
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
/*
|
||||
* Related Lots
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -36,8 +36,7 @@ declare const bulmaJS: BulmaJS;
|
|||
cityssm.disableNavBlocker();
|
||||
|
||||
if (isCreate) {
|
||||
window.location.href =
|
||||
los.urlPrefix + "/workOrders/" + responseJSON.workOrderId + "/edit";
|
||||
window.location.href = los.getWorkOrderURL(responseJSON.workOrderId!, true);
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
message: "Work Order Updated Successfully",
|
||||
|
|
@ -109,21 +108,20 @@ declare const bulmaJS: BulmaJS;
|
|||
|
||||
let workOrderMilestones: recordTypes.WorkOrderMilestone[];
|
||||
|
||||
if (!isCreate) {
|
||||
document.querySelector("#button--closeWorkOrder")!.addEventListener("click", () => {
|
||||
const hasOpenMilestones = workOrderMilestones.some((milestone) => {
|
||||
return !milestone.workOrderMilestoneCompletionDate;
|
||||
document.querySelector("#button--closeWorkOrder")?.addEventListener("click", () => {
|
||||
const hasOpenMilestones = workOrderMilestones.some((milestone) => {
|
||||
return !milestone.workOrderMilestoneCompletionDate;
|
||||
});
|
||||
|
||||
if (hasOpenMilestones) {
|
||||
bulmaJS.alert({
|
||||
title: "Outstanding Milestones",
|
||||
message: `You cannot close a work order with outstanding milestones.
|
||||
Either complete the outstanding milestones, or remove them from the work order.`,
|
||||
contextualColorName: "warning"
|
||||
});
|
||||
|
||||
if (hasOpenMilestones) {
|
||||
bulmaJS.alert({
|
||||
title: "Outstanding Milestones",
|
||||
message: `You cannot close a work order with outstanding milestones.
|
||||
Either complete the outstanding milestones, or remove them from the work order.`,
|
||||
contextualColorName: "warning"
|
||||
});
|
||||
|
||||
/*
|
||||
/*
|
||||
// Disable closing work orders with open milestones
|
||||
bulmaJS.confirm({
|
||||
title: "Close Work Order with Outstanding Milestones",
|
||||
|
|
@ -136,33 +134,32 @@ declare const bulmaJS: BulmaJS;
|
|||
}
|
||||
});
|
||||
*/
|
||||
} else {
|
||||
bulmaJS.confirm({
|
||||
title: "Close Work Order",
|
||||
message: "Are you sure you want to close this work order?",
|
||||
contextualColorName: "info",
|
||||
okButton: {
|
||||
text: "Yes, Close Work Order",
|
||||
callbackFunction: doClose
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
document.querySelector("#button--deleteWorkOrder")!.addEventListener("click", (clickEvent: Event) => {
|
||||
clickEvent.preventDefault();
|
||||
|
||||
} else {
|
||||
bulmaJS.confirm({
|
||||
title: "Delete Work Order",
|
||||
message: "Are you sure you want to delete this work order?",
|
||||
contextualColorName: "warning",
|
||||
title: "Close Work Order",
|
||||
message: "Are you sure you want to close this work order?",
|
||||
contextualColorName: "info",
|
||||
okButton: {
|
||||
text: "Yes, Delete Work Order",
|
||||
callbackFunction: doDelete
|
||||
text: "Yes, Close Work Order",
|
||||
callbackFunction: doClose
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
document.querySelector("#button--deleteWorkOrder")?.addEventListener("click", (clickEvent: Event) => {
|
||||
clickEvent.preventDefault();
|
||||
|
||||
bulmaJS.confirm({
|
||||
title: "Delete Work Order",
|
||||
message: "Are you sure you want to delete this work order?",
|
||||
contextualColorName: "warning",
|
||||
okButton: {
|
||||
text: "Yes, Delete Work Order",
|
||||
callbackFunction: doDelete
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
* Related Lots
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
var _a;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
let workOrderComments = exports.workOrderComments;
|
||||
delete exports.workOrderComments;
|
||||
|
|
@ -165,7 +166,7 @@ function openAddCommentModal() {
|
|||
}
|
||||
});
|
||||
}
|
||||
(_a = document.querySelector("#workOrderComments--add")) === null || _a === void 0 ? void 0 : _a.addEventListener("click", openAddCommentModal);
|
||||
if (!isCreate) {
|
||||
document.querySelector("#workOrderComments--add").addEventListener("click", openAddCommentModal);
|
||||
renderWorkOrderComments();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,8 +249,8 @@ function openAddCommentModal() {
|
|||
});
|
||||
}
|
||||
|
||||
if (!isCreate) {
|
||||
document.querySelector("#workOrderComments--add")!.addEventListener("click", openAddCommentModal);
|
||||
document.querySelector("#workOrderComments--add")?.addEventListener("click", openAddCommentModal);
|
||||
|
||||
if (!isCreate) {
|
||||
renderWorkOrderComments();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -720,15 +720,9 @@ document.querySelector("#button--addLot")!.addEventListener("click", () => {
|
|||
onshown(modalElement) {
|
||||
bulmaJS.toggleHtmlClipped();
|
||||
|
||||
(modalElement.querySelector("#lotSearch--lotName") as HTMLInputElement).addEventListener(
|
||||
"change",
|
||||
doSearch
|
||||
);
|
||||
modalElement.querySelector("#lotSearch--lotName")!.addEventListener("change", doSearch);
|
||||
|
||||
(modalElement.querySelector("#lotSearch--lotStatusId") as HTMLSelectElement).addEventListener(
|
||||
"change",
|
||||
doSearch
|
||||
);
|
||||
modalElement.querySelector("#lotSearch--lotStatusId")!.addEventListener("change", doSearch);
|
||||
|
||||
searchFormElement.addEventListener("submit", doSearch);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -88,9 +88,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
los.getRandomColor(milestone.workOrderNumber || "") +
|
||||
'" aria-hidden="true"></i>' +
|
||||
' <a class="has-text-weight-bold" href="' +
|
||||
los.urlPrefix +
|
||||
"/workOrders/" +
|
||||
milestone.workOrderId +
|
||||
los.getWorkOrderURL(milestone.workOrderId) +
|
||||
'">' +
|
||||
cityssm.escapeHTML(milestone.workOrderNumber || "") +
|
||||
"</a><br />" +
|
||||
|
|
|
|||
|
|
@ -122,9 +122,7 @@ declare const cityssm: cityssmGlobal;
|
|||
los.getRandomColor(milestone.workOrderNumber || "") +
|
||||
'" aria-hidden="true"></i>' +
|
||||
' <a class="has-text-weight-bold" href="' +
|
||||
los.urlPrefix +
|
||||
"/workOrders/" +
|
||||
milestone.workOrderId +
|
||||
los.getWorkOrderURL(milestone.workOrderId!) +
|
||||
'">' +
|
||||
cityssm.escapeHTML(milestone.workOrderNumber || "") +
|
||||
"</a><br />" +
|
||||
|
|
|
|||
|
|
@ -50,9 +50,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
resultsTbodyElement.insertAdjacentHTML("beforeend", "<tr>" +
|
||||
("<td>" +
|
||||
'<a class="has-text-weight-bold" href="' +
|
||||
los.urlPrefix +
|
||||
"/workOrders/" +
|
||||
workOrder.workOrderId +
|
||||
los.getWorkOrderURL(workOrder.workOrderId) +
|
||||
'">' +
|
||||
(workOrder.workOrderNumber.trim()
|
||||
? cityssm.escapeHTML(workOrder.workOrderNumber || "")
|
||||
|
|
|
|||
|
|
@ -76,9 +76,7 @@ declare const cityssm: cityssmGlobal;
|
|||
"<tr>" +
|
||||
("<td>" +
|
||||
'<a class="has-text-weight-bold" href="' +
|
||||
los.urlPrefix +
|
||||
"/workOrders/" +
|
||||
workOrder.workOrderId +
|
||||
los.getWorkOrderURL(workOrder.workOrderId!) +
|
||||
'">' +
|
||||
(workOrder.workOrderNumber!.trim()
|
||||
? cityssm.escapeHTML(workOrder.workOrderNumber || "")
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
"use strict";
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
/* eslint-disable unicorn/prefer-module, @typescript-eslint/no-non-null-assertion */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
const los = exports.los;
|
||||
|
|
@ -13,11 +13,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}, (responseJSON) => {
|
||||
if (responseJSON.success) {
|
||||
window.location.href =
|
||||
los.urlPrefix +
|
||||
"/workOrders/" +
|
||||
workOrderId +
|
||||
"/edit/?t=" +
|
||||
Date.now();
|
||||
los.getWorkOrderURL(workOrderId, true, true);
|
||||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* eslint-disable unicorn/prefer-module */
|
||||
/* eslint-disable unicorn/prefer-module, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
import type * as globalTypes from "../types/globalTypes";
|
||||
|
||||
|
|
@ -17,7 +17,7 @@ declare const bulmaJS: BulmaJS;
|
|||
) as HTMLButtonElement;
|
||||
|
||||
if (reopenWorkOrderButtonElement) {
|
||||
const workOrderId = reopenWorkOrderButtonElement.dataset.workOrderId;
|
||||
const workOrderId = reopenWorkOrderButtonElement.dataset.workOrderId!;
|
||||
|
||||
reopenWorkOrderButtonElement.addEventListener("click", () => {
|
||||
function doReopen() {
|
||||
|
|
@ -29,11 +29,7 @@ declare const bulmaJS: BulmaJS;
|
|||
(responseJSON: { success: boolean; errorMessage?: string }) => {
|
||||
if (responseJSON.success) {
|
||||
window.location.href =
|
||||
los.urlPrefix +
|
||||
"/workOrders/" +
|
||||
workOrderId +
|
||||
"/edit/?t=" +
|
||||
Date.now();
|
||||
los.getWorkOrderURL(workOrderId, true, true);
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
title: "Error Reopening Work Order",
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -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){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()})();
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const t=exports.los,a=document.querySelector("#form--searchFilters"),e=document.querySelector("#container--searchResults"),s=Number.parseInt(document.querySelector("#searchFilter--limit").value,10),c=document.querySelector("#searchFilter--offset");function n(a){var c,n;if(0===a.lotOccupancies.length)return void(e.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 e of a.lotOccupancies){let a="";a=e.occupancyStartDateString<=r&&(""===e.occupancyEndDateString||e.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>`:e.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 e.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">'+a+'</td><td><a class="has-text-weight-bold" href="'+t.getLotOccupancyURL(e.lotOccupancyId)+'">'+cityssm.escapeHTML(e.occupancyType)+"</a></td><td>"+(e.lotName?'<a class="has-tooltip-right" data-tooltip="'+cityssm.escapeHTML(e.lotType||"")+'" href="'+t.getLotURL(e.lotId)+'">'+cityssm.escapeHTML(e.lotName)+"</a>":'<span class="has-text-grey">(No '+t.escapedAliases.Lot+")</span>")+'<br /><span class="is-size-7">'+cityssm.escapeHTML(e.mapName||"")+"</span></td><td>"+e.occupancyStartDateString+"</td><td>"+(e.occupancyEndDate?e.occupancyEndDateString:'<span class="has-text-grey">(No End Date)</span>')+"</td><td>"+s+"</td><td>"+(e.printEJS?'<a class="button is-small" data-tooltip="Print" href="'+t.urlPrefix+"/print/"+e.printEJS+"/?lotOccupancyId="+e.lotOccupancyId+'" target="_blank"><i class="fas fa-print" aria-label="Print"></i></a>':"")+"</td></tr>")}e.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>`,e.querySelector("table").append(i),e.insertAdjacentHTML("beforeend",t.getSearchResultsPagerHTML(s,a.offset,a.count)),null===(c=e.querySelector("button[data-page='previous']"))||void 0===c||c.addEventListener("click",o),null===(n=e.querySelector("button[data-page='next']"))||void 0===n||n.addEventListener("click",l)}function i(){e.innerHTML=t.getLoadingParagraphHTML(`Loading ${exports.aliases.occupancies}...`),cityssm.postJSON(t.urlPrefix+"/lotOccupancies/doSearchLotOccupancies",a,n)}function r(){c.value="0",i()}function o(){c.value=Math.max(Number.parseInt(c.value,10)-s,0).toString(),i()}function l(){c.value=(Number.parseInt(c.value,10)+s).toString(),i()}const p=a.querySelectorAll("input, select");for(const t of p)t.addEventListener("change",r);a.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){var r,n;if(0===t.lots.length)return void(s.innerHTML=`<div class="message is-info">\n <p class="message-body">There are no ${e.escapedAliases.lots} that meet the search criteria.</p>\n </div>`);const 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()})();
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,t=document.querySelector("#form--searchFilters"),s=document.querySelector("#container--searchResults"),a=Number.parseInt(document.querySelector("#searchFilter--limit").value,10),n=document.querySelector("#searchFilter--offset");function r(t){var n,r;if(0===t.lots.length)return void(s.innerHTML=`<div class="message is-info">\n <p class="message-body">There are no ${e.escapedAliases.lots} that meet the search criteria.</p>\n </div>`);const o=document.createElement("tbody");for(const s of t.lots)o.insertAdjacentHTML("beforeend",'<tr><td><a class="has-text-weight-bold" href="'+e.getLotURL(s.lotId)+'">'+cityssm.escapeHTML(s.lotName||"")+'</a></td><td><a href="'+e.getMapURL(s.mapId)+'">'+(s.mapName?cityssm.escapeHTML(s.mapName):'<span class="has-text-grey">(No Name)</span>')+"</a></td><td>"+cityssm.escapeHTML(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===(n=s.querySelector("button[data-page='previous']"))||void 0===n||n.addEventListener("click",l),null===(r=s.querySelector("button[data-page='next']"))||void 0===r||r.addEventListener("click",i)}function o(){s.innerHTML=e.getLoadingParagraphHTML(`Loading ${e.escapedAliases.Lots}...`),cityssm.postJSON(e.urlPrefix+"/lots/doSearchLots",t,r)}function c(){n.value="0",o()}function l(){n.value=Math.max(Number.parseInt(n.value,10)-a,0).toString(),o()}function i(){n.value=(Number.parseInt(n.value,10)+a).toString(),o()}const d=t.querySelectorAll("input, select");for(const e of d)e.addEventListener("change",c);t.addEventListener("submit",e=>{e.preventDefault(),c()}),o()})();
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,t=document.querySelector("#map--mapId").value,a=""===t,s=document.querySelector("#form--map");s.addEventListener("submit",function(t){t.preventDefault(),cityssm.postJSON(e.urlPrefix+"/maps/"+(a?"doCreateMap":"doUpdateMap"),s,t=>{t.success?(cityssm.disableNavBlocker(),a?window.location.href=e.urlPrefix+"/maps/"+t.mapId+"/edit":bulmaJS.alert({message:exports.aliases.map+" Updated Successfully",contextualColorName:"success"})):bulmaJS.alert({title:"Error Updating "+exports.aliases.map,message:t.errorMessage||"",contextualColorName:"danger"})})});const o=s.querySelectorAll("input, select");for(const e of o)e.addEventListener("change",cityssm.enableNavBlocker);a||document.querySelector("#button--deleteMap").addEventListener("click",a=>{a.preventDefault(),bulmaJS.confirm({title:"Delete "+exports.aliases.map,message:`Are you sure you want to delete this ${exports.aliases.map.toLowerCase()} and all related ${exports.aliases.lots.toLowerCase()}?`,contextualColorName:"warning",okButton:{text:`Yes, Delete ${exports.aliases.map}`,callbackFunction:function(){cityssm.postJSON(e.urlPrefix+"/maps/doDeleteMap",{mapId:t},t=>{t.success?window.location.href=e.urlPrefix+"/maps?t="+Date.now():bulmaJS.alert({title:"Error Deleting "+exports.aliases.map,message:t.errorMessage||"",contextualColorName:"danger"})})}}})})})();
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{var e;const t=exports.los,a=document.querySelector("#map--mapId").value,s=""===a,o=document.querySelector("#form--map");o.addEventListener("submit",function(e){e.preventDefault(),cityssm.postJSON(t.urlPrefix+"/maps/"+(s?"doCreateMap":"doUpdateMap"),o,e=>{e.success?(cityssm.disableNavBlocker(),s?window.location.href=t.urlPrefix+"/maps/"+e.mapId+"/edit":bulmaJS.alert({message:exports.aliases.map+" Updated Successfully",contextualColorName:"success"})):bulmaJS.alert({title:"Error Updating "+exports.aliases.map,message:e.errorMessage||"",contextualColorName:"danger"})})});const r=o.querySelectorAll("input, select");for(const e of r)e.addEventListener("change",cityssm.enableNavBlocker);null===(e=document.querySelector("#button--deleteMap"))||void 0===e||e.addEventListener("click",e=>{e.preventDefault(),bulmaJS.confirm({title:"Delete "+exports.aliases.map,message:`Are you sure you want to delete this ${exports.aliases.map.toLowerCase()} and all related ${exports.aliases.lots.toLowerCase()}?`,contextualColorName:"warning",okButton:{text:`Yes, Delete ${exports.aliases.map}`,callbackFunction:function(){cityssm.postJSON(t.urlPrefix+"/maps/doDeleteMap",{mapId:a},e=>{e.success?window.location.href=t.urlPrefix+"/maps?t="+Date.now():bulmaJS.alert({title:"Error Deleting "+exports.aliases.map,message:e.errorMessage||"",contextualColorName:"danger"})})}}})})})();
|
||||
|
|
@ -1 +1 @@
|
|||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,s=exports.maps,a=document.querySelector("#searchFilter--map"),t=document.querySelector("#container--searchResults");function r(){t.innerHTML=e.getLoadingParagraphHTML(`Loading ${exports.aliases.maps}...`);let r=0;const i=document.createElement("tbody"),d=a.value.trim().toLowerCase().split(" ");for(const a of s){const s=`${a.mapName} ${a.mapDescription} ${a.mapAddress1} ${a.mapAddress2}`.toLowerCase();let t=!0;for(const e of d)if(!s.includes(e)){t=!1;break}t&&(r+=1,i.insertAdjacentHTML("beforeend",'<tr><td><a class="has-text-weight-bold" href="'+e.urlPrefix+"/maps/"+a.mapId+'">'+cityssm.escapeHTML(a.mapName||"(No Name)")+'</a><br /><span class="is-size-7">'+cityssm.escapeHTML(a.mapDescription||"")+"</span></td><td>"+(a.mapAddress1?cityssm.escapeHTML(a.mapAddress1)+"<br />":"")+(a.mapAddress2?cityssm.escapeHTML(a.mapAddress2)+"<br />":"")+(a.mapCity||a.mapProvince?cityssm.escapeHTML(a.mapCity||"")+", "+cityssm.escapeHTML(a.mapProvince||"")+"<br />":"")+(a.mapPostalCode?cityssm.escapeHTML(a.mapPostalCode):"")+"</td><td>"+cityssm.escapeHTML(a.mapPhoneNumber||"")+'</td><td class="has-text-centered">'+(a.mapLatitude&&a.mapLongitude?'<span data-tooltip="Has Geographic Coordinates"><i class="fas fa-map-marker-alt" aria-label="Has Geographic Coordinates"></i></span>':"")+'</td><td class="has-text-centered">'+(a.mapSVG?'<span data-tooltip="Has Image"><i class="fas fa-image" aria-label="Has Image"></i></span>':"")+'</td><td class="has-text-right"><a href="'+e.urlPrefix+"/lots?mapId="+a.mapId+'">'+a.lotCount+"</a></td></tr>"))}if(t.innerHTML="",0===r)t.innerHTML=`<div class="message is-info">\n <p class="message-body">There are no ${e.escapedAliases.maps} that meet the search criteria.</p>\n </div>`;else{const s=document.createElement("table");s.className="table is-fullwidth is-striped is-hoverable has-sticky-header",s.innerHTML=`<thead><tr>\n <th>${e.escapedAliases.Map}</th>\n <th>Address</th>\n <th>Phone Number</th>\n <th class="has-text-centered">Coordinates</th>\n <th class="has-text-centered">Image</th>\n <th class="has-text-right">${e.escapedAliases.Lot} Count</th>\n </tr></thead>`,s.append(i),t.append(s)}}a.addEventListener("keyup",r),document.querySelector("#form--searchFilters").addEventListener("submit",e=>{e.preventDefault(),r()}),r()})();
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,s=exports.maps,a=document.querySelector("#searchFilter--map"),t=document.querySelector("#container--searchResults");function r(){t.innerHTML=e.getLoadingParagraphHTML(`Loading ${e.escapedAliases.Maps}...`);let r=0;const i=document.createElement("tbody"),d=a.value.trim().toLowerCase().split(" ");for(const a of s){const s=`${a.mapName} ${a.mapDescription} ${a.mapAddress1} ${a.mapAddress2}`.toLowerCase();let t=!0;for(const e of d)if(!s.includes(e)){t=!1;break}t&&(r+=1,i.insertAdjacentHTML("beforeend",'<tr><td><a class="has-text-weight-bold" href="'+e.urlPrefix+"/maps/"+a.mapId+'">'+cityssm.escapeHTML(a.mapName||"(No Name)")+'</a><br /><span class="is-size-7">'+cityssm.escapeHTML(a.mapDescription||"")+"</span></td><td>"+(a.mapAddress1?cityssm.escapeHTML(a.mapAddress1)+"<br />":"")+(a.mapAddress2?cityssm.escapeHTML(a.mapAddress2)+"<br />":"")+(a.mapCity||a.mapProvince?cityssm.escapeHTML(a.mapCity||"")+", "+cityssm.escapeHTML(a.mapProvince||"")+"<br />":"")+(a.mapPostalCode?cityssm.escapeHTML(a.mapPostalCode):"")+"</td><td>"+cityssm.escapeHTML(a.mapPhoneNumber||"")+'</td><td class="has-text-centered">'+(a.mapLatitude&&a.mapLongitude?'<span data-tooltip="Has Geographic Coordinates"><i class="fas fa-map-marker-alt" aria-label="Has Geographic Coordinates"></i></span>':"")+'</td><td class="has-text-centered">'+(a.mapSVG?'<span data-tooltip="Has Image"><i class="fas fa-image" aria-label="Has Image"></i></span>':"")+'</td><td class="has-text-right"><a href="'+e.urlPrefix+"/lots?mapId="+a.mapId+'">'+a.lotCount+"</a></td></tr>"))}if(t.innerHTML="",0===r)t.innerHTML=`<div class="message is-info">\n <p class="message-body">There are no ${e.escapedAliases.maps} that meet the search criteria.</p>\n </div>`;else{const s=document.createElement("table");s.className="table is-fullwidth is-striped is-hoverable has-sticky-header",s.innerHTML=`<thead><tr>\n <th>${e.escapedAliases.Map}</th>\n <th>Address</th>\n <th>Phone Number</th>\n <th class="has-text-centered">Coordinates</th>\n <th class="has-text-centered">Image</th>\n <th class="has-text-right">${e.escapedAliases.Lot} Count</th>\n </tr></thead>`,s.append(i),t.append(s)}}a.addEventListener("keyup",r),document.querySelector("#form--searchFilters").addEventListener("submit",e=>{e.preventDefault(),r()}),r()})();
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,s=document.querySelector("#form--searchFilters"),r=s.querySelector("#searchFilter--workOrderMilestoneDateFilter"),a=s.querySelector("#searchFilter--workOrderMilestoneDateString"),t=document.querySelector("#container--milestoneCalendar");function i(r){r&&r.preventDefault(),t.innerHTML=e.getLoadingParagraphHTML("Loading Milestones..."),cityssm.postJSON(e.urlPrefix+"/workOrders/doGetWorkOrderMilestones",s,s=>{!function(s){if(0===s.length)return void(t.innerHTML='<div class="message is-info">\n <p class="message-body">There are no milestones that meet the search criteria.</p>\n </div>');t.innerHTML="";const r=cityssm.dateToString(new Date);let a,i="";for(const o of s){i!==o.workOrderMilestoneDateString&&(a&&t.append(a),(a=document.createElement("div")).className="panel",a.innerHTML=`<h2 class="panel-heading">${o.workOrderMilestoneDateString}</h2>`,i=o.workOrderMilestoneDateString);const s=document.createElement("div");s.className="panel-block is-block",!o.workOrderMilestoneCompletionDate&&o.workOrderMilestoneDateString<r&&s.classList.add("has-background-warning-light");let n="";for(const s of o.workOrderLots)n+='<span class="has-tooltip-left" data-tooltip="'+cityssm.escapeHTML(s.mapName||"")+'"><i class="fas fa-vector-square" aria-label="'+e.escapedAliases.Lot+'"></i> '+cityssm.escapeHTML(s.lotName||"")+"</span><br />";for(const s of o.workOrderLotOccupancies)for(const r of s.lotOccupancyOccupants)n+='<span class="has-tooltip-left" data-tooltip="'+cityssm.escapeHTML(r.lotOccupantType||"")+'"><i class="fas fa-user" aria-label="'+e.escapedAliases.Occupancy+'"></i> '+cityssm.escapeHTML(r.occupantName||"")+"</span><br />";s.innerHTML='<div class="columns"><div class="column is-narrow"><span class="icon is-small">'+(o.workOrderMilestoneCompletionDate?'<i class="fas fa-check" aria-label="Completed"></i>':'<i class="far fa-square has-text-grey" aria-label="Incomplete"></i>')+'</span></div><div class="column">'+(0===o.workOrderMilestoneTime?"":o.workOrderMilestoneTimeString+"<br />")+(o.workOrderMilestoneTypeId?"<strong>"+cityssm.escapeHTML(o.workOrderMilestoneType)+"</strong><br />":"")+'<span class="is-size-7">'+cityssm.escapeHTML(o.workOrderMilestoneDescription)+'</span></div><div class="column"><i class="fas fa-circle" style="color:'+e.getRandomColor(o.workOrderNumber||"")+'" aria-hidden="true"></i> <a class="has-text-weight-bold" href="'+e.urlPrefix+"/workOrders/"+o.workOrderId+'">'+cityssm.escapeHTML(o.workOrderNumber||"")+'</a><br /><span class="is-size-7">'+cityssm.escapeHTML(o.workOrderDescription||"")+'</span></div><div class="column is-size-7">'+n+"</div></div>",a.append(s)}t.append(a)}(s.workOrderMilestones)})}r.addEventListener("change",()=>{a.closest("fieldset").disabled="date"!==r.value,i()}),e.initializeDatePickers(s),a.addEventListener("change",i),s.addEventListener("submit",i),i()})();
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,s=document.querySelector("#form--searchFilters"),r=s.querySelector("#searchFilter--workOrderMilestoneDateFilter"),a=s.querySelector("#searchFilter--workOrderMilestoneDateString"),t=document.querySelector("#container--milestoneCalendar");function i(r){r&&r.preventDefault(),t.innerHTML=e.getLoadingParagraphHTML("Loading Milestones..."),cityssm.postJSON(e.urlPrefix+"/workOrders/doGetWorkOrderMilestones",s,s=>{!function(s){if(0===s.length)return void(t.innerHTML='<div class="message is-info">\n <p class="message-body">There are no milestones that meet the search criteria.</p>\n </div>');t.innerHTML="";const r=cityssm.dateToString(new Date);let a,i="";for(const o of s){i!==o.workOrderMilestoneDateString&&(a&&t.append(a),(a=document.createElement("div")).className="panel",a.innerHTML=`<h2 class="panel-heading">${o.workOrderMilestoneDateString}</h2>`,i=o.workOrderMilestoneDateString);const s=document.createElement("div");s.className="panel-block is-block",!o.workOrderMilestoneCompletionDate&&o.workOrderMilestoneDateString<r&&s.classList.add("has-background-warning-light");let n="";for(const s of o.workOrderLots)n+='<span class="has-tooltip-left" data-tooltip="'+cityssm.escapeHTML(s.mapName||"")+'"><i class="fas fa-vector-square" aria-label="'+e.escapedAliases.Lot+'"></i> '+cityssm.escapeHTML(s.lotName||"")+"</span><br />";for(const s of o.workOrderLotOccupancies)for(const r of s.lotOccupancyOccupants)n+='<span class="has-tooltip-left" data-tooltip="'+cityssm.escapeHTML(r.lotOccupantType||"")+'"><i class="fas fa-user" aria-label="'+e.escapedAliases.Occupancy+'"></i> '+cityssm.escapeHTML(r.occupantName||"")+"</span><br />";s.innerHTML='<div class="columns"><div class="column is-narrow"><span class="icon is-small">'+(o.workOrderMilestoneCompletionDate?'<i class="fas fa-check" aria-label="Completed"></i>':'<i class="far fa-square has-text-grey" aria-label="Incomplete"></i>')+'</span></div><div class="column">'+(0===o.workOrderMilestoneTime?"":o.workOrderMilestoneTimeString+"<br />")+(o.workOrderMilestoneTypeId?"<strong>"+cityssm.escapeHTML(o.workOrderMilestoneType)+"</strong><br />":"")+'<span class="is-size-7">'+cityssm.escapeHTML(o.workOrderMilestoneDescription)+'</span></div><div class="column"><i class="fas fa-circle" style="color:'+e.getRandomColor(o.workOrderNumber||"")+'" aria-hidden="true"></i> <a class="has-text-weight-bold" href="'+e.getWorkOrderURL(o.workOrderId)+'">'+cityssm.escapeHTML(o.workOrderNumber||"")+'</a><br /><span class="is-size-7">'+cityssm.escapeHTML(o.workOrderDescription||"")+'</span></div><div class="column is-size-7">'+n+"</div></div>",a.append(s)}t.append(a)}(s.workOrderMilestones)})}r.addEventListener("change",()=>{a.closest("fieldset").disabled="date"!==r.value,i()}),e.initializeDatePickers(s),a.addEventListener("change",i),s.addEventListener("submit",i),i()})();
|
||||
|
|
@ -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){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()})();
|
||||
"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.getWorkOrderURL(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()})();
|
||||
|
|
@ -1 +1 @@
|
|||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,r=document.querySelector("#button--reopenWorkOrder");if(r){const o=r.dataset.workOrderId;r.addEventListener("click",()=>{bulmaJS.confirm({title:"Reopen Work Order",message:"Are you sure you want to remove the close date from this work order and reopen it?",contextualColorName:"warning",okButton:{text:"Yes, Reopen Work Order",callbackFunction:function(){cityssm.postJSON(e.urlPrefix+"/workOrders/doReopenWorkOrder",{workOrderId:o},r=>{r.success?window.location.href=e.urlPrefix+"/workOrders/"+o+"/edit/?t="+Date.now():bulmaJS.alert({title:"Error Reopening Work Order",message:r.errorMessage||"",contextualColorName:"danger"})})}}})})}})();
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,r=document.querySelector("#button--reopenWorkOrder");if(r){const o=r.dataset.workOrderId;r.addEventListener("click",()=>{bulmaJS.confirm({title:"Reopen Work Order",message:"Are you sure you want to remove the close date from this work order and reopen it?",contextualColorName:"warning",okButton:{text:"Yes, Reopen Work Order",callbackFunction:function(){cityssm.postJSON(e.urlPrefix+"/workOrders/doReopenWorkOrder",{workOrderId:o},r=>{r.success?window.location.href=e.getWorkOrderURL(o,!0,!0):bulmaJS.alert({title:"Error Reopening Work Order",message:r.errorMessage||"",contextualColorName:"danger"})})}}})})}})();
|
||||
|
|
@ -38,4 +38,8 @@ export interface LOS {
|
|||
getMoveUpDownButtonFieldHTML: (upButtonClassNames: string, downButtonClassNames: string, isSmall?: boolean) => string;
|
||||
getLoadingParagraphHTML: (captionText?: string) => string;
|
||||
getSearchResultsPagerHTML: (limit: number, offset: number, count: number) => string;
|
||||
getMapURL: (mapId: number | string, edit?: boolean, time?: boolean) => string;
|
||||
getLotURL: (lotId: number | string, edit?: boolean, time?: boolean) => string;
|
||||
getLotOccupancyURL: (lotOccupancyId: number | string, edit?: boolean, time?: boolean) => string;
|
||||
getWorkOrderURL: (workOrderId: number | string, edit?: boolean, time?: boolean) => string;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,16 @@ export interface LOS {
|
|||
clearUnsavedChanges: () => void;
|
||||
hasUnsavedChanges: () => boolean;
|
||||
|
||||
getMoveUpDownButtonFieldHTML: (upButtonClassNames: string, downButtonClassNames: string, isSmall?: boolean) => string;
|
||||
getMoveUpDownButtonFieldHTML: (
|
||||
upButtonClassNames: string,
|
||||
downButtonClassNames: string,
|
||||
isSmall?: boolean
|
||||
) => string;
|
||||
getLoadingParagraphHTML: (captionText?: string) => string;
|
||||
getSearchResultsPagerHTML: (limit: number, offset: number, count: number) => string;
|
||||
|
||||
getMapURL: (mapId: number | string, edit?: boolean, time?: boolean) => string;
|
||||
getLotURL: (lotId: number | string, edit?: boolean, time?: boolean) => string;
|
||||
getLotOccupancyURL: (lotOccupancyId: number | string, edit?: boolean, time?: boolean) => string;
|
||||
getWorkOrderURL: (workOrderId: number | string, edit?: boolean, time?: boolean) => string;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue