diff --git a/public-typescript/adminDatabase.js b/public-typescript/adminDatabase.js
index 82520407..d9657609 100644
--- a/public-typescript/adminDatabase.js
+++ b/public-typescript/adminDatabase.js
@@ -11,7 +11,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
if (responseJSON.success) {
bulmaJS.alert({
title: 'Database Backed Up Successfully',
- message: `Backed up to ${responseJSON.fileName}`,
+ message: `Backed up to ${responseJSON.fileName}
+ To request a copy of the backup, contact your application administrator.`,
+ messageIsHtml: true,
contextualColorName: 'success'
});
}
diff --git a/public-typescript/adminDatabase.ts b/public-typescript/adminDatabase.ts
index 34432044..767984e3 100644
--- a/public-typescript/adminDatabase.ts
+++ b/public-typescript/adminDatabase.ts
@@ -29,7 +29,9 @@ declare const bulmaJS: BulmaJS
if (responseJSON.success) {
bulmaJS.alert({
title: 'Database Backed Up Successfully',
- message: `Backed up to ${responseJSON.fileName}`,
+ message: `Backed up to ${responseJSON.fileName}
+ To request a copy of the backup, contact your application administrator.`,
+ messageIsHtml: true,
contextualColorName: 'success'
})
} else {
diff --git a/public-typescript/adminFees.js b/public-typescript/adminFees.js
index 49eaccdd..cb2790af 100644
--- a/public-typescript/adminFees.js
+++ b/public-typescript/adminFees.js
@@ -1,4 +1,5 @@
"use strict";
+/* eslint-disable @typescript-eslint/indent */
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true });
(() => {
@@ -60,9 +61,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
feeCategoryContainerElement.insertAdjacentHTML('beforeend', `
@@ -84,9 +95,9 @@ declare const bulmaJS: BulmaJS
`
- There are no fees in the
- "${cityssm.escapeHTML(feeCategory.feeCategory ?? '')}"
- category.
+ There are no fees in the
+ "${cityssm.escapeHTML(feeCategory.feeCategory ?? '')}"
+ category.
`
@@ -239,11 +250,9 @@ declare const bulmaJS: BulmaJS
cityssm.postJSON(
los.urlPrefix + '/admin/doAddFeeCategory',
submitEvent.currentTarget,
- (responseJSON: {
- success: boolean
- errorMessage?: string
- feeCategories: recordTypes.FeeCategory[]
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
if (responseJSON.success) {
feeCategories = responseJSON.feeCategories
addCloseModalFunction()
@@ -306,11 +315,9 @@ declare const bulmaJS: BulmaJS
cityssm.postJSON(
los.urlPrefix + '/admin/doUpdateFeeCategory',
submitEvent.currentTarget,
- (responseJSON: {
- success: boolean
- errorMessage?: string
- feeCategories: recordTypes.FeeCategory[]
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
if (responseJSON.success) {
feeCategories = responseJSON.feeCategories
editCloseModalFunction()
@@ -375,11 +382,9 @@ declare const bulmaJS: BulmaJS
{
feeCategoryId
},
- (responseJSON: {
- success: boolean
- errorMessage?: string
- feeCategories?: recordTypes.FeeCategory[]
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
if (responseJSON.success) {
feeCategories = responseJSON.feeCategories!
renderFeeCategories()
@@ -422,11 +427,9 @@ declare const bulmaJS: BulmaJS
feeCategoryId,
moveToEnd: clickEvent.shiftKey ? '1' : '0'
},
- (responseJSON: {
- success: boolean
- errorMessage?: string
- feeCategories?: recordTypes.FeeCategory[]
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
if (responseJSON.success) {
feeCategories = responseJSON.feeCategories!
renderFeeCategories()
@@ -463,11 +466,9 @@ declare const bulmaJS: BulmaJS
cityssm.postJSON(
los.urlPrefix + '/admin/doAddFee',
submitEvent.currentTarget,
- (responseJSON: {
- success: boolean
- errorMessage?: string
- feeCategories: recordTypes.FeeCategory[]
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
if (responseJSON.success) {
feeCategories = responseJSON.feeCategories
addCloseModalFunction()
@@ -641,11 +642,9 @@ declare const bulmaJS: BulmaJS
cityssm.postJSON(
los.urlPrefix + '/admin/doUpdateFee',
submitEvent.currentTarget,
- (responseJSON: {
- success: boolean
- errorMessage?: string
- feeCategories?: recordTypes.FeeCategory[]
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
if (responseJSON.success) {
feeCategories = responseJSON.feeCategories!
editCloseModalFunction()
@@ -670,11 +669,9 @@ declare const bulmaJS: BulmaJS
{
feeId
},
- (responseJSON: {
- success: boolean
- errorMessage?: string
- feeCategories?: recordTypes.FeeCategory[]
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
if (responseJSON.success) {
feeCategories = responseJSON.feeCategories!
editCloseModalFunction()
@@ -913,11 +910,9 @@ declare const bulmaJS: BulmaJS
feeId,
moveToEnd: clickEvent.shiftKey ? '1' : '0'
},
- (responseJSON: {
- success: boolean
- errorMessage?: string
- feeCategories?: recordTypes.FeeCategory[]
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
if (responseJSON.success) {
feeCategories = responseJSON.feeCategories!
renderFeeCategories()
diff --git a/public-typescript/adminLotTypes.js b/public-typescript/adminLotTypes.js
index 6e336442..25c5d09e 100644
--- a/public-typescript/adminLotTypes.js
+++ b/public-typescript/adminLotTypes.js
@@ -1,4 +1,5 @@
"use strict";
+/* eslint-disable @typescript-eslint/indent */
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true });
(() => {
@@ -64,7 +65,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
let editCloseModalFunction;
function doEdit(submitEvent) {
submitEvent.preventDefault();
- cityssm.postJSON(los.urlPrefix + '/admin/doUpdateLotType', submitEvent.currentTarget, (responseJSON) => {
+ cityssm.postJSON(los.urlPrefix + '/admin/doUpdateLotType', submitEvent.currentTarget, (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON;
lotTypeResponseHandler(responseJSON);
if (responseJSON.success) {
editCloseModalFunction();
@@ -93,7 +95,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
let addCloseModalFunction;
function doAdd(submitEvent) {
submitEvent.preventDefault();
- cityssm.postJSON(los.urlPrefix + '/admin/doAddLotTypeField', submitEvent.currentTarget, (responseJSON) => {
+ cityssm.postJSON(los.urlPrefix + '/admin/doAddLotTypeField', submitEvent.currentTarget, (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON;
expandedLotTypes.add(lotTypeId);
lotTypeResponseHandler(responseJSON);
if (responseJSON.success) {
@@ -162,7 +165,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
}
function doUpdate(submitEvent) {
submitEvent.preventDefault();
- cityssm.postJSON(los.urlPrefix + '/admin/doUpdateLotTypeField', submitEvent.currentTarget, (responseJSON) => {
+ cityssm.postJSON(los.urlPrefix + '/admin/doUpdateLotTypeField', submitEvent.currentTarget, (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON;
lotTypeResponseHandler(responseJSON);
if (responseJSON.success) {
editCloseModalFunction();
@@ -172,7 +176,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
function doDelete() {
cityssm.postJSON(los.urlPrefix + '/admin/doDeleteLotTypeField', {
lotTypeFieldId
- }, (responseJSON) => {
+ }, (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON;
lotTypeResponseHandler(responseJSON);
if (responseJSON.success) {
editCloseModalFunction();
@@ -368,8 +373,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
let addCloseModalFunction;
function doAdd(submitEvent) {
submitEvent.preventDefault();
- cityssm.postJSON(los.urlPrefix + '/admin/doAddLotType', submitEvent.currentTarget, (responseJSON) => {
+ cityssm.postJSON(los.urlPrefix + '/admin/doAddLotType', submitEvent.currentTarget, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
addCloseModalFunction();
lotTypes = responseJSON.lotTypes;
diff --git a/public-typescript/adminLotTypes.ts b/public-typescript/adminLotTypes.ts
index 361b0071..78a1c2ae 100644
--- a/public-typescript/adminLotTypes.ts
+++ b/public-typescript/adminLotTypes.ts
@@ -1,3 +1,4 @@
+/* eslint-disable @typescript-eslint/indent */
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
import type * as globalTypes from '../types/globalTypes'
@@ -9,6 +10,17 @@ import type { BulmaJS } from '@cityssm/bulma-js/types'
declare const cityssm: cityssmGlobal
declare const bulmaJS: BulmaJS
+
+type ResponseJSON =
+ | {
+ success: true
+ lotTypes: recordTypes.LotType[]
+ lotTypeFieldId?: number
+ }
+ | {
+ success: false
+ errorMessage: string
+ }
;(() => {
const los = exports.los as globalTypes.LOS
@@ -47,11 +59,7 @@ declare const bulmaJS: BulmaJS
}
}
- function lotTypeResponseHandler(responseJSON: {
- success: boolean
- errorMessage?: string
- lotTypes?: recordTypes.LotType[]
- }): void {
+ function lotTypeResponseHandler(responseJSON: ResponseJSON): void {
if (responseJSON.success) {
lotTypes = responseJSON.lotTypes!
renderLotTypes()
@@ -117,11 +125,9 @@ declare const bulmaJS: BulmaJS
cityssm.postJSON(
los.urlPrefix + '/admin/doUpdateLotType',
submitEvent.currentTarget,
- (responseJSON: {
- success: boolean
- errorMessage?: string
- occupancyTypes?: recordTypes.OccupancyType[]
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
lotTypeResponseHandler(responseJSON)
if (responseJSON.success) {
editCloseModalFunction()
@@ -180,12 +186,9 @@ declare const bulmaJS: BulmaJS
cityssm.postJSON(
los.urlPrefix + '/admin/doAddLotTypeField',
submitEvent.currentTarget,
- (responseJSON: {
- success: boolean
- errorMessage?: string
- lotTypes?: recordTypes.LotType[]
- lotTypeFieldId?: number
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
expandedLotTypes.add(lotTypeId)
lotTypeResponseHandler(responseJSON)
@@ -289,11 +292,9 @@ declare const bulmaJS: BulmaJS
cityssm.postJSON(
los.urlPrefix + '/admin/doUpdateLotTypeField',
submitEvent.currentTarget,
- (responseJSON: {
- success: boolean
- errorMessage?: string
- occupancyTypes?: recordTypes.OccupancyType[]
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
lotTypeResponseHandler(responseJSON)
if (responseJSON.success) {
editCloseModalFunction()
@@ -308,11 +309,9 @@ declare const bulmaJS: BulmaJS
{
lotTypeFieldId
},
- (responseJSON: {
- success: boolean
- errorMessage?: string
- lotTypes?: recordTypes.LotType[]
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
lotTypeResponseHandler(responseJSON)
if (responseJSON.success) {
editCloseModalFunction()
@@ -632,11 +631,9 @@ declare const bulmaJS: BulmaJS
cityssm.postJSON(
los.urlPrefix + '/admin/doAddLotType',
submitEvent.currentTarget,
- (responseJSON: {
- success: boolean
- errorMessage?: string
- lotTypes?: recordTypes.LotType[]
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
if (responseJSON.success) {
addCloseModalFunction()
lotTypes = responseJSON.lotTypes!
diff --git a/public-typescript/adminOccupancyTypes.js b/public-typescript/adminOccupancyTypes.js
index 2c04f653..a86d5c2f 100644
--- a/public-typescript/adminOccupancyTypes.js
+++ b/public-typescript/adminOccupancyTypes.js
@@ -1,4 +1,5 @@
"use strict";
+/* eslint-disable @typescript-eslint/indent */
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true });
(() => {
@@ -68,7 +69,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
let editCloseModalFunction;
function doEdit(submitEvent) {
submitEvent.preventDefault();
- cityssm.postJSON(los.urlPrefix + '/admin/doUpdateOccupancyType', submitEvent.currentTarget, (responseJSON) => {
+ cityssm.postJSON(los.urlPrefix + '/admin/doUpdateOccupancyType', submitEvent.currentTarget, (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON;
occupancyTypeResponseHandler(responseJSON);
if (responseJSON.success) {
editCloseModalFunction();
@@ -97,7 +99,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
let addCloseModalFunction;
function doAdd(submitEvent) {
submitEvent.preventDefault();
- cityssm.postJSON(los.urlPrefix + '/admin/doAddOccupancyTypeField', submitEvent.currentTarget, (responseJSON) => {
+ cityssm.postJSON(los.urlPrefix + '/admin/doAddOccupancyTypeField', submitEvent.currentTarget, (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON;
expandedOccupancyTypes.add(occupancyTypeId);
occupancyTypeResponseHandler(responseJSON);
if (responseJSON.success) {
@@ -171,7 +174,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
}
function doUpdate(submitEvent) {
submitEvent.preventDefault();
- cityssm.postJSON(los.urlPrefix + '/admin/doUpdateOccupancyTypeField', submitEvent.currentTarget, (responseJSON) => {
+ cityssm.postJSON(los.urlPrefix + '/admin/doUpdateOccupancyTypeField', submitEvent.currentTarget, (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON;
occupancyTypeResponseHandler(responseJSON);
if (responseJSON.success) {
editCloseModalFunction();
@@ -181,7 +185,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
function doDelete() {
cityssm.postJSON(los.urlPrefix + '/admin/doDeleteOccupancyTypeField', {
occupancyTypeFieldId
- }, (responseJSON) => {
+ }, (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON;
occupancyTypeResponseHandler(responseJSON);
if (responseJSON.success) {
editCloseModalFunction();
@@ -307,7 +312,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
let closeAddModalFunction;
function doAdd(formEvent) {
formEvent.preventDefault();
- cityssm.postJSON(los.urlPrefix + '/admin/doAddOccupancyTypePrint', formEvent.currentTarget, (responseJSON) => {
+ cityssm.postJSON(los.urlPrefix + '/admin/doAddOccupancyTypePrint', formEvent.currentTarget, (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
closeAddModalFunction();
}
@@ -570,8 +576,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
let addCloseModalFunction;
function doAdd(submitEvent) {
submitEvent.preventDefault();
- cityssm.postJSON(los.urlPrefix + '/admin/doAddOccupancyType', submitEvent.currentTarget, (responseJSON) => {
+ cityssm.postJSON(los.urlPrefix + '/admin/doAddOccupancyType', submitEvent.currentTarget, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
addCloseModalFunction();
occupancyTypes = responseJSON.occupancyTypes;
diff --git a/public-typescript/adminOccupancyTypes.ts b/public-typescript/adminOccupancyTypes.ts
index 94b1be77..8d741926 100644
--- a/public-typescript/adminOccupancyTypes.ts
+++ b/public-typescript/adminOccupancyTypes.ts
@@ -1,3 +1,4 @@
+/* eslint-disable @typescript-eslint/indent */
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
import type * as globalTypes from '../types/globalTypes'
@@ -9,6 +10,18 @@ import type { BulmaJS } from '@cityssm/bulma-js/types'
declare const cityssm: cityssmGlobal
declare const bulmaJS: BulmaJS
+
+type ResponseJSON =
+ | {
+ success: true
+ occupancyTypes: recordTypes.OccupancyType[]
+ allOccupancyTypeFields: recordTypes.OccupancyTypeField[]
+ occupancyTypeFieldId?: number
+ }
+ | {
+ success: false
+ errorMessage: string
+ }
;(() => {
const los = exports.los as globalTypes.LOS
@@ -131,12 +144,9 @@ declare const bulmaJS: BulmaJS
cityssm.postJSON(
los.urlPrefix + '/admin/doUpdateOccupancyType',
submitEvent.currentTarget,
- (responseJSON: {
- success: boolean
- errorMessage?: string
- occupancyTypes?: recordTypes.OccupancyType[]
- allOccupancyTypeFields?: recordTypes.OccupancyTypeField[]
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
occupancyTypeResponseHandler(responseJSON)
if (responseJSON.success) {
editCloseModalFunction()
@@ -195,13 +205,9 @@ declare const bulmaJS: BulmaJS
cityssm.postJSON(
los.urlPrefix + '/admin/doAddOccupancyTypeField',
submitEvent.currentTarget,
- (responseJSON: {
- success: boolean
- errorMessage?: string
- occupancyTypes?: recordTypes.OccupancyType[]
- allOccupancyTypeFields?: recordTypes.OccupancyTypeField[]
- occupancyTypeFieldId?: number
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
expandedOccupancyTypes.add(occupancyTypeId)
occupancyTypeResponseHandler(responseJSON)
@@ -320,11 +326,9 @@ declare const bulmaJS: BulmaJS
cityssm.postJSON(
los.urlPrefix + '/admin/doUpdateOccupancyTypeField',
submitEvent.currentTarget,
- (responseJSON: {
- success: boolean
- errorMessage?: string
- occupancyTypes?: recordTypes.OccupancyType[]
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
occupancyTypeResponseHandler(responseJSON)
if (responseJSON.success) {
editCloseModalFunction()
@@ -339,11 +343,9 @@ declare const bulmaJS: BulmaJS
{
occupancyTypeFieldId
},
- (responseJSON: {
- success: boolean
- errorMessage?: string
- occupancyTypes?: recordTypes.OccupancyType[]
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
occupancyTypeResponseHandler(responseJSON)
if (responseJSON.success) {
editCloseModalFunction()
@@ -572,12 +574,9 @@ declare const bulmaJS: BulmaJS
cityssm.postJSON(
los.urlPrefix + '/admin/doAddOccupancyTypePrint',
formEvent.currentTarget,
- (responseJSON: {
- success: boolean
- errorMessage?: string
- occupancyTypes?: recordTypes.OccupancyType[]
- allOccupancyTypeFields?: recordTypes.OccupancyTypeField[]
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
if (responseJSON.success) {
closeAddModalFunction()
}
@@ -968,11 +967,9 @@ declare const bulmaJS: BulmaJS
cityssm.postJSON(
los.urlPrefix + '/admin/doAddOccupancyType',
submitEvent.currentTarget,
- (responseJSON: {
- success: boolean
- errorMessage?: string
- occupancyTypes?: recordTypes.OccupancyType[]
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
if (responseJSON.success) {
addCloseModalFunction()
occupancyTypes = responseJSON.occupancyTypes!
diff --git a/public-typescript/adminTables.js b/public-typescript/adminTables.js
index 53439b81..d316e43f 100644
--- a/public-typescript/adminTables.js
+++ b/public-typescript/adminTables.js
@@ -13,14 +13,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
.querySelectorAll('.button.is-static')[1].innerHTML = `
`;
}
"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;
delete exports.workOrderTypes;
function updateWorkOrderType(submitEvent) {
submitEvent.preventDefault();
- cityssm.postJSON(los.urlPrefix + '/admin/doUpdateWorkOrderType', submitEvent.currentTarget, (responseJSON) => {
+ cityssm.postJSON(los.urlPrefix + '/admin/doUpdateWorkOrderType', submitEvent.currentTarget, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
workOrderTypes = responseJSON.workOrderTypes;
bulmaJS.alert({
@@ -43,8 +45,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
function doDelete() {
cityssm.postJSON(los.urlPrefix + '/admin/doDeleteWorkOrderType', {
workOrderTypeId
- }, (responseJSON) => {
+ }, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
workOrderTypes = responseJSON.workOrderTypes;
if (workOrderTypes.length === 0) {
@@ -85,11 +88,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
const workOrderTypeId = tableRowElement.dataset.workOrderTypeId;
cityssm.postJSON(los.urlPrefix +
'/admin/' +
- (buttonElement.dataset.direction === 'up' ? 'doMoveWorkOrderTypeUp' : 'doMoveWorkOrderTypeDown'), {
+ (buttonElement.dataset.direction === 'up'
+ ? 'doMoveWorkOrderTypeUp'
+ : 'doMoveWorkOrderTypeDown'), {
workOrderTypeId,
moveToEnd: clickEvent.shiftKey ? '1' : '0'
- }, (responseJSON) => {
+ }, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
workOrderTypes = responseJSON.workOrderTypes;
renderWorkOrderTypes();
@@ -115,7 +121,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
containerElement.innerHTML = '';
for (const workOrderType of workOrderTypes) {
const tableRowElement = document.createElement('tr');
- tableRowElement.dataset.workOrderTypeId = workOrderType.workOrderTypeId.toString();
+ tableRowElement.dataset.workOrderTypeId =
+ workOrderType.workOrderTypeId.toString();
tableRowElement.innerHTML =
'
' +
' | ';
- tableRowElement.querySelector('form').addEventListener('submit', updateWorkOrderType);
+ tableRowElement
+ .querySelector('form')
+ .addEventListener('submit', updateWorkOrderType);
tableRowElement.querySelector('.button--moveWorkOrderTypeUp').addEventListener('click', moveWorkOrderType);
tableRowElement.querySelector('.button--moveWorkOrderTypeDown').addEventListener('click', moveWorkOrderType);
tableRowElement
@@ -155,11 +164,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
containerElement.append(tableRowElement);
}
}
+ ;
document.querySelector('#form--addWorkOrderType').addEventListener('submit', (submitEvent) => {
submitEvent.preventDefault();
const formElement = submitEvent.currentTarget;
- cityssm.postJSON(los.urlPrefix + '/admin/doAddWorkOrderType', formElement, (responseJSON) => {
+ cityssm.postJSON(los.urlPrefix + '/admin/doAddWorkOrderType', formElement, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
workOrderTypes = responseJSON.workOrderTypes;
renderWorkOrderTypes();
@@ -178,14 +189,16 @@ 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;
delete exports.workOrderMilestoneTypes;
function updateWorkOrderMilestoneType(submitEvent) {
submitEvent.preventDefault();
- cityssm.postJSON(los.urlPrefix + '/admin/doUpdateWorkOrderMilestoneType', submitEvent.currentTarget, (responseJSON) => {
+ cityssm.postJSON(los.urlPrefix + '/admin/doUpdateWorkOrderMilestoneType', submitEvent.currentTarget, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes;
bulmaJS.alert({
@@ -208,8 +221,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
function doDelete() {
cityssm.postJSON(los.urlPrefix + '/admin/doDeleteWorkOrderMilestoneType', {
workOrderMilestoneTypeId
- }, (responseJSON) => {
+ }, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes;
if (workOrderMilestoneTypes.length === 0) {
@@ -255,8 +269,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
: 'doMoveWorkOrderMilestoneTypeDown'), {
workOrderMilestoneTypeId,
moveToEnd: clickEvent.shiftKey ? '1' : '0'
- }, (responseJSON) => {
+ }, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes;
renderWorkOrderMilestoneTypes();
@@ -328,8 +343,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
document.querySelector('#form--addWorkOrderMilestoneType').addEventListener('submit', (submitEvent) => {
submitEvent.preventDefault();
const formElement = submitEvent.currentTarget;
- cityssm.postJSON(los.urlPrefix + '/admin/doAddWorkOrderMilestoneType', formElement, (responseJSON) => {
+ cityssm.postJSON(los.urlPrefix + '/admin/doAddWorkOrderMilestoneType', formElement, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes;
renderWorkOrderMilestoneTypes();
@@ -348,14 +364,16 @@ 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;
delete exports.lotStatuses;
function updateLotStatus(submitEvent) {
submitEvent.preventDefault();
- cityssm.postJSON(los.urlPrefix + '/admin/doUpdateLotStatus', submitEvent.currentTarget, (responseJSON) => {
+ cityssm.postJSON(los.urlPrefix + '/admin/doUpdateLotStatus', submitEvent.currentTarget, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
lotStatuses = responseJSON.lotStatuses;
bulmaJS.alert({
@@ -378,8 +396,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
function doDelete() {
cityssm.postJSON(los.urlPrefix + '/admin/doDeleteLotStatus', {
lotStatusId
- }, (responseJSON) => {
+ }, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
lotStatuses = responseJSON.lotStatuses;
if (lotStatuses.length === 0) {
@@ -425,8 +444,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
: 'doMoveLotStatusDown'), {
lotStatusId,
moveToEnd: clickEvent.shiftKey ? '1' : '0'
- }, (responseJSON) => {
+ }, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
lotStatuses = responseJSON.lotStatuses;
renderLotStatuses();
@@ -500,8 +520,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
document.querySelector('#form--addLotStatus').addEventListener('submit', (submitEvent) => {
submitEvent.preventDefault();
const formElement = submitEvent.currentTarget;
- cityssm.postJSON(los.urlPrefix + '/admin/doAddLotStatus', formElement, (responseJSON) => {
+ cityssm.postJSON(los.urlPrefix + '/admin/doAddLotStatus', formElement, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
lotStatuses = responseJSON.lotStatuses;
renderLotStatuses();
@@ -520,14 +541,16 @@ 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;
delete exports.lotOccupantTypes;
function updateLotOccupantType(submitEvent) {
submitEvent.preventDefault();
- cityssm.postJSON(los.urlPrefix + '/admin/doUpdateLotOccupantType', submitEvent.currentTarget, (responseJSON) => {
+ cityssm.postJSON(los.urlPrefix + '/admin/doUpdateLotOccupantType', submitEvent.currentTarget, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
lotOccupantTypes = responseJSON.lotOccupantTypes;
bulmaJS.alert({
@@ -550,8 +573,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
function doDelete() {
cityssm.postJSON(los.urlPrefix + '/admin/doDeleteLotOccupantType', {
lotOccupantTypeId
- }, (responseJSON) => {
+ }, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
lotOccupantTypes = responseJSON.lotOccupantTypes;
if (lotOccupantTypes.length === 0) {
@@ -597,8 +621,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
: 'doMoveLotOccupantTypeDown'), {
lotOccupantTypeId,
moveToEnd: clickEvent.shiftKey ? '1' : '0'
- }, (responseJSON) => {
+ }, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
lotOccupantTypes = responseJSON.lotOccupantTypes;
renderLotOccupantTypes();
@@ -673,9 +698,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
cityssm.escapeHTML(lotOccupantType.occupantCommentTitle) +
'"') +
(' form="' + formId + '"') +
- (' aria-label="' +
- los.escapedAliases.Occupant +
- ' Comment Title"') +
+ (' aria-label="' + los.escapedAliases.Occupant + ' Comment Title"') +
' maxlength="50" />' +
'
' +
'') +
@@ -728,8 +751,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
document.querySelector('#form--addLotOccupantType').addEventListener('submit', (submitEvent) => {
submitEvent.preventDefault();
const formElement = submitEvent.currentTarget;
- cityssm.postJSON(los.urlPrefix + '/admin/doAddLotOccupantType', formElement, (responseJSON) => {
+ cityssm.postJSON(los.urlPrefix + '/admin/doAddLotOccupantType', formElement, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
lotOccupantTypes = responseJSON.lotOccupantTypes;
renderLotOccupantTypes();
diff --git a/public-typescript/adminTables/adminTablesLotOccupantTypes.js b/public-typescript/adminTables/adminTablesLotOccupantTypes.js
index 51fa85f6..2de4869a 100644
--- a/public-typescript/adminTables/adminTablesLotOccupantTypes.js
+++ b/public-typescript/adminTables/adminTablesLotOccupantTypes.js
@@ -1,12 +1,14 @@
"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;
delete exports.lotOccupantTypes;
function updateLotOccupantType(submitEvent) {
submitEvent.preventDefault();
- cityssm.postJSON(los.urlPrefix + '/admin/doUpdateLotOccupantType', submitEvent.currentTarget, (responseJSON) => {
+ cityssm.postJSON(los.urlPrefix + '/admin/doUpdateLotOccupantType', submitEvent.currentTarget, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
lotOccupantTypes = responseJSON.lotOccupantTypes;
bulmaJS.alert({
@@ -29,8 +31,9 @@ function deleteLotOccupantType(clickEvent) {
function doDelete() {
cityssm.postJSON(los.urlPrefix + '/admin/doDeleteLotOccupantType', {
lotOccupantTypeId
- }, (responseJSON) => {
+ }, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
lotOccupantTypes = responseJSON.lotOccupantTypes;
if (lotOccupantTypes.length === 0) {
@@ -76,8 +79,9 @@ function moveLotOccupantType(clickEvent) {
: 'doMoveLotOccupantTypeDown'), {
lotOccupantTypeId,
moveToEnd: clickEvent.shiftKey ? '1' : '0'
- }, (responseJSON) => {
+ }, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
lotOccupantTypes = responseJSON.lotOccupantTypes;
renderLotOccupantTypes();
@@ -152,9 +156,7 @@ function renderLotOccupantTypes() {
cityssm.escapeHTML(lotOccupantType.occupantCommentTitle) +
'"') +
(' form="' + formId + '"') +
- (' aria-label="' +
- los.escapedAliases.Occupant +
- ' Comment Title"') +
+ (' aria-label="' + los.escapedAliases.Occupant + ' Comment Title"') +
' maxlength="50" />' +
'' +
'') +
@@ -207,8 +209,9 @@ function renderLotOccupantTypes() {
document.querySelector('#form--addLotOccupantType').addEventListener('submit', (submitEvent) => {
submitEvent.preventDefault();
const formElement = submitEvent.currentTarget;
- cityssm.postJSON(los.urlPrefix + '/admin/doAddLotOccupantType', formElement, (responseJSON) => {
+ cityssm.postJSON(los.urlPrefix + '/admin/doAddLotOccupantType', formElement, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
lotOccupantTypes = responseJSON.lotOccupantTypes;
renderLotOccupantTypes();
diff --git a/public-typescript/adminTables/adminTablesLotOccupantTypes.ts b/public-typescript/adminTables/adminTablesLotOccupantTypes.ts
index d716062a..e17d0c1b 100644
--- a/public-typescript/adminTables/adminTablesLotOccupantTypes.ts
+++ b/public-typescript/adminTables/adminTablesLotOccupantTypes.ts
@@ -1,3 +1,4 @@
+/* eslint-disable @typescript-eslint/indent */
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
import type * as globalTypes from '../../types/globalTypes'
@@ -16,17 +17,25 @@ declare const refreshFontAwesomeIcon: (changeEvent: Event) => void
let lotOccupantTypes: recordTypes.LotOccupantType[] = exports.lotOccupantTypes
delete exports.lotOccupantTypes
+type ResponseJSON =
+ | {
+ success: true
+ lotOccupantTypes: recordTypes.LotOccupantType[]
+ }
+ | {
+ success: false
+ errorMessage: string
+ }
+
function updateLotOccupantType(submitEvent: SubmitEvent): void {
submitEvent.preventDefault()
cityssm.postJSON(
los.urlPrefix + '/admin/doUpdateLotOccupantType',
submitEvent.currentTarget,
- (responseJSON: {
- success: boolean
- errorMessage?: string
- lotOccupantTypes?: recordTypes.LotOccupantType[]
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
if (responseJSON.success) {
lotOccupantTypes = responseJSON.lotOccupantTypes!
@@ -58,11 +67,9 @@ function deleteLotOccupantType(clickEvent: Event): void {
{
lotOccupantTypeId
},
- (responseJSON: {
- success: boolean
- errorMessage?: string
- lotOccupantTypes?: recordTypes.LotOccupantType[]
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
if (responseJSON.success) {
lotOccupantTypes = responseJSON.lotOccupantTypes!
@@ -117,11 +124,9 @@ function moveLotOccupantType(clickEvent: MouseEvent): void {
lotOccupantTypeId,
moveToEnd: clickEvent.shiftKey ? '1' : '0'
},
- (responseJSON: {
- success: boolean
- errorMessage?: string
- lotOccupantTypes?: recordTypes.LotOccupantType[]
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
if (responseJSON.success) {
lotOccupantTypes = responseJSON.lotOccupantTypes!
renderLotOccupantTypes()
@@ -207,9 +212,7 @@ function renderLotOccupantTypes(): void {
cityssm.escapeHTML(lotOccupantType.occupantCommentTitle) +
'"') +
(' form="' + formId + '"') +
- (' aria-label="' +
- los.escapedAliases.Occupant +
- ' Comment Title"') +
+ (' aria-label="' + los.escapedAliases.Occupant + ' Comment Title"') +
' maxlength="50" />' +
'' +
'') +
@@ -287,11 +290,9 @@ function renderLotOccupantTypes(): void {
cityssm.postJSON(
los.urlPrefix + '/admin/doAddLotOccupantType',
formElement,
- (responseJSON: {
- success: boolean
- errorMessage?: string
- lotOccupantTypes?: recordTypes.LotOccupantType[]
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
if (responseJSON.success) {
lotOccupantTypes = responseJSON.lotOccupantTypes!
renderLotOccupantTypes()
diff --git a/public-typescript/adminTables/adminTablesLotStatuses.js b/public-typescript/adminTables/adminTablesLotStatuses.js
index 8cad78aa..8b5b8e57 100644
--- a/public-typescript/adminTables/adminTablesLotStatuses.js
+++ b/public-typescript/adminTables/adminTablesLotStatuses.js
@@ -1,12 +1,14 @@
"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;
delete exports.lotStatuses;
function updateLotStatus(submitEvent) {
submitEvent.preventDefault();
- cityssm.postJSON(los.urlPrefix + '/admin/doUpdateLotStatus', submitEvent.currentTarget, (responseJSON) => {
+ cityssm.postJSON(los.urlPrefix + '/admin/doUpdateLotStatus', submitEvent.currentTarget, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
lotStatuses = responseJSON.lotStatuses;
bulmaJS.alert({
@@ -29,8 +31,9 @@ function deleteLotStatus(clickEvent) {
function doDelete() {
cityssm.postJSON(los.urlPrefix + '/admin/doDeleteLotStatus', {
lotStatusId
- }, (responseJSON) => {
+ }, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
lotStatuses = responseJSON.lotStatuses;
if (lotStatuses.length === 0) {
@@ -76,8 +79,9 @@ function moveLotStatus(clickEvent) {
: 'doMoveLotStatusDown'), {
lotStatusId,
moveToEnd: clickEvent.shiftKey ? '1' : '0'
- }, (responseJSON) => {
+ }, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
lotStatuses = responseJSON.lotStatuses;
renderLotStatuses();
@@ -151,8 +155,9 @@ function renderLotStatuses() {
document.querySelector('#form--addLotStatus').addEventListener('submit', (submitEvent) => {
submitEvent.preventDefault();
const formElement = submitEvent.currentTarget;
- cityssm.postJSON(los.urlPrefix + '/admin/doAddLotStatus', formElement, (responseJSON) => {
+ cityssm.postJSON(los.urlPrefix + '/admin/doAddLotStatus', formElement, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
lotStatuses = responseJSON.lotStatuses;
renderLotStatuses();
diff --git a/public-typescript/adminTables/adminTablesLotStatuses.ts b/public-typescript/adminTables/adminTablesLotStatuses.ts
index 2b1139da..1d8a32d6 100644
--- a/public-typescript/adminTables/adminTablesLotStatuses.ts
+++ b/public-typescript/adminTables/adminTablesLotStatuses.ts
@@ -1,3 +1,4 @@
+/* eslint-disable @typescript-eslint/indent */
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
import type * as globalTypes from '../../types/globalTypes'
@@ -15,17 +16,25 @@ declare const los: globalTypes.LOS
let lotStatuses: recordTypes.LotStatus[] = exports.lotStatuses
delete exports.lotStatuses
+type ResponseJSON =
+ | {
+ success: true
+ lotStatuses: recordTypes.LotStatus[]
+ }
+ | {
+ success: false
+ errorMessage: string
+ }
+
function updateLotStatus(submitEvent: SubmitEvent): void {
submitEvent.preventDefault()
cityssm.postJSON(
los.urlPrefix + '/admin/doUpdateLotStatus',
submitEvent.currentTarget,
- (responseJSON: {
- success: boolean
- errorMessage?: string
- lotStatuses?: recordTypes.LotStatus[]
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
if (responseJSON.success) {
lotStatuses = responseJSON.lotStatuses!
@@ -57,11 +66,9 @@ function deleteLotStatus(clickEvent: Event): void {
{
lotStatusId
},
- (responseJSON: {
- success: boolean
- errorMessage?: string
- lotStatuses?: recordTypes.LotStatus[]
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
if (responseJSON.success) {
lotStatuses = responseJSON.lotStatuses!
@@ -116,11 +123,9 @@ function moveLotStatus(clickEvent: MouseEvent): void {
lotStatusId,
moveToEnd: clickEvent.shiftKey ? '1' : '0'
},
- (responseJSON: {
- success: boolean
- errorMessage?: string
- lotStatuses?: recordTypes.LotStatus[]
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
if (responseJSON.success) {
lotStatuses = responseJSON.lotStatuses!
renderLotStatuses()
@@ -224,11 +229,9 @@ function renderLotStatuses(): void {
cityssm.postJSON(
los.urlPrefix + '/admin/doAddLotStatus',
formElement,
- (responseJSON: {
- success: boolean
- errorMessage?: string
- lotStatuses?: recordTypes.LotStatus[]
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
if (responseJSON.success) {
lotStatuses = responseJSON.lotStatuses!
renderLotStatuses()
diff --git a/public-typescript/adminTables/adminTablesWorkOrderMilestoneTypes.js b/public-typescript/adminTables/adminTablesWorkOrderMilestoneTypes.js
index a5a2b319..b8a6736d 100644
--- a/public-typescript/adminTables/adminTablesWorkOrderMilestoneTypes.js
+++ b/public-typescript/adminTables/adminTablesWorkOrderMilestoneTypes.js
@@ -1,12 +1,14 @@
"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;
delete exports.workOrderMilestoneTypes;
function updateWorkOrderMilestoneType(submitEvent) {
submitEvent.preventDefault();
- cityssm.postJSON(los.urlPrefix + '/admin/doUpdateWorkOrderMilestoneType', submitEvent.currentTarget, (responseJSON) => {
+ cityssm.postJSON(los.urlPrefix + '/admin/doUpdateWorkOrderMilestoneType', submitEvent.currentTarget, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes;
bulmaJS.alert({
@@ -29,8 +31,9 @@ function deleteWorkOrderMilestoneType(clickEvent) {
function doDelete() {
cityssm.postJSON(los.urlPrefix + '/admin/doDeleteWorkOrderMilestoneType', {
workOrderMilestoneTypeId
- }, (responseJSON) => {
+ }, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes;
if (workOrderMilestoneTypes.length === 0) {
@@ -76,8 +79,9 @@ function moveWorkOrderMilestoneType(clickEvent) {
: 'doMoveWorkOrderMilestoneTypeDown'), {
workOrderMilestoneTypeId,
moveToEnd: clickEvent.shiftKey ? '1' : '0'
- }, (responseJSON) => {
+ }, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes;
renderWorkOrderMilestoneTypes();
@@ -149,8 +153,9 @@ function renderWorkOrderMilestoneTypes() {
document.querySelector('#form--addWorkOrderMilestoneType').addEventListener('submit', (submitEvent) => {
submitEvent.preventDefault();
const formElement = submitEvent.currentTarget;
- cityssm.postJSON(los.urlPrefix + '/admin/doAddWorkOrderMilestoneType', formElement, (responseJSON) => {
+ cityssm.postJSON(los.urlPrefix + '/admin/doAddWorkOrderMilestoneType', formElement, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes;
renderWorkOrderMilestoneTypes();
diff --git a/public-typescript/adminTables/adminTablesWorkOrderMilestoneTypes.ts b/public-typescript/adminTables/adminTablesWorkOrderMilestoneTypes.ts
index 5400a550..118ab760 100644
--- a/public-typescript/adminTables/adminTablesWorkOrderMilestoneTypes.ts
+++ b/public-typescript/adminTables/adminTablesWorkOrderMilestoneTypes.ts
@@ -1,3 +1,4 @@
+/* eslint-disable @typescript-eslint/indent */
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
import type * as globalTypes from '../../types/globalTypes'
@@ -16,17 +17,25 @@ let workOrderMilestoneTypes: recordTypes.WorkOrderMilestoneType[] =
exports.workOrderMilestoneTypes
delete exports.workOrderMilestoneTypes
+type ResponseJSON =
+ | {
+ success: true
+ workOrderMilestoneTypes: recordTypes.WorkOrderMilestoneType[]
+ }
+ | {
+ success: false
+ errorMessage: string
+ }
+
function updateWorkOrderMilestoneType(submitEvent: SubmitEvent): void {
submitEvent.preventDefault()
cityssm.postJSON(
los.urlPrefix + '/admin/doUpdateWorkOrderMilestoneType',
submitEvent.currentTarget,
- (responseJSON: {
- success: boolean
- errorMessage?: string
- workOrderMilestoneTypes?: recordTypes.WorkOrderMilestoneType[]
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
if (responseJSON.success) {
workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes!
@@ -59,11 +68,9 @@ function deleteWorkOrderMilestoneType(clickEvent: Event): void {
{
workOrderMilestoneTypeId
},
- (responseJSON: {
- success: boolean
- errorMessage?: string
- workOrderMilestoneTypes?: recordTypes.WorkOrderMilestoneType[]
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
if (responseJSON.success) {
workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes!
@@ -119,11 +126,9 @@ function moveWorkOrderMilestoneType(clickEvent: MouseEvent): void {
workOrderMilestoneTypeId,
moveToEnd: clickEvent.shiftKey ? '1' : '0'
},
- (responseJSON: {
- success: boolean
- errorMessage?: string
- workOrderMilestoneTypes?: recordTypes.WorkOrderMilestoneType[]
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
if (responseJSON.success) {
workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes!
renderWorkOrderMilestoneTypes()
@@ -225,11 +230,9 @@ function renderWorkOrderMilestoneTypes(): void {
cityssm.postJSON(
los.urlPrefix + '/admin/doAddWorkOrderMilestoneType',
formElement,
- (responseJSON: {
- success: boolean
- errorMessage?: string
- workOrderMilestoneTypes?: recordTypes.WorkOrderMilestoneType[]
- }) => {
+ (rawResponseJSON) => {
+ const responseJSON = rawResponseJSON as ResponseJSON
+
if (responseJSON.success) {
workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes!
renderWorkOrderMilestoneTypes()
diff --git a/public-typescript/adminTables/adminTablesWorkOrderTypes.js b/public-typescript/adminTables/adminTablesWorkOrderTypes.js
index 72dbc145..1dc13ff6 100644
--- a/public-typescript/adminTables/adminTablesWorkOrderTypes.js
+++ b/public-typescript/adminTables/adminTablesWorkOrderTypes.js
@@ -1,12 +1,14 @@
"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;
delete exports.workOrderTypes;
function updateWorkOrderType(submitEvent) {
submitEvent.preventDefault();
- cityssm.postJSON(los.urlPrefix + '/admin/doUpdateWorkOrderType', submitEvent.currentTarget, (responseJSON) => {
+ cityssm.postJSON(los.urlPrefix + '/admin/doUpdateWorkOrderType', submitEvent.currentTarget, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
workOrderTypes = responseJSON.workOrderTypes;
bulmaJS.alert({
@@ -29,8 +31,9 @@ const deleteWorkOrderType = (clickEvent) => {
function doDelete() {
cityssm.postJSON(los.urlPrefix + '/admin/doDeleteWorkOrderType', {
workOrderTypeId
- }, (responseJSON) => {
+ }, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
workOrderTypes = responseJSON.workOrderTypes;
if (workOrderTypes.length === 0) {
@@ -71,11 +74,14 @@ function moveWorkOrderType(clickEvent) {
const workOrderTypeId = tableRowElement.dataset.workOrderTypeId;
cityssm.postJSON(los.urlPrefix +
'/admin/' +
- (buttonElement.dataset.direction === 'up' ? 'doMoveWorkOrderTypeUp' : 'doMoveWorkOrderTypeDown'), {
+ (buttonElement.dataset.direction === 'up'
+ ? 'doMoveWorkOrderTypeUp'
+ : 'doMoveWorkOrderTypeDown'), {
workOrderTypeId,
moveToEnd: clickEvent.shiftKey ? '1' : '0'
- }, (responseJSON) => {
+ }, (rawResponseJSON) => {
var _a;
+ const responseJSON = rawResponseJSON;
if (responseJSON.success) {
workOrderTypes = responseJSON.workOrderTypes;
renderWorkOrderTypes();
@@ -101,7 +107,8 @@ function renderWorkOrderTypes() {
containerElement.innerHTML = '';
for (const workOrderType of workOrderTypes) {
const tableRowElement = document.createElement('tr');
- tableRowElement.dataset.workOrderTypeId = workOrderType.workOrderTypeId.toString();
+ tableRowElement.dataset.workOrderTypeId =
+ workOrderType.workOrderTypeId.toString();
tableRowElement.innerHTML =
'