reduce move up down button duplication

deepsource-autofix-76c6eb20
Dan Gowans 2022-12-30 14:20:52 -05:00
parent 677a0f33bd
commit b1f4eb9fd1
24 changed files with 165 additions and 293 deletions

View File

@ -51,18 +51,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
"</button>" +
"</div>") +
('<div class="control">' +
'<div class="field has-addons">' +
'<div class="control">' +
'<button class="button is-small button--moveFeeCategoryUp" data-tooltip="Move Up" type="button" aria-label="Move Up">' +
'<i class="fas fa-arrow-up" aria-hidden="true"></i>' +
"</button>" +
"</div>" +
'<div class="control">' +
'<button class="button is-small button--moveFeeCategoryDown" data-tooltip="Move Down" type="button" aria-label="Move Down">' +
'<i class="fas fa-arrow-down" aria-hidden="true"></i>' +
"</button>" +
"</div>" +
"</div>" +
los.getMoveUpDownButtonFieldHTML("button--moveFeeCategoryUp", "button--moveFeeCategoryDown") +
"</div>") +
"</div>") +
"</div>" +
@ -148,17 +137,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
"</div>" +
"</div>") +
('<div class="column is-narrow">' +
'<div class="field has-addons is-justify-content-end">' +
'<div class="control">' +
'<button class="button is-small button--moveFeeUp" data-tooltip="Move Up" type="button" aria-label="Move Up">' +
'<i class="fas fa-arrow-up" aria-hidden="true"></i>' +
"</button>" +
"</div>" +
'<div class="control">' +
'<button class="button is-small button--moveFeeDown" data-tooltip="Move Down" type="button" aria-label="Move Down">' +
'<i class="fas fa-arrow-down" aria-hidden="true"></i>' +
"</button>" +
"</div>" +
los.getMoveUpDownButtonFieldHTML("button--moveFeeUp", "button--moveFeeDown") +
"</div>" +
"</div>") +
"</div>";

View File

@ -71,18 +71,10 @@ declare const bulmaJS: BulmaJS;
"</button>" +
"</div>") +
('<div class="control">' +
'<div class="field has-addons">' +
'<div class="control">' +
'<button class="button is-small button--moveFeeCategoryUp" data-tooltip="Move Up" type="button" aria-label="Move Up">' +
'<i class="fas fa-arrow-up" aria-hidden="true"></i>' +
"</button>" +
"</div>" +
'<div class="control">' +
'<button class="button is-small button--moveFeeCategoryDown" data-tooltip="Move Down" type="button" aria-label="Move Down">' +
'<i class="fas fa-arrow-down" aria-hidden="true"></i>' +
"</button>" +
"</div>" +
"</div>" +
los.getMoveUpDownButtonFieldHTML(
"button--moveFeeCategoryUp",
"button--moveFeeCategoryDown"
) +
"</div>") +
"</div>") +
"</div>" +
@ -175,17 +167,10 @@ declare const bulmaJS: BulmaJS;
"</div>" +
"</div>") +
('<div class="column is-narrow">' +
'<div class="field has-addons is-justify-content-end">' +
'<div class="control">' +
'<button class="button is-small button--moveFeeUp" data-tooltip="Move Up" type="button" aria-label="Move Up">' +
'<i class="fas fa-arrow-up" aria-hidden="true"></i>' +
"</button>" +
"</div>" +
'<div class="control">' +
'<button class="button is-small button--moveFeeDown" data-tooltip="Move Down" type="button" aria-label="Move Down">' +
'<i class="fas fa-arrow-down" aria-hidden="true"></i>' +
"</button>" +
"</div>" +
los.getMoveUpDownButtonFieldHTML(
"button--moveFeeUp",
"button--moveFeeDown"
) +
"</div>" +
"</div>") +
"</div>";

View File

