reduce redundant type descriptions
parent
bbc61c25f6
commit
353409abca
|
|
@ -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 <strong>${responseJSON.fileName}</strong><br />
|
||||
To request a copy of the backup, contact your application administrator.`,
|
||||
messageIsHtml: true,
|
||||
contextualColorName: 'success'
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 <strong>${responseJSON.fileName}</strong><br />
|
||||
To request a copy of the backup, contact your application administrator.`,
|
||||
messageIsHtml: true,
|
||||
contextualColorName: 'success'
|
||||
})
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -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', `<div class="panel-block is-block">
|
||||
<div class="message is-info">
|
||||
<p class="message-body">
|
||||
There are no fees in the
|
||||
"${cityssm.escapeHTML((_b = feeCategory.feeCategory) !== null && _b !== void 0 ? _b : '')}"
|
||||
category.
|
||||
There are no fees in the
|
||||
"${cityssm.escapeHTML((_b = feeCategory.feeCategory) !== null && _b !== void 0 ? _b : '')}"
|
||||
category.
|
||||
</p>
|
||||
</div>
|
||||
</div>`);
|
||||
|
|
@ -177,8 +178,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
let addCloseModalFunction;
|
||||
function doAddFeeCategory(submitEvent) {
|
||||
submitEvent.preventDefault();
|
||||
cityssm.postJSON(los.urlPrefix + '/admin/doAddFeeCategory', submitEvent.currentTarget, (responseJSON) => {
|
||||
cityssm.postJSON(los.urlPrefix + '/admin/doAddFeeCategory', submitEvent.currentTarget, (rawResponseJSON) => {
|
||||
var _a;
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.success) {
|
||||
feeCategories = responseJSON.feeCategories;
|
||||
addCloseModalFunction();
|
||||
|
|
@ -216,8 +218,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
let editCloseModalFunction;
|
||||
function doUpdateFeeCategory(submitEvent) {
|
||||
submitEvent.preventDefault();
|
||||
cityssm.postJSON(los.urlPrefix + '/admin/doUpdateFeeCategory', submitEvent.currentTarget, (responseJSON) => {
|
||||
cityssm.postJSON(los.urlPrefix + '/admin/doUpdateFeeCategory', submitEvent.currentTarget, (rawResponseJSON) => {
|
||||
var _a;
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.success) {
|
||||
feeCategories = responseJSON.feeCategories;
|
||||
editCloseModalFunction();
|
||||
|
|
@ -256,8 +259,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
function doDelete() {
|
||||
cityssm.postJSON(los.urlPrefix + '/admin/doDeleteFeeCategory', {
|
||||
feeCategoryId
|
||||
}, (responseJSON) => {
|
||||
}, (rawResponseJSON) => {
|
||||
var _a;
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.success) {
|
||||
feeCategories = responseJSON.feeCategories;
|
||||
renderFeeCategories();
|
||||
|
|
@ -291,8 +295,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
: 'doMoveFeeCategoryDown'), {
|
||||
feeCategoryId,
|
||||
moveToEnd: clickEvent.shiftKey ? '1' : '0'
|
||||
}, (responseJSON) => {
|
||||
}, (rawResponseJSON) => {
|
||||
var _a;
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.success) {
|
||||
feeCategories = responseJSON.feeCategories;
|
||||
renderFeeCategories();
|
||||
|
|
@ -314,8 +319,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
let addCloseModalFunction;
|
||||
function doAddFee(submitEvent) {
|
||||
submitEvent.preventDefault();
|
||||
cityssm.postJSON(los.urlPrefix + '/admin/doAddFee', submitEvent.currentTarget, (responseJSON) => {
|
||||
cityssm.postJSON(los.urlPrefix + '/admin/doAddFee', submitEvent.currentTarget, (rawResponseJSON) => {
|
||||
var _a;
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.success) {
|
||||
feeCategories = responseJSON.feeCategories;
|
||||
addCloseModalFunction();
|
||||
|
|
@ -426,8 +432,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
let editModalElement;
|
||||
function doUpdateFee(submitEvent) {
|
||||
submitEvent.preventDefault();
|
||||
cityssm.postJSON(los.urlPrefix + '/admin/doUpdateFee', submitEvent.currentTarget, (responseJSON) => {
|
||||
cityssm.postJSON(los.urlPrefix + '/admin/doUpdateFee', submitEvent.currentTarget, (rawResponseJSON) => {
|
||||
var _a;
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.success) {
|
||||
feeCategories = responseJSON.feeCategories;
|
||||
editCloseModalFunction();
|
||||
|
|
@ -447,8 +454,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
function doDelete() {
|
||||
cityssm.postJSON(los.urlPrefix + '/admin/doDeleteFee', {
|
||||
feeId
|
||||
}, (responseJSON) => {
|
||||
}, (rawResponseJSON) => {
|
||||
var _a;
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.success) {
|
||||
feeCategories = responseJSON.feeCategories;
|
||||
editCloseModalFunction();
|
||||
|
|
@ -596,8 +604,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
: 'doMoveFeeDown'), {
|
||||
feeId,
|
||||
moveToEnd: clickEvent.shiftKey ? '1' : '0'
|
||||
}, (responseJSON) => {
|
||||
}, (rawResponseJSON) => {
|
||||
var _a;
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.success) {
|
||||
feeCategories = responseJSON.feeCategories;
|
||||
renderFeeCategories();
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
@ -19,6 +20,16 @@ declare const bulmaJS: BulmaJS
|
|||
let feeCategories: recordTypes.FeeCategory[] = exports.feeCategories
|
||||
delete exports.feeCategories
|
||||
|
||||
type ResponseJSON =
|
||||
| {
|
||||
success: true
|
||||
feeCategories: recordTypes.FeeCategory[]
|
||||
}
|
||||
| {
|
||||
success: false
|
||||
errorMessage: string
|
||||
}
|
||||
|
||||
function renderFeeCategories(): void {
|
||||
if (feeCategories.length === 0) {
|
||||
feeCategoriesContainerElement.innerHTML = `<div class="message is-warning">
|
||||
|
|
@ -84,9 +95,9 @@ declare const bulmaJS: BulmaJS
|
|||
`<div class="panel-block is-block">
|
||||
<div class="message is-info">
|
||||
<p class="message-body">
|
||||
There are no fees in the
|
||||
"${cityssm.escapeHTML(feeCategory.feeCategory ?? '')}"
|
||||
category.
|
||||
There are no fees in the
|
||||
"${cityssm.escapeHTML(feeCategory.feeCategory ?? '')}"
|
||||
category.
|
||||
</p>
|
||||
</div>
|
||||
</div>`
|
||||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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!
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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!
|
||||
|
|
|
|||
|
|
@ -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>`;
|
||||
}
|
||||
"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 =
|
||||
'<td>' +
|
||||
'<form>' +
|
||||
|
|
@ -146,7 +153,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
'</div>' +
|
||||
'</div>' +
|
||||
'</td>';
|
||||
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" />' +
|
||||
'</div>' +
|
||||
'</div>') +
|
||||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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" />' +
|
||||
'</div>' +
|
||||
'</div>') +
|
||||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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" />' +
|
||||
'</div>' +
|
||||
'</div>') +
|
||||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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 =
|
||||
'<td>' +
|
||||
'<form>' +
|
||||
|
|
@ -132,7 +139,9 @@ function renderWorkOrderTypes() {
|
|||
'</div>' +
|
||||
'</div>' +
|
||||
'</td>';
|
||||
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
|
||||
|
|
@ -141,11 +150,13 @@ function renderWorkOrderTypes() {
|
|||
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();
|
||||
|
|
|
|||
|
|
@ -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 workOrderTypes: recordTypes.WorkOrderType[] = exports.workOrderTypes
|
||||
delete exports.workOrderTypes
|
||||
|
||||
type ResponseJSON =
|
||||
| {
|
||||
success: true
|
||||
workOrderTypes: recordTypes.WorkOrderType[]
|
||||
}
|
||||
| {
|
||||
success: false
|
||||
errorMessage: string
|
||||
}
|
||||
|
||||
function updateWorkOrderType(submitEvent: SubmitEvent): void {
|
||||
submitEvent.preventDefault()
|
||||
|
||||
cityssm.postJSON(
|
||||
los.urlPrefix + '/admin/doUpdateWorkOrderType',
|
||||
submitEvent.currentTarget,
|
||||
(responseJSON: {
|
||||
success: boolean
|
||||
errorMessage?: string
|
||||
workOrderTypes?: recordTypes.WorkOrderType[]
|
||||
}) => {
|
||||
(rawResponseJSON) => {
|
||||
const responseJSON = rawResponseJSON as ResponseJSON
|
||||
|
||||
if (responseJSON.success) {
|
||||
workOrderTypes = responseJSON.workOrderTypes!
|
||||
|
||||
|
|
@ -45,7 +54,9 @@ function updateWorkOrderType(submitEvent: SubmitEvent): 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
|
||||
|
||||
|
|
@ -55,11 +66,9 @@ const deleteWorkOrderType = (clickEvent: Event): void => {
|
|||
{
|
||||
workOrderTypeId
|
||||
},
|
||||
(responseJSON: {
|
||||
success: boolean
|
||||
errorMessage?: string
|
||||
workOrderTypes?: recordTypes.WorkOrderType[]
|
||||
}) => {
|
||||
(rawResponseJSON) => {
|
||||
const responseJSON = rawResponseJSON as ResponseJSON
|
||||
|
||||
if (responseJSON.success) {
|
||||
workOrderTypes = responseJSON.workOrderTypes!
|
||||
|
||||
|
|
@ -106,17 +115,17 @@ function moveWorkOrderType(clickEvent: MouseEvent): void {
|
|||
|
||||
cityssm.postJSON(
|
||||
los.urlPrefix +
|
||||
'/admin/' +
|
||||
(buttonElement.dataset.direction === 'up' ? 'doMoveWorkOrderTypeUp' : 'doMoveWorkOrderTypeDown'),
|
||||
'/admin/' +
|
||||
(buttonElement.dataset.direction === 'up'
|
||||
? 'doMoveWorkOrderTypeUp'
|
||||
: 'doMoveWorkOrderTypeDown'),
|
||||
{
|
||||
workOrderTypeId,
|
||||
moveToEnd: clickEvent.shiftKey ? '1' : '0'
|
||||
},
|
||||
(responseJSON: {
|
||||
success: boolean
|
||||
errorMessage?: string
|
||||
workOrderTypes?: recordTypes.WorkOrderType[]
|
||||
}) => {
|
||||
(rawResponseJSON) => {
|
||||
const responseJSON = rawResponseJSON as ResponseJSON
|
||||
|
||||
if (responseJSON.success) {
|
||||
workOrderTypes = responseJSON.workOrderTypes!
|
||||
renderWorkOrderTypes()
|
||||
|
|
@ -132,7 +141,9 @@ function moveWorkOrderType(clickEvent: MouseEvent): void {
|
|||
}
|
||||
|
||||
function renderWorkOrderTypes(): void {
|
||||
const containerElement = document.querySelector('#container--workOrderTypes') as HTMLTableSectionElement
|
||||
const containerElement = document.querySelector(
|
||||
'#container--workOrderTypes'
|
||||
) as HTMLTableSectionElement
|
||||
|
||||
if (workOrderTypes.length === 0) {
|
||||
containerElement.innerHTML = `<tr><td colspan="2">
|
||||
|
|
@ -147,13 +158,14 @@ function renderWorkOrderTypes(): void {
|
|||
for (const workOrderType of workOrderTypes) {
|
||||
const tableRowElement = document.createElement('tr')
|
||||
|
||||
tableRowElement.dataset.workOrderTypeId = workOrderType.workOrderTypeId!.toString()
|
||||
tableRowElement.dataset.workOrderTypeId =
|
||||
workOrderType.workOrderTypeId.toString()
|
||||
|
||||
tableRowElement.innerHTML =
|
||||
'<td>' +
|
||||
'<form>' +
|
||||
'<input name="workOrderTypeId" type="hidden" value="' +
|
||||
workOrderType.workOrderTypeId!.toString() +
|
||||
workOrderType.workOrderTypeId.toString() +
|
||||
'" />' +
|
||||
('<div class="field has-addons">' +
|
||||
'<div class="control">' +
|
||||
|
|
@ -184,13 +196,19 @@ function renderWorkOrderTypes(): void {
|
|||
'</div>' +
|
||||
'</td>'
|
||||
|
||||
tableRowElement.querySelector('form')!.addEventListener('submit', updateWorkOrderType); (tableRowElement.querySelector('.button--moveWorkOrderTypeUp') as HTMLButtonElement).addEventListener(
|
||||
'click',
|
||||
moveWorkOrderType
|
||||
); (tableRowElement.querySelector('.button--moveWorkOrderTypeDown') as HTMLButtonElement).addEventListener(
|
||||
'click',
|
||||
moveWorkOrderType
|
||||
)
|
||||
tableRowElement
|
||||
.querySelector('form')!
|
||||
.addEventListener('submit', updateWorkOrderType)
|
||||
;(
|
||||
tableRowElement.querySelector(
|
||||
'.button--moveWorkOrderTypeUp'
|
||||
) as HTMLButtonElement
|
||||
).addEventListener('click', moveWorkOrderType)
|
||||
;(
|
||||
tableRowElement.querySelector(
|
||||
'.button--moveWorkOrderTypeDown'
|
||||
) as HTMLButtonElement
|
||||
).addEventListener('click', moveWorkOrderType)
|
||||
|
||||
tableRowElement
|
||||
.querySelector('.button--deleteWorkOrderType')!
|
||||
|
|
@ -198,36 +216,34 @@ function renderWorkOrderTypes(): void {
|
|||
|
||||
containerElement.append(tableRowElement)
|
||||
}
|
||||
}(document.querySelector('#form--addWorkOrderType') as HTMLFormElement).addEventListener(
|
||||
'submit',
|
||||
(submitEvent: SubmitEvent) => {
|
||||
submitEvent.preventDefault()
|
||||
}
|
||||
;(
|
||||
document.querySelector('#form--addWorkOrderType') as HTMLFormElement
|
||||
).addEventListener('submit', (submitEvent: SubmitEvent) => {
|
||||
submitEvent.preventDefault()
|
||||
|
||||
const formElement = submitEvent.currentTarget as HTMLFormElement
|
||||
const formElement = submitEvent.currentTarget as HTMLFormElement
|
||||
|
||||
cityssm.postJSON(
|
||||
los.urlPrefix + '/admin/doAddWorkOrderType',
|
||||
formElement,
|
||||
(responseJSON: {
|
||||
success: boolean
|
||||
errorMessage?: string
|
||||
workOrderTypes?: recordTypes.WorkOrderType[]
|
||||
}) => {
|
||||
if (responseJSON.success) {
|
||||
workOrderTypes = responseJSON.workOrderTypes!
|
||||
renderWorkOrderTypes()
|
||||
formElement.reset()
|
||||
formElement.querySelector('input')!.focus()
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
title: 'Error Adding Work Order Type',
|
||||
message: responseJSON.errorMessage ?? '',
|
||||
contextualColorName: 'danger'
|
||||
})
|
||||
}
|
||||
cityssm.postJSON(
|
||||
los.urlPrefix + '/admin/doAddWorkOrderType',
|
||||
formElement,
|
||||
(rawResponseJSON) => {
|
||||
const responseJSON = rawResponseJSON as ResponseJSON
|
||||
|
||||
if (responseJSON.success) {
|
||||
workOrderTypes = responseJSON.workOrderTypes!
|
||||
renderWorkOrderTypes()
|
||||
formElement.reset()
|
||||
formElement.querySelector('input')!.focus()
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
title: 'Error Adding Work Order Type',
|
||||
message: responseJSON.errorMessage ?? '',
|
||||
contextualColorName: 'danger'
|
||||
})
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
renderWorkOrderTypes()
|
||||
|
|
|
|||
|
|
@ -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
Loading…
Reference in New Issue