reduce redundant type descriptions

deepsource-autofix-76c6eb20
Dan Gowans 2023-03-10 11:45:49 -05:00
parent bbc61c25f6
commit 353409abca
22 changed files with 386 additions and 300 deletions

View File

@ -11,7 +11,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
if (responseJSON.success) { if (responseJSON.success) {
bulmaJS.alert({ bulmaJS.alert({
title: 'Database Backed Up Successfully', title: 'Database Backed Up Successfully',
message: `Backed up to ${responseJSON.fileName}`, message: `Backed up to <strong>${responseJSON.fileName}</strong><br />
To request a copy of the backup, contact your application administrator.`,
messageIsHtml: true,
contextualColorName: 'success' contextualColorName: 'success'
}); });
} }

View File

@ -29,7 +29,9 @@ declare const bulmaJS: BulmaJS
if (responseJSON.success) { if (responseJSON.success) {
bulmaJS.alert({ bulmaJS.alert({
title: 'Database Backed Up Successfully', title: 'Database Backed Up Successfully',
message: `Backed up to ${responseJSON.fileName}`, message: `Backed up to <strong>${responseJSON.fileName}</strong><br />
To request a copy of the backup, contact your application administrator.`,
messageIsHtml: true,
contextualColorName: 'success' contextualColorName: 'success'
}) })
} else { } else {

View File

@ -1,4 +1,5 @@
"use strict"; "use strict";
/* eslint-disable @typescript-eslint/indent */
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */ /* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
(() => { (() => {
@ -60,9 +61,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
feeCategoryContainerElement.insertAdjacentHTML('beforeend', `<div class="panel-block is-block"> feeCategoryContainerElement.insertAdjacentHTML('beforeend', `<div class="panel-block is-block">
<div class="message is-info"> <div class="message is-info">
<p class="message-body"> <p class="message-body">
There are no fees in the There are no fees in the
"${cityssm.escapeHTML((_b = feeCategory.feeCategory) !== null && _b !== void 0 ? _b : '')}" "${cityssm.escapeHTML((_b = feeCategory.feeCategory) !== null && _b !== void 0 ? _b : '')}"
category. category.
</p> </p>
</div> </div>
</div>`); </div>`);
@ -177,8 +178,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
let addCloseModalFunction; let addCloseModalFunction;
function doAddFeeCategory(submitEvent) { function doAddFeeCategory(submitEvent) {
submitEvent.preventDefault(); submitEvent.preventDefault();
cityssm.postJSON(los.urlPrefix + '/admin/doAddFeeCategory', submitEvent.currentTarget, (responseJSON) => { cityssm.postJSON(los.urlPrefix + '/admin/doAddFeeCategory', submitEvent.currentTarget, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
feeCategories = responseJSON.feeCategories; feeCategories = responseJSON.feeCategories;
addCloseModalFunction(); addCloseModalFunction();
@ -216,8 +218,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
let editCloseModalFunction; let editCloseModalFunction;
function doUpdateFeeCategory(submitEvent) { function doUpdateFeeCategory(submitEvent) {
submitEvent.preventDefault(); submitEvent.preventDefault();
cityssm.postJSON(los.urlPrefix + '/admin/doUpdateFeeCategory', submitEvent.currentTarget, (responseJSON) => { cityssm.postJSON(los.urlPrefix + '/admin/doUpdateFeeCategory', submitEvent.currentTarget, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
feeCategories = responseJSON.feeCategories; feeCategories = responseJSON.feeCategories;
editCloseModalFunction(); editCloseModalFunction();
@ -256,8 +259,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
function doDelete() { function doDelete() {
cityssm.postJSON(los.urlPrefix + '/admin/doDeleteFeeCategory', { cityssm.postJSON(los.urlPrefix + '/admin/doDeleteFeeCategory', {
feeCategoryId feeCategoryId
}, (responseJSON) => { }, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
feeCategories = responseJSON.feeCategories; feeCategories = responseJSON.feeCategories;
renderFeeCategories(); renderFeeCategories();
@ -291,8 +295,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
: 'doMoveFeeCategoryDown'), { : 'doMoveFeeCategoryDown'), {
feeCategoryId, feeCategoryId,
moveToEnd: clickEvent.shiftKey ? '1' : '0' moveToEnd: clickEvent.shiftKey ? '1' : '0'
}, (responseJSON) => { }, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
feeCategories = responseJSON.feeCategories; feeCategories = responseJSON.feeCategories;
renderFeeCategories(); renderFeeCategories();
@ -314,8 +319,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
let addCloseModalFunction; let addCloseModalFunction;
function doAddFee(submitEvent) { function doAddFee(submitEvent) {
submitEvent.preventDefault(); submitEvent.preventDefault();
cityssm.postJSON(los.urlPrefix + '/admin/doAddFee', submitEvent.currentTarget, (responseJSON) => { cityssm.postJSON(los.urlPrefix + '/admin/doAddFee', submitEvent.currentTarget, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
feeCategories = responseJSON.feeCategories; feeCategories = responseJSON.feeCategories;
addCloseModalFunction(); addCloseModalFunction();
@ -426,8 +432,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
let editModalElement; let editModalElement;
function doUpdateFee(submitEvent) { function doUpdateFee(submitEvent) {
submitEvent.preventDefault(); submitEvent.preventDefault();
cityssm.postJSON(los.urlPrefix + '/admin/doUpdateFee', submitEvent.currentTarget, (responseJSON) => { cityssm.postJSON(los.urlPrefix + '/admin/doUpdateFee', submitEvent.currentTarget, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
feeCategories = responseJSON.feeCategories; feeCategories = responseJSON.feeCategories;
editCloseModalFunction(); editCloseModalFunction();
@ -447,8 +454,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
function doDelete() { function doDelete() {
cityssm.postJSON(los.urlPrefix + '/admin/doDeleteFee', { cityssm.postJSON(los.urlPrefix + '/admin/doDeleteFee', {
feeId feeId
}, (responseJSON) => { }, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
feeCategories = responseJSON.feeCategories; feeCategories = responseJSON.feeCategories;
editCloseModalFunction(); editCloseModalFunction();
@ -596,8 +604,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
: 'doMoveFeeDown'), { : 'doMoveFeeDown'), {
feeId, feeId,
moveToEnd: clickEvent.shiftKey ? '1' : '0' moveToEnd: clickEvent.shiftKey ? '1' : '0'
}, (responseJSON) => { }, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
feeCategories = responseJSON.feeCategories; feeCategories = responseJSON.feeCategories;
renderFeeCategories(); renderFeeCategories();

View File

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/indent */
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */ /* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
import type * as globalTypes from '../types/globalTypes' import type * as globalTypes from '../types/globalTypes'
@ -19,6 +20,16 @@ declare const bulmaJS: BulmaJS
let feeCategories: recordTypes.FeeCategory[] = exports.feeCategories let feeCategories: recordTypes.FeeCategory[] = exports.feeCategories
delete exports.feeCategories delete exports.feeCategories
type ResponseJSON =
| {
success: true
feeCategories: recordTypes.FeeCategory[]
}
| {
success: false
errorMessage: string
}
function renderFeeCategories(): void { function renderFeeCategories(): void {
if (feeCategories.length === 0) { if (feeCategories.length === 0) {
feeCategoriesContainerElement.innerHTML = `<div class="message is-warning"> feeCategoriesContainerElement.innerHTML = `<div class="message is-warning">
@ -84,9 +95,9 @@ declare const bulmaJS: BulmaJS
`<div class="panel-block is-block"> `<div class="panel-block is-block">
<div class="message is-info"> <div class="message is-info">
<p class="message-body"> <p class="message-body">
There are no fees in the There are no fees in the
"${cityssm.escapeHTML(feeCategory.feeCategory ?? '')}" "${cityssm.escapeHTML(feeCategory.feeCategory ?? '')}"
category. category.
</p> </p>
</div> </div>
</div>` </div>`
@ -239,11 +250,9 @@ declare const bulmaJS: BulmaJS
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/admin/doAddFeeCategory', los.urlPrefix + '/admin/doAddFeeCategory',
submitEvent.currentTarget, submitEvent.currentTarget,
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
feeCategories: recordTypes.FeeCategory[]
}) => {
if (responseJSON.success) { if (responseJSON.success) {
feeCategories = responseJSON.feeCategories feeCategories = responseJSON.feeCategories
addCloseModalFunction() addCloseModalFunction()
@ -306,11 +315,9 @@ declare const bulmaJS: BulmaJS
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/admin/doUpdateFeeCategory', los.urlPrefix + '/admin/doUpdateFeeCategory',
submitEvent.currentTarget, submitEvent.currentTarget,
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
feeCategories: recordTypes.FeeCategory[]
}) => {
if (responseJSON.success) { if (responseJSON.success) {
feeCategories = responseJSON.feeCategories feeCategories = responseJSON.feeCategories
editCloseModalFunction() editCloseModalFunction()
@ -375,11 +382,9 @@ declare const bulmaJS: BulmaJS
{ {
feeCategoryId feeCategoryId
}, },
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
feeCategories?: recordTypes.FeeCategory[]
}) => {
if (responseJSON.success) { if (responseJSON.success) {
feeCategories = responseJSON.feeCategories! feeCategories = responseJSON.feeCategories!
renderFeeCategories() renderFeeCategories()
@ -422,11 +427,9 @@ declare const bulmaJS: BulmaJS
feeCategoryId, feeCategoryId,
moveToEnd: clickEvent.shiftKey ? '1' : '0' moveToEnd: clickEvent.shiftKey ? '1' : '0'
}, },
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
feeCategories?: recordTypes.FeeCategory[]
}) => {
if (responseJSON.success) { if (responseJSON.success) {
feeCategories = responseJSON.feeCategories! feeCategories = responseJSON.feeCategories!
renderFeeCategories() renderFeeCategories()
@ -463,11 +466,9 @@ declare const bulmaJS: BulmaJS
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/admin/doAddFee', los.urlPrefix + '/admin/doAddFee',
submitEvent.currentTarget, submitEvent.currentTarget,
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
feeCategories: recordTypes.FeeCategory[]
}) => {
if (responseJSON.success) { if (responseJSON.success) {
feeCategories = responseJSON.feeCategories feeCategories = responseJSON.feeCategories
addCloseModalFunction() addCloseModalFunction()
@ -641,11 +642,9 @@ declare const bulmaJS: BulmaJS
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/admin/doUpdateFee', los.urlPrefix + '/admin/doUpdateFee',
submitEvent.currentTarget, submitEvent.currentTarget,
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
feeCategories?: recordTypes.FeeCategory[]
}) => {
if (responseJSON.success) { if (responseJSON.success) {
feeCategories = responseJSON.feeCategories! feeCategories = responseJSON.feeCategories!
editCloseModalFunction() editCloseModalFunction()
@ -670,11 +669,9 @@ declare const bulmaJS: BulmaJS
{ {
feeId feeId
}, },
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
feeCategories?: recordTypes.FeeCategory[]
}) => {
if (responseJSON.success) { if (responseJSON.success) {
feeCategories = responseJSON.feeCategories! feeCategories = responseJSON.feeCategories!
editCloseModalFunction() editCloseModalFunction()
@ -913,11 +910,9 @@ declare const bulmaJS: BulmaJS
feeId, feeId,
moveToEnd: clickEvent.shiftKey ? '1' : '0' moveToEnd: clickEvent.shiftKey ? '1' : '0'
}, },
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
feeCategories?: recordTypes.FeeCategory[]
}) => {
if (responseJSON.success) { if (responseJSON.success) {
feeCategories = responseJSON.feeCategories! feeCategories = responseJSON.feeCategories!
renderFeeCategories() renderFeeCategories()

View File

@ -1,4 +1,5 @@
"use strict"; "use strict";
/* eslint-disable @typescript-eslint/indent */
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */ /* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
(() => { (() => {
@ -64,7 +65,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
let editCloseModalFunction; let editCloseModalFunction;
function doEdit(submitEvent) { function doEdit(submitEvent) {
submitEvent.preventDefault(); 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); lotTypeResponseHandler(responseJSON);
if (responseJSON.success) { if (responseJSON.success) {
editCloseModalFunction(); editCloseModalFunction();
@ -93,7 +95,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
let addCloseModalFunction; let addCloseModalFunction;
function doAdd(submitEvent) { function doAdd(submitEvent) {
submitEvent.preventDefault(); 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); expandedLotTypes.add(lotTypeId);
lotTypeResponseHandler(responseJSON); lotTypeResponseHandler(responseJSON);
if (responseJSON.success) { if (responseJSON.success) {
@ -162,7 +165,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
} }
function doUpdate(submitEvent) { function doUpdate(submitEvent) {
submitEvent.preventDefault(); 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); lotTypeResponseHandler(responseJSON);
if (responseJSON.success) { if (responseJSON.success) {
editCloseModalFunction(); editCloseModalFunction();
@ -172,7 +176,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
function doDelete() { function doDelete() {
cityssm.postJSON(los.urlPrefix + '/admin/doDeleteLotTypeField', { cityssm.postJSON(los.urlPrefix + '/admin/doDeleteLotTypeField', {
lotTypeFieldId lotTypeFieldId
}, (responseJSON) => { }, (rawResponseJSON) => {
const responseJSON = rawResponseJSON;
lotTypeResponseHandler(responseJSON); lotTypeResponseHandler(responseJSON);
if (responseJSON.success) { if (responseJSON.success) {
editCloseModalFunction(); editCloseModalFunction();
@ -368,8 +373,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
let addCloseModalFunction; let addCloseModalFunction;
function doAdd(submitEvent) { function doAdd(submitEvent) {
submitEvent.preventDefault(); submitEvent.preventDefault();
cityssm.postJSON(los.urlPrefix + '/admin/doAddLotType', submitEvent.currentTarget, (responseJSON) => { cityssm.postJSON(los.urlPrefix + '/admin/doAddLotType', submitEvent.currentTarget, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
addCloseModalFunction(); addCloseModalFunction();
lotTypes = responseJSON.lotTypes; lotTypes = responseJSON.lotTypes;

View File

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/indent */
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */ /* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
import type * as globalTypes from '../types/globalTypes' 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 cityssm: cityssmGlobal
declare const bulmaJS: BulmaJS declare const bulmaJS: BulmaJS
type ResponseJSON =
| {
success: true
lotTypes: recordTypes.LotType[]
lotTypeFieldId?: number
}
| {
success: false
errorMessage: string
}
;(() => { ;(() => {
const los = exports.los as globalTypes.LOS const los = exports.los as globalTypes.LOS
@ -47,11 +59,7 @@ declare const bulmaJS: BulmaJS
} }
} }
function lotTypeResponseHandler(responseJSON: { function lotTypeResponseHandler(responseJSON: ResponseJSON): void {
success: boolean
errorMessage?: string
lotTypes?: recordTypes.LotType[]
}): void {
if (responseJSON.success) { if (responseJSON.success) {
lotTypes = responseJSON.lotTypes! lotTypes = responseJSON.lotTypes!
renderLotTypes() renderLotTypes()
@ -117,11 +125,9 @@ declare const bulmaJS: BulmaJS
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/admin/doUpdateLotType', los.urlPrefix + '/admin/doUpdateLotType',
submitEvent.currentTarget, submitEvent.currentTarget,
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
occupancyTypes?: recordTypes.OccupancyType[]
}) => {
lotTypeResponseHandler(responseJSON) lotTypeResponseHandler(responseJSON)
if (responseJSON.success) { if (responseJSON.success) {
editCloseModalFunction() editCloseModalFunction()
@ -180,12 +186,9 @@ declare const bulmaJS: BulmaJS
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/admin/doAddLotTypeField', los.urlPrefix + '/admin/doAddLotTypeField',
submitEvent.currentTarget, submitEvent.currentTarget,
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
lotTypes?: recordTypes.LotType[]
lotTypeFieldId?: number
}) => {
expandedLotTypes.add(lotTypeId) expandedLotTypes.add(lotTypeId)
lotTypeResponseHandler(responseJSON) lotTypeResponseHandler(responseJSON)
@ -289,11 +292,9 @@ declare const bulmaJS: BulmaJS
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/admin/doUpdateLotTypeField', los.urlPrefix + '/admin/doUpdateLotTypeField',
submitEvent.currentTarget, submitEvent.currentTarget,
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
occupancyTypes?: recordTypes.OccupancyType[]
}) => {
lotTypeResponseHandler(responseJSON) lotTypeResponseHandler(responseJSON)
if (responseJSON.success) { if (responseJSON.success) {
editCloseModalFunction() editCloseModalFunction()
@ -308,11 +309,9 @@ declare const bulmaJS: BulmaJS
{ {
lotTypeFieldId lotTypeFieldId
}, },
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
lotTypes?: recordTypes.LotType[]
}) => {
lotTypeResponseHandler(responseJSON) lotTypeResponseHandler(responseJSON)
if (responseJSON.success) { if (responseJSON.success) {
editCloseModalFunction() editCloseModalFunction()
@ -632,11 +631,9 @@ declare const bulmaJS: BulmaJS
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/admin/doAddLotType', los.urlPrefix + '/admin/doAddLotType',
submitEvent.currentTarget, submitEvent.currentTarget,
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
lotTypes?: recordTypes.LotType[]
}) => {
if (responseJSON.success) { if (responseJSON.success) {
addCloseModalFunction() addCloseModalFunction()
lotTypes = responseJSON.lotTypes! lotTypes = responseJSON.lotTypes!

View File

@ -1,4 +1,5 @@
"use strict"; "use strict";
/* eslint-disable @typescript-eslint/indent */
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */ /* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
(() => { (() => {
@ -68,7 +69,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
let editCloseModalFunction; let editCloseModalFunction;
function doEdit(submitEvent) { function doEdit(submitEvent) {
submitEvent.preventDefault(); 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); occupancyTypeResponseHandler(responseJSON);
if (responseJSON.success) { if (responseJSON.success) {
editCloseModalFunction(); editCloseModalFunction();
@ -97,7 +99,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
let addCloseModalFunction; let addCloseModalFunction;
function doAdd(submitEvent) { function doAdd(submitEvent) {
submitEvent.preventDefault(); 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); expandedOccupancyTypes.add(occupancyTypeId);
occupancyTypeResponseHandler(responseJSON); occupancyTypeResponseHandler(responseJSON);
if (responseJSON.success) { if (responseJSON.success) {
@ -171,7 +174,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
} }
function doUpdate(submitEvent) { function doUpdate(submitEvent) {
submitEvent.preventDefault(); 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); occupancyTypeResponseHandler(responseJSON);
if (responseJSON.success) { if (responseJSON.success) {
editCloseModalFunction(); editCloseModalFunction();
@ -181,7 +185,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
function doDelete() { function doDelete() {
cityssm.postJSON(los.urlPrefix + '/admin/doDeleteOccupancyTypeField', { cityssm.postJSON(los.urlPrefix + '/admin/doDeleteOccupancyTypeField', {
occupancyTypeFieldId occupancyTypeFieldId
}, (responseJSON) => { }, (rawResponseJSON) => {
const responseJSON = rawResponseJSON;
occupancyTypeResponseHandler(responseJSON); occupancyTypeResponseHandler(responseJSON);
if (responseJSON.success) { if (responseJSON.success) {
editCloseModalFunction(); editCloseModalFunction();
@ -307,7 +312,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
let closeAddModalFunction; let closeAddModalFunction;
function doAdd(formEvent) { function doAdd(formEvent) {
formEvent.preventDefault(); 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) { if (responseJSON.success) {
closeAddModalFunction(); closeAddModalFunction();
} }
@ -570,8 +576,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
let addCloseModalFunction; let addCloseModalFunction;
function doAdd(submitEvent) { function doAdd(submitEvent) {
submitEvent.preventDefault(); submitEvent.preventDefault();
cityssm.postJSON(los.urlPrefix + '/admin/doAddOccupancyType', submitEvent.currentTarget, (responseJSON) => { cityssm.postJSON(los.urlPrefix + '/admin/doAddOccupancyType', submitEvent.currentTarget, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
addCloseModalFunction(); addCloseModalFunction();
occupancyTypes = responseJSON.occupancyTypes; occupancyTypes = responseJSON.occupancyTypes;

View File

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/indent */
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */ /* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
import type * as globalTypes from '../types/globalTypes' 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 cityssm: cityssmGlobal
declare const bulmaJS: BulmaJS 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 const los = exports.los as globalTypes.LOS
@ -131,12 +144,9 @@ declare const bulmaJS: BulmaJS
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/admin/doUpdateOccupancyType', los.urlPrefix + '/admin/doUpdateOccupancyType',
submitEvent.currentTarget, submitEvent.currentTarget,
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
occupancyTypes?: recordTypes.OccupancyType[]
allOccupancyTypeFields?: recordTypes.OccupancyTypeField[]
}) => {
occupancyTypeResponseHandler(responseJSON) occupancyTypeResponseHandler(responseJSON)
if (responseJSON.success) { if (responseJSON.success) {
editCloseModalFunction() editCloseModalFunction()
@ -195,13 +205,9 @@ declare const bulmaJS: BulmaJS
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/admin/doAddOccupancyTypeField', los.urlPrefix + '/admin/doAddOccupancyTypeField',
submitEvent.currentTarget, submitEvent.currentTarget,
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
occupancyTypes?: recordTypes.OccupancyType[]
allOccupancyTypeFields?: recordTypes.OccupancyTypeField[]
occupancyTypeFieldId?: number
}) => {
expandedOccupancyTypes.add(occupancyTypeId) expandedOccupancyTypes.add(occupancyTypeId)
occupancyTypeResponseHandler(responseJSON) occupancyTypeResponseHandler(responseJSON)
@ -320,11 +326,9 @@ declare const bulmaJS: BulmaJS
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/admin/doUpdateOccupancyTypeField', los.urlPrefix + '/admin/doUpdateOccupancyTypeField',
submitEvent.currentTarget, submitEvent.currentTarget,
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
occupancyTypes?: recordTypes.OccupancyType[]
}) => {
occupancyTypeResponseHandler(responseJSON) occupancyTypeResponseHandler(responseJSON)
if (responseJSON.success) { if (responseJSON.success) {
editCloseModalFunction() editCloseModalFunction()
@ -339,11 +343,9 @@ declare const bulmaJS: BulmaJS
{ {
occupancyTypeFieldId occupancyTypeFieldId
}, },
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
occupancyTypes?: recordTypes.OccupancyType[]
}) => {
occupancyTypeResponseHandler(responseJSON) occupancyTypeResponseHandler(responseJSON)
if (responseJSON.success) { if (responseJSON.success) {
editCloseModalFunction() editCloseModalFunction()
@ -572,12 +574,9 @@ declare const bulmaJS: BulmaJS
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/admin/doAddOccupancyTypePrint', los.urlPrefix + '/admin/doAddOccupancyTypePrint',
formEvent.currentTarget, formEvent.currentTarget,
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
occupancyTypes?: recordTypes.OccupancyType[]
allOccupancyTypeFields?: recordTypes.OccupancyTypeField[]
}) => {
if (responseJSON.success) { if (responseJSON.success) {
closeAddModalFunction() closeAddModalFunction()
} }
@ -968,11 +967,9 @@ declare const bulmaJS: BulmaJS
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/admin/doAddOccupancyType', los.urlPrefix + '/admin/doAddOccupancyType',
submitEvent.currentTarget, submitEvent.currentTarget,
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
occupancyTypes?: recordTypes.OccupancyType[]
}) => {
if (responseJSON.success) { if (responseJSON.success) {
addCloseModalFunction() addCloseModalFunction()
occupancyTypes = responseJSON.occupancyTypes! occupancyTypes = responseJSON.occupancyTypes!

View File

@ -13,14 +13,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
.querySelectorAll('.button.is-static')[1].innerHTML = `<i class="fas fa-fw fa-${fontAwesomeIconClass}" aria-hidden="true"></i>`; .querySelectorAll('.button.is-static')[1].innerHTML = `<i class="fas fa-fw fa-${fontAwesomeIconClass}" aria-hidden="true"></i>`;
} }
"use strict"; "use strict";
/* eslint-disable @typescript-eslint/indent */
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */ /* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
let workOrderTypes = exports.workOrderTypes; let workOrderTypes = exports.workOrderTypes;
delete exports.workOrderTypes; delete exports.workOrderTypes;
function updateWorkOrderType(submitEvent) { function updateWorkOrderType(submitEvent) {
submitEvent.preventDefault(); submitEvent.preventDefault();
cityssm.postJSON(los.urlPrefix + '/admin/doUpdateWorkOrderType', submitEvent.currentTarget, (responseJSON) => { cityssm.postJSON(los.urlPrefix + '/admin/doUpdateWorkOrderType', submitEvent.currentTarget, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
workOrderTypes = responseJSON.workOrderTypes; workOrderTypes = responseJSON.workOrderTypes;
bulmaJS.alert({ bulmaJS.alert({
@ -43,8 +45,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
function doDelete() { function doDelete() {
cityssm.postJSON(los.urlPrefix + '/admin/doDeleteWorkOrderType', { cityssm.postJSON(los.urlPrefix + '/admin/doDeleteWorkOrderType', {
workOrderTypeId workOrderTypeId
}, (responseJSON) => { }, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
workOrderTypes = responseJSON.workOrderTypes; workOrderTypes = responseJSON.workOrderTypes;
if (workOrderTypes.length === 0) { if (workOrderTypes.length === 0) {
@ -85,11 +88,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
const workOrderTypeId = tableRowElement.dataset.workOrderTypeId; const workOrderTypeId = tableRowElement.dataset.workOrderTypeId;
cityssm.postJSON(los.urlPrefix + cityssm.postJSON(los.urlPrefix +
'/admin/' + '/admin/' +
(buttonElement.dataset.direction === 'up' ? 'doMoveWorkOrderTypeUp' : 'doMoveWorkOrderTypeDown'), { (buttonElement.dataset.direction === 'up'
? 'doMoveWorkOrderTypeUp'
: 'doMoveWorkOrderTypeDown'), {
workOrderTypeId, workOrderTypeId,
moveToEnd: clickEvent.shiftKey ? '1' : '0' moveToEnd: clickEvent.shiftKey ? '1' : '0'
}, (responseJSON) => { }, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
workOrderTypes = responseJSON.workOrderTypes; workOrderTypes = responseJSON.workOrderTypes;
renderWorkOrderTypes(); renderWorkOrderTypes();
@ -115,7 +121,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
containerElement.innerHTML = ''; containerElement.innerHTML = '';
for (const workOrderType of workOrderTypes) { for (const workOrderType of workOrderTypes) {
const tableRowElement = document.createElement('tr'); const tableRowElement = document.createElement('tr');
tableRowElement.dataset.workOrderTypeId = workOrderType.workOrderTypeId.toString(); tableRowElement.dataset.workOrderTypeId =
workOrderType.workOrderTypeId.toString();
tableRowElement.innerHTML = tableRowElement.innerHTML =
'<td>' + '<td>' +
'<form>' + '<form>' +
@ -146,7 +153,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
'</div>' + '</div>' +
'</div>' + '</div>' +
'</td>'; '</td>';
tableRowElement.querySelector('form').addEventListener('submit', updateWorkOrderType); tableRowElement
.querySelector('form')
.addEventListener('submit', updateWorkOrderType);
tableRowElement.querySelector('.button--moveWorkOrderTypeUp').addEventListener('click', moveWorkOrderType); tableRowElement.querySelector('.button--moveWorkOrderTypeUp').addEventListener('click', moveWorkOrderType);
tableRowElement.querySelector('.button--moveWorkOrderTypeDown').addEventListener('click', moveWorkOrderType); tableRowElement.querySelector('.button--moveWorkOrderTypeDown').addEventListener('click', moveWorkOrderType);
tableRowElement tableRowElement
@ -155,11 +164,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
containerElement.append(tableRowElement); containerElement.append(tableRowElement);
} }
} }
;
document.querySelector('#form--addWorkOrderType').addEventListener('submit', (submitEvent) => { document.querySelector('#form--addWorkOrderType').addEventListener('submit', (submitEvent) => {
submitEvent.preventDefault(); submitEvent.preventDefault();
const formElement = submitEvent.currentTarget; const formElement = submitEvent.currentTarget;
cityssm.postJSON(los.urlPrefix + '/admin/doAddWorkOrderType', formElement, (responseJSON) => { cityssm.postJSON(los.urlPrefix + '/admin/doAddWorkOrderType', formElement, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
workOrderTypes = responseJSON.workOrderTypes; workOrderTypes = responseJSON.workOrderTypes;
renderWorkOrderTypes(); renderWorkOrderTypes();
@ -178,14 +189,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
renderWorkOrderTypes(); renderWorkOrderTypes();
"use strict"; "use strict";
/* eslint-disable @typescript-eslint/indent */
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */ /* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
let workOrderMilestoneTypes = exports.workOrderMilestoneTypes; let workOrderMilestoneTypes = exports.workOrderMilestoneTypes;
delete exports.workOrderMilestoneTypes; delete exports.workOrderMilestoneTypes;
function updateWorkOrderMilestoneType(submitEvent) { function updateWorkOrderMilestoneType(submitEvent) {
submitEvent.preventDefault(); submitEvent.preventDefault();
cityssm.postJSON(los.urlPrefix + '/admin/doUpdateWorkOrderMilestoneType', submitEvent.currentTarget, (responseJSON) => { cityssm.postJSON(los.urlPrefix + '/admin/doUpdateWorkOrderMilestoneType', submitEvent.currentTarget, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes; workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes;
bulmaJS.alert({ bulmaJS.alert({
@ -208,8 +221,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
function doDelete() { function doDelete() {
cityssm.postJSON(los.urlPrefix + '/admin/doDeleteWorkOrderMilestoneType', { cityssm.postJSON(los.urlPrefix + '/admin/doDeleteWorkOrderMilestoneType', {
workOrderMilestoneTypeId workOrderMilestoneTypeId
}, (responseJSON) => { }, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes; workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes;
if (workOrderMilestoneTypes.length === 0) { if (workOrderMilestoneTypes.length === 0) {
@ -255,8 +269,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
: 'doMoveWorkOrderMilestoneTypeDown'), { : 'doMoveWorkOrderMilestoneTypeDown'), {
workOrderMilestoneTypeId, workOrderMilestoneTypeId,
moveToEnd: clickEvent.shiftKey ? '1' : '0' moveToEnd: clickEvent.shiftKey ? '1' : '0'
}, (responseJSON) => { }, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes; workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes;
renderWorkOrderMilestoneTypes(); renderWorkOrderMilestoneTypes();
@ -328,8 +343,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
document.querySelector('#form--addWorkOrderMilestoneType').addEventListener('submit', (submitEvent) => { document.querySelector('#form--addWorkOrderMilestoneType').addEventListener('submit', (submitEvent) => {
submitEvent.preventDefault(); submitEvent.preventDefault();
const formElement = submitEvent.currentTarget; const formElement = submitEvent.currentTarget;
cityssm.postJSON(los.urlPrefix + '/admin/doAddWorkOrderMilestoneType', formElement, (responseJSON) => { cityssm.postJSON(los.urlPrefix + '/admin/doAddWorkOrderMilestoneType', formElement, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes; workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes;
renderWorkOrderMilestoneTypes(); renderWorkOrderMilestoneTypes();
@ -348,14 +364,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
renderWorkOrderMilestoneTypes(); renderWorkOrderMilestoneTypes();
"use strict"; "use strict";
/* eslint-disable @typescript-eslint/indent */
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */ /* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
let lotStatuses = exports.lotStatuses; let lotStatuses = exports.lotStatuses;
delete exports.lotStatuses; delete exports.lotStatuses;
function updateLotStatus(submitEvent) { function updateLotStatus(submitEvent) {
submitEvent.preventDefault(); submitEvent.preventDefault();
cityssm.postJSON(los.urlPrefix + '/admin/doUpdateLotStatus', submitEvent.currentTarget, (responseJSON) => { cityssm.postJSON(los.urlPrefix + '/admin/doUpdateLotStatus', submitEvent.currentTarget, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
lotStatuses = responseJSON.lotStatuses; lotStatuses = responseJSON.lotStatuses;
bulmaJS.alert({ bulmaJS.alert({
@ -378,8 +396,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
function doDelete() { function doDelete() {
cityssm.postJSON(los.urlPrefix + '/admin/doDeleteLotStatus', { cityssm.postJSON(los.urlPrefix + '/admin/doDeleteLotStatus', {
lotStatusId lotStatusId
}, (responseJSON) => { }, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
lotStatuses = responseJSON.lotStatuses; lotStatuses = responseJSON.lotStatuses;
if (lotStatuses.length === 0) { if (lotStatuses.length === 0) {
@ -425,8 +444,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
: 'doMoveLotStatusDown'), { : 'doMoveLotStatusDown'), {
lotStatusId, lotStatusId,
moveToEnd: clickEvent.shiftKey ? '1' : '0' moveToEnd: clickEvent.shiftKey ? '1' : '0'
}, (responseJSON) => { }, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
lotStatuses = responseJSON.lotStatuses; lotStatuses = responseJSON.lotStatuses;
renderLotStatuses(); renderLotStatuses();
@ -500,8 +520,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
document.querySelector('#form--addLotStatus').addEventListener('submit', (submitEvent) => { document.querySelector('#form--addLotStatus').addEventListener('submit', (submitEvent) => {
submitEvent.preventDefault(); submitEvent.preventDefault();
const formElement = submitEvent.currentTarget; const formElement = submitEvent.currentTarget;
cityssm.postJSON(los.urlPrefix + '/admin/doAddLotStatus', formElement, (responseJSON) => { cityssm.postJSON(los.urlPrefix + '/admin/doAddLotStatus', formElement, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
lotStatuses = responseJSON.lotStatuses; lotStatuses = responseJSON.lotStatuses;
renderLotStatuses(); renderLotStatuses();
@ -520,14 +541,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
renderLotStatuses(); renderLotStatuses();
"use strict"; "use strict";
/* eslint-disable @typescript-eslint/indent */
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */ /* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
let lotOccupantTypes = exports.lotOccupantTypes; let lotOccupantTypes = exports.lotOccupantTypes;
delete exports.lotOccupantTypes; delete exports.lotOccupantTypes;
function updateLotOccupantType(submitEvent) { function updateLotOccupantType(submitEvent) {
submitEvent.preventDefault(); submitEvent.preventDefault();
cityssm.postJSON(los.urlPrefix + '/admin/doUpdateLotOccupantType', submitEvent.currentTarget, (responseJSON) => { cityssm.postJSON(los.urlPrefix + '/admin/doUpdateLotOccupantType', submitEvent.currentTarget, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
lotOccupantTypes = responseJSON.lotOccupantTypes; lotOccupantTypes = responseJSON.lotOccupantTypes;
bulmaJS.alert({ bulmaJS.alert({
@ -550,8 +573,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
function doDelete() { function doDelete() {
cityssm.postJSON(los.urlPrefix + '/admin/doDeleteLotOccupantType', { cityssm.postJSON(los.urlPrefix + '/admin/doDeleteLotOccupantType', {
lotOccupantTypeId lotOccupantTypeId
}, (responseJSON) => { }, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
lotOccupantTypes = responseJSON.lotOccupantTypes; lotOccupantTypes = responseJSON.lotOccupantTypes;
if (lotOccupantTypes.length === 0) { if (lotOccupantTypes.length === 0) {
@ -597,8 +621,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
: 'doMoveLotOccupantTypeDown'), { : 'doMoveLotOccupantTypeDown'), {
lotOccupantTypeId, lotOccupantTypeId,
moveToEnd: clickEvent.shiftKey ? '1' : '0' moveToEnd: clickEvent.shiftKey ? '1' : '0'
}, (responseJSON) => { }, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
lotOccupantTypes = responseJSON.lotOccupantTypes; lotOccupantTypes = responseJSON.lotOccupantTypes;
renderLotOccupantTypes(); renderLotOccupantTypes();
@ -673,9 +698,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
cityssm.escapeHTML(lotOccupantType.occupantCommentTitle) + cityssm.escapeHTML(lotOccupantType.occupantCommentTitle) +
'"') + '"') +
(' form="' + formId + '"') + (' form="' + formId + '"') +
(' aria-label="' + (' aria-label="' + los.escapedAliases.Occupant + ' Comment Title"') +
los.escapedAliases.Occupant +
' Comment Title"') +
' maxlength="50" />' + ' maxlength="50" />' +
'</div>' + '</div>' +
'</div>') + '</div>') +
@ -728,8 +751,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
document.querySelector('#form--addLotOccupantType').addEventListener('submit', (submitEvent) => { document.querySelector('#form--addLotOccupantType').addEventListener('submit', (submitEvent) => {
submitEvent.preventDefault(); submitEvent.preventDefault();
const formElement = submitEvent.currentTarget; const formElement = submitEvent.currentTarget;
cityssm.postJSON(los.urlPrefix + '/admin/doAddLotOccupantType', formElement, (responseJSON) => { cityssm.postJSON(los.urlPrefix + '/admin/doAddLotOccupantType', formElement, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
lotOccupantTypes = responseJSON.lotOccupantTypes; lotOccupantTypes = responseJSON.lotOccupantTypes;
renderLotOccupantTypes(); renderLotOccupantTypes();

View File

@ -1,12 +1,14 @@
"use strict"; "use strict";
/* eslint-disable @typescript-eslint/indent */
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */ /* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
let lotOccupantTypes = exports.lotOccupantTypes; let lotOccupantTypes = exports.lotOccupantTypes;
delete exports.lotOccupantTypes; delete exports.lotOccupantTypes;
function updateLotOccupantType(submitEvent) { function updateLotOccupantType(submitEvent) {
submitEvent.preventDefault(); submitEvent.preventDefault();
cityssm.postJSON(los.urlPrefix + '/admin/doUpdateLotOccupantType', submitEvent.currentTarget, (responseJSON) => { cityssm.postJSON(los.urlPrefix + '/admin/doUpdateLotOccupantType', submitEvent.currentTarget, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
lotOccupantTypes = responseJSON.lotOccupantTypes; lotOccupantTypes = responseJSON.lotOccupantTypes;
bulmaJS.alert({ bulmaJS.alert({
@ -29,8 +31,9 @@ function deleteLotOccupantType(clickEvent) {
function doDelete() { function doDelete() {
cityssm.postJSON(los.urlPrefix + '/admin/doDeleteLotOccupantType', { cityssm.postJSON(los.urlPrefix + '/admin/doDeleteLotOccupantType', {
lotOccupantTypeId lotOccupantTypeId
}, (responseJSON) => { }, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
lotOccupantTypes = responseJSON.lotOccupantTypes; lotOccupantTypes = responseJSON.lotOccupantTypes;
if (lotOccupantTypes.length === 0) { if (lotOccupantTypes.length === 0) {
@ -76,8 +79,9 @@ function moveLotOccupantType(clickEvent) {
: 'doMoveLotOccupantTypeDown'), { : 'doMoveLotOccupantTypeDown'), {
lotOccupantTypeId, lotOccupantTypeId,
moveToEnd: clickEvent.shiftKey ? '1' : '0' moveToEnd: clickEvent.shiftKey ? '1' : '0'
}, (responseJSON) => { }, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
lotOccupantTypes = responseJSON.lotOccupantTypes; lotOccupantTypes = responseJSON.lotOccupantTypes;
renderLotOccupantTypes(); renderLotOccupantTypes();
@ -152,9 +156,7 @@ function renderLotOccupantTypes() {
cityssm.escapeHTML(lotOccupantType.occupantCommentTitle) + cityssm.escapeHTML(lotOccupantType.occupantCommentTitle) +
'"') + '"') +
(' form="' + formId + '"') + (' form="' + formId + '"') +
(' aria-label="' + (' aria-label="' + los.escapedAliases.Occupant + ' Comment Title"') +
los.escapedAliases.Occupant +
' Comment Title"') +
' maxlength="50" />' + ' maxlength="50" />' +
'</div>' + '</div>' +
'</div>') + '</div>') +
@ -207,8 +209,9 @@ function renderLotOccupantTypes() {
document.querySelector('#form--addLotOccupantType').addEventListener('submit', (submitEvent) => { document.querySelector('#form--addLotOccupantType').addEventListener('submit', (submitEvent) => {
submitEvent.preventDefault(); submitEvent.preventDefault();
const formElement = submitEvent.currentTarget; const formElement = submitEvent.currentTarget;
cityssm.postJSON(los.urlPrefix + '/admin/doAddLotOccupantType', formElement, (responseJSON) => { cityssm.postJSON(los.urlPrefix + '/admin/doAddLotOccupantType', formElement, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
lotOccupantTypes = responseJSON.lotOccupantTypes; lotOccupantTypes = responseJSON.lotOccupantTypes;
renderLotOccupantTypes(); renderLotOccupantTypes();

View File

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/indent */
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */ /* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
import type * as globalTypes from '../../types/globalTypes' import type * as globalTypes from '../../types/globalTypes'
@ -16,17 +17,25 @@ declare const refreshFontAwesomeIcon: (changeEvent: Event) => void
let lotOccupantTypes: recordTypes.LotOccupantType[] = exports.lotOccupantTypes let lotOccupantTypes: recordTypes.LotOccupantType[] = exports.lotOccupantTypes
delete exports.lotOccupantTypes delete exports.lotOccupantTypes
type ResponseJSON =
| {
success: true
lotOccupantTypes: recordTypes.LotOccupantType[]
}
| {
success: false
errorMessage: string
}
function updateLotOccupantType(submitEvent: SubmitEvent): void { function updateLotOccupantType(submitEvent: SubmitEvent): void {
submitEvent.preventDefault() submitEvent.preventDefault()
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/admin/doUpdateLotOccupantType', los.urlPrefix + '/admin/doUpdateLotOccupantType',
submitEvent.currentTarget, submitEvent.currentTarget,
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
lotOccupantTypes?: recordTypes.LotOccupantType[]
}) => {
if (responseJSON.success) { if (responseJSON.success) {
lotOccupantTypes = responseJSON.lotOccupantTypes! lotOccupantTypes = responseJSON.lotOccupantTypes!
@ -58,11 +67,9 @@ function deleteLotOccupantType(clickEvent: Event): void {
{ {
lotOccupantTypeId lotOccupantTypeId
}, },
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
lotOccupantTypes?: recordTypes.LotOccupantType[]
}) => {
if (responseJSON.success) { if (responseJSON.success) {
lotOccupantTypes = responseJSON.lotOccupantTypes! lotOccupantTypes = responseJSON.lotOccupantTypes!
@ -117,11 +124,9 @@ function moveLotOccupantType(clickEvent: MouseEvent): void {
lotOccupantTypeId, lotOccupantTypeId,
moveToEnd: clickEvent.shiftKey ? '1' : '0' moveToEnd: clickEvent.shiftKey ? '1' : '0'
}, },
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
lotOccupantTypes?: recordTypes.LotOccupantType[]
}) => {
if (responseJSON.success) { if (responseJSON.success) {
lotOccupantTypes = responseJSON.lotOccupantTypes! lotOccupantTypes = responseJSON.lotOccupantTypes!
renderLotOccupantTypes() renderLotOccupantTypes()
@ -207,9 +212,7 @@ function renderLotOccupantTypes(): void {
cityssm.escapeHTML(lotOccupantType.occupantCommentTitle) + cityssm.escapeHTML(lotOccupantType.occupantCommentTitle) +
'"') + '"') +
(' form="' + formId + '"') + (' form="' + formId + '"') +
(' aria-label="' + (' aria-label="' + los.escapedAliases.Occupant + ' Comment Title"') +
los.escapedAliases.Occupant +
' Comment Title"') +
' maxlength="50" />' + ' maxlength="50" />' +
'</div>' + '</div>' +
'</div>') + '</div>') +
@ -287,11 +290,9 @@ function renderLotOccupantTypes(): void {
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/admin/doAddLotOccupantType', los.urlPrefix + '/admin/doAddLotOccupantType',
formElement, formElement,
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
lotOccupantTypes?: recordTypes.LotOccupantType[]
}) => {
if (responseJSON.success) { if (responseJSON.success) {
lotOccupantTypes = responseJSON.lotOccupantTypes! lotOccupantTypes = responseJSON.lotOccupantTypes!
renderLotOccupantTypes() renderLotOccupantTypes()

View File

@ -1,12 +1,14 @@
"use strict"; "use strict";
/* eslint-disable @typescript-eslint/indent */
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */ /* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
let lotStatuses = exports.lotStatuses; let lotStatuses = exports.lotStatuses;
delete exports.lotStatuses; delete exports.lotStatuses;
function updateLotStatus(submitEvent) { function updateLotStatus(submitEvent) {
submitEvent.preventDefault(); submitEvent.preventDefault();
cityssm.postJSON(los.urlPrefix + '/admin/doUpdateLotStatus', submitEvent.currentTarget, (responseJSON) => { cityssm.postJSON(los.urlPrefix + '/admin/doUpdateLotStatus', submitEvent.currentTarget, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
lotStatuses = responseJSON.lotStatuses; lotStatuses = responseJSON.lotStatuses;
bulmaJS.alert({ bulmaJS.alert({
@ -29,8 +31,9 @@ function deleteLotStatus(clickEvent) {
function doDelete() { function doDelete() {
cityssm.postJSON(los.urlPrefix + '/admin/doDeleteLotStatus', { cityssm.postJSON(los.urlPrefix + '/admin/doDeleteLotStatus', {
lotStatusId lotStatusId
}, (responseJSON) => { }, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
lotStatuses = responseJSON.lotStatuses; lotStatuses = responseJSON.lotStatuses;
if (lotStatuses.length === 0) { if (lotStatuses.length === 0) {
@ -76,8 +79,9 @@ function moveLotStatus(clickEvent) {
: 'doMoveLotStatusDown'), { : 'doMoveLotStatusDown'), {
lotStatusId, lotStatusId,
moveToEnd: clickEvent.shiftKey ? '1' : '0' moveToEnd: clickEvent.shiftKey ? '1' : '0'
}, (responseJSON) => { }, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
lotStatuses = responseJSON.lotStatuses; lotStatuses = responseJSON.lotStatuses;
renderLotStatuses(); renderLotStatuses();
@ -151,8 +155,9 @@ function renderLotStatuses() {
document.querySelector('#form--addLotStatus').addEventListener('submit', (submitEvent) => { document.querySelector('#form--addLotStatus').addEventListener('submit', (submitEvent) => {
submitEvent.preventDefault(); submitEvent.preventDefault();
const formElement = submitEvent.currentTarget; const formElement = submitEvent.currentTarget;
cityssm.postJSON(los.urlPrefix + '/admin/doAddLotStatus', formElement, (responseJSON) => { cityssm.postJSON(los.urlPrefix + '/admin/doAddLotStatus', formElement, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
lotStatuses = responseJSON.lotStatuses; lotStatuses = responseJSON.lotStatuses;
renderLotStatuses(); renderLotStatuses();

View File

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/indent */
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */ /* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
import type * as globalTypes from '../../types/globalTypes' import type * as globalTypes from '../../types/globalTypes'
@ -15,17 +16,25 @@ declare const los: globalTypes.LOS
let lotStatuses: recordTypes.LotStatus[] = exports.lotStatuses let lotStatuses: recordTypes.LotStatus[] = exports.lotStatuses
delete exports.lotStatuses delete exports.lotStatuses
type ResponseJSON =
| {
success: true
lotStatuses: recordTypes.LotStatus[]
}
| {
success: false
errorMessage: string
}
function updateLotStatus(submitEvent: SubmitEvent): void { function updateLotStatus(submitEvent: SubmitEvent): void {
submitEvent.preventDefault() submitEvent.preventDefault()
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/admin/doUpdateLotStatus', los.urlPrefix + '/admin/doUpdateLotStatus',
submitEvent.currentTarget, submitEvent.currentTarget,
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
lotStatuses?: recordTypes.LotStatus[]
}) => {
if (responseJSON.success) { if (responseJSON.success) {
lotStatuses = responseJSON.lotStatuses! lotStatuses = responseJSON.lotStatuses!
@ -57,11 +66,9 @@ function deleteLotStatus(clickEvent: Event): void {
{ {
lotStatusId lotStatusId
}, },
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
lotStatuses?: recordTypes.LotStatus[]
}) => {
if (responseJSON.success) { if (responseJSON.success) {
lotStatuses = responseJSON.lotStatuses! lotStatuses = responseJSON.lotStatuses!
@ -116,11 +123,9 @@ function moveLotStatus(clickEvent: MouseEvent): void {
lotStatusId, lotStatusId,
moveToEnd: clickEvent.shiftKey ? '1' : '0' moveToEnd: clickEvent.shiftKey ? '1' : '0'
}, },
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
lotStatuses?: recordTypes.LotStatus[]
}) => {
if (responseJSON.success) { if (responseJSON.success) {
lotStatuses = responseJSON.lotStatuses! lotStatuses = responseJSON.lotStatuses!
renderLotStatuses() renderLotStatuses()
@ -224,11 +229,9 @@ function renderLotStatuses(): void {
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/admin/doAddLotStatus', los.urlPrefix + '/admin/doAddLotStatus',
formElement, formElement,
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
lotStatuses?: recordTypes.LotStatus[]
}) => {
if (responseJSON.success) { if (responseJSON.success) {
lotStatuses = responseJSON.lotStatuses! lotStatuses = responseJSON.lotStatuses!
renderLotStatuses() renderLotStatuses()

View File

@ -1,12 +1,14 @@
"use strict"; "use strict";
/* eslint-disable @typescript-eslint/indent */
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */ /* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
let workOrderMilestoneTypes = exports.workOrderMilestoneTypes; let workOrderMilestoneTypes = exports.workOrderMilestoneTypes;
delete exports.workOrderMilestoneTypes; delete exports.workOrderMilestoneTypes;
function updateWorkOrderMilestoneType(submitEvent) { function updateWorkOrderMilestoneType(submitEvent) {
submitEvent.preventDefault(); submitEvent.preventDefault();
cityssm.postJSON(los.urlPrefix + '/admin/doUpdateWorkOrderMilestoneType', submitEvent.currentTarget, (responseJSON) => { cityssm.postJSON(los.urlPrefix + '/admin/doUpdateWorkOrderMilestoneType', submitEvent.currentTarget, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes; workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes;
bulmaJS.alert({ bulmaJS.alert({
@ -29,8 +31,9 @@ function deleteWorkOrderMilestoneType(clickEvent) {
function doDelete() { function doDelete() {
cityssm.postJSON(los.urlPrefix + '/admin/doDeleteWorkOrderMilestoneType', { cityssm.postJSON(los.urlPrefix + '/admin/doDeleteWorkOrderMilestoneType', {
workOrderMilestoneTypeId workOrderMilestoneTypeId
}, (responseJSON) => { }, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes; workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes;
if (workOrderMilestoneTypes.length === 0) { if (workOrderMilestoneTypes.length === 0) {
@ -76,8 +79,9 @@ function moveWorkOrderMilestoneType(clickEvent) {
: 'doMoveWorkOrderMilestoneTypeDown'), { : 'doMoveWorkOrderMilestoneTypeDown'), {
workOrderMilestoneTypeId, workOrderMilestoneTypeId,
moveToEnd: clickEvent.shiftKey ? '1' : '0' moveToEnd: clickEvent.shiftKey ? '1' : '0'
}, (responseJSON) => { }, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes; workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes;
renderWorkOrderMilestoneTypes(); renderWorkOrderMilestoneTypes();
@ -149,8 +153,9 @@ function renderWorkOrderMilestoneTypes() {
document.querySelector('#form--addWorkOrderMilestoneType').addEventListener('submit', (submitEvent) => { document.querySelector('#form--addWorkOrderMilestoneType').addEventListener('submit', (submitEvent) => {
submitEvent.preventDefault(); submitEvent.preventDefault();
const formElement = submitEvent.currentTarget; const formElement = submitEvent.currentTarget;
cityssm.postJSON(los.urlPrefix + '/admin/doAddWorkOrderMilestoneType', formElement, (responseJSON) => { cityssm.postJSON(los.urlPrefix + '/admin/doAddWorkOrderMilestoneType', formElement, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes; workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes;
renderWorkOrderMilestoneTypes(); renderWorkOrderMilestoneTypes();

View File

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/indent */
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */ /* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
import type * as globalTypes from '../../types/globalTypes' import type * as globalTypes from '../../types/globalTypes'
@ -16,17 +17,25 @@ let workOrderMilestoneTypes: recordTypes.WorkOrderMilestoneType[] =
exports.workOrderMilestoneTypes exports.workOrderMilestoneTypes
delete exports.workOrderMilestoneTypes delete exports.workOrderMilestoneTypes
type ResponseJSON =
| {
success: true
workOrderMilestoneTypes: recordTypes.WorkOrderMilestoneType[]
}
| {
success: false
errorMessage: string
}
function updateWorkOrderMilestoneType(submitEvent: SubmitEvent): void { function updateWorkOrderMilestoneType(submitEvent: SubmitEvent): void {
submitEvent.preventDefault() submitEvent.preventDefault()
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/admin/doUpdateWorkOrderMilestoneType', los.urlPrefix + '/admin/doUpdateWorkOrderMilestoneType',
submitEvent.currentTarget, submitEvent.currentTarget,
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
workOrderMilestoneTypes?: recordTypes.WorkOrderMilestoneType[]
}) => {
if (responseJSON.success) { if (responseJSON.success) {
workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes! workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes!
@ -59,11 +68,9 @@ function deleteWorkOrderMilestoneType(clickEvent: Event): void {
{ {
workOrderMilestoneTypeId workOrderMilestoneTypeId
}, },
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
workOrderMilestoneTypes?: recordTypes.WorkOrderMilestoneType[]
}) => {
if (responseJSON.success) { if (responseJSON.success) {
workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes! workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes!
@ -119,11 +126,9 @@ function moveWorkOrderMilestoneType(clickEvent: MouseEvent): void {
workOrderMilestoneTypeId, workOrderMilestoneTypeId,
moveToEnd: clickEvent.shiftKey ? '1' : '0' moveToEnd: clickEvent.shiftKey ? '1' : '0'
}, },
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
workOrderMilestoneTypes?: recordTypes.WorkOrderMilestoneType[]
}) => {
if (responseJSON.success) { if (responseJSON.success) {
workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes! workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes!
renderWorkOrderMilestoneTypes() renderWorkOrderMilestoneTypes()
@ -225,11 +230,9 @@ function renderWorkOrderMilestoneTypes(): void {
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/admin/doAddWorkOrderMilestoneType', los.urlPrefix + '/admin/doAddWorkOrderMilestoneType',
formElement, formElement,
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
workOrderMilestoneTypes?: recordTypes.WorkOrderMilestoneType[]
}) => {
if (responseJSON.success) { if (responseJSON.success) {
workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes! workOrderMilestoneTypes = responseJSON.workOrderMilestoneTypes!
renderWorkOrderMilestoneTypes() renderWorkOrderMilestoneTypes()

View File

@ -1,12 +1,14 @@
"use strict"; "use strict";
/* eslint-disable @typescript-eslint/indent */
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */ /* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
let workOrderTypes = exports.workOrderTypes; let workOrderTypes = exports.workOrderTypes;
delete exports.workOrderTypes; delete exports.workOrderTypes;
function updateWorkOrderType(submitEvent) { function updateWorkOrderType(submitEvent) {
submitEvent.preventDefault(); submitEvent.preventDefault();
cityssm.postJSON(los.urlPrefix + '/admin/doUpdateWorkOrderType', submitEvent.currentTarget, (responseJSON) => { cityssm.postJSON(los.urlPrefix + '/admin/doUpdateWorkOrderType', submitEvent.currentTarget, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
workOrderTypes = responseJSON.workOrderTypes; workOrderTypes = responseJSON.workOrderTypes;
bulmaJS.alert({ bulmaJS.alert({
@ -29,8 +31,9 @@ const deleteWorkOrderType = (clickEvent) => {
function doDelete() { function doDelete() {
cityssm.postJSON(los.urlPrefix + '/admin/doDeleteWorkOrderType', { cityssm.postJSON(los.urlPrefix + '/admin/doDeleteWorkOrderType', {
workOrderTypeId workOrderTypeId
}, (responseJSON) => { }, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
workOrderTypes = responseJSON.workOrderTypes; workOrderTypes = responseJSON.workOrderTypes;
if (workOrderTypes.length === 0) { if (workOrderTypes.length === 0) {
@ -71,11 +74,14 @@ function moveWorkOrderType(clickEvent) {
const workOrderTypeId = tableRowElement.dataset.workOrderTypeId; const workOrderTypeId = tableRowElement.dataset.workOrderTypeId;
cityssm.postJSON(los.urlPrefix + cityssm.postJSON(los.urlPrefix +
'/admin/' + '/admin/' +
(buttonElement.dataset.direction === 'up' ? 'doMoveWorkOrderTypeUp' : 'doMoveWorkOrderTypeDown'), { (buttonElement.dataset.direction === 'up'
? 'doMoveWorkOrderTypeUp'
: 'doMoveWorkOrderTypeDown'), {
workOrderTypeId, workOrderTypeId,
moveToEnd: clickEvent.shiftKey ? '1' : '0' moveToEnd: clickEvent.shiftKey ? '1' : '0'
}, (responseJSON) => { }, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
workOrderTypes = responseJSON.workOrderTypes; workOrderTypes = responseJSON.workOrderTypes;
renderWorkOrderTypes(); renderWorkOrderTypes();
@ -101,7 +107,8 @@ function renderWorkOrderTypes() {
containerElement.innerHTML = ''; containerElement.innerHTML = '';
for (const workOrderType of workOrderTypes) { for (const workOrderType of workOrderTypes) {
const tableRowElement = document.createElement('tr'); const tableRowElement = document.createElement('tr');
tableRowElement.dataset.workOrderTypeId = workOrderType.workOrderTypeId.toString(); tableRowElement.dataset.workOrderTypeId =
workOrderType.workOrderTypeId.toString();
tableRowElement.innerHTML = tableRowElement.innerHTML =
'<td>' + '<td>' +
'<form>' + '<form>' +
@ -132,7 +139,9 @@ function renderWorkOrderTypes() {
'</div>' + '</div>' +
'</div>' + '</div>' +
'</td>'; '</td>';
tableRowElement.querySelector('form').addEventListener('submit', updateWorkOrderType); tableRowElement
.querySelector('form')
.addEventListener('submit', updateWorkOrderType);
tableRowElement.querySelector('.button--moveWorkOrderTypeUp').addEventListener('click', moveWorkOrderType); tableRowElement.querySelector('.button--moveWorkOrderTypeUp').addEventListener('click', moveWorkOrderType);
tableRowElement.querySelector('.button--moveWorkOrderTypeDown').addEventListener('click', moveWorkOrderType); tableRowElement.querySelector('.button--moveWorkOrderTypeDown').addEventListener('click', moveWorkOrderType);
tableRowElement tableRowElement
@ -141,11 +150,13 @@ function renderWorkOrderTypes() {
containerElement.append(tableRowElement); containerElement.append(tableRowElement);
} }
} }
;
document.querySelector('#form--addWorkOrderType').addEventListener('submit', (submitEvent) => { document.querySelector('#form--addWorkOrderType').addEventListener('submit', (submitEvent) => {
submitEvent.preventDefault(); submitEvent.preventDefault();
const formElement = submitEvent.currentTarget; const formElement = submitEvent.currentTarget;
cityssm.postJSON(los.urlPrefix + '/admin/doAddWorkOrderType', formElement, (responseJSON) => { cityssm.postJSON(los.urlPrefix + '/admin/doAddWorkOrderType', formElement, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
workOrderTypes = responseJSON.workOrderTypes; workOrderTypes = responseJSON.workOrderTypes;
renderWorkOrderTypes(); renderWorkOrderTypes();

View File

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/indent */
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */ /* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
import type * as globalTypes from '../../types/globalTypes' import type * as globalTypes from '../../types/globalTypes'
@ -15,17 +16,25 @@ declare const los: globalTypes.LOS
let workOrderTypes: recordTypes.WorkOrderType[] = exports.workOrderTypes let workOrderTypes: recordTypes.WorkOrderType[] = exports.workOrderTypes
delete exports.workOrderTypes delete exports.workOrderTypes
type ResponseJSON =
| {
success: true
workOrderTypes: recordTypes.WorkOrderType[]
}
| {
success: false
errorMessage: string
}
function updateWorkOrderType(submitEvent: SubmitEvent): void { function updateWorkOrderType(submitEvent: SubmitEvent): void {
submitEvent.preventDefault() submitEvent.preventDefault()
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/admin/doUpdateWorkOrderType', los.urlPrefix + '/admin/doUpdateWorkOrderType',
submitEvent.currentTarget, submitEvent.currentTarget,
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
workOrderTypes?: recordTypes.WorkOrderType[]
}) => {
if (responseJSON.success) { if (responseJSON.success) {
workOrderTypes = responseJSON.workOrderTypes! workOrderTypes = responseJSON.workOrderTypes!
@ -45,7 +54,9 @@ function updateWorkOrderType(submitEvent: SubmitEvent): void {
} }
const deleteWorkOrderType = (clickEvent: Event): void => { const deleteWorkOrderType = (clickEvent: Event): void => {
const tableRowElement = (clickEvent.currentTarget as HTMLElement).closest('tr')! const tableRowElement = (clickEvent.currentTarget as HTMLElement).closest(
'tr'
)!
const workOrderTypeId = tableRowElement.dataset.workOrderTypeId const workOrderTypeId = tableRowElement.dataset.workOrderTypeId
@ -55,11 +66,9 @@ const deleteWorkOrderType = (clickEvent: Event): void => {
{ {
workOrderTypeId workOrderTypeId
}, },
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
workOrderTypes?: recordTypes.WorkOrderType[]
}) => {
if (responseJSON.success) { if (responseJSON.success) {
workOrderTypes = responseJSON.workOrderTypes! workOrderTypes = responseJSON.workOrderTypes!
@ -106,17 +115,17 @@ function moveWorkOrderType(clickEvent: MouseEvent): void {
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + los.urlPrefix +
'/admin/' + '/admin/' +
(buttonElement.dataset.direction === 'up' ? 'doMoveWorkOrderTypeUp' : 'doMoveWorkOrderTypeDown'), (buttonElement.dataset.direction === 'up'
? 'doMoveWorkOrderTypeUp'
: 'doMoveWorkOrderTypeDown'),
{ {
workOrderTypeId, workOrderTypeId,
moveToEnd: clickEvent.shiftKey ? '1' : '0' moveToEnd: clickEvent.shiftKey ? '1' : '0'
}, },
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
workOrderTypes?: recordTypes.WorkOrderType[]
}) => {
if (responseJSON.success) { if (responseJSON.success) {
workOrderTypes = responseJSON.workOrderTypes! workOrderTypes = responseJSON.workOrderTypes!
renderWorkOrderTypes() renderWorkOrderTypes()
@ -132,7 +141,9 @@ function moveWorkOrderType(clickEvent: MouseEvent): void {
} }
function renderWorkOrderTypes(): void { function renderWorkOrderTypes(): void {
const containerElement = document.querySelector('#container--workOrderTypes') as HTMLTableSectionElement const containerElement = document.querySelector(
'#container--workOrderTypes'
) as HTMLTableSectionElement
if (workOrderTypes.length === 0) { if (workOrderTypes.length === 0) {
containerElement.innerHTML = `<tr><td colspan="2"> containerElement.innerHTML = `<tr><td colspan="2">
@ -147,13 +158,14 @@ function renderWorkOrderTypes(): void {
for (const workOrderType of workOrderTypes) { for (const workOrderType of workOrderTypes) {
const tableRowElement = document.createElement('tr') const tableRowElement = document.createElement('tr')
tableRowElement.dataset.workOrderTypeId = workOrderType.workOrderTypeId!.toString() tableRowElement.dataset.workOrderTypeId =
workOrderType.workOrderTypeId.toString()
tableRowElement.innerHTML = tableRowElement.innerHTML =
'<td>' + '<td>' +
'<form>' + '<form>' +
'<input name="workOrderTypeId" type="hidden" value="' + '<input name="workOrderTypeId" type="hidden" value="' +
workOrderType.workOrderTypeId!.toString() + workOrderType.workOrderTypeId.toString() +
'" />' + '" />' +
('<div class="field has-addons">' + ('<div class="field has-addons">' +
'<div class="control">' + '<div class="control">' +
@ -184,13 +196,19 @@ function renderWorkOrderTypes(): void {
'</div>' + '</div>' +
'</td>' '</td>'
tableRowElement.querySelector('form')!.addEventListener('submit', updateWorkOrderType); (tableRowElement.querySelector('.button--moveWorkOrderTypeUp') as HTMLButtonElement).addEventListener( tableRowElement
'click', .querySelector('form')!
moveWorkOrderType .addEventListener('submit', updateWorkOrderType)
); (tableRowElement.querySelector('.button--moveWorkOrderTypeDown') as HTMLButtonElement).addEventListener( ;(
'click', tableRowElement.querySelector(
moveWorkOrderType '.button--moveWorkOrderTypeUp'
) ) as HTMLButtonElement
).addEventListener('click', moveWorkOrderType)
;(
tableRowElement.querySelector(
'.button--moveWorkOrderTypeDown'
) as HTMLButtonElement
).addEventListener('click', moveWorkOrderType)
tableRowElement tableRowElement
.querySelector('.button--deleteWorkOrderType')! .querySelector('.button--deleteWorkOrderType')!
@ -198,36 +216,34 @@ function renderWorkOrderTypes(): void {
containerElement.append(tableRowElement) containerElement.append(tableRowElement)
} }
}(document.querySelector('#form--addWorkOrderType') as HTMLFormElement).addEventListener( }
'submit', ;(
(submitEvent: SubmitEvent) => { document.querySelector('#form--addWorkOrderType') as HTMLFormElement
submitEvent.preventDefault() ).addEventListener('submit', (submitEvent: SubmitEvent) => {
submitEvent.preventDefault()
const formElement = submitEvent.currentTarget as HTMLFormElement const formElement = submitEvent.currentTarget as HTMLFormElement
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/admin/doAddWorkOrderType', los.urlPrefix + '/admin/doAddWorkOrderType',
formElement, formElement,
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as ResponseJSON
errorMessage?: string
workOrderTypes?: recordTypes.WorkOrderType[] if (responseJSON.success) {
}) => { workOrderTypes = responseJSON.workOrderTypes!
if (responseJSON.success) { renderWorkOrderTypes()
workOrderTypes = responseJSON.workOrderTypes! formElement.reset()
renderWorkOrderTypes() formElement.querySelector('input')!.focus()
formElement.reset() } else {
formElement.querySelector('input')!.focus() bulmaJS.alert({
} else { title: 'Error Adding Work Order Type',
bulmaJS.alert({ message: responseJSON.errorMessage ?? '',
title: 'Error Adding Work Order Type', contextualColorName: 'danger'
message: responseJSON.errorMessage ?? '', })
contextualColorName: 'danger'
})
}
} }
) }
} )
) })
renderWorkOrderTypes() renderWorkOrderTypes()

View File

@ -1 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{var e,a;const t=exports.los;function s(){cityssm.postJSON(t.urlPrefix+"/admin/doBackupDatabase",{},e=>{var a;const t=e;t.success?bulmaJS.alert({title:"Database Backed Up Successfully",message:`Backed up to ${t.fileName}`,contextualColorName:"success"}):bulmaJS.alert({title:"Error Backing Up Database",message:null!==(a=t.errorMessage)&&void 0!==a?a:"",contextualColorName:"danger"})})}function u(){cityssm.postJSON(t.urlPrefix+"/admin/doCleanupDatabase",{},e=>{var a;const t=e;t.success?bulmaJS.alert({title:"Database Cleaned Up Successfully",message:`${t.inactivatedRecordCount} records inactivated,\n ${t.purgedRecordCount} permanently deleted.`,contextualColorName:"success"}):bulmaJS.alert({title:"Error Cleaning Database",message:null!==(a=t.errorMessage)&&void 0!==a?a:"",contextualColorName:"danger"})})}null===(e=document.querySelector("#button--cleanupDatabase"))||void 0===e||e.addEventListener("click",()=>{bulmaJS.confirm({title:"Cleanup Database",message:"Are you sure you want to cleanup up the database?",okButton:{text:"Yes, Cleanup Database",callbackFunction:u}})}),null===(a=document.querySelector("#button--backupDatabase"))||void 0===a||a.addEventListener("click",()=>{bulmaJS.confirm({title:"Backup Database",message:"Are you sure you want to backup up the database?",okButton:{text:"Yes, Backup Database",callbackFunction:s}})})})(); "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{var e,a;const t=exports.los;function s(){cityssm.postJSON(t.urlPrefix+"/admin/doBackupDatabase",{},e=>{var a;const t=e;t.success?bulmaJS.alert({title:"Database Backed Up Successfully",message:`Backed up to <strong>${t.fileName}</strong><br />\n To request a copy of the backup, contact your application administrator.`,messageIsHtml:!0,contextualColorName:"success"}):bulmaJS.alert({title:"Error Backing Up Database",message:null!==(a=t.errorMessage)&&void 0!==a?a:"",contextualColorName:"danger"})})}function o(){cityssm.postJSON(t.urlPrefix+"/admin/doCleanupDatabase",{},e=>{var a;const t=e;t.success?bulmaJS.alert({title:"Database Cleaned Up Successfully",message:`${t.inactivatedRecordCount} records inactivated,\n ${t.purgedRecordCount} permanently deleted.`,contextualColorName:"success"}):bulmaJS.alert({title:"Error Cleaning Database",message:null!==(a=t.errorMessage)&&void 0!==a?a:"",contextualColorName:"danger"})})}null===(e=document.querySelector("#button--cleanupDatabase"))||void 0===e||e.addEventListener("click",()=>{bulmaJS.confirm({title:"Cleanup Database",message:"Are you sure you want to cleanup up the database?",okButton:{text:"Yes, Cleanup Database",callbackFunction:o}})}),null===(a=document.querySelector("#button--backupDatabase"))||void 0===a||a.addEventListener("click",()=>{bulmaJS.confirm({title:"Backup Database",message:"Are you sure you want to backup up the database?",okButton:{text:"Yes, Backup Database",callbackFunction:s}})})})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long