linting
parent
92a77c1d3e
commit
e849f5989a
|
|
@ -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 Debug from 'debug';
|
||||
import getLotOccupantTypesFromDatabase from '../database/getLotOccupantTypes.js';
|
||||
|
|
@ -21,17 +23,13 @@ export async function getLotOccupantTypes() {
|
|||
}
|
||||
export async function getLotOccupantTypeById(lotOccupantTypeId) {
|
||||
const cachedLotOccupantTypes = await getLotOccupantTypes();
|
||||
return cachedLotOccupantTypes.find((currentLotOccupantType) => {
|
||||
return currentLotOccupantType.lotOccupantTypeId === lotOccupantTypeId;
|
||||
});
|
||||
return cachedLotOccupantTypes.find((currentLotOccupantType) => currentLotOccupantType.lotOccupantTypeId === lotOccupantTypeId);
|
||||
}
|
||||
export async function getLotOccupantTypeByLotOccupantType(lotOccupantType) {
|
||||
const cachedLotOccupantTypes = await getLotOccupantTypes();
|
||||
const lotOccupantTypeLowerCase = lotOccupantType.toLowerCase();
|
||||
return cachedLotOccupantTypes.find((currentLotOccupantType) => {
|
||||
return (currentLotOccupantType.lotOccupantType.toLowerCase() ===
|
||||
return cachedLotOccupantTypes.find((currentLotOccupantType) => currentLotOccupantType.lotOccupantType.toLowerCase() ===
|
||||
lotOccupantTypeLowerCase);
|
||||
});
|
||||
}
|
||||
function clearLotOccupantTypesCache() {
|
||||
lotOccupantTypes = undefined;
|
||||
|
|
@ -48,16 +46,12 @@ export async function getLotStatuses() {
|
|||
}
|
||||
export async function getLotStatusById(lotStatusId) {
|
||||
const cachedLotStatuses = await getLotStatuses();
|
||||
return cachedLotStatuses.find((currentLotStatus) => {
|
||||
return currentLotStatus.lotStatusId === lotStatusId;
|
||||
});
|
||||
return cachedLotStatuses.find((currentLotStatus) => currentLotStatus.lotStatusId === lotStatusId);
|
||||
}
|
||||
export async function getLotStatusByLotStatus(lotStatus) {
|
||||
const cachedLotStatuses = await getLotStatuses();
|
||||
const lotStatusLowerCase = lotStatus.toLowerCase();
|
||||
return cachedLotStatuses.find((currentLotStatus) => {
|
||||
return currentLotStatus.lotStatus.toLowerCase() === lotStatusLowerCase;
|
||||
});
|
||||
return cachedLotStatuses.find((currentLotStatus) => currentLotStatus.lotStatus.toLowerCase() === lotStatusLowerCase);
|
||||
}
|
||||
function clearLotStatusesCache() {
|
||||
lotStatuses = undefined;
|
||||
|
|
@ -74,16 +68,12 @@ export async function getLotTypes() {
|
|||
}
|
||||
export async function getLotTypeById(lotTypeId) {
|
||||
const cachedLotTypes = await getLotTypes();
|
||||
return cachedLotTypes.find((currentLotType) => {
|
||||
return currentLotType.lotTypeId === lotTypeId;
|
||||
});
|
||||
return cachedLotTypes.find((currentLotType) => currentLotType.lotTypeId === lotTypeId);
|
||||
}
|
||||
export async function getLotTypesByLotType(lotType) {
|
||||
const cachedLotTypes = await getLotTypes();
|
||||
const lotTypeLowerCase = lotType.toLowerCase();
|
||||
return cachedLotTypes.find((currentLotType) => {
|
||||
return currentLotType.lotType.toLowerCase() === lotTypeLowerCase;
|
||||
});
|
||||
return cachedLotTypes.find((currentLotType) => currentLotType.lotType.toLowerCase() === lotTypeLowerCase);
|
||||
}
|
||||
function clearLotTypesCache() {
|
||||
lotTypes = undefined;
|
||||
|
|
@ -107,17 +97,13 @@ export async function getAllOccupancyTypeFields() {
|
|||
}
|
||||
export async function getOccupancyTypeById(occupancyTypeId) {
|
||||
const cachedOccupancyTypes = await getOccupancyTypes();
|
||||
return cachedOccupancyTypes.find((currentOccupancyType) => {
|
||||
return currentOccupancyType.occupancyTypeId === occupancyTypeId;
|
||||
});
|
||||
return cachedOccupancyTypes.find((currentOccupancyType) => currentOccupancyType.occupancyTypeId === occupancyTypeId);
|
||||
}
|
||||
export async function getOccupancyTypeByOccupancyType(occupancyTypeString) {
|
||||
const cachedOccupancyTypes = await getOccupancyTypes();
|
||||
const occupancyTypeLowerCase = occupancyTypeString.toLowerCase();
|
||||
return cachedOccupancyTypes.find((currentOccupancyType) => {
|
||||
return (currentOccupancyType.occupancyType.toLowerCase() ===
|
||||
return cachedOccupancyTypes.find((currentOccupancyType) => currentOccupancyType.occupancyType.toLowerCase() ===
|
||||
occupancyTypeLowerCase);
|
||||
});
|
||||
}
|
||||
export async function getOccupancyTypePrintsById(occupancyTypeId) {
|
||||
const occupancyType = await getOccupancyTypeById(occupancyTypeId);
|
||||
|
|
@ -146,9 +132,7 @@ export async function getWorkOrderTypes() {
|
|||
}
|
||||
export async function getWorkOrderTypeById(workOrderTypeId) {
|
||||
const cachedWorkOrderTypes = await getWorkOrderTypes();
|
||||
return cachedWorkOrderTypes.find((currentWorkOrderType) => {
|
||||
return currentWorkOrderType.workOrderTypeId === workOrderTypeId;
|
||||
});
|
||||
return cachedWorkOrderTypes.find((currentWorkOrderType) => currentWorkOrderType.workOrderTypeId === workOrderTypeId);
|
||||
}
|
||||
function clearWorkOrderTypesCache() {
|
||||
workOrderTypes = undefined;
|
||||
|
|
@ -165,18 +149,14 @@ export async function getWorkOrderMilestoneTypes() {
|
|||
}
|
||||
export async function getWorkOrderMilestoneTypeById(workOrderMilestoneTypeId) {
|
||||
const cachedWorkOrderMilestoneTypes = await getWorkOrderMilestoneTypes();
|
||||
return cachedWorkOrderMilestoneTypes.find((currentWorkOrderMilestoneType) => {
|
||||
return (currentWorkOrderMilestoneType.workOrderMilestoneTypeId ===
|
||||
return cachedWorkOrderMilestoneTypes.find((currentWorkOrderMilestoneType) => currentWorkOrderMilestoneType.workOrderMilestoneTypeId ===
|
||||
workOrderMilestoneTypeId);
|
||||
});
|
||||
}
|
||||
export async function getWorkOrderMilestoneTypeByWorkOrderMilestoneType(workOrderMilestoneTypeString) {
|
||||
const cachedWorkOrderMilestoneTypes = await getWorkOrderMilestoneTypes();
|
||||
const workOrderMilestoneTypeLowerCase = workOrderMilestoneTypeString.toLowerCase();
|
||||
return cachedWorkOrderMilestoneTypes.find((currentWorkOrderMilestoneType) => {
|
||||
return (currentWorkOrderMilestoneType.workOrderMilestoneType.toLowerCase() ===
|
||||
return cachedWorkOrderMilestoneTypes.find((currentWorkOrderMilestoneType) => currentWorkOrderMilestoneType.workOrderMilestoneType.toLowerCase() ===
|
||||
workOrderMilestoneTypeLowerCase);
|
||||
});
|
||||
}
|
||||
export async function preloadCaches() {
|
||||
debug('Preloading caches');
|
||||
|
|
@ -240,9 +220,11 @@ export function clearCacheByTableName(tableName, relayMessage = true) {
|
|||
pid: process.pid
|
||||
};
|
||||
debug(`Sending clear cache from worker: ${tableName}`);
|
||||
if (process.send !== undefined) {
|
||||
process.send(workerMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
process.on('message', (message) => {
|
||||
|
|
|
|||
|
|
@ -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 Debug from 'debug'
|
||||
|
|
@ -9,7 +12,10 @@ import getOccupancyTypeFieldsFromDatabase from '../database/getOccupancyTypeFiel
|
|||
import getOccupancyTypesFromDatabase from '../database/getOccupancyTypes.js'
|
||||
import getWorkOrderMilestoneTypesFromDatabase from '../database/getWorkOrderMilestoneTypes.js'
|
||||
import getWorkOrderTypesFromDatabase from '../database/getWorkOrderTypes.js'
|
||||
import type { ClearCacheWorkerMessage } from '../types/applicationTypes.js'
|
||||
import type {
|
||||
ClearCacheWorkerMessage,
|
||||
WorkerMessage
|
||||
} from '../types/applicationTypes.js'
|
||||
import type {
|
||||
LotOccupantType,
|
||||
LotStatus,
|
||||
|
|
@ -43,9 +49,10 @@ export async function getLotOccupantTypeById(
|
|||
): Promise<LotOccupantType | undefined> {
|
||||
const cachedLotOccupantTypes = await getLotOccupantTypes()
|
||||
|
||||
return cachedLotOccupantTypes.find((currentLotOccupantType) => {
|
||||
return currentLotOccupantType.lotOccupantTypeId === lotOccupantTypeId
|
||||
})
|
||||
return cachedLotOccupantTypes.find(
|
||||
(currentLotOccupantType) =>
|
||||
currentLotOccupantType.lotOccupantTypeId === lotOccupantTypeId
|
||||
)
|
||||
}
|
||||
|
||||
export async function getLotOccupantTypeByLotOccupantType(
|
||||
|
|
@ -55,12 +62,11 @@ export async function getLotOccupantTypeByLotOccupantType(
|
|||
|
||||
const lotOccupantTypeLowerCase = lotOccupantType.toLowerCase()
|
||||
|
||||
return cachedLotOccupantTypes.find((currentLotOccupantType) => {
|
||||
return (
|
||||
return cachedLotOccupantTypes.find(
|
||||
(currentLotOccupantType) =>
|
||||
currentLotOccupantType.lotOccupantType.toLowerCase() ===
|
||||
lotOccupantTypeLowerCase
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
function clearLotOccupantTypesCache(): void {
|
||||
|
|
@ -86,9 +92,9 @@ export async function getLotStatusById(
|
|||
): Promise<LotStatus | undefined> {
|
||||
const cachedLotStatuses = await getLotStatuses()
|
||||
|
||||
return cachedLotStatuses.find((currentLotStatus) => {
|
||||
return currentLotStatus.lotStatusId === lotStatusId
|
||||
})
|
||||
return cachedLotStatuses.find(
|
||||
(currentLotStatus) => currentLotStatus.lotStatusId === lotStatusId
|
||||
)
|
||||
}
|
||||
|
||||
export async function getLotStatusByLotStatus(
|
||||
|
|
@ -98,9 +104,10 @@ export async function getLotStatusByLotStatus(
|
|||
|
||||
const lotStatusLowerCase = lotStatus.toLowerCase()
|
||||
|
||||
return cachedLotStatuses.find((currentLotStatus) => {
|
||||
return currentLotStatus.lotStatus.toLowerCase() === lotStatusLowerCase
|
||||
})
|
||||
return cachedLotStatuses.find(
|
||||
(currentLotStatus) =>
|
||||
currentLotStatus.lotStatus.toLowerCase() === lotStatusLowerCase
|
||||
)
|
||||
}
|
||||
|
||||
function clearLotStatusesCache(): void {
|
||||
|
|
@ -126,9 +133,9 @@ export async function getLotTypeById(
|
|||
): Promise<LotType | undefined> {
|
||||
const cachedLotTypes = await getLotTypes()
|
||||
|
||||
return cachedLotTypes.find((currentLotType) => {
|
||||
return currentLotType.lotTypeId === lotTypeId
|
||||
})
|
||||
return cachedLotTypes.find(
|
||||
(currentLotType) => currentLotType.lotTypeId === lotTypeId
|
||||
)
|
||||
}
|
||||
|
||||
export async function getLotTypesByLotType(
|
||||
|
|
@ -138,9 +145,10 @@ export async function getLotTypesByLotType(
|
|||
|
||||
const lotTypeLowerCase = lotType.toLowerCase()
|
||||
|
||||
return cachedLotTypes.find((currentLotType) => {
|
||||
return currentLotType.lotType.toLowerCase() === lotTypeLowerCase
|
||||
})
|
||||
return cachedLotTypes.find(
|
||||
(currentLotType) =>
|
||||
currentLotType.lotType.toLowerCase() === lotTypeLowerCase
|
||||
)
|
||||
}
|
||||
|
||||
function clearLotTypesCache(): void {
|
||||
|
|
@ -176,9 +184,10 @@ export async function getOccupancyTypeById(
|
|||
): Promise<OccupancyType | undefined> {
|
||||
const cachedOccupancyTypes = await getOccupancyTypes()
|
||||
|
||||
return cachedOccupancyTypes.find((currentOccupancyType) => {
|
||||
return currentOccupancyType.occupancyTypeId === occupancyTypeId
|
||||
})
|
||||
return cachedOccupancyTypes.find(
|
||||
(currentOccupancyType) =>
|
||||
currentOccupancyType.occupancyTypeId === occupancyTypeId
|
||||
)
|
||||
}
|
||||
|
||||
export async function getOccupancyTypeByOccupancyType(
|
||||
|
|
@ -188,12 +197,11 @@ export async function getOccupancyTypeByOccupancyType(
|
|||
|
||||
const occupancyTypeLowerCase = occupancyTypeString.toLowerCase()
|
||||
|
||||
return cachedOccupancyTypes.find((currentOccupancyType) => {
|
||||
return (
|
||||
return cachedOccupancyTypes.find(
|
||||
(currentOccupancyType) =>
|
||||
currentOccupancyType.occupancyType.toLowerCase() ===
|
||||
occupancyTypeLowerCase
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
export async function getOccupancyTypePrintsById(
|
||||
|
|
@ -239,9 +247,10 @@ export async function getWorkOrderTypeById(
|
|||
): Promise<WorkOrderType | undefined> {
|
||||
const cachedWorkOrderTypes = await getWorkOrderTypes()
|
||||
|
||||
return cachedWorkOrderTypes.find((currentWorkOrderType) => {
|
||||
return currentWorkOrderType.workOrderTypeId === workOrderTypeId
|
||||
})
|
||||
return cachedWorkOrderTypes.find(
|
||||
(currentWorkOrderType) =>
|
||||
currentWorkOrderType.workOrderTypeId === workOrderTypeId
|
||||
)
|
||||
}
|
||||
|
||||
function clearWorkOrderTypesCache(): void {
|
||||
|
|
@ -269,12 +278,11 @@ export async function getWorkOrderMilestoneTypeById(
|
|||
): Promise<WorkOrderMilestoneType | undefined> {
|
||||
const cachedWorkOrderMilestoneTypes = await getWorkOrderMilestoneTypes()
|
||||
|
||||
return cachedWorkOrderMilestoneTypes.find((currentWorkOrderMilestoneType) => {
|
||||
return (
|
||||
return cachedWorkOrderMilestoneTypes.find(
|
||||
(currentWorkOrderMilestoneType) =>
|
||||
currentWorkOrderMilestoneType.workOrderMilestoneTypeId ===
|
||||
workOrderMilestoneTypeId
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
export async function getWorkOrderMilestoneTypeByWorkOrderMilestoneType(
|
||||
|
|
@ -285,12 +293,11 @@ export async function getWorkOrderMilestoneTypeByWorkOrderMilestoneType(
|
|||
const workOrderMilestoneTypeLowerCase =
|
||||
workOrderMilestoneTypeString.toLowerCase()
|
||||
|
||||
return cachedWorkOrderMilestoneTypes.find((currentWorkOrderMilestoneType) => {
|
||||
return (
|
||||
return cachedWorkOrderMilestoneTypes.find(
|
||||
(currentWorkOrderMilestoneType) =>
|
||||
currentWorkOrderMilestoneType.workOrderMilestoneType.toLowerCase() ===
|
||||
workOrderMilestoneTypeLowerCase
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
export async function preloadCaches(): Promise<void> {
|
||||
|
|
@ -370,14 +377,16 @@ export function clearCacheByTableName(
|
|||
|
||||
debug(`Sending clear cache from worker: ${tableName}`)
|
||||
|
||||
process.send!(workerMessage)
|
||||
if (process.send !== undefined) {
|
||||
process.send(workerMessage)
|
||||
}
|
||||
}
|
||||
} catch {}
|
||||
}
|
||||
|
||||
process.on('message', (message: ClearCacheWorkerMessage) => {
|
||||
process.on('message', (message: WorkerMessage) => {
|
||||
if (message.messageType === 'clearCache' && message.pid !== process.pid) {
|
||||
debug(`Clearing cache: ${message.tableName}`)
|
||||
clearCacheByTableName(message.tableName, false)
|
||||
debug(`Clearing cache: ${(message as ClearCacheWorkerMessage).tableName}`)
|
||||
clearCacheByTableName((message as ClearCacheWorkerMessage).tableName, false)
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* eslint-disable unicorn/filename-case, @eslint-community/eslint-comments/disable-enable-pair */
|
||||
import { DynamicsGP } from '@cityssm/dynamics-gp';
|
||||
import { getConfigProperty } from './functions.config.js';
|
||||
// eslint-disable-next-line @typescript-eslint/init-declarations
|
||||
let gp;
|
||||
if (getConfigProperty('settings.dynamicsGP.integrationIsEnabled')) {
|
||||
gp = new DynamicsGP(getConfigProperty('settings.dynamicsGP.mssqlConfig'));
|
||||
|
|
@ -25,9 +25,7 @@ function filterCashReceipt(cashReceipt) {
|
|||
function filterInvoice(invoice) {
|
||||
const itemNumbers = getConfigProperty('settings.dynamicsGP.itemNumbers');
|
||||
for (const itemNumber of itemNumbers) {
|
||||
const found = invoice.lineItems.some((itemRecord) => {
|
||||
return itemRecord.itemNumber === itemNumber;
|
||||
});
|
||||
const found = invoice.lineItems.some((itemRecord) => itemRecord.itemNumber === itemNumber);
|
||||
if (!found) {
|
||||
return undefined;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
/* eslint-disable unicorn/filename-case, @eslint-community/eslint-comments/disable-enable-pair */
|
||||
|
||||
import {
|
||||
type DiamondCashReceipt,
|
||||
type DiamondExtendedGPInvoice,
|
||||
|
|
@ -12,6 +10,7 @@ import type { DynamicsGPDocument } from '../types/recordTypes.js'
|
|||
|
||||
import { getConfigProperty } from './functions.config.js'
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/init-declarations
|
||||
let gp: DynamicsGP
|
||||
|
||||
if (getConfigProperty('settings.dynamicsGP.integrationIsEnabled')) {
|
||||
|
|
@ -46,9 +45,7 @@ function filterInvoice(invoice: GPInvoice): GPInvoice | undefined {
|
|||
const itemNumbers = getConfigProperty('settings.dynamicsGP.itemNumbers')
|
||||
|
||||
for (const itemNumber of itemNumbers) {
|
||||
const found = invoice.lineItems.some((itemRecord) => {
|
||||
return itemRecord.itemNumber === itemNumber
|
||||
})
|
||||
const found = invoice.lineItems.some((itemRecord) => itemRecord.itemNumber === itemNumber)
|
||||
|
||||
if (!found) {
|
||||
return undefined
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type * as recordTypes from '../types/recordTypes';
|
||||
export declare const calculateFeeAmount: (fee: recordTypes.Fee, lotOccupancy: recordTypes.LotOccupancy) => number;
|
||||
export declare function calculateTaxAmount(fee: recordTypes.Fee, feeAmount: number): number;
|
||||
import type { Fee, LotOccupancy } from '../types/recordTypes.js';
|
||||
export declare function calculateFeeAmount(fee: Fee, lotOccupancy: LotOccupancy): number;
|
||||
export declare function calculateTaxAmount(fee: Fee, feeAmount: number): number;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
export const calculateFeeAmount = (fee, lotOccupancy) => {
|
||||
export function calculateFeeAmount(fee, lotOccupancy) {
|
||||
return fee.feeFunction ? 0 : fee.feeAmount ?? 0;
|
||||
};
|
||||
}
|
||||
export function calculateTaxAmount(fee, feeAmount) {
|
||||
return fee.taxPercentage
|
||||
? feeAmount * (fee.taxPercentage / 100)
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import type * as recordTypes from '../types/recordTypes'
|
||||
import type { Fee, LotOccupancy } from '../types/recordTypes.js'
|
||||
|
||||
export const calculateFeeAmount = (
|
||||
fee: recordTypes.Fee,
|
||||
lotOccupancy: recordTypes.LotOccupancy
|
||||
): number => {
|
||||
export function calculateFeeAmount(
|
||||
fee: Fee,
|
||||
lotOccupancy: LotOccupancy
|
||||
): number {
|
||||
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
|
||||
? feeAmount * (fee.taxPercentage / 100)
|
||||
: fee.taxAmount ?? 0
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
"randomcolor": "^0.6.2",
|
||||
"session-file-store": "^1.5.0",
|
||||
"set-interval-async": "^3.0.3",
|
||||
"uuid": "^11.0.1"
|
||||
"uuid": "^11.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@cityssm/bulma-a11y": "^0.4.0",
|
||||
|
|
@ -80,7 +80,7 @@
|
|||
"bulma-tooltip": "^3.0.2",
|
||||
"cypress": "^13.15.1",
|
||||
"cypress-axe": "^1.5.0",
|
||||
"eslint-config-cityssm": "^14.0.0",
|
||||
"eslint-config-cityssm": "^14.0.1",
|
||||
"gulp": "^5.0.0",
|
||||
"gulp-sass": "^5.1.0",
|
||||
"nodemon": "^3.1.7",
|
||||
|
|
@ -8120,9 +8120,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/eslint-config-cityssm": {
|
||||
"version": "14.0.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-cityssm/-/eslint-config-cityssm-14.0.0.tgz",
|
||||
"integrity": "sha512-RLS0mniIK2r5evcqpcYq41SdVxRAy1h37Y3nr1OnqAVc3TWPlcB+HNj/nad9ovfm9NsXWCWKINYO63/BVNjgfg==",
|
||||
"version": "14.0.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-cityssm/-/eslint-config-cityssm-14.0.1.tgz",
|
||||
"integrity": "sha512-pmqsNjS0cxznslzhZeihz1iGSOe/4LgJZdJzi7D8R3KE3N6dDSxiIay0T+q2u8BgmZJJwmmvrL6Qlk0924mNyA==",
|
||||
"dev": true,
|
||||
"license": "Unlicense",
|
||||
"dependencies": {
|
||||
|
|
@ -16370,9 +16370,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/uuid": {
|
||||
"version": "11.0.1",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-11.0.1.tgz",
|
||||
"integrity": "sha512-wt9UB5EcLhnboy1UvA1mvGPXkIIrHSu+3FmUksARfdVw9tuPf3CH/CohxO0Su1ApoKAeT6BVzAJIvjTuQVSmuQ==",
|
||||
"version": "11.0.2",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-11.0.2.tgz",
|
||||
"integrity": "sha512-14FfcOJmqdjbBPdDjFQyk/SdT4NySW4eM0zcG+HqbHP5jzuH56xO3J1DGhgs/cEMCfwYi3HQI1gnTO62iaG+tQ==",
|
||||
"funding": [
|
||||
"https://github.com/sponsors/broofa",
|
||||
"https://github.com/sponsors/ctavan"
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@
|
|||
"randomcolor": "^0.6.2",
|
||||
"session-file-store": "^1.5.0",
|
||||
"set-interval-async": "^3.0.3",
|
||||
"uuid": "^11.0.1"
|
||||
"uuid": "^11.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@cityssm/bulma-a11y": "^0.4.0",
|
||||
|
|
@ -104,7 +104,7 @@
|
|||
"bulma-tooltip": "^3.0.2",
|
||||
"cypress": "^13.15.1",
|
||||
"cypress-axe": "^1.5.0",
|
||||
"eslint-config-cityssm": "^14.0.0",
|
||||
"eslint-config-cityssm": "^14.0.1",
|
||||
"gulp": "^5.0.0",
|
||||
"gulp-sass": "^5.1.0",
|
||||
"nodemon": "^3.1.7",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
"use strict";
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
const los = exports.los;
|
||||
|
|
|
|||
|
|
@ -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 { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
"use strict";
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
const los = exports.los;
|
||||
|
|
@ -273,7 +271,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
const containerElement = document.querySelector('#container--workOrderMilestoneTypes');
|
||||
if (workOrderMilestoneTypes.length === 0) {
|
||||
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>`;
|
||||
return;
|
||||
}
|
||||
|
|
@ -438,7 +438,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
if (lotStatuses.length === 0) {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
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>`;
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
|
||||
|
||||
|
|
@ -413,7 +410,9 @@ declare const bulmaJS: BulmaJS
|
|||
|
||||
if (workOrderMilestoneTypes.length === 0) {
|
||||
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>`
|
||||
|
||||
return
|
||||
|
|
@ -654,7 +653,9 @@ declare const bulmaJS: BulmaJS
|
|||
if (lotStatuses.length === 0) {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
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>`
|
||||
|
||||
return
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
"use strict";
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
const los = exports.los;
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
||||
declare const exports: Record<string, unknown>
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
if (responseJSON.success) {
|
||||
clearUnsavedChanges();
|
||||
if (isCreate || refreshAfterSave) {
|
||||
window.location.href = los.getLotOccupancyURL(responseJSON.lotOccupancyId, true, true);
|
||||
globalThis.location.href = los.getLotOccupancyURL(responseJSON.lotOccupancyId, true, true);
|
||||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
|
|
@ -57,7 +57,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.success) {
|
||||
clearUnsavedChanges();
|
||||
window.location.href = los.getLotOccupancyURL(responseJSON.lotOccupancyId, true);
|
||||
globalThis.location.href = los.getLotOccupancyURL(responseJSON.lotOccupancyId, true);
|
||||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
|
|
@ -102,7 +102,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.success) {
|
||||
clearUnsavedChanges();
|
||||
window.location.href = los.getLotOccupancyURL();
|
||||
globalThis.location.href = los.getLotOccupancyURL();
|
||||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
|
|
@ -141,7 +141,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
okButton: {
|
||||
text: 'Yes, Open the Work Order',
|
||||
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({
|
||||
title: 'Delete Trasnaction',
|
||||
title: 'Delete Transaction',
|
||||
message: 'Are you sure you want to delete this transaction?',
|
||||
contextualColorName: 'warning',
|
||||
okButton: {
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ declare const exports: Record<string, unknown>
|
|||
clearUnsavedChanges()
|
||||
|
||||
if (isCreate || refreshAfterSave) {
|
||||
window.location.href = los.getLotOccupancyURL(
|
||||
globalThis.location.href = los.getLotOccupancyURL(
|
||||
responseJSON.lotOccupancyId,
|
||||
true,
|
||||
true
|
||||
|
|
@ -115,7 +115,7 @@ declare const exports: Record<string, unknown>
|
|||
if (responseJSON.success) {
|
||||
clearUnsavedChanges()
|
||||
|
||||
window.location.href = los.getLotOccupancyURL(
|
||||
globalThis.location.href = los.getLotOccupancyURL(
|
||||
responseJSON.lotOccupancyId,
|
||||
true
|
||||
)
|
||||
|
|
@ -173,7 +173,7 @@ declare const exports: Record<string, unknown>
|
|||
|
||||
if (responseJSON.success) {
|
||||
clearUnsavedChanges()
|
||||
window.location.href = los.getLotOccupancyURL()
|
||||
globalThis.location.href = los.getLotOccupancyURL()
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
title: 'Error Deleting Record',
|
||||
|
|
@ -226,7 +226,7 @@ declare const exports: Record<string, unknown>
|
|||
okButton: {
|
||||
text: 'Yes, Open the Work Order',
|
||||
callbackFunction: () => {
|
||||
window.location.href = los.getWorkOrderURL(
|
||||
globalThis.location.href = los.getWorkOrderURL(
|
||||
responseJSON.workOrderId,
|
||||
true
|
||||
)
|
||||
|
|
@ -2474,7 +2474,7 @@ declare const exports: Record<string, unknown>
|
|||
}
|
||||
|
||||
bulmaJS.confirm({
|
||||
title: 'Delete Trasnaction',
|
||||
title: 'Delete Transaction',
|
||||
message: 'Are you sure you want to delete this transaction?',
|
||||
contextualColorName: 'warning',
|
||||
okButton: {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
"use strict";
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
const los = exports.los;
|
||||
|
|
@ -52,14 +50,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
${cityssm.escapeHTML(occupant.occupantFamilyName ?? '')}
|
||||
</li>`;
|
||||
}
|
||||
const feeTotal = (lotOccupancy.lotOccupancyFees?.reduce((soFar, currentFee) => {
|
||||
return (soFar +
|
||||
const feeTotal = (lotOccupancy.lotOccupancyFees?.reduce((soFar, currentFee) => soFar +
|
||||
((currentFee.feeAmount ?? 0) + (currentFee.taxAmount ?? 0)) *
|
||||
(currentFee.quantity ?? 0));
|
||||
}, 0) ?? 0).toFixed(2);
|
||||
const transactionTotal = (lotOccupancy.lotOccupancyTransactions?.reduce((soFar, currentTransaction) => {
|
||||
return soFar + currentTransaction.transactionAmount;
|
||||
}, 0) ?? 0).toFixed(2);
|
||||
(currentFee.quantity ?? 0), 0) ?? 0).toFixed(2);
|
||||
const transactionTotal = (lotOccupancy.lotOccupancyTransactions?.reduce((soFar, currentTransaction) => soFar + currentTransaction.transactionAmount, 0) ?? 0).toFixed(2);
|
||||
let feeIconHTML = '';
|
||||
if (feeTotal !== '0.00' || transactionTotal !== '0.00') {
|
||||
feeIconHTML = `<span class="icon"
|
||||
|
|
|
|||
|
|
@ -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 { LOS } from '../../types/globalTypes.js'
|
||||
|
|
@ -89,20 +86,19 @@ declare const exports: Record<string, unknown>
|
|||
}
|
||||
|
||||
const feeTotal = (
|
||||
lotOccupancy.lotOccupancyFees?.reduce((soFar, currentFee): number => {
|
||||
return (
|
||||
lotOccupancy.lotOccupancyFees?.reduce(
|
||||
(soFar, currentFee): number =>
|
||||
soFar +
|
||||
((currentFee.feeAmount ?? 0) + (currentFee.taxAmount ?? 0)) *
|
||||
(currentFee.quantity ?? 0)
|
||||
)
|
||||
}, 0) ?? 0
|
||||
(currentFee.quantity ?? 0),
|
||||
0
|
||||
) ?? 0
|
||||
).toFixed(2)
|
||||
|
||||
const transactionTotal = (
|
||||
lotOccupancy.lotOccupancyTransactions?.reduce(
|
||||
(soFar, currentTransaction): number => {
|
||||
return soFar + currentTransaction.transactionAmount
|
||||
},
|
||||
(soFar, currentTransaction): number =>
|
||||
soFar + currentTransaction.transactionAmount,
|
||||
0
|
||||
) ?? 0
|
||||
).toFixed(2)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
"use strict";
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
const los = exports.los;
|
||||
|
|
|
|||
|
|
@ -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 { LOS } from '../../types/globalTypes.js'
|
||||
|
|
@ -28,7 +25,7 @@ declare const exports: Record<string, unknown>
|
|||
'#searchFilter--offset'
|
||||
) as HTMLInputElement
|
||||
|
||||
function renderLots(rawResponseJSON): void {
|
||||
function renderLots(rawResponseJSON: unknown): void {
|
||||
const responseJSON = rawResponseJSON as {
|
||||
count: number
|
||||
offset: number
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
"use strict";
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
const mapContainerElement = document.querySelector('#lot--map');
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
||||
declare const exports: Record<string, unknown>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
"use strict";
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
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('-')));
|
||||
}
|
||||
if (svgElementToHighlight !== null) {
|
||||
// eslint-disable-next-line unicorn/no-null
|
||||
svgElementToHighlight.style.fill = '';
|
||||
svgElementToHighlight.classList.add('highlight', `is-${contextualClass}`);
|
||||
const childPathElements = svgElementToHighlight.querySelectorAll('path');
|
||||
for (const pathElement of childPathElements) {
|
||||
// eslint-disable-next-line unicorn/no-null
|
||||
pathElement.style.fill = '';
|
||||
}
|
||||
}
|
||||
|
|
@ -83,7 +79,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
function initializeDatePickers(containerElement) {
|
||||
const dateElements = containerElement.querySelectorAll("input[type='date']");
|
||||
for (const dateElement of dateElements) {
|
||||
const datePickerOptions = Object.assign({}, datePickerBaseOptions);
|
||||
const datePickerOptions = { ...datePickerBaseOptions };
|
||||
if (dateElement.required) {
|
||||
datePickerOptions.showClearButton = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
|
||||
import type { Options as BulmaCalendarOptions } from 'bulma-calendar'
|
||||
|
|
@ -79,14 +76,12 @@ declare const exports: Record<string, unknown> & {
|
|||
}
|
||||
|
||||
if (svgElementToHighlight !== null) {
|
||||
// eslint-disable-next-line unicorn/no-null
|
||||
svgElementToHighlight.style.fill = ''
|
||||
|
||||
svgElementToHighlight.classList.add('highlight', `is-${contextualClass}`)
|
||||
|
||||
const childPathElements = svgElementToHighlight.querySelectorAll('path')
|
||||
for (const pathElement of childPathElements) {
|
||||
// eslint-disable-next-line unicorn/no-null
|
||||
pathElement.style.fill = ''
|
||||
}
|
||||
}
|
||||
|
|
@ -144,7 +139,7 @@ declare const exports: Record<string, unknown> & {
|
|||
containerElement.querySelectorAll("input[type='date']")
|
||||
|
||||
for (const dateElement of dateElements) {
|
||||
const datePickerOptions = Object.assign({}, datePickerBaseOptions)
|
||||
const datePickerOptions = { ...datePickerBaseOptions }
|
||||
|
||||
if (dateElement.required) {
|
||||
datePickerOptions.showClearButton = false
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
"use strict";
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
const los = exports.los;
|
||||
|
|
@ -27,7 +25,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
if (responseJSON.success) {
|
||||
clearUnsavedChanges();
|
||||
if (isCreate) {
|
||||
window.location.href = los.getMapURL(responseJSON.mapId, true);
|
||||
globalThis.location.href = los.getMapURL(responseJSON.mapId, true);
|
||||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
|
|
@ -60,7 +58,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}, (rawResponseJSON) => {
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.success) {
|
||||
window.location.href = los.getMapURL();
|
||||
globalThis.location.href = los.getMapURL();
|
||||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
|
|
|
|||
|
|
@ -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 { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
|
||||
|
||||
|
|
@ -50,7 +47,7 @@ declare const exports: Record<string, unknown>
|
|||
clearUnsavedChanges()
|
||||
|
||||
if (isCreate) {
|
||||
window.location.href = los.getMapURL(responseJSON.mapId, true)
|
||||
globalThis.location.href = los.getMapURL(responseJSON.mapId, true)
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
message: `${los.escapedAliases.Map} Updated Successfully`,
|
||||
|
|
@ -95,7 +92,7 @@ declare const exports: Record<string, unknown>
|
|||
}
|
||||
|
||||
if (responseJSON.success) {
|
||||
window.location.href = los.getMapURL()
|
||||
globalThis.location.href = los.getMapURL()
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
title: `Error Deleting ${los.escapedAliases.Map}`,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
"use strict";
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
const los = exports.los;
|
||||
|
|
|
|||
|
|
@ -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 { LOS } from '../../types/globalTypes.js'
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
|
||||
;(() => {
|
||||
const menuTabElements: NodeListOf<HTMLAnchorElement> =
|
||||
document.querySelectorAll('.menu a')
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
"use strict";
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
const los = exports.los;
|
||||
|
|
@ -30,7 +28,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
if (responseJSON.success) {
|
||||
clearUnsavedChanges();
|
||||
if (isCreate) {
|
||||
window.location.href = los.getWorkOrderURL(responseJSON.workOrderId, true);
|
||||
globalThis.location.href = los.getWorkOrderURL(responseJSON.workOrderId, true);
|
||||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
|
|
@ -62,7 +60,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.success) {
|
||||
clearUnsavedChanges();
|
||||
window.location.href = los.getWorkOrderURL(workOrderId);
|
||||
globalThis.location.href = los.getWorkOrderURL(workOrderId);
|
||||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
|
|
@ -80,7 +78,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.success) {
|
||||
clearUnsavedChanges();
|
||||
window.location.href = `${los.urlPrefix}/workOrders`;
|
||||
globalThis.location.href = `${los.urlPrefix}/workOrders`;
|
||||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
|
|
@ -95,9 +93,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
document
|
||||
.querySelector('#button--closeWorkOrder')
|
||||
?.addEventListener('click', () => {
|
||||
const hasOpenMilestones = workOrderMilestones.some((milestone) => {
|
||||
return !milestone.workOrderMilestoneCompletionDate;
|
||||
});
|
||||
const hasOpenMilestones = workOrderMilestones.some((milestone) => !milestone.workOrderMilestoneCompletionDate);
|
||||
if (hasOpenMilestones) {
|
||||
bulmaJS.alert({
|
||||
title: 'Outstanding Milestones',
|
||||
|
|
@ -268,9 +264,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
const isActive = !(lotOccupancy.occupancyEndDate &&
|
||||
lotOccupancy.occupancyEndDateString < currentDateString);
|
||||
const hasLotRecord = lotOccupancy.lotId &&
|
||||
workOrderLots.some((lot) => {
|
||||
return lotOccupancy.lotId === lot.lotId;
|
||||
});
|
||||
workOrderLots.some((lot) => lotOccupancy.lotId === lot.lotId);
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
rowElement.innerHTML = `<td class="is-width-1 has-text-centered">
|
||||
${isActive
|
||||
|
|
@ -340,9 +334,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}
|
||||
function openEditLotStatus(clickEvent) {
|
||||
const lotId = Number.parseInt(clickEvent.currentTarget.closest('.container--lot').dataset.lotId ?? '', 10);
|
||||
const lot = workOrderLots.find((possibleLot) => {
|
||||
return possibleLot.lotId === lotId;
|
||||
});
|
||||
const lot = workOrderLots.find((possibleLot) => possibleLot.lotId === lotId);
|
||||
let editCloseModalFunction;
|
||||
function doUpdateLotStatus(submitEvent) {
|
||||
submitEvent.preventDefault();
|
||||
|
|
@ -716,9 +708,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
function openEditWorkOrderComment(clickEvent) {
|
||||
const workOrderCommentId = Number.parseInt(clickEvent.currentTarget.closest('tr')?.dataset
|
||||
.workOrderCommentId ?? '', 10);
|
||||
const workOrderComment = workOrderComments.find((currentComment) => {
|
||||
return currentComment.workOrderCommentId === workOrderCommentId;
|
||||
});
|
||||
const workOrderComment = workOrderComments.find((currentComment) => currentComment.workOrderCommentId === workOrderCommentId);
|
||||
let editFormElement;
|
||||
let editCloseModalFunction;
|
||||
function editComment(submitEvent) {
|
||||
|
|
@ -814,7 +804,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
<th>Commentor</th>
|
||||
<th>Comment Date</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) {
|
||||
const tableRowElement = document.createElement('tr');
|
||||
tableRowElement.dataset.workOrderCommentId =
|
||||
|
|
@ -910,9 +902,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
workOrderMilestoneDateString
|
||||
}, (rawResponseJSON) => {
|
||||
const responseJSON = rawResponseJSON;
|
||||
const workOrderMilestones = responseJSON.workOrderMilestones.filter((possibleMilestone) => {
|
||||
return possibleMilestone.workOrderId.toString() !== workOrderId;
|
||||
});
|
||||
const workOrderMilestones = responseJSON.workOrderMilestones.filter((possibleMilestone) => possibleMilestone.workOrderId.toString() !== workOrderId);
|
||||
clearPanelBlockElements(targetPanelElement);
|
||||
for (const milestone of workOrderMilestones) {
|
||||
targetPanelElement.insertAdjacentHTML('beforeend', `<div class="panel-block is-block">
|
||||
|
|
@ -960,9 +950,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
clickEvent.preventDefault();
|
||||
const currentDateString = cityssm.dateToString(new Date());
|
||||
const workOrderMilestoneId = Number.parseInt(clickEvent.currentTarget.closest('.container--milestone').dataset.workOrderMilestoneId ?? '', 10);
|
||||
const workOrderMilestone = workOrderMilestones.find((currentMilestone) => {
|
||||
return currentMilestone.workOrderMilestoneId === workOrderMilestoneId;
|
||||
});
|
||||
const workOrderMilestone = workOrderMilestones.find((currentMilestone) => currentMilestone.workOrderMilestoneId === workOrderMilestoneId);
|
||||
function doComplete() {
|
||||
cityssm.postJSON(`${los.urlPrefix}/workOrders/doCompleteWorkOrderMilestone`, {
|
||||
workOrderId,
|
||||
|
|
@ -1026,9 +1014,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
function editMilestone(clickEvent) {
|
||||
clickEvent.preventDefault();
|
||||
const workOrderMilestoneId = Number.parseInt(clickEvent.currentTarget.closest('.container--milestone').dataset.workOrderMilestoneId ?? '', 10);
|
||||
const workOrderMilestone = workOrderMilestones.find((currentMilestone) => {
|
||||
return currentMilestone.workOrderMilestoneId === workOrderMilestoneId;
|
||||
});
|
||||
const workOrderMilestone = workOrderMilestones.find((currentMilestone) => currentMilestone.workOrderMilestoneId === workOrderMilestoneId);
|
||||
let editCloseModalFunction;
|
||||
let workOrderMilestoneDateStringElement;
|
||||
function doEdit(submitEvent) {
|
||||
|
|
|
|||
|
|
@ -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 { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
|
||||
|
||||
|
|
@ -69,7 +66,7 @@ declare const exports: Record<string, unknown>
|
|||
clearUnsavedChanges()
|
||||
|
||||
if (isCreate) {
|
||||
window.location.href = los.getWorkOrderURL(
|
||||
globalThis.location.href = los.getWorkOrderURL(
|
||||
responseJSON.workOrderId,
|
||||
true
|
||||
)
|
||||
|
|
@ -116,7 +113,7 @@ declare const exports: Record<string, unknown>
|
|||
|
||||
if (responseJSON.success) {
|
||||
clearUnsavedChanges()
|
||||
window.location.href = los.getWorkOrderURL(workOrderId)
|
||||
globalThis.location.href = los.getWorkOrderURL(workOrderId)
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
title: 'Error Closing Work Order',
|
||||
|
|
@ -142,7 +139,7 @@ declare const exports: Record<string, unknown>
|
|||
|
||||
if (responseJSON.success) {
|
||||
clearUnsavedChanges()
|
||||
window.location.href = `${los.urlPrefix}/workOrders`
|
||||
globalThis.location.href = `${los.urlPrefix}/workOrders`
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
title: 'Error Deleting Work Order',
|
||||
|
|
@ -159,9 +156,9 @@ declare const exports: Record<string, unknown>
|
|||
document
|
||||
.querySelector('#button--closeWorkOrder')
|
||||
?.addEventListener('click', () => {
|
||||
const hasOpenMilestones = workOrderMilestones.some((milestone) => {
|
||||
return !milestone.workOrderMilestoneCompletionDate
|
||||
})
|
||||
const hasOpenMilestones = workOrderMilestones.some(
|
||||
(milestone) => !milestone.workOrderMilestoneCompletionDate
|
||||
)
|
||||
|
||||
if (hasOpenMilestones) {
|
||||
bulmaJS.alert({
|
||||
|
|
@ -398,9 +395,7 @@ declare const exports: Record<string, unknown>
|
|||
|
||||
const hasLotRecord =
|
||||
lotOccupancy.lotId &&
|
||||
workOrderLots.some((lot) => {
|
||||
return lotOccupancy.lotId === lot.lotId
|
||||
})
|
||||
workOrderLots.some((lot) => lotOccupancy.lotId === lot.lotId)
|
||||
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
rowElement.innerHTML = `<td class="is-width-1 has-text-centered">
|
||||
|
|
@ -505,9 +500,9 @@ declare const exports: Record<string, unknown>
|
|||
10
|
||||
)
|
||||
|
||||
const lot = workOrderLots.find((possibleLot) => {
|
||||
return possibleLot.lotId === lotId
|
||||
}) as Lot
|
||||
const lot = workOrderLots.find(
|
||||
(possibleLot) => possibleLot.lotId === lotId
|
||||
) as Lot
|
||||
|
||||
let editCloseModalFunction: () => void
|
||||
|
||||
|
|
@ -1078,9 +1073,10 @@ declare const exports: Record<string, unknown>
|
|||
10
|
||||
)
|
||||
|
||||
const workOrderComment = workOrderComments.find((currentComment) => {
|
||||
return currentComment.workOrderCommentId === workOrderCommentId
|
||||
}) as WorkOrderComment
|
||||
const workOrderComment = workOrderComments.find(
|
||||
(currentComment) =>
|
||||
currentComment.workOrderCommentId === workOrderCommentId
|
||||
) as WorkOrderComment
|
||||
|
||||
let editFormElement: HTMLFormElement
|
||||
let editCloseModalFunction: () => void
|
||||
|
|
@ -1237,7 +1233,9 @@ declare const exports: Record<string, unknown>
|
|||
<th>Commentor</th>
|
||||
<th>Comment Date</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) {
|
||||
const tableRowElement = document.createElement('tr')
|
||||
|
|
@ -1389,9 +1387,8 @@ declare const exports: Record<string, unknown>
|
|||
}
|
||||
|
||||
const workOrderMilestones = responseJSON.workOrderMilestones.filter(
|
||||
(possibleMilestone) => {
|
||||
return possibleMilestone.workOrderId.toString() !== workOrderId
|
||||
}
|
||||
(possibleMilestone) =>
|
||||
possibleMilestone.workOrderId.toString() !== workOrderId
|
||||
)
|
||||
|
||||
clearPanelBlockElements(targetPanelElement)
|
||||
|
|
@ -1466,9 +1463,10 @@ declare const exports: Record<string, unknown>
|
|||
10
|
||||
)
|
||||
|
||||
const workOrderMilestone = workOrderMilestones.find((currentMilestone) => {
|
||||
return currentMilestone.workOrderMilestoneId === workOrderMilestoneId
|
||||
}) as WorkOrderMilestone
|
||||
const workOrderMilestone = workOrderMilestones.find(
|
||||
(currentMilestone) =>
|
||||
currentMilestone.workOrderMilestoneId === workOrderMilestoneId
|
||||
) as WorkOrderMilestone
|
||||
|
||||
function doComplete(): void {
|
||||
cityssm.postJSON(
|
||||
|
|
@ -1575,9 +1573,10 @@ declare const exports: Record<string, unknown>
|
|||
10
|
||||
)
|
||||
|
||||
const workOrderMilestone = workOrderMilestones.find((currentMilestone) => {
|
||||
return currentMilestone.workOrderMilestoneId === workOrderMilestoneId
|
||||
}) as WorkOrderMilestone
|
||||
const workOrderMilestone = workOrderMilestones.find(
|
||||
(currentMilestone) =>
|
||||
currentMilestone.workOrderMilestoneId === workOrderMilestoneId
|
||||
) as WorkOrderMilestone
|
||||
|
||||
let editCloseModalFunction: () => void
|
||||
let workOrderMilestoneDateStringElement: HTMLInputElement
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
"use strict";
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
const los = exports.los;
|
||||
|
|
|
|||
|
|
@ -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 { LOS } from '../../types/globalTypes.js'
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
"use strict";
|
||||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
const los = exports.los;
|
||||
|
|
|
|||
|
|
@ -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 { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue