refactoring
parent
47eb2f4abd
commit
2247857716
|
|
@ -1,15 +1,12 @@
|
|||
import { configWebApp } from 'eslint-config-cityssm'
|
||||
import tseslint from 'typescript-eslint'
|
||||
|
||||
export const config = tseslint.config(
|
||||
...configWebApp,
|
||||
{
|
||||
export const config = tseslint.config(...configWebApp, {
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.json', './tsconfig.client.json']
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
export default config
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/indent, @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
/* @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
var _a, _b;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/indent */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/indent */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/indent */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
.querySelectorAll('.button.is-static')[1].innerHTML = `<i class="fas fa-fw fa-${fontAwesomeIconClass}" aria-hidden="true"></i>`;
|
||||
}
|
||||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/indent */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
let workOrderTypes = exports.workOrderTypes;
|
||||
|
|
@ -189,7 +188,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
renderWorkOrderTypes();
|
||||
|
||||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/indent */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
let workOrderMilestoneTypes = exports.workOrderMilestoneTypes;
|
||||
|
|
@ -364,7 +362,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
renderWorkOrderMilestoneTypes();
|
||||
|
||||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/indent */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
let lotStatuses = exports.lotStatuses;
|
||||
|
|
@ -541,7 +538,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
renderLotStatuses();
|
||||
|
||||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/indent */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
let lotOccupantTypes = exports.lotOccupantTypes;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/indent */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
let lotOccupantTypes = exports.lotOccupantTypes;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/indent */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
let lotStatuses = exports.lotStatuses;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/indent */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
let workOrderMilestoneTypes = exports.workOrderMilestoneTypes;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/indent */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
let workOrderTypes = exports.workOrderTypes;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
"use strict";
|
||||
/* eslint-disable spaced-comment, @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
/* eslint-disable @eslint-community/eslint-comments/disable-enable-pair */
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
|
|
@ -25,9 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
const formElement = document.querySelector('#form--lotOccupancy');
|
||||
formElement.addEventListener('submit', (formEvent) => {
|
||||
formEvent.preventDefault();
|
||||
cityssm.postJSON(los.urlPrefix +
|
||||
'/lotOccupancies/' +
|
||||
(isCreate ? 'doCreateLotOccupancy' : 'doUpdateLotOccupancy'), formElement, (rawResponseJSON) => {
|
||||
cityssm.postJSON(`${los.urlPrefix}/lotOccupancies/${isCreate ? 'doCreateLotOccupancy' : 'doUpdateLotOccupancy'}`, formElement, (rawResponseJSON) => {
|
||||
var _a;
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.success) {
|
||||
|
|
@ -44,7 +43,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
title: 'Error Saving ' + los.escapedAliases.Occupancy,
|
||||
title: `Error Saving ${los.escapedAliases.Occupancy}`,
|
||||
message: (_a = responseJSON.errorMessage) !== null && _a !== void 0 ? _a : '',
|
||||
contextualColorName: 'danger'
|
||||
});
|
||||
|
|
@ -56,7 +55,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
formInputElement.addEventListener('change', setUnsavedChanges);
|
||||
}
|
||||
function doCopy() {
|
||||
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doCopyLotOccupancy', {
|
||||
cityssm.postJSON(`${los.urlPrefix}/lotOccupancies/doCopyLotOccupancy`, {
|
||||
lotOccupancyId
|
||||
}, (rawResponseJSON) => {
|
||||
var _a;
|
||||
|
|
@ -100,7 +99,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
.querySelector('#button--deleteLotOccupancy')) === null || _b === void 0 ? void 0 : _b.addEventListener('click', (clickEvent) => {
|
||||
clickEvent.preventDefault();
|
||||
function doDelete() {
|
||||
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doDeleteLotOccupancy', {
|
||||
cityssm.postJSON(`${los.urlPrefix}/lotOccupancies/doDeleteLotOccupancy`, {
|
||||
lotOccupancyId
|
||||
}, (rawResponseJSON) => {
|
||||
var _a;
|
||||
|
|
@ -134,7 +133,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
let createCloseModalFunction;
|
||||
function doCreate(formEvent) {
|
||||
formEvent.preventDefault();
|
||||
cityssm.postJSON(los.urlPrefix + '/workOrders/doCreateWorkOrder', formEvent.currentTarget, (rawResponseJSON) => {
|
||||
cityssm.postJSON(`${los.urlPrefix}/workOrders/doCreateWorkOrder`, formEvent.currentTarget, (rawResponseJSON) => {
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.success) {
|
||||
createCloseModalFunction();
|
||||
|
|
@ -166,7 +165,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
modalElement.querySelector('#workOrderCreate--lotOccupancyId').value = lotOccupancyId;
|
||||
modalElement.querySelector('#workOrderCreate--workOrderOpenDateString').value = cityssm.dateToString(new Date());
|
||||
const workOrderTypeSelectElement = modalElement.querySelector('#workOrderCreate--workOrderTypeId');
|
||||
const workOrderTypes = exports.workOrderTypes;
|
||||
const workOrderTypes = exports
|
||||
.workOrderTypes;
|
||||
if (workOrderTypes.length === 1) {
|
||||
workOrderTypeSelectElement.innerHTML = '';
|
||||
}
|
||||
|
|
@ -197,6 +197,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
const lotOccupancyFieldsContainerElement = document.querySelector('#container--lotOccupancyFields');
|
||||
occupancyTypeIdElement.addEventListener('change', () => {
|
||||
if (occupancyTypeIdElement.value === '') {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
lotOccupancyFieldsContainerElement.innerHTML = `<div class="message is-info">
|
||||
<p class="message-body">Select the ${los.escapedAliases.occupancy} type to load the available fields.</p>
|
||||
</div>`;
|
||||
|
|
@ -208,6 +209,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
var _a, _b;
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.occupancyTypeFields.length === 0) {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
lotOccupancyFieldsContainerElement.innerHTML = `<div class="message is-info">
|
||||
<p class="message-body">There are no additional fields for this ${los.escapedAliases.occupancy} type.</p>
|
||||
</div>`;
|
||||
|
|
@ -218,12 +220,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
for (const occupancyTypeField of responseJSON.occupancyTypeFields) {
|
||||
occupancyTypeFieldIds +=
|
||||
',' + occupancyTypeField.occupancyTypeFieldId.toString();
|
||||
const fieldName = 'lotOccupancyFieldValue_' +
|
||||
occupancyTypeField.occupancyTypeFieldId.toString();
|
||||
const fieldId = 'lotOccupancy--' + fieldName;
|
||||
const fieldName = `lotOccupancyFieldValue_${occupancyTypeField.occupancyTypeFieldId.toString()}`;
|
||||
const fieldId = `lotOccupancy--${fieldName}`;
|
||||
const fieldElement = document.createElement('div');
|
||||
fieldElement.className = 'field';
|
||||
fieldElement.innerHTML = `<label class="label" for="${fieldId}"></label><div class="control"></div>`;
|
||||
fieldElement.innerHTML = `<label class="label" for="${cityssm.escapeHTML(fieldId)}"></label><div class="control"></div>`;
|
||||
fieldElement.querySelector('label').textContent = occupancyTypeField.occupancyTypeField;
|
||||
if (((_a = occupancyTypeField.occupancyTypeFieldValues) !== null && _a !== void 0 ? _a : '') === '') {
|
||||
const inputElement = document.createElement('input');
|
||||
|
|
@ -245,7 +246,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
else {
|
||||
;
|
||||
fieldElement.querySelector('.control').innerHTML = `<div class="select is-fullwidth">
|
||||
<select id="${fieldId}" name="${fieldName}">
|
||||
<select id="${cityssm.escapeHTML(fieldId)}" name="${cityssm.escapeHTML(fieldName)}">
|
||||
<option value="">(Not Set)</option>
|
||||
</select>
|
||||
</div>`;
|
||||
|
|
@ -262,7 +263,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
console.log(fieldElement);
|
||||
lotOccupancyFieldsContainerElement.append(fieldElement);
|
||||
}
|
||||
lotOccupancyFieldsContainerElement.insertAdjacentHTML('beforeend', `<input name="occupancyTypeFieldIds" type="hidden" value="${occupancyTypeFieldIds.slice(1)}" />`);
|
||||
lotOccupancyFieldsContainerElement.insertAdjacentHTML('beforeend',
|
||||
// eslint-disable-next-line no-secrets/no-secrets
|
||||
`<input name="occupancyTypeFieldIds" type="hidden"
|
||||
value="${cityssm.escapeHTML(occupancyTypeFieldIds.slice(1))}" />`);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
@ -312,9 +316,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
renderSelectedLotAndClose(selectedLotElement.dataset.lotId, selectedLotElement.dataset.lotName);
|
||||
}
|
||||
function searchLots() {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
lotSelectResultsElement.innerHTML =
|
||||
los.getLoadingParagraphHTML('Searching...');
|
||||
cityssm.postJSON(los.urlPrefix + '/lots/doSearchLots', lotSelectFormElement, (rawResponseJSON) => {
|
||||
cityssm.postJSON(`${los.urlPrefix}/lots/doSearchLots`, lotSelectFormElement, (rawResponseJSON) => {
|
||||
var _a, _b;
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.count === 0) {
|
||||
|
|
@ -331,23 +336,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
panelBlockElement.href = '#';
|
||||
panelBlockElement.dataset.lotId = lot.lotId.toString();
|
||||
panelBlockElement.dataset.lotName = lot.lotName;
|
||||
panelBlockElement.innerHTML =
|
||||
'<div class="columns">' +
|
||||
('<div class="column">' +
|
||||
cityssm.escapeHTML((_a = lot.lotName) !== null && _a !== void 0 ? _a : '') +
|
||||
'<br />' +
|
||||
'<span class="is-size-7">' +
|
||||
cityssm.escapeHTML((_b = lot.mapName) !== null && _b !== void 0 ? _b : '') +
|
||||
'</span>' +
|
||||
'</div>') +
|
||||
('<div class="column">' +
|
||||
cityssm.escapeHTML(lot.lotStatus) +
|
||||
'<br />' +
|
||||
'<span class="is-size-7">' +
|
||||
(lot.lotOccupancyCount > 0 ? 'Currently Occupied' : '') +
|
||||
'</span>' +
|
||||
'</div>') +
|
||||
'</div>';
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
panelBlockElement.innerHTML = `<div class="columns">
|
||||
<div class="column">
|
||||
${cityssm.escapeHTML((_a = lot.lotName) !== null && _a !== void 0 ? _a : '')}<br />
|
||||
<span class="is-size-7">${cityssm.escapeHTML((_b = lot.mapName) !== null && _b !== void 0 ? _b : '')}</span>
|
||||
</div>
|
||||
<div class="column">
|
||||
${cityssm.escapeHTML(lot.lotStatus)}<br />
|
||||
<span class="is-size-7">
|
||||
${lot.lotOccupancyCount > 0 ? 'Currently Occupied' : ''}
|
||||
</span>
|
||||
</div>
|
||||
</div>`;
|
||||
panelBlockElement.addEventListener('click', selectExistingLot);
|
||||
panelElement.append(panelBlockElement);
|
||||
}
|
||||
|
|
@ -358,7 +359,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
function createLotAndSelect(submitEvent) {
|
||||
submitEvent.preventDefault();
|
||||
const lotName = lotSelectModalElement.querySelector('#lotCreate--lotName').value;
|
||||
cityssm.postJSON(los.urlPrefix + '/lots/doCreateLot', submitEvent.currentTarget, (rawResponseJSON) => {
|
||||
cityssm.postJSON(`${los.urlPrefix}/lots/doCreateLot`, submitEvent.currentTarget, (rawResponseJSON) => {
|
||||
var _a;
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.success) {
|
||||
|
|
@ -1089,7 +1090,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
renderLotOccupancyComments();
|
||||
|
||||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/indent, unicorn/prefer-module */
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
let lotOccupancyFees = exports.lotOccupancyFees;
|
||||
delete exports.lotOccupancyFees;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
"use strict";
|
||||
/* eslint-disable spaced-comment, @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
/* eslint-disable @eslint-community/eslint-comments/disable-enable-pair */
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
|
|
@ -25,9 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
const formElement = document.querySelector('#form--lotOccupancy');
|
||||
formElement.addEventListener('submit', (formEvent) => {
|
||||
formEvent.preventDefault();
|
||||
cityssm.postJSON(los.urlPrefix +
|
||||
'/lotOccupancies/' +
|
||||
(isCreate ? 'doCreateLotOccupancy' : 'doUpdateLotOccupancy'), formElement, (rawResponseJSON) => {
|
||||
cityssm.postJSON(`${los.urlPrefix}/lotOccupancies/${isCreate ? 'doCreateLotOccupancy' : 'doUpdateLotOccupancy'}`, formElement, (rawResponseJSON) => {
|
||||
var _a;
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.success) {
|
||||
|
|
@ -44,7 +43,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
title: 'Error Saving ' + los.escapedAliases.Occupancy,
|
||||
title: `Error Saving ${los.escapedAliases.Occupancy}`,
|
||||
message: (_a = responseJSON.errorMessage) !== null && _a !== void 0 ? _a : '',
|
||||
contextualColorName: 'danger'
|
||||
});
|
||||
|
|
@ -56,7 +55,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
formInputElement.addEventListener('change', setUnsavedChanges);
|
||||
}
|
||||
function doCopy() {
|
||||
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doCopyLotOccupancy', {
|
||||
cityssm.postJSON(`${los.urlPrefix}/lotOccupancies/doCopyLotOccupancy`, {
|
||||
lotOccupancyId
|
||||
}, (rawResponseJSON) => {
|
||||
var _a;
|
||||
|
|
@ -100,7 +99,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
.querySelector('#button--deleteLotOccupancy')) === null || _b === void 0 ? void 0 : _b.addEventListener('click', (clickEvent) => {
|
||||
clickEvent.preventDefault();
|
||||
function doDelete() {
|
||||
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doDeleteLotOccupancy', {
|
||||
cityssm.postJSON(`${los.urlPrefix}/lotOccupancies/doDeleteLotOccupancy`, {
|
||||
lotOccupancyId
|
||||
}, (rawResponseJSON) => {
|
||||
var _a;
|
||||
|
|
@ -134,7 +133,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
let createCloseModalFunction;
|
||||
function doCreate(formEvent) {
|
||||
formEvent.preventDefault();
|
||||
cityssm.postJSON(los.urlPrefix + '/workOrders/doCreateWorkOrder', formEvent.currentTarget, (rawResponseJSON) => {
|
||||
cityssm.postJSON(`${los.urlPrefix}/workOrders/doCreateWorkOrder`, formEvent.currentTarget, (rawResponseJSON) => {
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.success) {
|
||||
createCloseModalFunction();
|
||||
|
|
@ -166,7 +165,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
modalElement.querySelector('#workOrderCreate--lotOccupancyId').value = lotOccupancyId;
|
||||
modalElement.querySelector('#workOrderCreate--workOrderOpenDateString').value = cityssm.dateToString(new Date());
|
||||
const workOrderTypeSelectElement = modalElement.querySelector('#workOrderCreate--workOrderTypeId');
|
||||
const workOrderTypes = exports.workOrderTypes;
|
||||
const workOrderTypes = exports
|
||||
.workOrderTypes;
|
||||
if (workOrderTypes.length === 1) {
|
||||
workOrderTypeSelectElement.innerHTML = '';
|
||||
}
|
||||
|
|
@ -197,6 +197,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
const lotOccupancyFieldsContainerElement = document.querySelector('#container--lotOccupancyFields');
|
||||
occupancyTypeIdElement.addEventListener('change', () => {
|
||||
if (occupancyTypeIdElement.value === '') {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
lotOccupancyFieldsContainerElement.innerHTML = `<div class="message is-info">
|
||||
<p class="message-body">Select the ${los.escapedAliases.occupancy} type to load the available fields.</p>
|
||||
</div>`;
|
||||
|
|
@ -208,6 +209,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
var _a, _b;
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.occupancyTypeFields.length === 0) {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
lotOccupancyFieldsContainerElement.innerHTML = `<div class="message is-info">
|
||||
<p class="message-body">There are no additional fields for this ${los.escapedAliases.occupancy} type.</p>
|
||||
</div>`;
|
||||
|
|
@ -218,12 +220,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
for (const occupancyTypeField of responseJSON.occupancyTypeFields) {
|
||||
occupancyTypeFieldIds +=
|
||||
',' + occupancyTypeField.occupancyTypeFieldId.toString();
|
||||
const fieldName = 'lotOccupancyFieldValue_' +
|
||||
occupancyTypeField.occupancyTypeFieldId.toString();
|
||||
const fieldId = 'lotOccupancy--' + fieldName;
|
||||
const fieldName = `lotOccupancyFieldValue_${occupancyTypeField.occupancyTypeFieldId.toString()}`;
|
||||
const fieldId = `lotOccupancy--${fieldName}`;
|
||||
const fieldElement = document.createElement('div');
|
||||
fieldElement.className = 'field';
|
||||
fieldElement.innerHTML = `<label class="label" for="${fieldId}"></label><div class="control"></div>`;
|
||||
fieldElement.innerHTML = `<label class="label" for="${cityssm.escapeHTML(fieldId)}"></label><div class="control"></div>`;
|
||||
fieldElement.querySelector('label').textContent = occupancyTypeField.occupancyTypeField;
|
||||
if (((_a = occupancyTypeField.occupancyTypeFieldValues) !== null && _a !== void 0 ? _a : '') === '') {
|
||||
const inputElement = document.createElement('input');
|
||||
|
|
@ -245,7 +246,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
else {
|
||||
;
|
||||
fieldElement.querySelector('.control').innerHTML = `<div class="select is-fullwidth">
|
||||
<select id="${fieldId}" name="${fieldName}">
|
||||
<select id="${cityssm.escapeHTML(fieldId)}" name="${cityssm.escapeHTML(fieldName)}">
|
||||
<option value="">(Not Set)</option>
|
||||
</select>
|
||||
</div>`;
|
||||
|
|
@ -262,7 +263,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
console.log(fieldElement);
|
||||
lotOccupancyFieldsContainerElement.append(fieldElement);
|
||||
}
|
||||
lotOccupancyFieldsContainerElement.insertAdjacentHTML('beforeend', `<input name="occupancyTypeFieldIds" type="hidden" value="${occupancyTypeFieldIds.slice(1)}" />`);
|
||||
lotOccupancyFieldsContainerElement.insertAdjacentHTML('beforeend',
|
||||
// eslint-disable-next-line no-secrets/no-secrets
|
||||
`<input name="occupancyTypeFieldIds" type="hidden"
|
||||
value="${cityssm.escapeHTML(occupancyTypeFieldIds.slice(1))}" />`);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
@ -312,9 +316,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
renderSelectedLotAndClose(selectedLotElement.dataset.lotId, selectedLotElement.dataset.lotName);
|
||||
}
|
||||
function searchLots() {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
lotSelectResultsElement.innerHTML =
|
||||
los.getLoadingParagraphHTML('Searching...');
|
||||
cityssm.postJSON(los.urlPrefix + '/lots/doSearchLots', lotSelectFormElement, (rawResponseJSON) => {
|
||||
cityssm.postJSON(`${los.urlPrefix}/lots/doSearchLots`, lotSelectFormElement, (rawResponseJSON) => {
|
||||
var _a, _b;
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.count === 0) {
|
||||
|
|
@ -331,23 +336,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
panelBlockElement.href = '#';
|
||||
panelBlockElement.dataset.lotId = lot.lotId.toString();
|
||||
panelBlockElement.dataset.lotName = lot.lotName;
|
||||
panelBlockElement.innerHTML =
|
||||
'<div class="columns">' +
|
||||
('<div class="column">' +
|
||||
cityssm.escapeHTML((_a = lot.lotName) !== null && _a !== void 0 ? _a : '') +
|
||||
'<br />' +
|
||||
'<span class="is-size-7">' +
|
||||
cityssm.escapeHTML((_b = lot.mapName) !== null && _b !== void 0 ? _b : '') +
|
||||
'</span>' +
|
||||
'</div>') +
|
||||
('<div class="column">' +
|
||||
cityssm.escapeHTML(lot.lotStatus) +
|
||||
'<br />' +
|
||||
'<span class="is-size-7">' +
|
||||
(lot.lotOccupancyCount > 0 ? 'Currently Occupied' : '') +
|
||||
'</span>' +
|
||||
'</div>') +
|
||||
'</div>';
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
panelBlockElement.innerHTML = `<div class="columns">
|
||||
<div class="column">
|
||||
${cityssm.escapeHTML((_a = lot.lotName) !== null && _a !== void 0 ? _a : '')}<br />
|
||||
<span class="is-size-7">${cityssm.escapeHTML((_b = lot.mapName) !== null && _b !== void 0 ? _b : '')}</span>
|
||||
</div>
|
||||
<div class="column">
|
||||
${cityssm.escapeHTML(lot.lotStatus)}<br />
|
||||
<span class="is-size-7">
|
||||
${lot.lotOccupancyCount > 0 ? 'Currently Occupied' : ''}
|
||||
</span>
|
||||
</div>
|
||||
</div>`;
|
||||
panelBlockElement.addEventListener('click', selectExistingLot);
|
||||
panelElement.append(panelBlockElement);
|
||||
}
|
||||
|
|
@ -358,7 +359,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
function createLotAndSelect(submitEvent) {
|
||||
submitEvent.preventDefault();
|
||||
const lotName = lotSelectModalElement.querySelector('#lotCreate--lotName').value;
|
||||
cityssm.postJSON(los.urlPrefix + '/lots/doCreateLot', submitEvent.currentTarget, (rawResponseJSON) => {
|
||||
cityssm.postJSON(`${los.urlPrefix}/lots/doCreateLot`, submitEvent.currentTarget, (rawResponseJSON) => {
|
||||
var _a;
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.success) {
|
||||
|
|
|
|||
|
|
@ -1,16 +1,17 @@
|
|||
/* eslint-disable spaced-comment, @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
/* eslint-disable @eslint-community/eslint-comments/disable-enable-pair */
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
|
||||
import type * as globalTypes from '../../types/globalTypes'
|
||||
import type * as recordTypes from '../../types/recordTypes'
|
||||
import type { BulmaJS } from '@cityssm/bulma-js/types.js'
|
||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
|
||||
|
||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types'
|
||||
|
||||
import type { BulmaJS } from '@cityssm/bulma-js/types'
|
||||
import type * as globalTypes from '../../types/globalTypes.js'
|
||||
import type * as recordTypes from '../../types/recordTypes.js'
|
||||
|
||||
declare const cityssm: cityssmGlobal
|
||||
declare const bulmaJS: BulmaJS
|
||||
declare const exports: Record<string, unknown>
|
||||
;(() => {
|
||||
const los = exports.los as globalTypes.LOS
|
||||
const los = (exports as Record<string, unknown>).los as globalTypes.LOS
|
||||
|
||||
const lotOccupancyId = (
|
||||
document.querySelector('#lotOccupancy--lotOccupancyId') as HTMLInputElement
|
||||
|
|
@ -45,9 +46,7 @@ declare const bulmaJS: BulmaJS
|
|||
formEvent.preventDefault()
|
||||
|
||||
cityssm.postJSON(
|
||||
los.urlPrefix +
|
||||
'/lotOccupancies/' +
|
||||
(isCreate ? 'doCreateLotOccupancy' : 'doUpdateLotOccupancy'),
|
||||
`${los.urlPrefix}/lotOccupancies/${isCreate ? 'doCreateLotOccupancy' : 'doUpdateLotOccupancy'}`,
|
||||
formElement,
|
||||
(rawResponseJSON) => {
|
||||
const responseJSON = rawResponseJSON as {
|
||||
|
|
@ -73,7 +72,7 @@ declare const bulmaJS: BulmaJS
|
|||
}
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
title: 'Error Saving ' + los.escapedAliases.Occupancy,
|
||||
title: `Error Saving ${los.escapedAliases.Occupancy}`,
|
||||
message: responseJSON.errorMessage ?? '',
|
||||
contextualColorName: 'danger'
|
||||
})
|
||||
|
|
@ -90,7 +89,7 @@ declare const bulmaJS: BulmaJS
|
|||
|
||||
function doCopy(): void {
|
||||
cityssm.postJSON(
|
||||
los.urlPrefix + '/lotOccupancies/doCopyLotOccupancy',
|
||||
`${los.urlPrefix}/lotOccupancies/doCopyLotOccupancy`,
|
||||
{
|
||||
lotOccupancyId
|
||||
},
|
||||
|
|
@ -150,7 +149,7 @@ declare const bulmaJS: BulmaJS
|
|||
|
||||
function doDelete(): void {
|
||||
cityssm.postJSON(
|
||||
los.urlPrefix + '/lotOccupancies/doDeleteLotOccupancy',
|
||||
`${los.urlPrefix}/lotOccupancies/doDeleteLotOccupancy`,
|
||||
{
|
||||
lotOccupancyId
|
||||
},
|
||||
|
|
@ -196,7 +195,7 @@ declare const bulmaJS: BulmaJS
|
|||
formEvent.preventDefault()
|
||||
|
||||
cityssm.postJSON(
|
||||
los.urlPrefix + '/workOrders/doCreateWorkOrder',
|
||||
`${los.urlPrefix}/workOrders/doCreateWorkOrder`,
|
||||
formEvent.currentTarget,
|
||||
(rawResponseJSON) => {
|
||||
const responseJSON = rawResponseJSON as {
|
||||
|
|
@ -250,8 +249,8 @@ declare const bulmaJS: BulmaJS
|
|||
'#workOrderCreate--workOrderTypeId'
|
||||
) as HTMLSelectElement
|
||||
|
||||
const workOrderTypes =
|
||||
exports.workOrderTypes as recordTypes.WorkOrderType[]
|
||||
const workOrderTypes = (exports as Record<string, unknown>)
|
||||
.workOrderTypes as recordTypes.WorkOrderType[]
|
||||
|
||||
if (workOrderTypes.length === 1) {
|
||||
workOrderTypeSelectElement.innerHTML = ''
|
||||
|
|
@ -301,6 +300,7 @@ declare const bulmaJS: BulmaJS
|
|||
|
||||
occupancyTypeIdElement.addEventListener('change', () => {
|
||||
if (occupancyTypeIdElement.value === '') {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
lotOccupancyFieldsContainerElement.innerHTML = `<div class="message is-info">
|
||||
<p class="message-body">Select the ${los.escapedAliases.occupancy} type to load the available fields.</p>
|
||||
</div>`
|
||||
|
|
@ -319,6 +319,7 @@ declare const bulmaJS: BulmaJS
|
|||
}
|
||||
|
||||
if (responseJSON.occupancyTypeFields.length === 0) {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
lotOccupancyFieldsContainerElement.innerHTML = `<div class="message is-info">
|
||||
<p class="message-body">There are no additional fields for this ${los.escapedAliases.occupancy} type.</p>
|
||||
</div>`
|
||||
|
|
@ -332,17 +333,15 @@ declare const bulmaJS: BulmaJS
|
|||
|
||||
for (const occupancyTypeField of responseJSON.occupancyTypeFields) {
|
||||
occupancyTypeFieldIds +=
|
||||
',' + occupancyTypeField.occupancyTypeFieldId!.toString()
|
||||
',' + occupancyTypeField.occupancyTypeFieldId.toString()
|
||||
|
||||
const fieldName =
|
||||
'lotOccupancyFieldValue_' +
|
||||
occupancyTypeField.occupancyTypeFieldId!.toString()
|
||||
const fieldName = `lotOccupancyFieldValue_${occupancyTypeField.occupancyTypeFieldId.toString()}`
|
||||
|
||||
const fieldId = 'lotOccupancy--' + fieldName
|
||||
const fieldId = `lotOccupancy--${fieldName}`
|
||||
|
||||
const fieldElement = document.createElement('div')
|
||||
fieldElement.className = 'field'
|
||||
fieldElement.innerHTML = `<label class="label" for="${fieldId}"></label><div class="control"></div>`
|
||||
fieldElement.innerHTML = `<label class="label" for="${cityssm.escapeHTML(fieldId)}"></label><div class="control"></div>`
|
||||
;(
|
||||
fieldElement.querySelector('label') as HTMLLabelElement
|
||||
).textContent = occupancyTypeField.occupancyTypeField as string
|
||||
|
|
@ -365,7 +364,7 @@ declare const bulmaJS: BulmaJS
|
|||
occupancyTypeField.maximumLength as number
|
||||
|
||||
if ((occupancyTypeField.pattern ?? '') !== '') {
|
||||
inputElement.pattern = occupancyTypeField.pattern!
|
||||
inputElement.pattern = occupancyTypeField.pattern as string
|
||||
}
|
||||
|
||||
;(fieldElement.querySelector('.control') as HTMLElement).append(
|
||||
|
|
@ -375,7 +374,7 @@ declare const bulmaJS: BulmaJS
|
|||
;(
|
||||
fieldElement.querySelector('.control') as HTMLElement
|
||||
).innerHTML = `<div class="select is-fullwidth">
|
||||
<select id="${fieldId}" name="${fieldName}">
|
||||
<select id="${cityssm.escapeHTML(fieldId)}" name="${cityssm.escapeHTML(fieldName)}">
|
||||
<option value="">(Not Set)</option>
|
||||
</select>
|
||||
</div>`
|
||||
|
|
@ -405,9 +404,9 @@ declare const bulmaJS: BulmaJS
|
|||
|
||||
lotOccupancyFieldsContainerElement.insertAdjacentHTML(
|
||||
'beforeend',
|
||||
`<input name="occupancyTypeFieldIds" type="hidden" value="${occupancyTypeFieldIds.slice(
|
||||
1
|
||||
)}" />`
|
||||
// eslint-disable-next-line no-secrets/no-secrets
|
||||
`<input name="occupancyTypeFieldIds" type="hidden"
|
||||
value="${cityssm.escapeHTML(occupancyTypeFieldIds.slice(1))}" />`
|
||||
)
|
||||
}
|
||||
)
|
||||
|
|
@ -481,11 +480,12 @@ declare const bulmaJS: BulmaJS
|
|||
}
|
||||
|
||||
function searchLots(): void {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
lotSelectResultsElement.innerHTML =
|
||||
los.getLoadingParagraphHTML('Searching...')
|
||||
|
||||
cityssm.postJSON(
|
||||
los.urlPrefix + '/lots/doSearchLots',
|
||||
`${los.urlPrefix}/lots/doSearchLots`,
|
||||
lotSelectFormElement,
|
||||
(rawResponseJSON) => {
|
||||
const responseJSON = rawResponseJSON as {
|
||||
|
|
@ -512,23 +512,19 @@ declare const bulmaJS: BulmaJS
|
|||
panelBlockElement.dataset.lotId = lot.lotId.toString()
|
||||
panelBlockElement.dataset.lotName = lot.lotName
|
||||
|
||||
panelBlockElement.innerHTML =
|
||||
'<div class="columns">' +
|
||||
('<div class="column">' +
|
||||
cityssm.escapeHTML(lot.lotName ?? '') +
|
||||
'<br />' +
|
||||
'<span class="is-size-7">' +
|
||||
cityssm.escapeHTML(lot.mapName ?? '') +
|
||||
'</span>' +
|
||||
'</div>') +
|
||||
('<div class="column">' +
|
||||
cityssm.escapeHTML(lot.lotStatus as string) +
|
||||
'<br />' +
|
||||
'<span class="is-size-7">' +
|
||||
(lot.lotOccupancyCount! > 0 ? 'Currently Occupied' : '') +
|
||||
'</span>' +
|
||||
'</div>') +
|
||||
'</div>'
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
panelBlockElement.innerHTML = `<div class="columns">
|
||||
<div class="column">
|
||||
${cityssm.escapeHTML(lot.lotName ?? '')}<br />
|
||||
<span class="is-size-7">${cityssm.escapeHTML(lot.mapName ?? '')}</span>
|
||||
</div>
|
||||
<div class="column">
|
||||
${cityssm.escapeHTML(lot.lotStatus as string)}<br />
|
||||
<span class="is-size-7">
|
||||
${lot.lotOccupancyCount! > 0 ? 'Currently Occupied' : ''}
|
||||
</span>
|
||||
</div>
|
||||
</div>`
|
||||
|
||||
panelBlockElement.addEventListener('click', selectExistingLot)
|
||||
|
||||
|
|
@ -551,7 +547,7 @@ declare const bulmaJS: BulmaJS
|
|||
).value
|
||||
|
||||
cityssm.postJSON(
|
||||
los.urlPrefix + '/lots/doCreateLot',
|
||||
`${los.urlPrefix}/lots/doCreateLot`,
|
||||
submitEvent.currentTarget,
|
||||
(rawResponseJSON) => {
|
||||
const responseJSON = rawResponseJSON as {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/indent, unicorn/prefer-module */
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
let lotOccupancyFees = exports.lotOccupancyFees;
|
||||
delete exports.lotOccupancyFees;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
/*
|
||||
* Unsaved Changes
|
||||
*/
|
||||
var _a, _b, _c, _d;
|
||||
let _hasUnsavedChanges = false;
|
||||
function setUnsavedChanges() {
|
||||
if (!hasUnsavedChanges()) {
|
||||
|
|
@ -80,7 +82,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
displayMode: 'dialog'
|
||||
};
|
||||
function initializeDatePickers(containerElement) {
|
||||
var _a, _b;
|
||||
var _a, _b, _c;
|
||||
const dateElements = containerElement.querySelectorAll("input[type='date']");
|
||||
for (const dateElement of dateElements) {
|
||||
const datePickerOptions = Object.assign({}, datePickerBaseOptions);
|
||||
|
|
@ -110,7 +112,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
bulmaJS.toggleHtmlClipped();
|
||||
});
|
||||
// Get the datepicker container element
|
||||
const datepickerElement = containerElement.querySelector('#' + cal._id);
|
||||
const datepickerElement = containerElement.querySelector(`#${cal._id}`);
|
||||
// Override the previous and next month button styles
|
||||
const datePickerNavButtonElements = datepickerElement.querySelectorAll('.datepicker-nav button.is-text');
|
||||
for (const datePickerNavButtonElement of datePickerNavButtonElements) {
|
||||
|
|
@ -133,84 +135,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
// Apply a label
|
||||
const labelElement = document.querySelector("label[for='" + dateElement.id + "']");
|
||||
if (labelElement !== null) {
|
||||
datepickerElement
|
||||
.querySelector('.datetimepicker-dummy-input')
|
||||
.setAttribute('aria-label', (_b = labelElement.textContent) !== null && _b !== void 0 ? _b : '');
|
||||
(_b = datepickerElement
|
||||
.querySelector('.datetimepicker-dummy-input')) === null || _b === void 0 ? void 0 : _b.setAttribute('aria-label', (_c = labelElement.textContent) !== null && _c !== void 0 ? _c : '');
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
const timePickerBaseOptions: BulmaCalendarOptions = {
|
||||
type: "time",
|
||||
timeFormat: "hh:mm",
|
||||
color: "info",
|
||||
displayMode: "dialog",
|
||||
validateLabel: "Set Time",
|
||||
minuteSteps: 1
|
||||
};
|
||||
|
||||
const initializeTimePickers = (containerElement: HTMLElement) => {
|
||||
|
||||
const timeElements = containerElement.querySelectorAll(
|
||||
"input[type='time']"
|
||||
) as NodeListOf<HTMLInputElement>;
|
||||
|
||||
for (const timeElement of timeElements) {
|
||||
const timePickerOptions = Object.assign({}, timePickerBaseOptions);
|
||||
|
||||
if (timeElement.required) {
|
||||
timePickerOptions.showClearButton = false;
|
||||
}
|
||||
|
||||
const cal = exports.bulmaCalendar.attach(timeElement, timePickerOptions)[0];
|
||||
|
||||
// trigger change event on original element
|
||||
cal.on("save", () => {
|
||||
timeElement.value = cal.value();
|
||||
timeElement.dispatchEvent(new Event("change"));
|
||||
});
|
||||
|
||||
// Disable html scrolling when calendar is open
|
||||
cal.on("show", () => {
|
||||
document.querySelector("html")!.classList.add("is-clipped");
|
||||
});
|
||||
|
||||
// Reenable scrolling, if a modal window is not open
|
||||
cal.on("hide", () => {
|
||||
bulmaJS.toggleHtmlClipped();
|
||||
});
|
||||
|
||||
// Get the datepicker container element
|
||||
const timePickerElement = containerElement.querySelector("#" + cal._id) as HTMLElement;
|
||||
|
||||
// Remove "cancel" button
|
||||
|
||||
const timePickerCancelButtonElement = timePickerElement.querySelector(
|
||||
".datetimepicker-footer-cancel"
|
||||
);
|
||||
|
||||
if (timePickerCancelButtonElement) {
|
||||
timePickerCancelButtonElement.remove();
|
||||
}
|
||||
|
||||
// Override the clear button style
|
||||
|
||||
const clearButtonElement = timePickerElement.querySelector(
|
||||
".datetimepicker-clear-button"
|
||||
) as HTMLElement;
|
||||
|
||||
if (clearButtonElement) {
|
||||
if (timeElement.required) {
|
||||
clearButtonElement.remove();
|
||||
} else {
|
||||
clearButtonElement.dataset.tooltip = "Clear";
|
||||
clearButtonElement.innerHTML =
|
||||
'<span class="has-text-weight-bold" aria-hidden="true">×</span>';
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
*/
|
||||
/*
|
||||
* Aliases
|
||||
*/
|
||||
|
|
@ -337,19 +266,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
'</div>') +
|
||||
('<div class="level-right">' +
|
||||
(offset > 0
|
||||
? '<div class="level-item">' +
|
||||
'<button class="button is-rounded is-link is-outlined" data-page="previous" type="button" title="Previous">' +
|
||||
'<i class="fas fa-arrow-left" aria-hidden="true"></i>' +
|
||||
'</button>' +
|
||||
'</div>'
|
||||
? `<div class="level-item">
|
||||
<button class="button is-rounded is-link is-outlined" data-page="previous" type="button" title="Previous">
|
||||
<i class="fas fa-arrow-left" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>`
|
||||
: '') +
|
||||
(limit + offset < count
|
||||
? '<div class="level-item">' +
|
||||
'<button class="button is-rounded is-link" data-page="next" type="button" title="Next">' +
|
||||
'<span>Next</span>' +
|
||||
'<span class="icon"><i class="fas fa-arrow-right" aria-hidden="true"></i></span>' +
|
||||
'</button>' +
|
||||
'</div>'
|
||||
? `<div class="level-item">
|
||||
<button class="button is-rounded is-link" data-page="next" type="button" title="Next">
|
||||
<span>Next</span>
|
||||
<span class="icon"><i class="fas fa-arrow-right" aria-hidden="true"></i></span>
|
||||
</button>
|
||||
</div>`
|
||||
: '') +
|
||||
'</div>') +
|
||||
'</div>');
|
||||
|
|
@ -357,7 +286,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
/*
|
||||
* URLs
|
||||
*/
|
||||
const urlPrefix = document.querySelector('main').dataset.urlPrefix;
|
||||
const urlPrefix = (_b = (_a = document.querySelector('main')) === null || _a === void 0 ? void 0 : _a.dataset.urlPrefix) !== null && _b !== void 0 ? _b : '';
|
||||
function getRecordURL(recordTypePlural, recordId, edit, time) {
|
||||
return (urlPrefix +
|
||||
'/' +
|
||||
|
|
@ -387,7 +316,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
*/
|
||||
const los = {
|
||||
urlPrefix,
|
||||
apiKey: document.querySelector('main').dataset.apiKey,
|
||||
apiKey: (_d = (_c = document.querySelector('main')) === null || _c === void 0 ? void 0 : _c.dataset.apiKey) !== null && _d !== void 0 ? _d : '',
|
||||
dynamicsGPIntegrationIsEnabled,
|
||||
highlightMap,
|
||||
initializeUnlockFieldButtons,
|
||||
|
|
|
|||
|
|
@ -1,12 +1,17 @@
|
|||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
|
||||
import type * as globalTypes from '../types/globalTypes'
|
||||
import type { BulmaJS } from '@cityssm/bulma-js/types.js'
|
||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
|
||||
import type { Options as BulmaCalendarOptions } from 'bulma-calendar'
|
||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types'
|
||||
import type { BulmaJS } from '@cityssm/bulma-js/types'
|
||||
|
||||
import type * as globalTypes from '../types/globalTypes.js'
|
||||
|
||||
declare const cityssm: cityssmGlobal
|
||||
declare const bulmaJS: BulmaJS
|
||||
declare const exports: Record<string, unknown> & {
|
||||
aliases: Record<string, string>
|
||||
}
|
||||
;(() => {
|
||||
/*
|
||||
* Unsaved Changes
|
||||
|
|
@ -71,7 +76,7 @@ declare const bulmaJS: BulmaJS
|
|||
function unlockField(clickEvent: Event): void {
|
||||
const fieldElement = (clickEvent.currentTarget as HTMLElement).closest(
|
||||
'.field'
|
||||
)!
|
||||
) as HTMLElement
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
||||
const inputOrSelectElement = fieldElement.querySelector(
|
||||
|
|
@ -158,7 +163,9 @@ declare const bulmaJS: BulmaJS
|
|||
})
|
||||
|
||||
// Get the datepicker container element
|
||||
const datepickerElement = containerElement.querySelector('#' + (cal._id as string))!
|
||||
const datepickerElement = containerElement.querySelector(
|
||||
`#${cal._id as string}`
|
||||
)!
|
||||
|
||||
// Override the previous and next month button styles
|
||||
const datePickerNavButtonElements = datepickerElement.querySelectorAll(
|
||||
|
|
@ -194,85 +201,12 @@ declare const bulmaJS: BulmaJS
|
|||
|
||||
if (labelElement !== null) {
|
||||
datepickerElement
|
||||
.querySelector('.datetimepicker-dummy-input')!
|
||||
.setAttribute('aria-label', labelElement.textContent ?? '')
|
||||
.querySelector('.datetimepicker-dummy-input')
|
||||
?.setAttribute('aria-label', labelElement.textContent ?? '')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
const timePickerBaseOptions: BulmaCalendarOptions = {
|
||||
type: "time",
|
||||
timeFormat: "hh:mm",
|
||||
color: "info",
|
||||
displayMode: "dialog",
|
||||
validateLabel: "Set Time",
|
||||
minuteSteps: 1
|
||||
};
|
||||
|
||||
const initializeTimePickers = (containerElement: HTMLElement) => {
|
||||
|
||||
const timeElements = containerElement.querySelectorAll(
|
||||
"input[type='time']"
|
||||
) as NodeListOf<HTMLInputElement>;
|
||||
|
||||
for (const timeElement of timeElements) {
|
||||
const timePickerOptions = Object.assign({}, timePickerBaseOptions);
|
||||
|
||||
if (timeElement.required) {
|
||||
timePickerOptions.showClearButton = false;
|
||||
}
|
||||
|
||||
const cal = exports.bulmaCalendar.attach(timeElement, timePickerOptions)[0];
|
||||
|
||||
// trigger change event on original element
|
||||
cal.on("save", () => {
|
||||
timeElement.value = cal.value();
|
||||
timeElement.dispatchEvent(new Event("change"));
|
||||
});
|
||||
|
||||
// Disable html scrolling when calendar is open
|
||||
cal.on("show", () => {
|
||||
document.querySelector("html")!.classList.add("is-clipped");
|
||||
});
|
||||
|
||||
// Reenable scrolling, if a modal window is not open
|
||||
cal.on("hide", () => {
|
||||
bulmaJS.toggleHtmlClipped();
|
||||
});
|
||||
|
||||
// Get the datepicker container element
|
||||
const timePickerElement = containerElement.querySelector("#" + cal._id) as HTMLElement;
|
||||
|
||||
// Remove "cancel" button
|
||||
|
||||
const timePickerCancelButtonElement = timePickerElement.querySelector(
|
||||
".datetimepicker-footer-cancel"
|
||||
);
|
||||
|
||||
if (timePickerCancelButtonElement) {
|
||||
timePickerCancelButtonElement.remove();
|
||||
}
|
||||
|
||||
// Override the clear button style
|
||||
|
||||
const clearButtonElement = timePickerElement.querySelector(
|
||||
".datetimepicker-clear-button"
|
||||
) as HTMLElement;
|
||||
|
||||
if (clearButtonElement) {
|
||||
if (timeElement.required) {
|
||||
clearButtonElement.remove();
|
||||
} else {
|
||||
clearButtonElement.dataset.tooltip = "Clear";
|
||||
clearButtonElement.innerHTML =
|
||||
'<span class="has-text-weight-bold" aria-hidden="true">×</span>';
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
*/
|
||||
|
||||
/*
|
||||
* Aliases
|
||||
*/
|
||||
|
|
@ -402,18 +336,14 @@ declare const bulmaJS: BulmaJS
|
|||
return `<div class="field has-addons">
|
||||
<div class="control">
|
||||
<button
|
||||
class="button ${
|
||||
isSmall ? 'is-small' : ''
|
||||
} ${upButtonClassNames}"
|
||||
class="button ${isSmall ? 'is-small' : ''} ${upButtonClassNames}"
|
||||
data-tooltip="Move Up" data-direction="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}"
|
||||
class="button ${isSmall ? 'is-small' : ''} ${downButtonClassNames}"
|
||||
data-tooltip="Move Down" data-direction="down" type="button" aria-label="Move Down">
|
||||
<i class="fas fa-arrow-down" aria-hidden="true"></i>
|
||||
</button>
|
||||
|
|
@ -447,19 +377,19 @@ declare const bulmaJS: BulmaJS
|
|||
'</div>') +
|
||||
('<div class="level-right">' +
|
||||
(offset > 0
|
||||
? '<div class="level-item">' +
|
||||
'<button class="button is-rounded is-link is-outlined" data-page="previous" type="button" title="Previous">' +
|
||||
'<i class="fas fa-arrow-left" aria-hidden="true"></i>' +
|
||||
'</button>' +
|
||||
'</div>'
|
||||
? `<div class="level-item">
|
||||
<button class="button is-rounded is-link is-outlined" data-page="previous" type="button" title="Previous">
|
||||
<i class="fas fa-arrow-left" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>`
|
||||
: '') +
|
||||
(limit + offset < count
|
||||
? '<div class="level-item">' +
|
||||
'<button class="button is-rounded is-link" data-page="next" type="button" title="Next">' +
|
||||
'<span>Next</span>' +
|
||||
'<span class="icon"><i class="fas fa-arrow-right" aria-hidden="true"></i></span>' +
|
||||
'</button>' +
|
||||
'</div>'
|
||||
? `<div class="level-item">
|
||||
<button class="button is-rounded is-link" data-page="next" type="button" title="Next">
|
||||
<span>Next</span>
|
||||
<span class="icon"><i class="fas fa-arrow-right" aria-hidden="true"></i></span>
|
||||
</button>
|
||||
</div>`
|
||||
: '') +
|
||||
'</div>') +
|
||||
'</div>'
|
||||
|
|
@ -470,7 +400,7 @@ declare const bulmaJS: BulmaJS
|
|||
* URLs
|
||||
*/
|
||||
|
||||
const urlPrefix = document.querySelector('main')!.dataset.urlPrefix!
|
||||
const urlPrefix = document.querySelector('main')?.dataset.urlPrefix ?? ''
|
||||
|
||||
function getRecordURL(
|
||||
recordTypePlural: 'maps' | 'lots' | 'lotOccupancies' | 'workOrders',
|
||||
|
|
@ -524,7 +454,8 @@ declare const bulmaJS: BulmaJS
|
|||
* Settings
|
||||
*/
|
||||
|
||||
const dynamicsGPIntegrationIsEnabled = exports.dynamicsGPIntegrationIsEnabled as boolean
|
||||
const dynamicsGPIntegrationIsEnabled =
|
||||
exports.dynamicsGPIntegrationIsEnabled as boolean
|
||||
|
||||
/*
|
||||
* Declare LOS
|
||||
|
|
@ -532,7 +463,7 @@ declare const bulmaJS: BulmaJS
|
|||
|
||||
const los: globalTypes.LOS = {
|
||||
urlPrefix,
|
||||
apiKey: document.querySelector('main')!.dataset.apiKey!,
|
||||
apiKey: document.querySelector('main')?.dataset.apiKey ?? '',
|
||||
dynamicsGPIntegrationIsEnabled,
|
||||
highlightMap,
|
||||
initializeUnlockFieldButtons,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
"use strict";
|
||||
/* eslint-disable spaced-comment, @typescript-eslint/indent, @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
/* eslint-disable spaced-comment, @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
var _a, _b, _c;
|
||||
|
|
@ -155,7 +155,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
*/
|
||||
if (!isCreate) {
|
||||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/indent */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
var _a, _b;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
"use strict";
|
||||
/* eslint-disable spaced-comment, @typescript-eslint/indent, @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
/* eslint-disable spaced-comment, @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
var _a, _b, _c;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/indent */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
var _a, _b;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
|
|
|
|||
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
Loading…
Reference in New Issue