deepsource-autofix-76c6eb20
Dan Gowans 2024-10-28 14:43:35 -04:00
parent 92a77c1d3e
commit e849f5989a
37 changed files with 436 additions and 526 deletions

View File

@ -1,3 +1,5 @@
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable @typescript-eslint/init-declarations */
import cluster from 'node:cluster'; import cluster from 'node:cluster';
import Debug from 'debug'; import Debug from 'debug';
import getLotOccupantTypesFromDatabase from '../database/getLotOccupantTypes.js'; import getLotOccupantTypesFromDatabase from '../database/getLotOccupantTypes.js';
@ -21,17 +23,13 @@ export async function getLotOccupantTypes() {
} }
export async function getLotOccupantTypeById(lotOccupantTypeId) { export async function getLotOccupantTypeById(lotOccupantTypeId) {
const cachedLotOccupantTypes = await getLotOccupantTypes(); const cachedLotOccupantTypes = await getLotOccupantTypes();
return cachedLotOccupantTypes.find((currentLotOccupantType) => { return cachedLotOccupantTypes.find((currentLotOccupantType) => currentLotOccupantType.lotOccupantTypeId === lotOccupantTypeId);
return currentLotOccupantType.lotOccupantTypeId === lotOccupantTypeId;
});
} }
export async function getLotOccupantTypeByLotOccupantType(lotOccupantType) { export async function getLotOccupantTypeByLotOccupantType(lotOccupantType) {
const cachedLotOccupantTypes = await getLotOccupantTypes(); const cachedLotOccupantTypes = await getLotOccupantTypes();
const lotOccupantTypeLowerCase = lotOccupantType.toLowerCase(); const lotOccupantTypeLowerCase = lotOccupantType.toLowerCase();
return cachedLotOccupantTypes.find((currentLotOccupantType) => { return cachedLotOccupantTypes.find((currentLotOccupantType) => currentLotOccupantType.lotOccupantType.toLowerCase() ===
return (currentLotOccupantType.lotOccupantType.toLowerCase() ===
lotOccupantTypeLowerCase); lotOccupantTypeLowerCase);
});
} }
function clearLotOccupantTypesCache() { function clearLotOccupantTypesCache() {
lotOccupantTypes = undefined; lotOccupantTypes = undefined;
@ -48,16 +46,12 @@ export async function getLotStatuses() {
} }
export async function getLotStatusById(lotStatusId) { export async function getLotStatusById(lotStatusId) {
const cachedLotStatuses = await getLotStatuses(); const cachedLotStatuses = await getLotStatuses();
return cachedLotStatuses.find((currentLotStatus) => { return cachedLotStatuses.find((currentLotStatus) => currentLotStatus.lotStatusId === lotStatusId);
return currentLotStatus.lotStatusId === lotStatusId;
});
} }
export async function getLotStatusByLotStatus(lotStatus) { export async function getLotStatusByLotStatus(lotStatus) {
const cachedLotStatuses = await getLotStatuses(); const cachedLotStatuses = await getLotStatuses();
const lotStatusLowerCase = lotStatus.toLowerCase(); const lotStatusLowerCase = lotStatus.toLowerCase();
return cachedLotStatuses.find((currentLotStatus) => { return cachedLotStatuses.find((currentLotStatus) => currentLotStatus.lotStatus.toLowerCase() === lotStatusLowerCase);
return currentLotStatus.lotStatus.toLowerCase() === lotStatusLowerCase;
});
} }
function clearLotStatusesCache() { function clearLotStatusesCache() {
lotStatuses = undefined; lotStatuses = undefined;
@ -74,16 +68,12 @@ export async function getLotTypes() {
} }
export async function getLotTypeById(lotTypeId) { export async function getLotTypeById(lotTypeId) {
const cachedLotTypes = await getLotTypes(); const cachedLotTypes = await getLotTypes();
return cachedLotTypes.find((currentLotType) => { return cachedLotTypes.find((currentLotType) => currentLotType.lotTypeId === lotTypeId);
return currentLotType.lotTypeId === lotTypeId;
});
} }
export async function getLotTypesByLotType(lotType) { export async function getLotTypesByLotType(lotType) {
const cachedLotTypes = await getLotTypes(); const cachedLotTypes = await getLotTypes();
const lotTypeLowerCase = lotType.toLowerCase(); const lotTypeLowerCase = lotType.toLowerCase();
return cachedLotTypes.find((currentLotType) => { return cachedLotTypes.find((currentLotType) => currentLotType.lotType.toLowerCase() === lotTypeLowerCase);
return currentLotType.lotType.toLowerCase() === lotTypeLowerCase;
});
} }
function clearLotTypesCache() { function clearLotTypesCache() {
lotTypes = undefined; lotTypes = undefined;
@ -107,17 +97,13 @@ export async function getAllOccupancyTypeFields() {
} }
export async function getOccupancyTypeById(occupancyTypeId) { export async function getOccupancyTypeById(occupancyTypeId) {
const cachedOccupancyTypes = await getOccupancyTypes(); const cachedOccupancyTypes = await getOccupancyTypes();
return cachedOccupancyTypes.find((currentOccupancyType) => { return cachedOccupancyTypes.find((currentOccupancyType) => currentOccupancyType.occupancyTypeId === occupancyTypeId);
return currentOccupancyType.occupancyTypeId === occupancyTypeId;
});
} }
export async function getOccupancyTypeByOccupancyType(occupancyTypeString) { export async function getOccupancyTypeByOccupancyType(occupancyTypeString) {
const cachedOccupancyTypes = await getOccupancyTypes(); const cachedOccupancyTypes = await getOccupancyTypes();
const occupancyTypeLowerCase = occupancyTypeString.toLowerCase(); const occupancyTypeLowerCase = occupancyTypeString.toLowerCase();
return cachedOccupancyTypes.find((currentOccupancyType) => { return cachedOccupancyTypes.find((currentOccupancyType) => currentOccupancyType.occupancyType.toLowerCase() ===
return (currentOccupancyType.occupancyType.toLowerCase() ===
occupancyTypeLowerCase); occupancyTypeLowerCase);
});
} }
export async function getOccupancyTypePrintsById(occupancyTypeId) { export async function getOccupancyTypePrintsById(occupancyTypeId) {
const occupancyType = await getOccupancyTypeById(occupancyTypeId); const occupancyType = await getOccupancyTypeById(occupancyTypeId);
@ -146,9 +132,7 @@ export async function getWorkOrderTypes() {
} }
export async function getWorkOrderTypeById(workOrderTypeId) { export async function getWorkOrderTypeById(workOrderTypeId) {
const cachedWorkOrderTypes = await getWorkOrderTypes(); const cachedWorkOrderTypes = await getWorkOrderTypes();
return cachedWorkOrderTypes.find((currentWorkOrderType) => { return cachedWorkOrderTypes.find((currentWorkOrderType) => currentWorkOrderType.workOrderTypeId === workOrderTypeId);
return currentWorkOrderType.workOrderTypeId === workOrderTypeId;
});
} }
function clearWorkOrderTypesCache() { function clearWorkOrderTypesCache() {
workOrderTypes = undefined; workOrderTypes = undefined;
@ -165,18 +149,14 @@ export async function getWorkOrderMilestoneTypes() {
} }
export async function getWorkOrderMilestoneTypeById(workOrderMilestoneTypeId) { export async function getWorkOrderMilestoneTypeById(workOrderMilestoneTypeId) {
const cachedWorkOrderMilestoneTypes = await getWorkOrderMilestoneTypes(); const cachedWorkOrderMilestoneTypes = await getWorkOrderMilestoneTypes();
return cachedWorkOrderMilestoneTypes.find((currentWorkOrderMilestoneType) => { return cachedWorkOrderMilestoneTypes.find((currentWorkOrderMilestoneType) => currentWorkOrderMilestoneType.workOrderMilestoneTypeId ===
return (currentWorkOrderMilestoneType.workOrderMilestoneTypeId ===
workOrderMilestoneTypeId); workOrderMilestoneTypeId);
});
} }
export async function getWorkOrderMilestoneTypeByWorkOrderMilestoneType(workOrderMilestoneTypeString) { export async function getWorkOrderMilestoneTypeByWorkOrderMilestoneType(workOrderMilestoneTypeString) {
const cachedWorkOrderMilestoneTypes = await getWorkOrderMilestoneTypes(); const cachedWorkOrderMilestoneTypes = await getWorkOrderMilestoneTypes();
const workOrderMilestoneTypeLowerCase = workOrderMilestoneTypeString.toLowerCase(); const workOrderMilestoneTypeLowerCase = workOrderMilestoneTypeString.toLowerCase();
return cachedWorkOrderMilestoneTypes.find((currentWorkOrderMilestoneType) => { return cachedWorkOrderMilestoneTypes.find((currentWorkOrderMilestoneType) => currentWorkOrderMilestoneType.workOrderMilestoneType.toLowerCase() ===
return (currentWorkOrderMilestoneType.workOrderMilestoneType.toLowerCase() ===
workOrderMilestoneTypeLowerCase); workOrderMilestoneTypeLowerCase);
});
} }
export async function preloadCaches() { export async function preloadCaches() {
debug('Preloading caches'); debug('Preloading caches');
@ -240,9 +220,11 @@ export function clearCacheByTableName(tableName, relayMessage = true) {
pid: process.pid pid: process.pid
}; };
debug(`Sending clear cache from worker: ${tableName}`); debug(`Sending clear cache from worker: ${tableName}`);
if (process.send !== undefined) {
process.send(workerMessage); process.send(workerMessage);
} }
} }
}
catch { } catch { }
} }
process.on('message', (message) => { process.on('message', (message) => {

View File

@ -1,3 +1,6 @@
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable @typescript-eslint/init-declarations */
import cluster from 'node:cluster' import cluster from 'node:cluster'
import Debug from 'debug' import Debug from 'debug'
@ -9,7 +12,10 @@ import getOccupancyTypeFieldsFromDatabase from '../database/getOccupancyTypeFiel
import getOccupancyTypesFromDatabase from '../database/getOccupancyTypes.js' import getOccupancyTypesFromDatabase from '../database/getOccupancyTypes.js'
import getWorkOrderMilestoneTypesFromDatabase from '../database/getWorkOrderMilestoneTypes.js' import getWorkOrderMilestoneTypesFromDatabase from '../database/getWorkOrderMilestoneTypes.js'
import getWorkOrderTypesFromDatabase from '../database/getWorkOrderTypes.js' import getWorkOrderTypesFromDatabase from '../database/getWorkOrderTypes.js'
import type { ClearCacheWorkerMessage } from '../types/applicationTypes.js' import type {
ClearCacheWorkerMessage,
WorkerMessage
} from '../types/applicationTypes.js'
import type { import type {
LotOccupantType, LotOccupantType,
LotStatus, LotStatus,
@ -43,9 +49,10 @@ export async function getLotOccupantTypeById(
): Promise<LotOccupantType | undefined> { ): Promise<LotOccupantType | undefined> {
const cachedLotOccupantTypes = await getLotOccupantTypes() const cachedLotOccupantTypes = await getLotOccupantTypes()
return cachedLotOccupantTypes.find((currentLotOccupantType) => { return cachedLotOccupantTypes.find(
return currentLotOccupantType.lotOccupantTypeId === lotOccupantTypeId (currentLotOccupantType) =>
}) currentLotOccupantType.lotOccupantTypeId === lotOccupantTypeId
)
} }
export async function getLotOccupantTypeByLotOccupantType( export async function getLotOccupantTypeByLotOccupantType(
@ -55,12 +62,11 @@ export async function getLotOccupantTypeByLotOccupantType(
const lotOccupantTypeLowerCase = lotOccupantType.toLowerCase() const lotOccupantTypeLowerCase = lotOccupantType.toLowerCase()
return cachedLotOccupantTypes.find((currentLotOccupantType) => { return cachedLotOccupantTypes.find(
return ( (currentLotOccupantType) =>
currentLotOccupantType.lotOccupantType.toLowerCase() === currentLotOccupantType.lotOccupantType.toLowerCase() ===
lotOccupantTypeLowerCase lotOccupantTypeLowerCase
) )
})
} }
function clearLotOccupantTypesCache(): void { function clearLotOccupantTypesCache(): void {
@ -86,9 +92,9 @@ export async function getLotStatusById(
): Promise<LotStatus | undefined> { ): Promise<LotStatus | undefined> {
const cachedLotStatuses = await getLotStatuses() const cachedLotStatuses = await getLotStatuses()
return cachedLotStatuses.find((currentLotStatus) => { return cachedLotStatuses.find(
return currentLotStatus.lotStatusId === lotStatusId (currentLotStatus) => currentLotStatus.lotStatusId === lotStatusId
}) )
} }
export async function getLotStatusByLotStatus( export async function getLotStatusByLotStatus(
@ -98,9 +104,10 @@ export async function getLotStatusByLotStatus(
const lotStatusLowerCase = lotStatus.toLowerCase() const lotStatusLowerCase = lotStatus.toLowerCase()
return cachedLotStatuses.find((currentLotStatus) => { return cachedLotStatuses.find(
return currentLotStatus.lotStatus.toLowerCase() === lotStatusLowerCase (currentLotStatus) =>
}) currentLotStatus.lotStatus.toLowerCase() === lotStatusLowerCase
)
} }
function clearLotStatusesCache(): void { function clearLotStatusesCache(): void {
@ -126,9 +133,9 @@ export async function getLotTypeById(
): Promise<LotType | undefined> { ): Promise<LotType | undefined> {
const cachedLotTypes = await getLotTypes() const cachedLotTypes = await getLotTypes()
return cachedLotTypes.find((currentLotType) => { return cachedLotTypes.find(
return currentLotType.lotTypeId === lotTypeId (currentLotType) => currentLotType.lotTypeId === lotTypeId
}) )
} }
export async function getLotTypesByLotType( export async function getLotTypesByLotType(
@ -138,9 +145,10 @@ export async function getLotTypesByLotType(
const lotTypeLowerCase = lotType.toLowerCase() const lotTypeLowerCase = lotType.toLowerCase()
return cachedLotTypes.find((currentLotType) => { return cachedLotTypes.find(
return currentLotType.lotType.toLowerCase() === lotTypeLowerCase (currentLotType) =>
}) currentLotType.lotType.toLowerCase() === lotTypeLowerCase
)
} }
function clearLotTypesCache(): void { function clearLotTypesCache(): void {
@ -176,9 +184,10 @@ export async function getOccupancyTypeById(
): Promise<OccupancyType | undefined> { ): Promise<OccupancyType | undefined> {
const cachedOccupancyTypes = await getOccupancyTypes() const cachedOccupancyTypes = await getOccupancyTypes()
return cachedOccupancyTypes.find((currentOccupancyType) => { return cachedOccupancyTypes.find(
return currentOccupancyType.occupancyTypeId === occupancyTypeId (currentOccupancyType) =>
}) currentOccupancyType.occupancyTypeId === occupancyTypeId
)
} }
export async function getOccupancyTypeByOccupancyType( export async function getOccupancyTypeByOccupancyType(
@ -188,12 +197,11 @@ export async function getOccupancyTypeByOccupancyType(
const occupancyTypeLowerCase = occupancyTypeString.toLowerCase() const occupancyTypeLowerCase = occupancyTypeString.toLowerCase()
return cachedOccupancyTypes.find((currentOccupancyType) => { return cachedOccupancyTypes.find(
return ( (currentOccupancyType) =>
currentOccupancyType.occupancyType.toLowerCase() === currentOccupancyType.occupancyType.toLowerCase() ===
occupancyTypeLowerCase occupancyTypeLowerCase
) )
})
} }
export async function getOccupancyTypePrintsById( export async function getOccupancyTypePrintsById(
@ -239,9 +247,10 @@ export async function getWorkOrderTypeById(
): Promise<WorkOrderType | undefined> { ): Promise<WorkOrderType | undefined> {
const cachedWorkOrderTypes = await getWorkOrderTypes() const cachedWorkOrderTypes = await getWorkOrderTypes()
return cachedWorkOrderTypes.find((currentWorkOrderType) => { return cachedWorkOrderTypes.find(
return currentWorkOrderType.workOrderTypeId === workOrderTypeId (currentWorkOrderType) =>
}) currentWorkOrderType.workOrderTypeId === workOrderTypeId
)
} }
function clearWorkOrderTypesCache(): void { function clearWorkOrderTypesCache(): void {
@ -269,12 +278,11 @@ export async function getWorkOrderMilestoneTypeById(
): Promise<WorkOrderMilestoneType | undefined> { ): Promise<WorkOrderMilestoneType | undefined> {
const cachedWorkOrderMilestoneTypes = await getWorkOrderMilestoneTypes() const cachedWorkOrderMilestoneTypes = await getWorkOrderMilestoneTypes()
return cachedWorkOrderMilestoneTypes.find((currentWorkOrderMilestoneType) => { return cachedWorkOrderMilestoneTypes.find(
return ( (currentWorkOrderMilestoneType) =>
currentWorkOrderMilestoneType.workOrderMilestoneTypeId === currentWorkOrderMilestoneType.workOrderMilestoneTypeId ===
workOrderMilestoneTypeId workOrderMilestoneTypeId
) )
})
} }
export async function getWorkOrderMilestoneTypeByWorkOrderMilestoneType( export async function getWorkOrderMilestoneTypeByWorkOrderMilestoneType(
@ -285,12 +293,11 @@ export async function getWorkOrderMilestoneTypeByWorkOrderMilestoneType(
const workOrderMilestoneTypeLowerCase = const workOrderMilestoneTypeLowerCase =
workOrderMilestoneTypeString.toLowerCase() workOrderMilestoneTypeString.toLowerCase()
return cachedWorkOrderMilestoneTypes.find((currentWorkOrderMilestoneType) => { return cachedWorkOrderMilestoneTypes.find(
return ( (currentWorkOrderMilestoneType) =>
currentWorkOrderMilestoneType.workOrderMilestoneType.toLowerCase() === currentWorkOrderMilestoneType.workOrderMilestoneType.toLowerCase() ===
workOrderMilestoneTypeLowerCase workOrderMilestoneTypeLowerCase
) )
})
} }
export async function preloadCaches(): Promise<void> { export async function preloadCaches(): Promise<void> {
@ -370,14 +377,16 @@ export function clearCacheByTableName(
debug(`Sending clear cache from worker: ${tableName}`) debug(`Sending clear cache from worker: ${tableName}`)
process.send!(workerMessage) if (process.send !== undefined) {
process.send(workerMessage)
}
} }
} catch {} } catch {}
} }
process.on('message', (message: ClearCacheWorkerMessage) => { process.on('message', (message: WorkerMessage) => {
if (message.messageType === 'clearCache' && message.pid !== process.pid) { if (message.messageType === 'clearCache' && message.pid !== process.pid) {
debug(`Clearing cache: ${message.tableName}`) debug(`Clearing cache: ${(message as ClearCacheWorkerMessage).tableName}`)
clearCacheByTableName(message.tableName, false) clearCacheByTableName((message as ClearCacheWorkerMessage).tableName, false)
} }
}) })

View File

@ -1,6 +1,6 @@
/* eslint-disable unicorn/filename-case, @eslint-community/eslint-comments/disable-enable-pair */
import { DynamicsGP } from '@cityssm/dynamics-gp'; import { DynamicsGP } from '@cityssm/dynamics-gp';
import { getConfigProperty } from './functions.config.js'; import { getConfigProperty } from './functions.config.js';
// eslint-disable-next-line @typescript-eslint/init-declarations
let gp; let gp;
if (getConfigProperty('settings.dynamicsGP.integrationIsEnabled')) { if (getConfigProperty('settings.dynamicsGP.integrationIsEnabled')) {
gp = new DynamicsGP(getConfigProperty('settings.dynamicsGP.mssqlConfig')); gp = new DynamicsGP(getConfigProperty('settings.dynamicsGP.mssqlConfig'));
@ -25,9 +25,7 @@ function filterCashReceipt(cashReceipt) {
function filterInvoice(invoice) { function filterInvoice(invoice) {
const itemNumbers = getConfigProperty('settings.dynamicsGP.itemNumbers'); const itemNumbers = getConfigProperty('settings.dynamicsGP.itemNumbers');
for (const itemNumber of itemNumbers) { for (const itemNumber of itemNumbers) {
const found = invoice.lineItems.some((itemRecord) => { const found = invoice.lineItems.some((itemRecord) => itemRecord.itemNumber === itemNumber);
return itemRecord.itemNumber === itemNumber;
});
if (!found) { if (!found) {
return undefined; return undefined;
} }

View File

@ -1,5 +1,3 @@
/* eslint-disable unicorn/filename-case, @eslint-community/eslint-comments/disable-enable-pair */
import { import {
type DiamondCashReceipt, type DiamondCashReceipt,
type DiamondExtendedGPInvoice, type DiamondExtendedGPInvoice,
@ -12,6 +10,7 @@ import type { DynamicsGPDocument } from '../types/recordTypes.js'
import { getConfigProperty } from './functions.config.js' import { getConfigProperty } from './functions.config.js'
// eslint-disable-next-line @typescript-eslint/init-declarations
let gp: DynamicsGP let gp: DynamicsGP
if (getConfigProperty('settings.dynamicsGP.integrationIsEnabled')) { if (getConfigProperty('settings.dynamicsGP.integrationIsEnabled')) {
@ -46,9 +45,7 @@ function filterInvoice(invoice: GPInvoice): GPInvoice | undefined {
const itemNumbers = getConfigProperty('settings.dynamicsGP.itemNumbers') const itemNumbers = getConfigProperty('settings.dynamicsGP.itemNumbers')
for (const itemNumber of itemNumbers) { for (const itemNumber of itemNumbers) {
const found = invoice.lineItems.some((itemRecord) => { const found = invoice.lineItems.some((itemRecord) => itemRecord.itemNumber === itemNumber)
return itemRecord.itemNumber === itemNumber
})
if (!found) { if (!found) {
return undefined return undefined

View File

@ -1,3 +1,3 @@
import type * as recordTypes from '../types/recordTypes'; import type { Fee, LotOccupancy } from '../types/recordTypes.js';
export declare const calculateFeeAmount: (fee: recordTypes.Fee, lotOccupancy: recordTypes.LotOccupancy) => number; export declare function calculateFeeAmount(fee: Fee, lotOccupancy: LotOccupancy): number;
export declare function calculateTaxAmount(fee: recordTypes.Fee, feeAmount: number): number; export declare function calculateTaxAmount(fee: Fee, feeAmount: number): number;

View File

@ -1,6 +1,6 @@
export const calculateFeeAmount = (fee, lotOccupancy) => { export function calculateFeeAmount(fee, lotOccupancy) {
return fee.feeFunction ? 0 : fee.feeAmount ?? 0; return fee.feeFunction ? 0 : fee.feeAmount ?? 0;
}; }
export function calculateTaxAmount(fee, feeAmount) { export function calculateTaxAmount(fee, feeAmount) {
return fee.taxPercentage return fee.taxPercentage
? feeAmount * (fee.taxPercentage / 100) ? feeAmount * (fee.taxPercentage / 100)

View File

@ -1,13 +1,13 @@
import type * as recordTypes from '../types/recordTypes' import type { Fee, LotOccupancy } from '../types/recordTypes.js'
export const calculateFeeAmount = ( export function calculateFeeAmount(
fee: recordTypes.Fee, fee: Fee,
lotOccupancy: recordTypes.LotOccupancy lotOccupancy: LotOccupancy
): number => { ): number {
return fee.feeFunction ? 0 : fee.feeAmount ?? 0 return fee.feeFunction ? 0 : fee.feeAmount ?? 0
} }
export function calculateTaxAmount(fee: recordTypes.Fee, feeAmount: number): number { export function calculateTaxAmount(fee: Fee, feeAmount: number): number {
return fee.taxPercentage return fee.taxPercentage
? feeAmount * (fee.taxPercentage / 100) ? feeAmount * (fee.taxPercentage / 100)
: fee.taxAmount ?? 0 : fee.taxAmount ?? 0

16
package-lock.json generated
View File

@ -42,7 +42,7 @@
"randomcolor": "^0.6.2", "randomcolor": "^0.6.2",
"session-file-store": "^1.5.0", "session-file-store": "^1.5.0",
"set-interval-async": "^3.0.3", "set-interval-async": "^3.0.3",
"uuid": "^11.0.1" "uuid": "^11.0.2"
}, },
"devDependencies": { "devDependencies": {
"@cityssm/bulma-a11y": "^0.4.0", "@cityssm/bulma-a11y": "^0.4.0",
@ -80,7 +80,7 @@
"bulma-tooltip": "^3.0.2", "bulma-tooltip": "^3.0.2",
"cypress": "^13.15.1", "cypress": "^13.15.1",
"cypress-axe": "^1.5.0", "cypress-axe": "^1.5.0",
"eslint-config-cityssm": "^14.0.0", "eslint-config-cityssm": "^14.0.1",
"gulp": "^5.0.0", "gulp": "^5.0.0",
"gulp-sass": "^5.1.0", "gulp-sass": "^5.1.0",
"nodemon": "^3.1.7", "nodemon": "^3.1.7",
@ -8120,9 +8120,9 @@
} }
}, },
"node_modules/eslint-config-cityssm": { "node_modules/eslint-config-cityssm": {
"version": "14.0.0", "version": "14.0.1",
"resolved": "https://registry.npmjs.org/eslint-config-cityssm/-/eslint-config-cityssm-14.0.0.tgz", "resolved": "https://registry.npmjs.org/eslint-config-cityssm/-/eslint-config-cityssm-14.0.1.tgz",
"integrity": "sha512-RLS0mniIK2r5evcqpcYq41SdVxRAy1h37Y3nr1OnqAVc3TWPlcB+HNj/nad9ovfm9NsXWCWKINYO63/BVNjgfg==", "integrity": "sha512-pmqsNjS0cxznslzhZeihz1iGSOe/4LgJZdJzi7D8R3KE3N6dDSxiIay0T+q2u8BgmZJJwmmvrL6Qlk0924mNyA==",
"dev": true, "dev": true,
"license": "Unlicense", "license": "Unlicense",
"dependencies": { "dependencies": {
@ -16370,9 +16370,9 @@
} }
}, },
"node_modules/uuid": { "node_modules/uuid": {
"version": "11.0.1", "version": "11.0.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-11.0.1.tgz", "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.0.2.tgz",
"integrity": "sha512-wt9UB5EcLhnboy1UvA1mvGPXkIIrHSu+3FmUksARfdVw9tuPf3CH/CohxO0Su1ApoKAeT6BVzAJIvjTuQVSmuQ==", "integrity": "sha512-14FfcOJmqdjbBPdDjFQyk/SdT4NySW4eM0zcG+HqbHP5jzuH56xO3J1DGhgs/cEMCfwYi3HQI1gnTO62iaG+tQ==",
"funding": [ "funding": [
"https://github.com/sponsors/broofa", "https://github.com/sponsors/broofa",
"https://github.com/sponsors/ctavan" "https://github.com/sponsors/ctavan"

View File

@ -66,7 +66,7 @@
"randomcolor": "^0.6.2", "randomcolor": "^0.6.2",
"session-file-store": "^1.5.0", "session-file-store": "^1.5.0",
"set-interval-async": "^3.0.3", "set-interval-async": "^3.0.3",
"uuid": "^11.0.1" "uuid": "^11.0.2"
}, },
"devDependencies": { "devDependencies": {
"@cityssm/bulma-a11y": "^0.4.0", "@cityssm/bulma-a11y": "^0.4.0",
@ -104,7 +104,7 @@
"bulma-tooltip": "^3.0.2", "bulma-tooltip": "^3.0.2",
"cypress": "^13.15.1", "cypress": "^13.15.1",
"cypress-axe": "^1.5.0", "cypress-axe": "^1.5.0",
"eslint-config-cityssm": "^14.0.0", "eslint-config-cityssm": "^14.0.1",
"gulp": "^5.0.0", "gulp": "^5.0.0",
"gulp-sass": "^5.1.0", "gulp-sass": "^5.1.0",
"nodemon": "^3.1.7", "nodemon": "^3.1.7",

View File

@ -1,6 +1,4 @@
"use strict"; "use strict";
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
(() => { (() => {
const los = exports.los; const los = exports.los;

View File

@ -1,6 +1,3 @@
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
import type { BulmaJS } from '@cityssm/bulma-js/types.js' import type { BulmaJS } from '@cityssm/bulma-js/types.js'
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js' import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'

View File

@ -1,6 +1,4 @@
"use strict"; "use strict";
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
(() => { (() => {
const los = exports.los; const los = exports.los;
@ -273,7 +271,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
const containerElement = document.querySelector('#container--workOrderMilestoneTypes'); const containerElement = document.querySelector('#container--workOrderMilestoneTypes');
if (workOrderMilestoneTypes.length === 0) { if (workOrderMilestoneTypes.length === 0) {
containerElement.innerHTML = `<tr><td colspan="2"> containerElement.innerHTML = `<tr><td colspan="2">
<div class="message is-warning"><p class="message-body">There are no active work order milestone types.</p></div> <div class="message is-warning">
<p class="message-body">There are no active work order milestone types.</p>
</div>
</td></tr>`; </td></tr>`;
return; return;
} }
@ -438,7 +438,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
if (lotStatuses.length === 0) { if (lotStatuses.length === 0) {
// eslint-disable-next-line no-unsanitized/property // eslint-disable-next-line no-unsanitized/property
containerElement.innerHTML = `<tr><td colspan="2"> containerElement.innerHTML = `<tr><td colspan="2">
<div class="message is-warning"><p class="message-body">There are no active ${los.escapedAliases.lot} statuses.</p></div> <div class="message is-warning">
<p class="message-body">There are no active ${los.escapedAliases.lot} statuses.</p>
</div>
</td></tr>`; </td></tr>`;
return; return;
} }

View File

@ -1,6 +1,3 @@
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
import type { BulmaJS } from '@cityssm/bulma-js/types.js' import type { BulmaJS } from '@cityssm/bulma-js/types.js'
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js' import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
@ -413,7 +410,9 @@ declare const bulmaJS: BulmaJS
if (workOrderMilestoneTypes.length === 0) { if (workOrderMilestoneTypes.length === 0) {
containerElement.innerHTML = `<tr><td colspan="2"> containerElement.innerHTML = `<tr><td colspan="2">
<div class="message is-warning"><p class="message-body">There are no active work order milestone types.</p></div> <div class="message is-warning">
<p class="message-body">There are no active work order milestone types.</p>
</div>
</td></tr>` </td></tr>`
return return
@ -654,7 +653,9 @@ declare const bulmaJS: BulmaJS
if (lotStatuses.length === 0) { if (lotStatuses.length === 0) {
// eslint-disable-next-line no-unsanitized/property // eslint-disable-next-line no-unsanitized/property
containerElement.innerHTML = `<tr><td colspan="2"> containerElement.innerHTML = `<tr><td colspan="2">
<div class="message is-warning"><p class="message-body">There are no active ${los.escapedAliases.lot} statuses.</p></div> <div class="message is-warning">
<p class="message-body">There are no active ${los.escapedAliases.lot} statuses.</p>
</div>
</td></tr>` </td></tr>`
return return

View File

@ -1,6 +1,4 @@
"use strict"; "use strict";
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
(() => { (() => {
const los = exports.los; const los = exports.los;

View File

@ -1,6 +1,3 @@
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
import type { LOS } from '../../types/globalTypes.js' import type { LOS } from '../../types/globalTypes.js'
declare const exports: Record<string, unknown> declare const exports: Record<string, unknown>

View File

@ -28,7 +28,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
if (responseJSON.success) { if (responseJSON.success) {
clearUnsavedChanges(); clearUnsavedChanges();
if (isCreate || refreshAfterSave) { if (isCreate || refreshAfterSave) {
window.location.href = los.getLotOccupancyURL(responseJSON.lotOccupancyId, true, true); globalThis.location.href = los.getLotOccupancyURL(responseJSON.lotOccupancyId, true, true);
} }
else { else {
bulmaJS.alert({ bulmaJS.alert({
@ -57,7 +57,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
const responseJSON = rawResponseJSON; const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
clearUnsavedChanges(); clearUnsavedChanges();
window.location.href = los.getLotOccupancyURL(responseJSON.lotOccupancyId, true); globalThis.location.href = los.getLotOccupancyURL(responseJSON.lotOccupancyId, true);
} }
else { else {
bulmaJS.alert({ bulmaJS.alert({
@ -102,7 +102,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
const responseJSON = rawResponseJSON; const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
clearUnsavedChanges(); clearUnsavedChanges();
window.location.href = los.getLotOccupancyURL(); globalThis.location.href = los.getLotOccupancyURL();
} }
else { else {
bulmaJS.alert({ bulmaJS.alert({
@ -141,7 +141,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
okButton: { okButton: {
text: 'Yes, Open the Work Order', text: 'Yes, Open the Work Order',
callbackFunction: () => { callbackFunction: () => {
window.location.href = los.getWorkOrderURL(responseJSON.workOrderId, true); globalThis.location.href = los.getWorkOrderURL(responseJSON.workOrderId, true);
} }
} }
}); });
@ -1519,7 +1519,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
}); });
} }
bulmaJS.confirm({ bulmaJS.confirm({
title: 'Delete Trasnaction', title: 'Delete Transaction',
message: 'Are you sure you want to delete this transaction?', message: 'Are you sure you want to delete this transaction?',
contextualColorName: 'warning', contextualColorName: 'warning',
okButton: { okButton: {

View File

@ -71,7 +71,7 @@ declare const exports: Record<string, unknown>
clearUnsavedChanges() clearUnsavedChanges()
if (isCreate || refreshAfterSave) { if (isCreate || refreshAfterSave) {
window.location.href = los.getLotOccupancyURL( globalThis.location.href = los.getLotOccupancyURL(
responseJSON.lotOccupancyId, responseJSON.lotOccupancyId,
true, true,
true true
@ -115,7 +115,7 @@ declare const exports: Record<string, unknown>
if (responseJSON.success) { if (responseJSON.success) {
clearUnsavedChanges() clearUnsavedChanges()
window.location.href = los.getLotOccupancyURL( globalThis.location.href = los.getLotOccupancyURL(
responseJSON.lotOccupancyId, responseJSON.lotOccupancyId,
true true
) )
@ -173,7 +173,7 @@ declare const exports: Record<string, unknown>
if (responseJSON.success) { if (responseJSON.success) {
clearUnsavedChanges() clearUnsavedChanges()
window.location.href = los.getLotOccupancyURL() globalThis.location.href = los.getLotOccupancyURL()
} else { } else {
bulmaJS.alert({ bulmaJS.alert({
title: 'Error Deleting Record', title: 'Error Deleting Record',
@ -226,7 +226,7 @@ declare const exports: Record<string, unknown>
okButton: { okButton: {
text: 'Yes, Open the Work Order', text: 'Yes, Open the Work Order',
callbackFunction: () => { callbackFunction: () => {
window.location.href = los.getWorkOrderURL( globalThis.location.href = los.getWorkOrderURL(
responseJSON.workOrderId, responseJSON.workOrderId,
true true
) )
@ -2474,7 +2474,7 @@ declare const exports: Record<string, unknown>
} }
bulmaJS.confirm({ bulmaJS.confirm({
title: 'Delete Trasnaction', title: 'Delete Transaction',
message: 'Are you sure you want to delete this transaction?', message: 'Are you sure you want to delete this transaction?',
contextualColorName: 'warning', contextualColorName: 'warning',
okButton: { okButton: {

View File

@ -1,6 +1,4 @@
"use strict"; "use strict";
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
(() => { (() => {
const los = exports.los; const los = exports.los;
@ -52,14 +50,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
${cityssm.escapeHTML(occupant.occupantFamilyName ?? '')} ${cityssm.escapeHTML(occupant.occupantFamilyName ?? '')}
</li>`; </li>`;
} }
const feeTotal = (lotOccupancy.lotOccupancyFees?.reduce((soFar, currentFee) => { const feeTotal = (lotOccupancy.lotOccupancyFees?.reduce((soFar, currentFee) => soFar +
return (soFar +
((currentFee.feeAmount ?? 0) + (currentFee.taxAmount ?? 0)) * ((currentFee.feeAmount ?? 0) + (currentFee.taxAmount ?? 0)) *
(currentFee.quantity ?? 0)); (currentFee.quantity ?? 0), 0) ?? 0).toFixed(2);
}, 0) ?? 0).toFixed(2); const transactionTotal = (lotOccupancy.lotOccupancyTransactions?.reduce((soFar, currentTransaction) => soFar + currentTransaction.transactionAmount, 0) ?? 0).toFixed(2);
const transactionTotal = (lotOccupancy.lotOccupancyTransactions?.reduce((soFar, currentTransaction) => {
return soFar + currentTransaction.transactionAmount;
}, 0) ?? 0).toFixed(2);
let feeIconHTML = ''; let feeIconHTML = '';
if (feeTotal !== '0.00' || transactionTotal !== '0.00') { if (feeTotal !== '0.00' || transactionTotal !== '0.00') {
feeIconHTML = `<span class="icon" feeIconHTML = `<span class="icon"

View File

@ -1,6 +1,3 @@
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js' import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
import type { LOS } from '../../types/globalTypes.js' import type { LOS } from '../../types/globalTypes.js'
@ -89,20 +86,19 @@ declare const exports: Record<string, unknown>
} }
const feeTotal = ( const feeTotal = (
lotOccupancy.lotOccupancyFees?.reduce((soFar, currentFee): number => { lotOccupancy.lotOccupancyFees?.reduce(
return ( (soFar, currentFee): number =>
soFar + soFar +
((currentFee.feeAmount ?? 0) + (currentFee.taxAmount ?? 0)) * ((currentFee.feeAmount ?? 0) + (currentFee.taxAmount ?? 0)) *
(currentFee.quantity ?? 0) (currentFee.quantity ?? 0),
) 0
}, 0) ?? 0 ) ?? 0
).toFixed(2) ).toFixed(2)
const transactionTotal = ( const transactionTotal = (
lotOccupancy.lotOccupancyTransactions?.reduce( lotOccupancy.lotOccupancyTransactions?.reduce(
(soFar, currentTransaction): number => { (soFar, currentTransaction): number =>
return soFar + currentTransaction.transactionAmount soFar + currentTransaction.transactionAmount,
},
0 0
) ?? 0 ) ?? 0
).toFixed(2) ).toFixed(2)

View File

@ -1,6 +1,4 @@
"use strict"; "use strict";
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
(() => { (() => {
const los = exports.los; const los = exports.los;

View File

@ -1,6 +1,3 @@
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js' import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
import type { LOS } from '../../types/globalTypes.js' import type { LOS } from '../../types/globalTypes.js'
@ -28,7 +25,7 @@ declare const exports: Record<string, unknown>
'#searchFilter--offset' '#searchFilter--offset'
) as HTMLInputElement ) as HTMLInputElement
function renderLots(rawResponseJSON): void { function renderLots(rawResponseJSON: unknown): void {
const responseJSON = rawResponseJSON as { const responseJSON = rawResponseJSON as {
count: number count: number
offset: number offset: number

View File

@ -1,6 +1,4 @@
"use strict"; "use strict";
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
(() => { (() => {
const mapContainerElement = document.querySelector('#lot--map'); const mapContainerElement = document.querySelector('#lot--map');

View File

@ -1,6 +1,3 @@
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
import type { LOS } from '../../types/globalTypes.js' import type { LOS } from '../../types/globalTypes.js'
declare const exports: Record<string, unknown> declare const exports: Record<string, unknown>

View File

@ -1,6 +1,4 @@
"use strict"; "use strict";
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
(() => { (() => {
/* /*
@ -36,12 +34,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
svgId = svgId.slice(0, Math.max(0, svgId.lastIndexOf('-'))); svgId = svgId.slice(0, Math.max(0, svgId.lastIndexOf('-')));
} }
if (svgElementToHighlight !== null) { if (svgElementToHighlight !== null) {
// eslint-disable-next-line unicorn/no-null
svgElementToHighlight.style.fill = ''; svgElementToHighlight.style.fill = '';
svgElementToHighlight.classList.add('highlight', `is-${contextualClass}`); svgElementToHighlight.classList.add('highlight', `is-${contextualClass}`);
const childPathElements = svgElementToHighlight.querySelectorAll('path'); const childPathElements = svgElementToHighlight.querySelectorAll('path');
for (const pathElement of childPathElements) { for (const pathElement of childPathElements) {
// eslint-disable-next-line unicorn/no-null
pathElement.style.fill = ''; pathElement.style.fill = '';
} }
} }
@ -83,7 +79,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
function initializeDatePickers(containerElement) { function initializeDatePickers(containerElement) {
const dateElements = containerElement.querySelectorAll("input[type='date']"); const dateElements = containerElement.querySelectorAll("input[type='date']");
for (const dateElement of dateElements) { for (const dateElement of dateElements) {
const datePickerOptions = Object.assign({}, datePickerBaseOptions); const datePickerOptions = { ...datePickerBaseOptions };
if (dateElement.required) { if (dateElement.required) {
datePickerOptions.showClearButton = false; datePickerOptions.showClearButton = false;
} }

View File

@ -1,6 +1,3 @@
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
import type { BulmaJS } from '@cityssm/bulma-js/types.js' import type { BulmaJS } from '@cityssm/bulma-js/types.js'
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js' import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
import type { Options as BulmaCalendarOptions } from 'bulma-calendar' import type { Options as BulmaCalendarOptions } from 'bulma-calendar'
@ -79,14 +76,12 @@ declare const exports: Record<string, unknown> & {
} }
if (svgElementToHighlight !== null) { if (svgElementToHighlight !== null) {
// eslint-disable-next-line unicorn/no-null
svgElementToHighlight.style.fill = '' svgElementToHighlight.style.fill = ''
svgElementToHighlight.classList.add('highlight', `is-${contextualClass}`) svgElementToHighlight.classList.add('highlight', `is-${contextualClass}`)
const childPathElements = svgElementToHighlight.querySelectorAll('path') const childPathElements = svgElementToHighlight.querySelectorAll('path')
for (const pathElement of childPathElements) { for (const pathElement of childPathElements) {
// eslint-disable-next-line unicorn/no-null
pathElement.style.fill = '' pathElement.style.fill = ''
} }
} }
@ -144,7 +139,7 @@ declare const exports: Record<string, unknown> & {
containerElement.querySelectorAll("input[type='date']") containerElement.querySelectorAll("input[type='date']")
for (const dateElement of dateElements) { for (const dateElement of dateElements) {
const datePickerOptions = Object.assign({}, datePickerBaseOptions) const datePickerOptions = { ...datePickerBaseOptions }
if (dateElement.required) { if (dateElement.required) {
datePickerOptions.showClearButton = false datePickerOptions.showClearButton = false

View File

@ -1,6 +1,4 @@
"use strict"; "use strict";
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
(() => { (() => {
const los = exports.los; const los = exports.los;
@ -27,7 +25,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
if (responseJSON.success) { if (responseJSON.success) {
clearUnsavedChanges(); clearUnsavedChanges();
if (isCreate) { if (isCreate) {
window.location.href = los.getMapURL(responseJSON.mapId, true); globalThis.location.href = los.getMapURL(responseJSON.mapId, true);
} }
else { else {
bulmaJS.alert({ bulmaJS.alert({
@ -60,7 +58,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
}, (rawResponseJSON) => { }, (rawResponseJSON) => {
const responseJSON = rawResponseJSON; const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
window.location.href = los.getMapURL(); globalThis.location.href = los.getMapURL();
} }
else { else {
bulmaJS.alert({ bulmaJS.alert({

View File

@ -1,6 +1,3 @@
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
import type { BulmaJS } from '@cityssm/bulma-js/types.js' import type { BulmaJS } from '@cityssm/bulma-js/types.js'
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js' import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
@ -50,7 +47,7 @@ declare const exports: Record<string, unknown>
clearUnsavedChanges() clearUnsavedChanges()
if (isCreate) { if (isCreate) {
window.location.href = los.getMapURL(responseJSON.mapId, true) globalThis.location.href = los.getMapURL(responseJSON.mapId, true)
} else { } else {
bulmaJS.alert({ bulmaJS.alert({
message: `${los.escapedAliases.Map} Updated Successfully`, message: `${los.escapedAliases.Map} Updated Successfully`,
@ -95,7 +92,7 @@ declare const exports: Record<string, unknown>
} }
if (responseJSON.success) { if (responseJSON.success) {
window.location.href = los.getMapURL() globalThis.location.href = los.getMapURL()
} else { } else {
bulmaJS.alert({ bulmaJS.alert({
title: `Error Deleting ${los.escapedAliases.Map}`, title: `Error Deleting ${los.escapedAliases.Map}`,

View File

@ -1,6 +1,4 @@
"use strict"; "use strict";
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
(() => { (() => {
const los = exports.los; const los = exports.los;

View File

@ -1,6 +1,3 @@
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js' import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
import type { LOS } from '../../types/globalTypes.js' import type { LOS } from '../../types/globalTypes.js'

View File

@ -1,5 +1,3 @@
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
; ;
(() => { (() => {
const menuTabElements = document.querySelectorAll('.menu a'); const menuTabElements = document.querySelectorAll('.menu a');

View File

@ -1,6 +1,3 @@
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
;(() => { ;(() => {
const menuTabElements: NodeListOf<HTMLAnchorElement> = const menuTabElements: NodeListOf<HTMLAnchorElement> =
document.querySelectorAll('.menu a') document.querySelectorAll('.menu a')

View File

@ -1,6 +1,4 @@
"use strict"; "use strict";
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
(() => { (() => {
const los = exports.los; const los = exports.los;
@ -30,7 +28,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
if (responseJSON.success) { if (responseJSON.success) {
clearUnsavedChanges(); clearUnsavedChanges();
if (isCreate) { if (isCreate) {
window.location.href = los.getWorkOrderURL(responseJSON.workOrderId, true); globalThis.location.href = los.getWorkOrderURL(responseJSON.workOrderId, true);
} }
else { else {
bulmaJS.alert({ bulmaJS.alert({
@ -62,7 +60,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
const responseJSON = rawResponseJSON; const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
clearUnsavedChanges(); clearUnsavedChanges();
window.location.href = los.getWorkOrderURL(workOrderId); globalThis.location.href = los.getWorkOrderURL(workOrderId);
} }
else { else {
bulmaJS.alert({ bulmaJS.alert({
@ -80,7 +78,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
const responseJSON = rawResponseJSON; const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
clearUnsavedChanges(); clearUnsavedChanges();
window.location.href = `${los.urlPrefix}/workOrders`; globalThis.location.href = `${los.urlPrefix}/workOrders`;
} }
else { else {
bulmaJS.alert({ bulmaJS.alert({
@ -95,9 +93,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
document document
.querySelector('#button--closeWorkOrder') .querySelector('#button--closeWorkOrder')
?.addEventListener('click', () => { ?.addEventListener('click', () => {
const hasOpenMilestones = workOrderMilestones.some((milestone) => { const hasOpenMilestones = workOrderMilestones.some((milestone) => !milestone.workOrderMilestoneCompletionDate);
return !milestone.workOrderMilestoneCompletionDate;
});
if (hasOpenMilestones) { if (hasOpenMilestones) {
bulmaJS.alert({ bulmaJS.alert({
title: 'Outstanding Milestones', title: 'Outstanding Milestones',
@ -268,9 +264,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
const isActive = !(lotOccupancy.occupancyEndDate && const isActive = !(lotOccupancy.occupancyEndDate &&
lotOccupancy.occupancyEndDateString < currentDateString); lotOccupancy.occupancyEndDateString < currentDateString);
const hasLotRecord = lotOccupancy.lotId && const hasLotRecord = lotOccupancy.lotId &&
workOrderLots.some((lot) => { workOrderLots.some((lot) => lotOccupancy.lotId === lot.lotId);
return lotOccupancy.lotId === lot.lotId;
});
// eslint-disable-next-line no-unsanitized/property // eslint-disable-next-line no-unsanitized/property
rowElement.innerHTML = `<td class="is-width-1 has-text-centered"> rowElement.innerHTML = `<td class="is-width-1 has-text-centered">
${isActive ${isActive
@ -340,9 +334,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
} }
function openEditLotStatus(clickEvent) { function openEditLotStatus(clickEvent) {
const lotId = Number.parseInt(clickEvent.currentTarget.closest('.container--lot').dataset.lotId ?? '', 10); const lotId = Number.parseInt(clickEvent.currentTarget.closest('.container--lot').dataset.lotId ?? '', 10);
const lot = workOrderLots.find((possibleLot) => { const lot = workOrderLots.find((possibleLot) => possibleLot.lotId === lotId);
return possibleLot.lotId === lotId;
});
let editCloseModalFunction; let editCloseModalFunction;
function doUpdateLotStatus(submitEvent) { function doUpdateLotStatus(submitEvent) {
submitEvent.preventDefault(); submitEvent.preventDefault();
@ -716,9 +708,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
function openEditWorkOrderComment(clickEvent) { function openEditWorkOrderComment(clickEvent) {
const workOrderCommentId = Number.parseInt(clickEvent.currentTarget.closest('tr')?.dataset const workOrderCommentId = Number.parseInt(clickEvent.currentTarget.closest('tr')?.dataset
.workOrderCommentId ?? '', 10); .workOrderCommentId ?? '', 10);
const workOrderComment = workOrderComments.find((currentComment) => { const workOrderComment = workOrderComments.find((currentComment) => currentComment.workOrderCommentId === workOrderCommentId);
return currentComment.workOrderCommentId === workOrderCommentId;
});
let editFormElement; let editFormElement;
let editCloseModalFunction; let editCloseModalFunction;
function editComment(submitEvent) { function editComment(submitEvent) {
@ -814,7 +804,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
<th>Commentor</th> <th>Commentor</th>
<th>Comment Date</th> <th>Comment Date</th>
<th>Comment</th> <th>Comment</th>
<th class="is-hidden-print"><span class="is-sr-only">Options</span></th></tr></thead><tbody></tbody>`; <th class="is-hidden-print"><span class="is-sr-only">Options</span></th>
</tr></thead>
<tbody></tbody>`;
for (const workOrderComment of workOrderComments) { for (const workOrderComment of workOrderComments) {
const tableRowElement = document.createElement('tr'); const tableRowElement = document.createElement('tr');
tableRowElement.dataset.workOrderCommentId = tableRowElement.dataset.workOrderCommentId =
@ -910,9 +902,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
workOrderMilestoneDateString workOrderMilestoneDateString
}, (rawResponseJSON) => { }, (rawResponseJSON) => {
const responseJSON = rawResponseJSON; const responseJSON = rawResponseJSON;
const workOrderMilestones = responseJSON.workOrderMilestones.filter((possibleMilestone) => { const workOrderMilestones = responseJSON.workOrderMilestones.filter((possibleMilestone) => possibleMilestone.workOrderId.toString() !== workOrderId);
return possibleMilestone.workOrderId.toString() !== workOrderId;
});
clearPanelBlockElements(targetPanelElement); clearPanelBlockElements(targetPanelElement);
for (const milestone of workOrderMilestones) { for (const milestone of workOrderMilestones) {
targetPanelElement.insertAdjacentHTML('beforeend', `<div class="panel-block is-block"> targetPanelElement.insertAdjacentHTML('beforeend', `<div class="panel-block is-block">
@ -960,9 +950,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
clickEvent.preventDefault(); clickEvent.preventDefault();
const currentDateString = cityssm.dateToString(new Date()); const currentDateString = cityssm.dateToString(new Date());
const workOrderMilestoneId = Number.parseInt(clickEvent.currentTarget.closest('.container--milestone').dataset.workOrderMilestoneId ?? '', 10); const workOrderMilestoneId = Number.parseInt(clickEvent.currentTarget.closest('.container--milestone').dataset.workOrderMilestoneId ?? '', 10);
const workOrderMilestone = workOrderMilestones.find((currentMilestone) => { const workOrderMilestone = workOrderMilestones.find((currentMilestone) => currentMilestone.workOrderMilestoneId === workOrderMilestoneId);
return currentMilestone.workOrderMilestoneId === workOrderMilestoneId;
});
function doComplete() { function doComplete() {
cityssm.postJSON(`${los.urlPrefix}/workOrders/doCompleteWorkOrderMilestone`, { cityssm.postJSON(`${los.urlPrefix}/workOrders/doCompleteWorkOrderMilestone`, {
workOrderId, workOrderId,
@ -1026,9 +1014,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
function editMilestone(clickEvent) { function editMilestone(clickEvent) {
clickEvent.preventDefault(); clickEvent.preventDefault();
const workOrderMilestoneId = Number.parseInt(clickEvent.currentTarget.closest('.container--milestone').dataset.workOrderMilestoneId ?? '', 10); const workOrderMilestoneId = Number.parseInt(clickEvent.currentTarget.closest('.container--milestone').dataset.workOrderMilestoneId ?? '', 10);
const workOrderMilestone = workOrderMilestones.find((currentMilestone) => { const workOrderMilestone = workOrderMilestones.find((currentMilestone) => currentMilestone.workOrderMilestoneId === workOrderMilestoneId);
return currentMilestone.workOrderMilestoneId === workOrderMilestoneId;
});
let editCloseModalFunction; let editCloseModalFunction;
let workOrderMilestoneDateStringElement; let workOrderMilestoneDateStringElement;
function doEdit(submitEvent) { function doEdit(submitEvent) {

View File

@ -1,6 +1,3 @@
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
import type { BulmaJS } from '@cityssm/bulma-js/types.js' import type { BulmaJS } from '@cityssm/bulma-js/types.js'
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js' import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
@ -69,7 +66,7 @@ declare const exports: Record<string, unknown>
clearUnsavedChanges() clearUnsavedChanges()
if (isCreate) { if (isCreate) {
window.location.href = los.getWorkOrderURL( globalThis.location.href = los.getWorkOrderURL(
responseJSON.workOrderId, responseJSON.workOrderId,
true true
) )
@ -116,7 +113,7 @@ declare const exports: Record<string, unknown>
if (responseJSON.success) { if (responseJSON.success) {
clearUnsavedChanges() clearUnsavedChanges()
window.location.href = los.getWorkOrderURL(workOrderId) globalThis.location.href = los.getWorkOrderURL(workOrderId)
} else { } else {
bulmaJS.alert({ bulmaJS.alert({
title: 'Error Closing Work Order', title: 'Error Closing Work Order',
@ -142,7 +139,7 @@ declare const exports: Record<string, unknown>
if (responseJSON.success) { if (responseJSON.success) {
clearUnsavedChanges() clearUnsavedChanges()
window.location.href = `${los.urlPrefix}/workOrders` globalThis.location.href = `${los.urlPrefix}/workOrders`
} else { } else {
bulmaJS.alert({ bulmaJS.alert({
title: 'Error Deleting Work Order', title: 'Error Deleting Work Order',
@ -159,9 +156,9 @@ declare const exports: Record<string, unknown>
document document
.querySelector('#button--closeWorkOrder') .querySelector('#button--closeWorkOrder')
?.addEventListener('click', () => { ?.addEventListener('click', () => {
const hasOpenMilestones = workOrderMilestones.some((milestone) => { const hasOpenMilestones = workOrderMilestones.some(
return !milestone.workOrderMilestoneCompletionDate (milestone) => !milestone.workOrderMilestoneCompletionDate
}) )
if (hasOpenMilestones) { if (hasOpenMilestones) {
bulmaJS.alert({ bulmaJS.alert({
@ -398,9 +395,7 @@ declare const exports: Record<string, unknown>
const hasLotRecord = const hasLotRecord =
lotOccupancy.lotId && lotOccupancy.lotId &&
workOrderLots.some((lot) => { workOrderLots.some((lot) => lotOccupancy.lotId === lot.lotId)
return lotOccupancy.lotId === lot.lotId
})
// eslint-disable-next-line no-unsanitized/property // eslint-disable-next-line no-unsanitized/property
rowElement.innerHTML = `<td class="is-width-1 has-text-centered"> rowElement.innerHTML = `<td class="is-width-1 has-text-centered">
@ -505,9 +500,9 @@ declare const exports: Record<string, unknown>
10 10
) )
const lot = workOrderLots.find((possibleLot) => { const lot = workOrderLots.find(
return possibleLot.lotId === lotId (possibleLot) => possibleLot.lotId === lotId
}) as Lot ) as Lot
let editCloseModalFunction: () => void let editCloseModalFunction: () => void
@ -1078,9 +1073,10 @@ declare const exports: Record<string, unknown>
10 10
) )
const workOrderComment = workOrderComments.find((currentComment) => { const workOrderComment = workOrderComments.find(
return currentComment.workOrderCommentId === workOrderCommentId (currentComment) =>
}) as WorkOrderComment currentComment.workOrderCommentId === workOrderCommentId
) as WorkOrderComment
let editFormElement: HTMLFormElement let editFormElement: HTMLFormElement
let editCloseModalFunction: () => void let editCloseModalFunction: () => void
@ -1237,7 +1233,9 @@ declare const exports: Record<string, unknown>
<th>Commentor</th> <th>Commentor</th>
<th>Comment Date</th> <th>Comment Date</th>
<th>Comment</th> <th>Comment</th>
<th class="is-hidden-print"><span class="is-sr-only">Options</span></th></tr></thead><tbody></tbody>` <th class="is-hidden-print"><span class="is-sr-only">Options</span></th>
</tr></thead>
<tbody></tbody>`
for (const workOrderComment of workOrderComments) { for (const workOrderComment of workOrderComments) {
const tableRowElement = document.createElement('tr') const tableRowElement = document.createElement('tr')
@ -1389,9 +1387,8 @@ declare const exports: Record<string, unknown>
} }
const workOrderMilestones = responseJSON.workOrderMilestones.filter( const workOrderMilestones = responseJSON.workOrderMilestones.filter(
(possibleMilestone) => { (possibleMilestone) =>
return possibleMilestone.workOrderId.toString() !== workOrderId possibleMilestone.workOrderId.toString() !== workOrderId
}
) )
clearPanelBlockElements(targetPanelElement) clearPanelBlockElements(targetPanelElement)
@ -1466,9 +1463,10 @@ declare const exports: Record<string, unknown>
10 10
) )
const workOrderMilestone = workOrderMilestones.find((currentMilestone) => { const workOrderMilestone = workOrderMilestones.find(
return currentMilestone.workOrderMilestoneId === workOrderMilestoneId (currentMilestone) =>
}) as WorkOrderMilestone currentMilestone.workOrderMilestoneId === workOrderMilestoneId
) as WorkOrderMilestone
function doComplete(): void { function doComplete(): void {
cityssm.postJSON( cityssm.postJSON(
@ -1575,9 +1573,10 @@ declare const exports: Record<string, unknown>
10 10
) )
const workOrderMilestone = workOrderMilestones.find((currentMilestone) => { const workOrderMilestone = workOrderMilestones.find(
return currentMilestone.workOrderMilestoneId === workOrderMilestoneId (currentMilestone) =>
}) as WorkOrderMilestone currentMilestone.workOrderMilestoneId === workOrderMilestoneId
) as WorkOrderMilestone
let editCloseModalFunction: () => void let editCloseModalFunction: () => void
let workOrderMilestoneDateStringElement: HTMLInputElement let workOrderMilestoneDateStringElement: HTMLInputElement

View File

@ -1,6 +1,4 @@
"use strict"; "use strict";
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
(() => { (() => {
const los = exports.los; const los = exports.los;

View File

@ -1,6 +1,3 @@
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js' import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
import type { LOS } from '../../types/globalTypes.js' import type { LOS } from '../../types/globalTypes.js'

View File

@ -1,6 +1,4 @@
"use strict"; "use strict";
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
(() => { (() => {
const los = exports.los; const los = exports.los;

View File

@ -1,6 +1,3 @@
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
import type { BulmaJS } from '@cityssm/bulma-js/types.js' import type { BulmaJS } from '@cityssm/bulma-js/types.js'
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js' import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'