@ -280,18 +280,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
"</div>" +
'<div class="level-right">' +
('<div class="level-item">' +
'<div class="field has-addons">' +
'<div class="control">' +
'<button class="button is-small button--moveLotTypeFieldUp" data-tooltip="Move Up" type="button" aria-label="Move Up">' +
'<i class="fas fa-arrow-up" aria-hidden="true"></i>' +
"</button>" +
"</div>" +
'<div class="control">' +
'<button class="button is-small button--moveLotTypeFieldDown" data-tooltip="Move Down" type="button" aria-label="Move Down">' +
'<i class="fas fa-arrow-down" aria-hidden="true"></i>' +
"</button>" +
"</div>" +
"</div>" +
los.getMoveUpDownButtonFieldHTML("button--moveLotTypeFieldUp", "button--moveLotTypeFieldDown") +
"</div>") +
"</div>" +
"</div>";
@ -355,18 +344,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
"</button>" +
"</div>") +
('<div class="level-item">' +
'<div class="field has-addons">' +
'<div class="control">' +
'<button class="button is-small button--moveLotTypeUp" data-tooltip="Move Up" type="button" aria-label="Move Up">' +
'<i class="fas fa-arrow-up" aria-hidden="true"></i>' +
"</button>" +
"</div>" +
'<div class="control">' +
'<button class="button is-small button--moveLotTypeDown" data-tooltip="Move Down" type="button" aria-label="Move Down">' +
'<i class="fas fa-arrow-down" aria-hidden="true"></i>' +
"</button>" +
"</div>" +
"</div>" +
los.getMoveUpDownButtonFieldHTML("button--moveLotTypeUp", "button--moveLotTypeDown") +
"</div>") +
"</div>") +
"</div>" +

View File

@ -504,18 +504,10 @@ declare const bulmaJS: BulmaJS;
"</div>" +
'<div class="level-right">' +
('<div class="level-item">' +
'<div class="field has-addons">' +
'<div class="control">' +
'<button class="button is-small button--moveLotTypeFieldUp" data-tooltip="Move Up" type="button" aria-label="Move Up">' +
'<i class="fas fa-arrow-up" aria-hidden="true"></i>' +
"</button>" +
"</div>" +
'<div class="control">' +
'<button class="button is-small button--moveLotTypeFieldDown" data-tooltip="Move Down" type="button" aria-label="Move Down">' +
'<i class="fas fa-arrow-down" aria-hidden="true"></i>' +
"</button>" +
"</div>" +
"</div>" +
los.getMoveUpDownButtonFieldHTML(
"button--moveLotTypeFieldUp",
"button--moveLotTypeFieldDown"
) +
"</div>") +
"</div>" +
"</div>";
@ -601,18 +593,10 @@ declare const bulmaJS: BulmaJS;
"</button>" +
"</div>") +
('<div class="level-item">' +
'<div class="field has-addons">' +
'<div class="control">' +
'<button class="button is-small button--moveLotTypeUp" data-tooltip="Move Up" type="button" aria-label="Move Up">' +
'<i class="fas fa-arrow-up" aria-hidden="true"></i>' +
"</button>" +
"</div>" +
'<div class="control">' +
'<button class="button is-small button--moveLotTypeDown" data-tooltip="Move Down" type="button" aria-label="Move Down">' +
'<i class="fas fa-arrow-down" aria-hidden="true"></i>' +
"</button>" +
"</div>" +
"</div>" +
los.getMoveUpDownButtonFieldHTML(
"button--moveLotTypeUp",
"button--moveLotTypeDown"
) +
"</div>") +
"</div>") +
"</div>" +

View File

@ -287,18 +287,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
"</div>" +
'<div class="level-right">' +
('<div class="level-item">' +
'<div class="field has-addons">' +
'<div class="control">' +
'<button class="button is-small button--moveOccupancyTypeFieldUp" data-tooltip="Move Up" type="button" aria-label="Move Up">' +
'<i class="fas fa-arrow-up" aria-hidden="true"></i>' +
"</button>" +
"</div>" +
'<div class="control">' +
'<button class="button is-small button--moveOccupancyTypeFieldDown" data-tooltip="Move Down" type="button" aria-label="Move Down">' +
'<i class="fas fa-arrow-down" aria-hidden="true"></i>' +
"</button>" +
"</div>" +
"</div>" +
los.getMoveUpDownButtonFieldHTML("button--moveOccupancyTypeFieldUp", "button--moveOccupancyTypeFieldDown") +
"</div>") +
"</div>" +
"</div>";
@ -417,18 +406,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
"</div>" +
'<div class="level-right">' +
('<div class="level-item">' +
'<div class="field has-addons">' +
'<div class="control">' +
'<button class="button is-small button--moveOccupancyTypePrintUp" data-tooltip="Move Up" type="button" aria-label="Move Up">' +
'<i class="fas fa-arrow-up" aria-hidden="true"></i>' +
"</button>" +
"</div>" +
'<div class="control">' +
'<button class="button is-small button--moveOccupancyTypePrintDown" data-tooltip="Move Down" type="button" aria-label="Move Down">' +
'<i class="fas fa-arrow-down" aria-hidden="true"></i>' +
"</button>" +
"</div>" +
"</div>" +
los.getMoveUpDownButtonFieldHTML("button--moveOccupancyTypePrintUp", "button--moveOccupancyTypePrintDown") +
"</div>") +
('<div class="level-item">' +
'<button class="button is-small is-danger button--deleteOccupancyTypePrint" data-tooltip="Delete" type="button" aria-label="Delete Print">' +
@ -526,18 +504,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
"</button>" +
"</div>") +
('<div class="level-item">' +
'<div class="field has-addons">' +
'<div class="control">' +
'<button class="button is-small button--moveOccupancyTypeUp" data-tooltip="Move Up" type="button" aria-label="Move Up">' +
'<i class="fas fa-arrow-up" aria-hidden="true"></i>' +
"</button>" +
"</div>" +
'<div class="control">' +
'<button class="button is-small button--moveOccupancyTypeDown" data-tooltip="Move Down" type="button" aria-label="Move Down">' +
'<i class="fas fa-arrow-down" aria-hidden="true"></i>' +
"</button>" +
"</div>" +
"</div>" +
los.getMoveUpDownButtonFieldHTML("button--moveOccupancyTypeUp", "button--moveOccupancyTypeDown") +
"</div>") +
"</div>") +
"</div>" +

