linting
parent
e849f5989a
commit
80c60d1a4a
|
|
@ -20,7 +20,7 @@ export default async function addLot(lotForm, user) {
|
|||
await addOrUpdateLotField({
|
||||
lotId,
|
||||
lotTypeFieldId,
|
||||
lotFieldValue
|
||||
lotFieldValue: lotFieldValue ?? ''
|
||||
}, user, database);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,14 +53,14 @@ export default async function addLot(
|
|||
const lotTypeFieldIds = (lotForm.lotTypeFieldIds ?? '').split(',')
|
||||
|
||||
for (const lotTypeFieldId of lotTypeFieldIds) {
|
||||
const lotFieldValue = lotForm[`lotFieldValue_${lotTypeFieldId}`] as string
|
||||
const lotFieldValue = lotForm[`lotFieldValue_${lotTypeFieldId}`] as string | undefined
|
||||
|
||||
if ((lotFieldValue ?? '') !== '') {
|
||||
await addOrUpdateLotField(
|
||||
{
|
||||
lotId,
|
||||
lotTypeFieldId,
|
||||
lotFieldValue
|
||||
lotFieldValue: lotFieldValue ?? ''
|
||||
},
|
||||
user,
|
||||
database
|
||||
|
|
|
|||
|
|
@ -27,24 +27,24 @@ export default async function addLotOccupancy(lotOccupancyForm, user, connectedD
|
|||
await addOrUpdateLotOccupancyField({
|
||||
lotOccupancyId,
|
||||
occupancyTypeFieldId,
|
||||
lotOccupancyFieldValue
|
||||
lotOccupancyFieldValue: lotOccupancyFieldValue ?? ''
|
||||
}, user, database);
|
||||
}
|
||||
}
|
||||
if ((lotOccupancyForm.lotOccupantTypeId ?? '') !== '') {
|
||||
await addLotOccupancyOccupant({
|
||||
lotOccupancyId,
|
||||
lotOccupantTypeId: lotOccupancyForm.lotOccupantTypeId,
|
||||
occupantName: lotOccupancyForm.occupantName,
|
||||
occupantFamilyName: lotOccupancyForm.occupantFamilyName,
|
||||
occupantAddress1: lotOccupancyForm.occupantAddress1,
|
||||
occupantAddress2: lotOccupancyForm.occupantAddress2,
|
||||
occupantCity: lotOccupancyForm.occupantCity,
|
||||
occupantProvince: lotOccupancyForm.occupantProvince,
|
||||
occupantPostalCode: lotOccupancyForm.occupantPostalCode,
|
||||
occupantPhoneNumber: lotOccupancyForm.occupantPhoneNumber,
|
||||
occupantEmailAddress: lotOccupancyForm.occupantEmailAddress,
|
||||
occupantComment: lotOccupancyForm.occupantComment
|
||||
lotOccupantTypeId: lotOccupancyForm.lotOccupantTypeId ?? '',
|
||||
occupantName: lotOccupancyForm.occupantName ?? '',
|
||||
occupantFamilyName: lotOccupancyForm.occupantFamilyName ?? '',
|
||||
occupantAddress1: lotOccupancyForm.occupantAddress1 ?? '',
|
||||
occupantAddress2: lotOccupancyForm.occupantAddress2 ?? '',
|
||||
occupantCity: lotOccupancyForm.occupantCity ?? '',
|
||||
occupantProvince: lotOccupancyForm.occupantProvince ?? '',
|
||||
occupantPostalCode: lotOccupancyForm.occupantPostalCode ?? '',
|
||||
occupantPhoneNumber: lotOccupancyForm.occupantPhoneNumber ?? '',
|
||||
occupantEmailAddress: lotOccupancyForm.occupantEmailAddress ?? '',
|
||||
occupantComment: lotOccupancyForm.occupantComment ?? ''
|
||||
}, user, database);
|
||||
}
|
||||
if (connectedDatabase === undefined) {
|
||||
|
|
|
|||
|
|
@ -78,14 +78,14 @@ export default async function addLotOccupancy(
|
|||
for (const occupancyTypeFieldId of occupancyTypeFieldIds) {
|
||||
const lotOccupancyFieldValue = lotOccupancyForm[
|
||||
`lotOccupancyFieldValue_${occupancyTypeFieldId}`
|
||||
] as string
|
||||
] as string | undefined
|
||||
|
||||
if ((lotOccupancyFieldValue ?? '') !== '') {
|
||||
await addOrUpdateLotOccupancyField(
|
||||
{
|
||||
lotOccupancyId,
|
||||
occupancyTypeFieldId,
|
||||
lotOccupancyFieldValue
|
||||
lotOccupancyFieldValue: lotOccupancyFieldValue ?? ''
|
||||
},
|
||||
user,
|
||||
database
|
||||
|
|
@ -97,17 +97,17 @@ export default async function addLotOccupancy(
|
|||
await addLotOccupancyOccupant(
|
||||
{
|
||||
lotOccupancyId,
|
||||
lotOccupantTypeId: lotOccupancyForm.lotOccupantTypeId!,
|
||||
occupantName: lotOccupancyForm.occupantName!,
|
||||
occupantFamilyName: lotOccupancyForm.occupantFamilyName!,
|
||||
occupantAddress1: lotOccupancyForm.occupantAddress1!,
|
||||
occupantAddress2: lotOccupancyForm.occupantAddress2!,
|
||||
occupantCity: lotOccupancyForm.occupantCity!,
|
||||
occupantProvince: lotOccupancyForm.occupantProvince!,
|
||||
occupantPostalCode: lotOccupancyForm.occupantPostalCode!,
|
||||
occupantPhoneNumber: lotOccupancyForm.occupantPhoneNumber!,
|
||||
occupantEmailAddress: lotOccupancyForm.occupantEmailAddress!,
|
||||
occupantComment: lotOccupancyForm.occupantComment!
|
||||
lotOccupantTypeId: lotOccupancyForm.lotOccupantTypeId ?? '',
|
||||
occupantName: lotOccupancyForm.occupantName ?? '',
|
||||
occupantFamilyName: lotOccupancyForm.occupantFamilyName ?? '',
|
||||
occupantAddress1: lotOccupancyForm.occupantAddress1 ?? '',
|
||||
occupantAddress2: lotOccupancyForm.occupantAddress2 ?? '',
|
||||
occupantCity: lotOccupancyForm.occupantCity ?? '',
|
||||
occupantProvince: lotOccupancyForm.occupantProvince ?? '',
|
||||
occupantPostalCode: lotOccupancyForm.occupantPostalCode ?? '',
|
||||
occupantPhoneNumber: lotOccupancyForm.occupantPhoneNumber ?? '',
|
||||
occupantEmailAddress: lotOccupancyForm.occupantEmailAddress ?? '',
|
||||
occupantComment: lotOccupancyForm.occupantComment ?? ''
|
||||
},
|
||||
user,
|
||||
database
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { type PoolConnection } from 'better-sqlite-pool';
|
||||
import type { PoolConnection } from 'better-sqlite-pool';
|
||||
export interface AddLotOccupancyFeeForm {
|
||||
lotOccupancyId: number | string;
|
||||
feeId: number | string;
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ export default async function addLotOccupancyFee(lotOccupancyFeeForm, user, conn
|
|||
where lotOccupancyId = ?
|
||||
and feeId = ?`)
|
||||
.get(lotOccupancyFeeForm.lotOccupancyId, lotOccupancyFeeForm.feeId);
|
||||
if (record) {
|
||||
if (record.recordDelete_timeMillis) {
|
||||
if (record !== undefined) {
|
||||
if (record.recordDelete_timeMillis !== null) {
|
||||
database
|
||||
.prepare(`delete from LotOccupancyFees
|
||||
where recordDelete_timeMillis is not null
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { type PoolConnection } from 'better-sqlite-pool'
|
||||
import type { PoolConnection } from 'better-sqlite-pool'
|
||||
|
||||
import {
|
||||
calculateFeeAmount,
|
||||
|
|
@ -60,14 +60,16 @@ export default async function addLotOccupancyFee(
|
|||
where lotOccupancyId = ?
|
||||
and feeId = ?`
|
||||
)
|
||||
.get(lotOccupancyFeeForm.lotOccupancyId, lotOccupancyFeeForm.feeId) as {
|
||||
feeAmount?: number
|
||||
taxAmount?: number
|
||||
recordDelete_timeMillis?: number
|
||||
.get(lotOccupancyFeeForm.lotOccupancyId, lotOccupancyFeeForm.feeId) as
|
||||
| {
|
||||
feeAmount: number | null
|
||||
taxAmount: number | null
|
||||
recordDelete_timeMillis: number | null
|
||||
}
|
||||
| undefined
|
||||
|
||||
if (record) {
|
||||
if (record.recordDelete_timeMillis) {
|
||||
if (record !== undefined) {
|
||||
if (record.recordDelete_timeMillis !== null) {
|
||||
database
|
||||
.prepare(
|
||||
`delete from LotOccupancyFees
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@
|
|||
"bulma-tooltip": "^3.0.2",
|
||||
"cypress": "^13.15.1",
|
||||
"cypress-axe": "^1.5.0",
|
||||
"eslint-config-cityssm": "^14.0.1",
|
||||
"eslint-config-cityssm": "^14.0.2",
|
||||
"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.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-cityssm/-/eslint-config-cityssm-14.0.1.tgz",
|
||||
"integrity": "sha512-pmqsNjS0cxznslzhZeihz1iGSOe/4LgJZdJzi7D8R3KE3N6dDSxiIay0T+q2u8BgmZJJwmmvrL6Qlk0924mNyA==",
|
||||
"version": "14.0.2",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-cityssm/-/eslint-config-cityssm-14.0.2.tgz",
|
||||
"integrity": "sha512-eCQHo5VoJGXvuhSYaJ6erZ7NS/KwDP+D9pkB0GtJMdk8NNBuN0NJyvJojJJwdwYTVFzG+Jhcc9LJvd05mpoufA==",
|
||||
"dev": true,
|
||||
"license": "Unlicense",
|
||||
"dependencies": {
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@
|
|||
"bulma-tooltip": "^3.0.2",
|
||||
"cypress": "^13.15.1",
|
||||
"cypress-axe": "^1.5.0",
|
||||
"eslint-config-cityssm": "^14.0.1",
|
||||
"eslint-config-cityssm": "^14.0.2",
|
||||
"gulp": "^5.0.0",
|
||||
"gulp-sass": "^5.1.0",
|
||||
"nodemon": "^3.1.7",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
"use strict";
|
||||
/* @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
const los = exports.los;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
/* @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
|
||||
import type { BulmaJS } from '@cityssm/bulma-js/types.js'
|
||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
|
||||
|
||||
|
|
@ -24,7 +22,7 @@ declare const exports: Record<string, unknown>
|
|||
}
|
||||
| {
|
||||
success: false
|
||||
errorMessage: string
|
||||
errorMessage?: string
|
||||
}
|
||||
|
||||
if (responseJSON.success) {
|
||||
|
|
@ -59,7 +57,7 @@ declare const exports: Record<string, unknown>
|
|||
}
|
||||
| {
|
||||
success: false
|
||||
errorMessage: string
|
||||
errorMessage?: string
|
||||
}
|
||||
|
||||
if (responseJSON.success) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -8,14 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
let feeCategories = exports.feeCategories;
|
||||
delete exports.feeCategories;
|
||||
function getFeeCategory(feeCategoryId) {
|
||||
return feeCategories.find((currentFeeCategory) => {
|
||||
return currentFeeCategory.feeCategoryId === feeCategoryId;
|
||||
});
|
||||
return feeCategories.find((currentFeeCategory) => currentFeeCategory.feeCategoryId === feeCategoryId);
|
||||
}
|
||||
function getFee(feeCategory, feeId) {
|
||||
return feeCategory.fees.find((currentFee) => {
|
||||
return currentFee.feeId === feeId;
|
||||
});
|
||||
return feeCategory.fees.find((currentFee) => currentFee.feeId === feeId);
|
||||
}
|
||||
function renderFeeCategories() {
|
||||
if (feeCategories.length === 0) {
|
||||
|
|
@ -551,8 +545,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}
|
||||
}
|
||||
function toggleQuantityFields() {
|
||||
const includeQuanitityValue = editModalElement.querySelector('#feeEdit--includeQuantity').value;
|
||||
editModalElement.querySelector('#feeEdit--quantityUnit').disabled = includeQuanitityValue === '';
|
||||
const includeQuantityValue = editModalElement.querySelector('#feeEdit--includeQuantity').value;
|
||||
editModalElement.querySelector('#feeEdit--quantityUnit').disabled = includeQuantityValue === '';
|
||||
}
|
||||
cityssm.openHtmlModal('adminFees-editFee', {
|
||||
onshow(modalElement) {
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
||||
|
|
@ -33,19 +30,19 @@ declare const exports: Record<string, unknown>
|
|||
}
|
||||
| {
|
||||
success: false
|
||||
errorMessage: string
|
||||
errorMessage?: string
|
||||
}
|
||||
|
||||
function getFeeCategory(feeCategoryId: number): FeeCategory {
|
||||
return feeCategories.find((currentFeeCategory) => {
|
||||
return currentFeeCategory.feeCategoryId === feeCategoryId
|
||||
}) as FeeCategory
|
||||
return feeCategories.find(
|
||||
(currentFeeCategory) => currentFeeCategory.feeCategoryId === feeCategoryId
|
||||
) as FeeCategory
|
||||
}
|
||||
|
||||
function getFee(feeCategory: FeeCategory, feeId: number): Fee {
|
||||
return feeCategory.fees.find((currentFee) => {
|
||||
return currentFee.feeId === feeId
|
||||
}) as Fee
|
||||
return feeCategory.fees.find(
|
||||
(currentFee) => currentFee.feeId === feeId
|
||||
) as Fee
|
||||
}
|
||||
|
||||
function renderFeeCategories(): void {
|
||||
|
|
@ -861,7 +858,7 @@ declare const exports: Record<string, unknown>
|
|||
}
|
||||
|
||||
function toggleQuantityFields(): void {
|
||||
const includeQuanitityValue = (
|
||||
const includeQuantityValue = (
|
||||
editModalElement.querySelector(
|
||||
'#feeEdit--includeQuantity'
|
||||
) as HTMLSelectElement
|
||||
|
|
@ -871,7 +868,7 @@ declare const exports: Record<string, unknown>
|
|||
editModalElement.querySelector(
|
||||
'#feeEdit--quantityUnit'
|
||||
) as HTMLInputElement
|
||||
).disabled = includeQuanitityValue === ''
|
||||
).disabled = includeQuantityValue === ''
|
||||
}
|
||||
|
||||
cityssm.openHtmlModal('adminFees-editFee', {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ type ResponseJSON =
|
|||
}
|
||||
| {
|
||||
success: false
|
||||
errorMessage: string
|
||||
errorMessage?: string
|
||||
}
|
||||
;(() => {
|
||||
const los = exports.los as LOS
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}, (rawResponseJSON) => {
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.success) {
|
||||
window.location.href = los.getWorkOrderURL(workOrderId, true, true);
|
||||
globalThis.location.href = los.getWorkOrderURL(workOrderId, true, true);
|
||||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ declare const exports: Record<string, unknown>
|
|||
}
|
||||
|
||||
if (responseJSON.success) {
|
||||
window.location.href = los.getWorkOrderURL(
|
||||
globalThis.location.href = los.getWorkOrderURL(
|
||||
workOrderId,
|
||||
true,
|
||||
true
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ describe('Initialize Database', () => {
|
|||
if (!useTestDatabases) {
|
||||
assert.fail('Test database must be used!');
|
||||
}
|
||||
// eslint-disable-next-line security/detect-non-literal-fs-filename
|
||||
await fs.unlink(databasePath);
|
||||
const success = await initializeCemeteryDatabase();
|
||||
assert.ok(success);
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ describe('Initialize Database', () => {
|
|||
assert.fail('Test database must be used!')
|
||||
}
|
||||
|
||||
// eslint-disable-next-line security/detect-non-literal-fs-filename
|
||||
await fs.unlink(databasePath)
|
||||
|
||||
const success = await initializeCemeteryDatabase()
|
||||
|
|
|
|||
Loading…
Reference in New Issue