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 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() ===
lotOccupantTypeLowerCase);
});
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() ===
occupancyTypeLowerCase);
});
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 ===
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() ===
workOrderMilestoneTypeLowerCase);
});
return cachedWorkOrderMilestoneTypes.find((currentWorkOrderMilestoneType) => currentWorkOrderMilestoneType.workOrderMilestoneType.toLowerCase() ===
workOrderMilestoneTypeLowerCase);
}
export async function preloadCaches() {
debug('Preloading caches');
@ -240,7 +220,9 @@ export function clearCacheByTableName(tableName, relayMessage = true) {
pid: process.pid
};
debug(`Sending clear cache from worker: ${tableName}`);
process.send(workerMessage);
if (process.send !== undefined) {
process.send(workerMessage);
}
}
}
catch { }

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 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)
}
})

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 { 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;
}

View File

@ -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

View File

@ -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;

View File

@ -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)

View File

@ -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

16
package-lock.json generated
View File

@ -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"

View File

@ -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",

View File

@ -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;

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 { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'

View File

@ -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;
@ -72,7 +70,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
bulmaJS.confirm({
title: 'Delete Work Order Type',
message: `Are you sure you want to delete this work order type?<br />
Note that no work orders will be removed.`,
Note that no work orders will be removed.`,
messageIsHtml: true,
contextualColorName: 'warning',
okButton: {
@ -109,8 +107,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
const containerElement = document.querySelector('#container--workOrderTypes');
if (workOrderTypes.length === 0) {
containerElement.innerHTML = `<tr><td colspan="2">
<div class="message is-warning"><p class="message-body">There are no active work order types.</p></div>
</td></tr>`;
<div class="message is-warning"><p class="message-body">There are no active work order types.</p></div>
</td></tr>`;
return;
}
containerElement.innerHTML = '';
@ -236,7 +234,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
bulmaJS.confirm({
title: 'Delete Work Order Milestone Type',
message: `Are you sure you want to delete this work order milestone type?<br />
Note that no work orders will be removed.`,
Note that no work orders will be removed.`,
messageIsHtml: true,
contextualColorName: 'warning',
okButton: {
@ -273,8 +271,10 @@ 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>
</td></tr>`;
<div class="message is-warning">
<p class="message-body">There are no active work order milestone types.</p>
</div>
</td></tr>`;
return;
}
containerElement.innerHTML = '';
@ -400,7 +400,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
bulmaJS.confirm({
title: `Delete ${los.escapedAliases.Lot} Status`,
message: `Are you sure you want to delete this status?<br />
Note that no ${los.escapedAliases.lot} will be removed.`,
Note that no ${los.escapedAliases.lot} will be removed.`,
messageIsHtml: true,
contextualColorName: 'warning',
okButton: {
@ -438,8 +438,10 @@ 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>
</td></tr>`;
<div class="message is-warning">
<p class="message-body">There are no active ${los.escapedAliases.lot} statuses.</p>
</div>
</td></tr>`;
return;
}
containerElement.innerHTML = '';
@ -603,10 +605,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
if (lotOccupantTypes.length === 0) {
// eslint-disable-next-line no-unsanitized/property
containerElement.innerHTML = `<tr><td colspan="3">
<div class="message is-warning">
<p class="message-body">There are no active ${los.escapedAliases.lot} ${los.escapedAliases.occupant} types.</p>
</div>
</td></tr>`;
<div class="message is-warning">
<p class="message-body">There are no active ${los.escapedAliases.lot} ${los.escapedAliases.occupant} types.</p>
</div>
</td></tr>`;
return;
}
containerElement.innerHTML = '';

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 { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
@ -121,7 +118,7 @@ declare const bulmaJS: BulmaJS
bulmaJS.confirm({
title: 'Delete Work Order Type',
message: `Are you sure you want to delete this work order type?<br />
Note that no work orders will be removed.`,
Note that no work orders will be removed.`,
messageIsHtml: true,
contextualColorName: 'warning',
okButton: {
@ -172,8 +169,8 @@ declare const bulmaJS: BulmaJS
if (workOrderTypes.length === 0) {
containerElement.innerHTML = `<tr><td colspan="2">
<div class="message is-warning"><p class="message-body">There are no active work order types.</p></div>
</td></tr>`
<div class="message is-warning"><p class="message-body">There are no active work order types.</p></div>
</td></tr>`
return
}
@ -361,7 +358,7 @@ declare const bulmaJS: BulmaJS
bulmaJS.confirm({
title: 'Delete Work Order Milestone Type',
message: `Are you sure you want to delete this work order milestone type?<br />
Note that no work orders will be removed.`,
Note that no work orders will be removed.`,
messageIsHtml: true,
contextualColorName: 'warning',
okButton: {
@ -413,8 +410,10 @@ 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>
</td></tr>`
<div class="message is-warning">
<p class="message-body">There are no active work order milestone types.</p>
</div>
</td></tr>`
return
}
@ -602,7 +601,7 @@ declare const bulmaJS: BulmaJS
bulmaJS.confirm({
title: `Delete ${los.escapedAliases.Lot} Status`,
message: `Are you sure you want to delete this status?<br />
Note that no ${los.escapedAliases.lot} will be removed.`,
Note that no ${los.escapedAliases.lot} will be removed.`,
messageIsHtml: true,
contextualColorName: 'warning',
okButton: {
@ -654,8 +653,10 @@ 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>
</td></tr>`
<div class="message is-warning">
<p class="message-body">There are no active ${los.escapedAliases.lot} statuses.</p>
</div>
</td></tr>`
return
}
@ -893,10 +894,10 @@ declare const bulmaJS: BulmaJS
if (lotOccupantTypes.length === 0) {
// eslint-disable-next-line no-unsanitized/property
containerElement.innerHTML = `<tr><td colspan="3">
<div class="message is-warning">
<p class="message-body">There are no active ${los.escapedAliases.lot} ${los.escapedAliases.occupant} types.</p>
</div>
</td></tr>`
<div class="message is-warning">
<p class="message-body">There are no active ${los.escapedAliases.lot} ${los.escapedAliases.occupant} types.</p>
</div>
</td></tr>`
return
}

View File

@ -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;

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'
declare const exports: Record<string, unknown>

View File

@ -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);
}
}
});
@ -1355,11 +1355,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
categoryContainerElement
.querySelector('.columns')
?.insertAdjacentHTML('beforeend', `<div class="column is-narrow has-text-right">
<button class="button is-small is-success" type="button" data-fee-category-id="${feeCategory.feeCategoryId}">
<span class="icon is-small"><i class="fas fa-plus" aria-hidden="true"></i></span>
<span>Add Fee Group</span>
</button>
</div>`);
<button class="button is-small is-success" type="button" data-fee-category-id="${feeCategory.feeCategoryId}">
<span class="icon is-small"><i class="fas fa-plus" aria-hidden="true"></i></span>
<span>Add Fee Group</span>
</button>
</div>`);
categoryContainerElement
.querySelector('button')
?.addEventListener('click', doAddFeeCategory);
@ -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: {

View File

@ -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
)
@ -2197,11 +2197,11 @@ declare const exports: Record<string, unknown>
?.insertAdjacentHTML(
'beforeend',
`<div class="column is-narrow has-text-right">
<button class="button is-small is-success" type="button" data-fee-category-id="${feeCategory.feeCategoryId}">
<span class="icon is-small"><i class="fas fa-plus" aria-hidden="true"></i></span>
<span>Add Fee Group</span>
</button>
</div>`
<button class="button is-small is-success" type="button" data-fee-category-id="${feeCategory.feeCategoryId}">
<span class="icon is-small"><i class="fas fa-plus" aria-hidden="true"></i></span>
<span>Add Fee Group</span>
</button>
</div>`
)
categoryContainerElement
@ -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: {

View File

@ -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 +
((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);
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) => soFar + currentTransaction.transactionAmount, 0) ?? 0).toFixed(2);
let feeIconHTML = '';
if (feeTotal !== '0.00' || transactionTotal !== '0.00') {
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 { 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)

View File

@ -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;

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 { 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

View File

@ -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');

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'
declare const exports: Record<string, unknown>

View File

@ -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;
}

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 { 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

View File

@ -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({

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 { 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}`,

View File

@ -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;

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 { 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');

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> =
document.querySelectorAll('.menu a')

View File

@ -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',
@ -242,23 +238,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
if (workOrderLotOccupancies.length === 0) {
// eslint-disable-next-line no-unsanitized/property
occupanciesContainerElement.innerHTML = `<div class="message is-info">
<p class="message-body">There are no ${los.escapedAliases.occupancies} associated with this work order.</p>
</div>`;
<p class="message-body">There are no ${los.escapedAliases.occupancies} associated with this work order.</p>
</div>`;
return;
}
// eslint-disable-next-line no-unsanitized/property
occupanciesContainerElement.innerHTML = `<table class="table is-fullwidth is-striped is-hoverable">
<thead><tr>
<th class="has-width-1"></th>
<th>${los.escapedAliases.Occupancy} Type</th>
<th>${los.escapedAliases.Lot}</th>
<th>${los.escapedAliases.OccupancyStartDate}</th>
<th>End Date</th>
<th>${los.escapedAliases.Occupants}</th>
<th class="has-width-1"></th>
</tr></thead>
<tbody></tbody>
</table>`;
<thead><tr>
<th class="has-width-1"></th>
<th>${los.escapedAliases.Occupancy} Type</th>
<th>${los.escapedAliases.Lot}</th>
<th>${los.escapedAliases.OccupancyStartDate}</th>
<th>End Date</th>
<th>${los.escapedAliases.Occupants}</th>
<th class="has-width-1"></th>
</tr></thead>
<tbody></tbody>
</table>`;
const currentDateString = cityssm.dateToString(new Date());
for (const lotOccupancy of workOrderLotOccupancies) {
const rowElement = document.createElement('tr');
@ -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
@ -303,15 +297,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
let occupantsHTML = '';
for (const occupant of lotOccupancy.lotOccupancyOccupants) {
occupantsHTML += `<li class="has-tooltip-left"
data-tooltip="${cityssm.escapeHTML(occupant.lotOccupantType ?? '')}">
<span class="fa-li">
<i class="fas fa-fw fa-${cityssm.escapeHTML((occupant.fontAwesomeIconClass ?? '') === ''
data-tooltip="${cityssm.escapeHTML(occupant.lotOccupantType ?? '')}">
<span class="fa-li">
<i class="fas fa-fw fa-${cityssm.escapeHTML((occupant.fontAwesomeIconClass ?? '') === ''
? 'user'
: occupant.fontAwesomeIconClass ?? '')}" aria-label="${los.escapedAliases.Occupant}"></i>
</span>
${cityssm.escapeHTML(occupant.occupantName ?? '')}
${cityssm.escapeHTML(occupant.occupantFamilyName ?? '')}
</li>`;
</span>
${cityssm.escapeHTML(occupant.occupantName ?? '')}
${cityssm.escapeHTML(occupant.occupantFamilyName ?? '')}
</li>`;
}
// eslint-disable-next-line no-unsanitized/method
rowElement.insertAdjacentHTML('beforeend', `<td>
@ -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();
@ -441,46 +433,46 @@ Object.defineProperty(exports, "__esModule", { value: true });
if (workOrderLots.length === 0) {
// eslint-disable-next-line no-unsanitized/property
lotsContainerElement.innerHTML = `<div class="message is-info">
<p class="message-body">There are no ${los.escapedAliases.lots} associated with this work order.</p>
</div>`;
<p class="message-body">There are no ${los.escapedAliases.lots} associated with this work order.</p>
</div>`;
return;
}
// eslint-disable-next-line no-unsanitized/property
lotsContainerElement.innerHTML = `<table class="table is-fullwidth is-striped is-hoverable">
<thead><tr>
<th>${los.escapedAliases.Lot}</th>
<th>${los.escapedAliases.Map}</th>
<th>${los.escapedAliases.Lot} Type</th>
<th>Status</th>
<th class="has-width-1"></th>
</tr></thead>
<tbody></tbody>
</table>`;
<thead><tr>
<th>${los.escapedAliases.Lot}</th>
<th>${los.escapedAliases.Map}</th>
<th>${los.escapedAliases.Lot} Type</th>
<th>Status</th>
<th class="has-width-1"></th>
</tr></thead>
<tbody></tbody>
</table>`;
for (const lot of workOrderLots) {
const rowElement = document.createElement('tr');
rowElement.className = 'container--lot';
rowElement.dataset.lotId = lot.lotId.toString();
// eslint-disable-next-line no-unsanitized/property
rowElement.innerHTML = `<td>
<a class="has-text-weight-bold" href="${los.getLotURL(lot.lotId)}">
${cityssm.escapeHTML(lot.lotName ?? '')}
</a>
</td><td>
${cityssm.escapeHTML(lot.mapName ?? '')}
</td><td>
${cityssm.escapeHTML(lot.lotType ?? '')}
</td><td>
${lot.lotStatusId
<a class="has-text-weight-bold" href="${los.getLotURL(lot.lotId)}">
${cityssm.escapeHTML(lot.lotName ?? '')}
</a>
</td><td>
${cityssm.escapeHTML(lot.mapName ?? '')}
</td><td>
${cityssm.escapeHTML(lot.lotType ?? '')}
</td><td>
${lot.lotStatusId
? cityssm.escapeHTML(lot.lotStatus ?? '')
: '<span class="has-text-grey">(No Status)</span>'}
</td><td class="is-nowrap">
<button class="button is-small is-light is-info button--editLotStatus" data-tooltip="Update Status" type="button">
<i class="fas fa-pencil-alt" aria-hidden="true"></i>
</button>
<button class="button is-small is-light is-danger button--deleteLot" data-tooltip="Delete Relationship" type="button">
<i class="fas fa-trash" aria-hidden="true"></i>
</button>
</td>`;
</td><td class="is-nowrap">
<button class="button is-small is-light is-info button--editLotStatus" data-tooltip="Update Status" type="button">
<i class="fas fa-pencil-alt" aria-hidden="true"></i>
</button>
<button class="button is-small is-light is-danger button--deleteLot" data-tooltip="Delete Relationship" type="button">
<i class="fas fa-trash" aria-hidden="true"></i>
</button>
</td>`;
rowElement
.querySelector('.button--editLotStatus')
?.addEventListener('click', openEditLotStatus);
@ -520,35 +512,35 @@ Object.defineProperty(exports, "__esModule", { value: true });
const responseJSON = rawResponseJSON;
if (responseJSON.lotOccupancies.length === 0) {
searchResultsContainerElement.innerHTML = `<div class="message is-info">
<p class="message-body">There are no records that meet the search criteria.</p>
</div>`;
<p class="message-body">There are no records that meet the search criteria.</p>
</div>`;
return;
}
// eslint-disable-next-line no-unsanitized/property
searchResultsContainerElement.innerHTML = `<table class="table is-fullwidth is-striped is-hoverable">
<thead><tr>
<th class="has-width-1"></th>
<th>${los.escapedAliases.Occupancy} Type</th>
<th>${los.escapedAliases.Lot}</th>
<th>${los.escapedAliases.OccupancyStartDate}</th>
<th>End Date</th>
<th>${los.escapedAliases.Occupants}</th>
</tr></thead>
<tbody></tbody>
</table>`;
<thead><tr>
<th class="has-width-1"></th>
<th>${los.escapedAliases.Occupancy} Type</th>
<th>${los.escapedAliases.Lot}</th>
<th>${los.escapedAliases.OccupancyStartDate}</th>
<th>End Date</th>
<th>${los.escapedAliases.Occupants}</th>
</tr></thead>
<tbody></tbody>
</table>`;
for (const lotOccupancy of responseJSON.lotOccupancies) {
const rowElement = document.createElement('tr');
rowElement.className = 'container--lotOccupancy';
rowElement.dataset.lotOccupancyId =
lotOccupancy.lotOccupancyId.toString();
rowElement.innerHTML = `<td class="has-text-centered">
<button class="button is-small is-success button--addLotOccupancy" data-tooltip="Add" type="button" aria-label="Add">
<i class="fas fa-plus" aria-hidden="true"></i>
</button>
</td>
<td class="has-text-weight-bold">
${cityssm.escapeHTML(lotOccupancy.occupancyType ?? '')}
</td>`;
<button class="button is-small is-success button--addLotOccupancy" data-tooltip="Add" type="button" aria-label="Add">
<i class="fas fa-plus" aria-hidden="true"></i>
</button>
</td>
<td class="has-text-weight-bold">
${cityssm.escapeHTML(lotOccupancy.occupancyType ?? '')}
</td>`;
if (lotOccupancy.lotId) {
rowElement.insertAdjacentHTML('beforeend', `<td>${cityssm.escapeHTML(lotOccupancy.lotName ?? '')}</td>`);
}
@ -638,32 +630,32 @@ Object.defineProperty(exports, "__esModule", { value: true });
}
// eslint-disable-next-line no-unsanitized/property
searchResultsContainerElement.innerHTML = `<table class="table is-fullwidth is-striped is-hoverable">
<thead><tr>
<th class="has-width-1"></th>
<th>${los.escapedAliases.Lot}</th>
<th>${los.escapedAliases.Map}</th>
<th>${los.escapedAliases.Lot} Type</th>
<th>Status</th>
</tr></thead>
<tbody></tbody>
</table>`;
<thead><tr>
<th class="has-width-1"></th>
<th>${los.escapedAliases.Lot}</th>
<th>${los.escapedAliases.Map}</th>
<th>${los.escapedAliases.Lot} Type</th>
<th>Status</th>
</tr></thead>
<tbody></tbody>
</table>`;
for (const lot of responseJSON.lots) {
const rowElement = document.createElement('tr');
rowElement.className = 'container--lot';
rowElement.dataset.lotId = lot.lotId.toString();
rowElement.innerHTML = `<td class="has-text-centered">
<button class="button is-small is-success button--addLot" data-tooltip="Add" type="button" aria-label="Add">
<i class="fas fa-plus" aria-hidden="true"></i>
</button>
</td><td class="has-text-weight-bold">
${cityssm.escapeHTML(lot.lotName ?? '')}
</td><td>
${cityssm.escapeHTML(lot.mapName ?? '')}
</td><td>
${cityssm.escapeHTML(lot.lotType ?? '')}
</td><td>
${cityssm.escapeHTML(lot.lotStatus ?? '')}
</td>`;
<button class="button is-small is-success button--addLot" data-tooltip="Add" type="button" aria-label="Add">
<i class="fas fa-plus" aria-hidden="true"></i>
</button>
</td><td class="has-text-weight-bold">
${cityssm.escapeHTML(lot.lotName ?? '')}
</td><td>
${cityssm.escapeHTML(lot.mapName ?? '')}
</td><td>
${cityssm.escapeHTML(lot.lotType ?? '')}
</td><td>
${cityssm.escapeHTML(lot.lotStatus ?? '')}
</td>`;
rowElement
.querySelector('.button--addLot')
?.addEventListener('click', doAddLot);
@ -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) {
@ -811,35 +801,37 @@ Object.defineProperty(exports, "__esModule", { value: true });
const tableElement = document.createElement('table');
tableElement.className = 'table is-fullwidth is-striped is-hoverable';
tableElement.innerHTML = `<thead><tr>
<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>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>`;
for (const workOrderComment of workOrderComments) {
const tableRowElement = document.createElement('tr');
tableRowElement.dataset.workOrderCommentId =
workOrderComment.workOrderCommentId?.toString();
// eslint-disable-next-line no-unsanitized/property
tableRowElement.innerHTML = `<td>
${cityssm.escapeHTML(workOrderComment.recordCreate_userName ?? '')}
</td><td>
${workOrderComment.workOrderCommentDateString}
${workOrderComment.workOrderCommentTime === 0
${cityssm.escapeHTML(workOrderComment.recordCreate_userName ?? '')}
</td><td>
${workOrderComment.workOrderCommentDateString}
${workOrderComment.workOrderCommentTime === 0
? ''
: workOrderComment.workOrderCommentTimePeriodString}
</td><td>
${cityssm.escapeHTML(workOrderComment.workOrderComment ?? '')}
</td><td class="is-hidden-print">
<div class="buttons are-small is-justify-content-end">
<button class="button is-primary button--edit" type="button">
<span class="icon is-small"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>
<span>Edit</span>
</button>
<button class="button is-light is-danger button--delete" data-tooltip="Delete Comment" type="button" aria-label="Delete">
<i class="fas fa-trash" aria-hidden="true"></i>
</button>
</div>
</td>`;
</td><td>
${cityssm.escapeHTML(workOrderComment.workOrderComment ?? '')}
</td><td class="is-hidden-print">
<div class="buttons are-small is-justify-content-end">
<button class="button is-primary button--edit" type="button">
<span class="icon is-small"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>
<span>Edit</span>
</button>
<button class="button is-light is-danger button--delete" data-tooltip="Delete Comment" type="button" aria-label="Delete">
<i class="fas fa-trash" aria-hidden="true"></i>
</button>
</div>
</td>`;
tableRowElement
.querySelector('.button--edit')
?.addEventListener('click', openEditWorkOrderComment);
@ -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) {

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 { 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({
@ -363,25 +360,25 @@ declare const exports: Record<string, unknown>
if (workOrderLotOccupancies.length === 0) {
// eslint-disable-next-line no-unsanitized/property
occupanciesContainerElement.innerHTML = `<div class="message is-info">
<p class="message-body">There are no ${los.escapedAliases.occupancies} associated with this work order.</p>
</div>`
<p class="message-body">There are no ${los.escapedAliases.occupancies} associated with this work order.</p>
</div>`
return
}
// eslint-disable-next-line no-unsanitized/property
occupanciesContainerElement.innerHTML = `<table class="table is-fullwidth is-striped is-hoverable">
<thead><tr>
<th class="has-width-1"></th>
<th>${los.escapedAliases.Occupancy} Type</th>
<th>${los.escapedAliases.Lot}</th>
<th>${los.escapedAliases.OccupancyStartDate}</th>
<th>End Date</th>
<th>${los.escapedAliases.Occupants}</th>
<th class="has-width-1"></th>
</tr></thead>
<tbody></tbody>
</table>`
<thead><tr>
<th class="has-width-1"></th>
<th>${los.escapedAliases.Occupancy} Type</th>
<th>${los.escapedAliases.Lot}</th>
<th>${los.escapedAliases.OccupancyStartDate}</th>
<th>End Date</th>
<th>${los.escapedAliases.Occupants}</th>
<th class="has-width-1"></th>
</tr></thead>
<tbody></tbody>
</table>`
const currentDateString = cityssm.dateToString(new Date())
@ -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">
@ -446,17 +441,17 @@ declare const exports: Record<string, unknown>
for (const occupant of lotOccupancy.lotOccupancyOccupants!) {
occupantsHTML += `<li class="has-tooltip-left"
data-tooltip="${cityssm.escapeHTML(occupant.lotOccupantType ?? '')}">
<span class="fa-li">
<i class="fas fa-fw fa-${cityssm.escapeHTML(
(occupant.fontAwesomeIconClass ?? '') === ''
? 'user'
: occupant.fontAwesomeIconClass ?? ''
)}" aria-label="${los.escapedAliases.Occupant}"></i>
</span>
${cityssm.escapeHTML(occupant.occupantName ?? '')}
${cityssm.escapeHTML(occupant.occupantFamilyName ?? '')}
</li>`
data-tooltip="${cityssm.escapeHTML(occupant.lotOccupantType ?? '')}">
<span class="fa-li">
<i class="fas fa-fw fa-${cityssm.escapeHTML(
(occupant.fontAwesomeIconClass ?? '') === ''
? 'user'
: occupant.fontAwesomeIconClass ?? ''
)}" aria-label="${los.escapedAliases.Occupant}"></i>
</span>
${cityssm.escapeHTML(occupant.occupantName ?? '')}
${cityssm.escapeHTML(occupant.occupantFamilyName ?? '')}
</li>`
}
// eslint-disable-next-line no-unsanitized/method
@ -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
@ -665,23 +660,23 @@ declare const exports: Record<string, unknown>
if (workOrderLots.length === 0) {
// eslint-disable-next-line no-unsanitized/property
lotsContainerElement.innerHTML = `<div class="message is-info">
<p class="message-body">There are no ${los.escapedAliases.lots} associated with this work order.</p>
</div>`
<p class="message-body">There are no ${los.escapedAliases.lots} associated with this work order.</p>
</div>`
return
}
// eslint-disable-next-line no-unsanitized/property
lotsContainerElement.innerHTML = `<table class="table is-fullwidth is-striped is-hoverable">
<thead><tr>
<th>${los.escapedAliases.Lot}</th>
<th>${los.escapedAliases.Map}</th>
<th>${los.escapedAliases.Lot} Type</th>
<th>Status</th>
<th class="has-width-1"></th>
</tr></thead>
<tbody></tbody>
</table>`
<thead><tr>
<th>${los.escapedAliases.Lot}</th>
<th>${los.escapedAliases.Map}</th>
<th>${los.escapedAliases.Lot} Type</th>
<th>Status</th>
<th class="has-width-1"></th>
</tr></thead>
<tbody></tbody>
</table>`
for (const lot of workOrderLots) {
const rowElement = document.createElement('tr')
@ -691,27 +686,27 @@ declare const exports: Record<string, unknown>
// eslint-disable-next-line no-unsanitized/property
rowElement.innerHTML = `<td>
<a class="has-text-weight-bold" href="${los.getLotURL(lot.lotId)}">
${cityssm.escapeHTML(lot.lotName ?? '')}
</a>
</td><td>
${cityssm.escapeHTML(lot.mapName ?? '')}
</td><td>
${cityssm.escapeHTML(lot.lotType ?? '')}
</td><td>
${
lot.lotStatusId
? cityssm.escapeHTML(lot.lotStatus ?? '')
: '<span class="has-text-grey">(No Status)</span>'
}
</td><td class="is-nowrap">
<button class="button is-small is-light is-info button--editLotStatus" data-tooltip="Update Status" type="button">
<i class="fas fa-pencil-alt" aria-hidden="true"></i>
</button>
<button class="button is-small is-light is-danger button--deleteLot" data-tooltip="Delete Relationship" type="button">
<i class="fas fa-trash" aria-hidden="true"></i>
</button>
</td>`
<a class="has-text-weight-bold" href="${los.getLotURL(lot.lotId)}">
${cityssm.escapeHTML(lot.lotName ?? '')}
</a>
</td><td>
${cityssm.escapeHTML(lot.mapName ?? '')}
</td><td>
${cityssm.escapeHTML(lot.lotType ?? '')}
</td><td>
${
lot.lotStatusId
? cityssm.escapeHTML(lot.lotStatus ?? '')
: '<span class="has-text-grey">(No Status)</span>'
}
</td><td class="is-nowrap">
<button class="button is-small is-light is-info button--editLotStatus" data-tooltip="Update Status" type="button">
<i class="fas fa-pencil-alt" aria-hidden="true"></i>
</button>
<button class="button is-small is-light is-danger button--deleteLot" data-tooltip="Delete Relationship" type="button">
<i class="fas fa-trash" aria-hidden="true"></i>
</button>
</td>`
rowElement
.querySelector('.button--editLotStatus')
@ -771,24 +766,24 @@ declare const exports: Record<string, unknown>
if (responseJSON.lotOccupancies.length === 0) {
searchResultsContainerElement.innerHTML = `<div class="message is-info">
<p class="message-body">There are no records that meet the search criteria.</p>
</div>`
<p class="message-body">There are no records that meet the search criteria.</p>
</div>`
return
}
// eslint-disable-next-line no-unsanitized/property
searchResultsContainerElement.innerHTML = `<table class="table is-fullwidth is-striped is-hoverable">
<thead><tr>
<th class="has-width-1"></th>
<th>${los.escapedAliases.Occupancy} Type</th>
<th>${los.escapedAliases.Lot}</th>
<th>${los.escapedAliases.OccupancyStartDate}</th>
<th>End Date</th>
<th>${los.escapedAliases.Occupants}</th>
</tr></thead>
<tbody></tbody>
</table>`
<thead><tr>
<th class="has-width-1"></th>
<th>${los.escapedAliases.Occupancy} Type</th>
<th>${los.escapedAliases.Lot}</th>
<th>${los.escapedAliases.OccupancyStartDate}</th>
<th>End Date</th>
<th>${los.escapedAliases.Occupants}</th>
</tr></thead>
<tbody></tbody>
</table>`
for (const lotOccupancy of responseJSON.lotOccupancies) {
const rowElement = document.createElement('tr')
@ -797,13 +792,13 @@ declare const exports: Record<string, unknown>
lotOccupancy.lotOccupancyId.toString()
rowElement.innerHTML = `<td class="has-text-centered">
<button class="button is-small is-success button--addLotOccupancy" data-tooltip="Add" type="button" aria-label="Add">
<i class="fas fa-plus" aria-hidden="true"></i>
</button>
</td>
<td class="has-text-weight-bold">
${cityssm.escapeHTML(lotOccupancy.occupancyType ?? '')}
</td>`
<button class="button is-small is-success button--addLotOccupancy" data-tooltip="Add" type="button" aria-label="Add">
<i class="fas fa-plus" aria-hidden="true"></i>
</button>
</td>
<td class="has-text-weight-bold">
${cityssm.escapeHTML(lotOccupancy.occupancyType ?? '')}
</td>`
if (lotOccupancy.lotId) {
rowElement.insertAdjacentHTML(
@ -966,15 +961,15 @@ declare const exports: Record<string, unknown>
// eslint-disable-next-line no-unsanitized/property
searchResultsContainerElement.innerHTML = `<table class="table is-fullwidth is-striped is-hoverable">
<thead><tr>
<th class="has-width-1"></th>
<th>${los.escapedAliases.Lot}</th>
<th>${los.escapedAliases.Map}</th>
<th>${los.escapedAliases.Lot} Type</th>
<th>Status</th>
</tr></thead>
<tbody></tbody>
</table>`
<thead><tr>
<th class="has-width-1"></th>
<th>${los.escapedAliases.Lot}</th>
<th>${los.escapedAliases.Map}</th>
<th>${los.escapedAliases.Lot} Type</th>
<th>Status</th>
</tr></thead>
<tbody></tbody>
</table>`
for (const lot of responseJSON.lots) {
const rowElement = document.createElement('tr')
@ -982,18 +977,18 @@ declare const exports: Record<string, unknown>
rowElement.dataset.lotId = lot.lotId.toString()
rowElement.innerHTML = `<td class="has-text-centered">
<button class="button is-small is-success button--addLot" data-tooltip="Add" type="button" aria-label="Add">
<i class="fas fa-plus" aria-hidden="true"></i>
</button>
</td><td class="has-text-weight-bold">
${cityssm.escapeHTML(lot.lotName ?? '')}
</td><td>
${cityssm.escapeHTML(lot.mapName ?? '')}
</td><td>
${cityssm.escapeHTML(lot.lotType ?? '')}
</td><td>
${cityssm.escapeHTML(lot.lotStatus ?? '')}
</td>`
<button class="button is-small is-success button--addLot" data-tooltip="Add" type="button" aria-label="Add">
<i class="fas fa-plus" aria-hidden="true"></i>
</button>
</td><td class="has-text-weight-bold">
${cityssm.escapeHTML(lot.lotName ?? '')}
</td><td>
${cityssm.escapeHTML(lot.mapName ?? '')}
</td><td>
${cityssm.escapeHTML(lot.lotType ?? '')}
</td><td>
${cityssm.escapeHTML(lot.lotStatus ?? '')}
</td>`
rowElement
.querySelector('.button--addLot')
@ -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
@ -1234,10 +1230,12 @@ declare const exports: Record<string, unknown>
const tableElement = document.createElement('table')
tableElement.className = 'table is-fullwidth is-striped is-hoverable'
tableElement.innerHTML = `<thead><tr>
<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>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>`
for (const workOrderComment of workOrderComments) {
const tableRowElement = document.createElement('tr')
@ -1247,27 +1245,27 @@ declare const exports: Record<string, unknown>
// eslint-disable-next-line no-unsanitized/property
tableRowElement.innerHTML = `<td>
${cityssm.escapeHTML(workOrderComment.recordCreate_userName ?? '')}
</td><td>
${workOrderComment.workOrderCommentDateString}
${
workOrderComment.workOrderCommentTime === 0
? ''
: workOrderComment.workOrderCommentTimePeriodString
}
</td><td>
${cityssm.escapeHTML(workOrderComment.workOrderComment ?? '')}
</td><td class="is-hidden-print">
<div class="buttons are-small is-justify-content-end">
<button class="button is-primary button--edit" type="button">
<span class="icon is-small"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>
<span>Edit</span>
</button>
<button class="button is-light is-danger button--delete" data-tooltip="Delete Comment" type="button" aria-label="Delete">
<i class="fas fa-trash" aria-hidden="true"></i>
</button>
</div>
</td>`
${cityssm.escapeHTML(workOrderComment.recordCreate_userName ?? '')}
</td><td>
${workOrderComment.workOrderCommentDateString}
${
workOrderComment.workOrderCommentTime === 0
? ''
: workOrderComment.workOrderCommentTimePeriodString
}
</td><td>
${cityssm.escapeHTML(workOrderComment.workOrderComment ?? '')}
</td><td class="is-hidden-print">
<div class="buttons are-small is-justify-content-end">
<button class="button is-primary button--edit" type="button">
<span class="icon is-small"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>
<span>Edit</span>
</button>
<button class="button is-light is-danger button--delete" data-tooltip="Delete Comment" type="button" aria-label="Delete">
<i class="fas fa-trash" aria-hidden="true"></i>
</button>
</div>
</td>`
tableRowElement
.querySelector('.button--edit')
@ -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

View File

@ -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;

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 { LOS } from '../../types/globalTypes.js'

View File

@ -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;

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 { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'