View File

@ -16,6 +16,7 @@ declare const bulmaJS: BulmaJS;
const occupancyTypesContainerElement = document.querySelector(
"#container--occupancyTypes"
) as HTMLElement;
const occupancyTypePrintsContainerElement = document.querySelector(
"#container--occupancyTypePrints"
) as HTMLElement;
@ -551,18 +552,10 @@ declare const bulmaJS: BulmaJS;
"</div>" +
'<div class="level-right">' +
('<div class="level-item">' +
'<div class="field has-addons">' +
'<div class="control">' +
'<button class="button is-small button--moveOccupancyTypeFieldUp" data-tooltip="Move Up" type="button" aria-label="Move Up">' +
'<i class="fas fa-arrow-up" aria-hidden="true"></i>' +
"</button>" +
"</div>" +
'<div class="control">' +
'<button class="button is-small button--moveOccupancyTypeFieldDown" data-tooltip="Move Down" type="button" aria-label="Move Down">' +
'<i class="fas fa-arrow-down" aria-hidden="true"></i>' +
"</button>" +
"</div>" +
"</div>" +
los.getMoveUpDownButtonFieldHTML(
"button--moveOccupancyTypeFieldUp",
"button--moveOccupancyTypeFieldDown"
) +
"</div>") +
"</div>" +
"</div>";
@ -788,18 +781,10 @@ declare const bulmaJS: BulmaJS;
"</div>" +
'<div class="level-right">' +
('<div class="level-item">' +
'<div class="field has-addons">' +
'<div class="control">' +
'<button class="button is-small button--moveOccupancyTypePrintUp" data-tooltip="Move Up" type="button" aria-label="Move Up">' +
'<i class="fas fa-arrow-up" aria-hidden="true"></i>' +
"</button>" +
"</div>" +
'<div class="control">' +
'<button class="button is-small button--moveOccupancyTypePrintDown" data-tooltip="Move Down" type="button" aria-label="Move Down">' +
'<i class="fas fa-arrow-down" aria-hidden="true"></i>' +
"</button>" +
"</div>" +
"</div>" +
los.getMoveUpDownButtonFieldHTML(
"button--moveOccupancyTypePrintUp",
"button--moveOccupancyTypePrintDown"
) +
"</div>") +
('<div class="level-item">' +
'<button class="button is-small is-danger button--deleteOccupancyTypePrint" data-tooltip="Delete" type="button" aria-label="Delete Print">' +
@ -940,18 +925,10 @@ declare const bulmaJS: BulmaJS;
"</button>" +
"</div>") +
('<div class="level-item">' +
'<div class="field has-addons">' +
'<div class="control">' +
'<button class="button is-small button--moveOccupancyTypeUp" data-tooltip="Move Up" type="button" aria-label="Move Up">' +
'<i class="fas fa-arrow-up" aria-hidden="true"></i>' +
"</button>" +
"</div>" +
'<div class="control">' +
'<button class="button is-small button--moveOccupancyTypeDown" data-tooltip="Move Down" type="button" aria-label="Move Down">' +
'<i class="fas fa-arrow-down" aria-hidden="true"></i>' +
"</button>" +
"</div>" +
"</div>" +
los.getMoveUpDownButtonFieldHTML(
"button--moveOccupancyTypeUp",
"button--moveOccupancyTypeDown"
) +
"</div>") +
"</div>") +
"</div>" +

View File

@ -154,14 +154,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
'<td class="is-nowrap">' +
'<div class="field is-grouped">' +
'<div class="control">' +
('<div class="field has-addons">' +
'<div class="control">' +
'<button class="button button--moveWorkOrderTypeUp" data-tooltip="Move Up" type="button" aria-label="Move Up"><i class="fas fa-arrow-up" aria-hidden="true"></i></button>' +
"</div>" +
'<div class="control">' +
'<button class="button button--moveWorkOrderTypeDown" data-tooltip="Move Down" type="button" aria-label="Move Down"><i class="fas fa-arrow-down" aria-hidden="true"></i></button>' +
"</div>" +
"</div>") +
los.getMoveUpDownButtonFieldHTML("button--moveWorkOrderTypeUp", "button--moveWorkOrderTypeDown", false) +
"</div>" +
'<div class="control">' +
'<button class="button is-danger is-light button--deleteWorkOrderType" data-tooltip="Delete Work Order Type" type="button" aria-label="Delete Work Order Type">' +
@ -342,14 +335,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
'<td class="is-nowrap">' +
'<div class="field is-grouped">' +
'<div class="control">' +
('<div class="field has-addons">' +
'<div class="control">' +
'<button class="button button--moveWorkOrderMilestoneTypeUp" data-tooltip="Move Up" type="button" aria-label="Move Up"><i class="fas fa-arrow-up" aria-hidden="true"></i></button>' +
"</div>" +
'<div class="control">' +
'<button class="button button--moveWorkOrderMilestoneTypeDown" data-tooltip="Move Down" type="button" aria-label="Move Down"><i class="fas fa-arrow-down" aria-hidden="true"></i></button>' +
"</div>" +
"</div>") +
los.getMoveUpDownButtonFieldHTML("button--moveWorkOrderMilestoneTypeUp", "button--moveWorkOrderMilestoneTypeDown", false) +
"</div>" +
'<div class="control">' +
'<button class="button is-danger is-light button--deleteWorkOrderMilestoneType" data-tooltip="Delete Mielstone Type" type="button" aria-label="Delete Milestone Type">' +
@ -534,14 +520,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
'<td class="is-nowrap">' +
'<div class="field is-grouped">' +
'<div class="control">' +
('<div class="field has-addons">' +
'<div class="control">' +
'<button class="button button--moveLotStatusUp" data-tooltip="Move Up" type="button" aria-label="Move Up"><i class="fas fa-arrow-up" aria-hidden="true"></i></button>' +
"</div>" +
'<div class="control">' +
'<button class="button button--moveLotStatusDown" data-tooltip="Move Down" type="button" aria-label="Move Down"><i class="fas fa-arrow-down" aria-hidden="true"></i></button>' +
"</div>" +
"</div>") +
los.getMoveUpDownButtonFieldHTML("button--moveLotStatusUp", "button--moveLotStatusDown", false) +
"</div>" +
'<div class="control">' +
'<button class="button is-danger is-light button--deleteLotStatus" data-tooltip="Delete Status" type="button" aria-label="Delete Status">' +
@ -733,8 +712,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
containerElement.innerHTML = "";
for (const lotOccupantType of lotOccupantTypes) {
const tableRowElement = document.createElement("tr");
tableRowElement.dataset.lotOccupantTypeId =
lotOccupantType.lotOccupantTypeId.toString();
tableRowElement.dataset.lotOccupantTypeId = lotOccupantType.lotOccupantTypeId.toString();
const formId = "form--lotOccupantType-" + lotOccupantType.lotOccupantTypeId;
tableRowElement.innerHTML =
"<td>" +
@ -778,14 +756,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
'<td class="is-nowrap">' +
'<div class="field is-grouped">' +
'<div class="control">' +
('<div class="field has-addons">' +
'<div class="control">' +
'<button class="button button--moveLotOccupantTypeUp" data-tooltip="Move Up" type="button" aria-label="Move Up"><i class="fas fa-arrow-up" aria-hidden="true"></i></button>' +
"</div>" +
'<div class="control">' +
'<button class="button button--moveLotOccupantTypeDown" data-tooltip="Move Down" type="button" aria-label="Move Down"><i class="fas fa-arrow-down" aria-hidden="true"></i></button>' +
"</div>" +
"</div>") +
los.getMoveUpDownButtonFieldHTML("button--moveLotOccupantTypeUp", "button--moveLotOccupantTypeDown", false) +
"</div>" +
'<div class="control">' +
'<button class="button is-danger is-light button--deleteLotOccupantType"' +
@ -807,9 +778,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
const fontAwesomeInputElement = tableRowElement.querySelector("input[name='fontAwesomeIconClass']");
fontAwesomeInputElement.addEventListener("keyup", refreshFontAwesomeIcon);
fontAwesomeInputElement.addEventListener("change", refreshFontAwesomeIcon);
tableRowElement
.querySelector("form")
.addEventListener("submit", updateLotOccupantType);
tableRowElement.querySelector("form").addEventListener("submit", updateLotOccupantType);
tableRowElement.querySelector(".button--moveLotOccupantTypeUp").addEventListener("click", moveLotOccupantTypeUp);
tableRowElement.querySelector(".button--moveLotOccupantTypeDown").addEventListener("click", moveLotOccupantTypeDown);
tableRowElement.querySelector(".button--deleteLotOccupantType").addEventListener("click", deleteLotOccupantType);

View File

@ -153,8 +153,7 @@ const renderLotOccupantTypes = () => {
containerElement.innerHTML = "";
for (const lotOccupantType of lotOccupantTypes) {
const tableRowElement = document.createElement("tr");
tableRowElement.dataset.lotOccupantTypeId =
lotOccupantType.lotOccupantTypeId.toString();
tableRowElement.dataset.lotOccupantTypeId = lotOccupantType.lotOccupantTypeId.toString();
const formId = "form--lotOccupantType-" + lotOccupantType.lotOccupantTypeId;
tableRowElement.innerHTML =
"<td>" +
@ -198,14 +197,7 @@ const renderLotOccupantTypes = () => {
'<td class="is-nowrap">' +
'<div class="field is-grouped">' +
'<div class="control">' +
('<div class="field has-addons">' +
'<div class="control">' +
'<button class="button button--moveLotOccupantTypeUp" data-tooltip="Move Up" type="button" aria-label="Move Up"><i class="fas fa-arrow-up" aria-hidden="true"></i></button>' +
"</div>" +
'<div class="control">' +
'<button class="button button--moveLotOccupantTypeDown" data-tooltip="Move Down" type="button" aria-label="Move Down"><i class="fas fa-arrow-down" aria-hidden="true"></i></button>' +
"</div>" +
"</div>") +
los.getMoveUpDownButtonFieldHTML("button--moveLotOccupantTypeUp", "button--moveLotOccupantTypeDown", false) +
"</div>" +
'<div class="control">' +
'<button class="button is-danger is-light button--deleteLotOccupantType"' +
@ -227,9 +219,7 @@ const renderLotOccupantTypes = () => {
const fontAwesomeInputElement = tableRowElement.querySelector("input[name='fontAwesomeIconClass']");
fontAwesomeInputElement.addEventListener("keyup", refreshFontAwesomeIcon);
fontAwesomeInputElement.addEventListener("change", refreshFontAwesomeIcon);
tableRowElement
.querySelector("form")
.addEventListener("submit", updateLotOccupantType);
tableRowElement.querySelector("form").addEventListener("submit", updateLotOccupantType);
tableRowElement.querySelector(".button--moveLotOccupantTypeUp").addEventListener("click", moveLotOccupantTypeUp);
tableRowElement.querySelector(".button--moveLotOccupantTypeDown").addEventListener("click", moveLotOccupantTypeDown);
tableRowElement.querySelector(".button--deleteLotOccupantType").addEventListener("click", deleteLotOccupantType);

View File

@ -119,8 +119,7 @@ const deleteLotOccupantType = (clickEvent: Event) => {
messageIsHtml: true,
contextualColorName: "warning",
okButton: {
text:
"Yes, Delete " + exports.aliases.lot + " " + exports.aliases.occupant + " Type",
text: "Yes, Delete " + exports.aliases.lot + " " + exports.aliases.occupant + " Type",
callbackFunction: doDelete
}
});
@ -223,8 +222,7 @@ const renderLotOccupantTypes = () => {
for (const lotOccupantType of lotOccupantTypes) {
const tableRowElement = document.createElement("tr");
tableRowElement.dataset.lotOccupantTypeId =
lotOccupantType.lotOccupantTypeId.toString();
tableRowElement.dataset.lotOccupantTypeId = lotOccupantType.lotOccupantTypeId.toString();
const formId = "form--lotOccupantType-" + lotOccupantType.lotOccupantTypeId;
@ -270,14 +268,11 @@ const renderLotOccupantTypes = () => {
'<td class="is-nowrap">' +
'<div class="field is-grouped">' +
'<div class="control">' +
('<div class="field has-addons">' +
'<div class="control">' +
'<button class="button button--moveLotOccupantTypeUp" data-tooltip="Move Up" type="button" aria-label="Move Up"><i class="fas fa-arrow-up" aria-hidden="true"></i></button>' +
"</div>" +
'<div class="control">' +
'<button class="button button--moveLotOccupantTypeDown" data-tooltip="Move Down" type="button" aria-label="Move Down"><i class="fas fa-arrow-down" aria-hidden="true"></i></button>' +
"</div>" +
"</div>") +
los.getMoveUpDownButtonFieldHTML(
"button--moveLotOccupantTypeUp",
"button--moveLotOccupantTypeDown",
false
) +
"</div>" +
'<div class="control">' +
'<button class="button is-danger is-light button--deleteLotOccupantType"' +
@ -304,18 +299,14 @@ const renderLotOccupantTypes = () => {
fontAwesomeInputElement.addEventListener("keyup", refreshFontAwesomeIcon);
fontAwesomeInputElement.addEventListener("change", refreshFontAwesomeIcon);
tableRowElement
.querySelector("form")!
.addEventListener("submit", updateLotOccupantType);
tableRowElement.querySelector("form")!.addEventListener("submit", updateLotOccupantType);
(
tableRowElement.querySelector(".button--moveLotOccupantTypeUp") as HTMLButtonElement
).addEventListener("click", moveLotOccupantTypeUp);
(
tableRowElement.querySelector(
".button--moveLotOccupantTypeDown"
) as HTMLButtonElement
tableRowElement.querySelector(".button--moveLotOccupantTypeDown") as HTMLButtonElement
).addEventListener("click", moveLotOccupantTypeDown);
(

View File

@ -146,14 +146,7 @@ const renderLotStatuses = () => {
'<td class="is-nowrap">' +
'<div class="field is-grouped">' +
'<div class="control">' +
('<div class="field has-addons">' +
'<div class="control">' +
'<button class="button button--moveLotStatusUp" data-tooltip="Move Up" type="button" aria-label="Move Up"><i class="fas fa-arrow-up" aria-hidden="true"></i></button>' +
"</div>" +
'<div class="control">' +
'<button class="button button--moveLotStatusDown" data-tooltip="Move Down" type="button" aria-label="Move Down"><i class="fas fa-arrow-down" aria-hidden="true"></i></button>' +
"</div>" +
"</div>") +
los.getMoveUpDownButtonFieldHTML("button--moveLotStatusUp", "button--moveLotStatusDown", false) +
"</div>" +
'<div class="control">' +
'<button class="button is-danger is-light button--deleteLotStatus" data-tooltip="Delete Status" type="button" aria-label="Delete Status">' +

View File

@ -209,14 +209,11 @@ const renderLotStatuses = () => {
'<td class="is-nowrap">' +
'<div class="field is-grouped">' +
'<div class="control">' +
('<div class="field has-addons">' +
'<div class="control">' +
'<button class="button button--moveLotStatusUp" data-tooltip="Move Up" type="button" aria-label="Move Up"><i class="fas fa-arrow-up" aria-hidden="true"></i></button>' +
"</div>" +
'<div class="control">' +
'<button class="button button--moveLotStatusDown" data-tooltip="Move Down" type="button" aria-label="Move Down"><i class="fas fa-arrow-down" aria-hidden="true"></i></button>' +
"</div>" +
"</div>") +
los.getMoveUpDownButtonFieldHTML(
"button--moveLotStatusUp",
"button--moveLotStatusDown",
false
) +
"</div>" +
'<div class="control">' +
'<button class="button is-danger is-light button--deleteLotStatus" data-tooltip="Delete Status" type="button" aria-label="Delete Status">' +

View File

@ -142,14 +142,7 @@ const renderWorkOrderMilestoneTypes = () => {
'<td class="is-nowrap">' +
'<div class="field is-grouped">' +
'<div class="control">' +
('<div class="field has-addons">' +
'<div class="control">' +
'<button class="button button--moveWorkOrderMilestoneTypeUp" data-tooltip="Move Up" type="button" aria-label="Move Up"><i class="fas fa-arrow-up" aria-hidden="true"></i></button>' +
"</div>" +
'<div class="control">' +
'<button class="button button--moveWorkOrderMilestoneTypeDown" data-tooltip="Move Down" type="button" aria-label="Move Down"><i class="fas fa-arrow-down" aria-hidden="true"></i></button>' +
"</div>" +
"</div>") +
los.getMoveUpDownButtonFieldHTML("button--moveWorkOrderMilestoneTypeUp", "button--moveWorkOrderMilestoneTypeDown", false) +
"</div>" +
'<div class="control">' +
'<button class="button is-danger is-light button--deleteWorkOrderMilestoneType" data-tooltip="Delete Mielstone Type" type="button" aria-label="Delete Milestone Type">' +

View File

@ -205,14 +205,11 @@ const renderWorkOrderMilestoneTypes = () => {
'<td class="is-nowrap">' +
'<div class="field is-grouped">' +
'<div class="control">' +
('<div class="field has-addons">' +
'<div class="control">' +
'<button class="button button--moveWorkOrderMilestoneTypeUp" data-tooltip="Move Up" type="button" aria-label="Move Up"><i class="fas fa-arrow-up" aria-hidden="true"></i></button>' +
"</div>" +
'<div class="control">' +
'<button class="button button--moveWorkOrderMilestoneTypeDown" data-tooltip="Move Down" type="button" aria-label="Move Down"><i class="fas fa-arrow-down" aria-hidden="true"></i></button>' +
"</div>" +
"</div>") +
los.getMoveUpDownButtonFieldHTML(
"button--moveWorkOrderMilestoneTypeUp",
"button--moveWorkOrderMilestoneTypeDown",
false
) +
"</div>" +
'<div class="control">' +
'<button class="button is-danger is-light button--deleteWorkOrderMilestoneType" data-tooltip="Delete Mielstone Type" type="button" aria-label="Delete Milestone Type">' +

View File

@ -141,14 +141,7 @@ const renderWorkOrderTypes = () => {
'<td class="is-nowrap">' +
'<div class="field is-grouped">' +
'<div class="control">' +
('<div class="field has-addons">' +
'<div class="control">' +
'<button class="button button--moveWorkOrderTypeUp" data-tooltip="Move Up" type="button" aria-label="Move Up"><i class="fas fa-arrow-up" aria-hidden="true"></i></button>' +
"</div>" +
'<div class="control">' +
'<button class="button button--moveWorkOrderTypeDown" data-tooltip="Move Down" type="button" aria-label="Move Down"><i class="fas fa-arrow-down" aria-hidden="true"></i></button>' +
"</div>" +
"</div>") +
los.getMoveUpDownButtonFieldHTML("button--moveWorkOrderTypeUp", "button--moveWorkOrderTypeDown", false) +
"</div>" +
'<div class="control">' +
'<button class="button is-danger is-light button--deleteWorkOrderType" data-tooltip="Delete Work Order Type" type="button" aria-label="Delete Work Order Type">' +

View File

@ -204,14 +204,11 @@ const renderWorkOrderTypes = () => {
'<td class="is-nowrap">' +
'<div class="field is-grouped">' +
'<div class="control">' +
('<div class="field has-addons">' +
'<div class="control">' +
'<button class="button button--moveWorkOrderTypeUp" data-tooltip="Move Up" type="button" aria-label="Move Up"><i class="fas fa-arrow-up" aria-hidden="true"></i></button>' +
"</div>" +
'<div class="control">' +
'<button class="button button--moveWorkOrderTypeDown" data-tooltip="Move Down" type="button" aria-label="Move Down"><i class="fas fa-arrow-down" aria-hidden="true"></i></button>' +
"</div>" +
"</div>") +
los.getMoveUpDownButtonFieldHTML(
"button--moveWorkOrderTypeUp",
"button--moveWorkOrderTypeDown",
false
) +
"</div>" +
'<div class="control">' +
'<button class="button is-danger is-light button--deleteWorkOrderType" data-tooltip="Delete Work Order Type" type="button" aria-label="Delete Work Order Type">' +

View File

@ -2,6 +2,9 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true });
(() => {
/*
* Unsaved Changes
*/
let _hasUnsavedChanges = false;
function setUnsavedChanges() {
if (!hasUnsavedChanges()) {
@ -61,6 +64,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
unlockFieldButtonElement.addEventListener("click", unlockField);
}
}
/*
* Date Pickers
*/
const datePickerBaseOptions = {
type: "date",
dateFormat: "yyyy-MM-dd",
@ -198,6 +204,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
}
};
*/
/*
* Aliases
*/
function populateAliases(containerElement) {
const aliasElements = containerElement.querySelectorAll(".alias");
for (const aliasElement of aliasElements) {
@ -274,19 +283,43 @@ Object.defineProperty(exports, "__esModule", { value: true });
luminosity: luminosity[actualSeedString.codePointAt(actualSeedString.length - 2) % luminosity.length]
});
}
/*
* Bulma Snippets
*/
function getMoveUpDownButtonFieldHTML(upButtonClassNames, downButtonClassNames, isSmall = true) {
return `<div class="field has-addons">
<div class="control">
<button
class="button ${isSmall ? "is-small" : ""} ${upButtonClassNames}"
data-tooltip="Move Up" type="button" aria-label="Move Up">
<i class="fas fa-arrow-up" aria-hidden="true"></i>
</button>
</div>
<div class="control">
<button
class="button ${isSmall ? "is-small" : ""} ${downButtonClassNames}"
data-tooltip="Move Down" type="button" aria-label="Move Down">
<i class="fas fa-arrow-down" aria-hidden="true"></i>
</button>
</div>
</div>`;
}
/*
* Declare LOS
*/
const los = {
urlPrefix: document.querySelector("main").dataset.urlPrefix,
apiKey: document.querySelector("main").dataset.apiKey,
highlightMap,
initializeUnlockFieldButtons,
initializeDatePickers,
// initializeTimePickers,
populateAliases,
escapedAliases,
getRandomColor,
setUnsavedChanges,
clearUnsavedChanges,
hasUnsavedChanges
hasUnsavedChanges,
getMoveUpDownButtonFieldHTML
};
exports.los = los;
})();

View File

@ -9,6 +9,10 @@ declare const cityssm: cityssmGlobal;
declare const bulmaJS: BulmaJS;
(() => {
/*
* Unsaved Changes
*/
let _hasUnsavedChanges = false;
function setUnsavedChanges() {
@ -92,6 +96,10 @@ declare const bulmaJS: BulmaJS;
}
}
/*
* Date Pickers
*/
const datePickerBaseOptions: BulmaCalendarOptions = {
type: "date",
dateFormat: "yyyy-MM-dd",
@ -252,6 +260,10 @@ declare const bulmaJS: BulmaJS;
};
*/
/*
* Aliases
*/
function populateAliases(containerElement: HTMLElement): void {
const aliasElements = containerElement.querySelectorAll(
".alias"
@ -349,20 +361,54 @@ declare const bulmaJS: BulmaJS;
});
}
/*
* Bulma Snippets
*/
function getMoveUpDownButtonFieldHTML(
upButtonClassNames: string,
downButtonClassNames: string,
isSmall = true
): string {
return `<div class="field has-addons">
<div class="control">
<button
class="button ${isSmall ? "is-small" : ""} ${upButtonClassNames}"
data-tooltip="Move Up" type="button" aria-label="Move Up">
<i class="fas fa-arrow-up" aria-hidden="true"></i>
</button>
</div>
<div class="control">
<button
class="button ${isSmall ? "is-small" : ""} ${downButtonClassNames}"
data-tooltip="Move Down" type="button" aria-label="Move Down">
<i class="fas fa-arrow-down" aria-hidden="true"></i>
</button>
</div>
</div>`;
}
/*
* Declare LOS
*/
const los: globalTypes.LOS = {
urlPrefix: document.querySelector("main")!.dataset.urlPrefix!,
apiKey: document.querySelector("main")!.dataset.apiKey!,
highlightMap,
initializeUnlockFieldButtons,
initializeDatePickers,
// initializeTimePickers,
populateAliases,
escapedAliases,
getRandomColor,
setUnsavedChanges,
clearUnsavedChanges,
hasUnsavedChanges
hasUnsavedChanges,
getMoveUpDownButtonFieldHTML
};
exports.los = los;

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -33,4 +33,5 @@ export interface LOS {
setUnsavedChanges: () => void;
clearUnsavedChanges: () => void;
hasUnsavedChanges: () => boolean;
getMoveUpDownButtonFieldHTML: (upButtonClassNames: string, downButtonClassNames: string, isSmall?: boolean) => string;
}

View File

@ -45,4 +45,6 @@ export interface LOS {
setUnsavedChanges: () => void;
clearUnsavedChanges: () => void;
hasUnsavedChanges: () => boolean;
getMoveUpDownButtonFieldHTML: (upButtonClassNames: string, downButtonClassNames: string, isSmall?: boolean) => string;
}