linting
parent
669d942c0d
commit
4af21f4261
4
app.js
4
app.js
|
|
@ -1,5 +1,5 @@
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import * as dateTimeFns from '@cityssm/utils-datetime';
|
import * as dateTimeFunctions from '@cityssm/utils-datetime';
|
||||||
import compression from 'compression';
|
import compression from 'compression';
|
||||||
import cookieParser from 'cookie-parser';
|
import cookieParser from 'cookie-parser';
|
||||||
import csurf from 'csurf';
|
import csurf from 'csurf';
|
||||||
|
|
@ -129,7 +129,7 @@ app.use((request, response, next) => {
|
||||||
response.locals.csrfToken = request.csrfToken();
|
response.locals.csrfToken = request.csrfToken();
|
||||||
response.locals.configFunctions = configFunctions;
|
response.locals.configFunctions = configFunctions;
|
||||||
response.locals.printFunctions = printFunctions;
|
response.locals.printFunctions = printFunctions;
|
||||||
response.locals.dateTimeFunctions = dateTimeFns;
|
response.locals.dateTimeFunctions = dateTimeFunctions;
|
||||||
response.locals.urlPrefix = configFunctions.getConfigProperty('reverseProxy.urlPrefix');
|
response.locals.urlPrefix = configFunctions.getConfigProperty('reverseProxy.urlPrefix');
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
4
app.ts
4
app.ts
|
|
@ -1,6 +1,6 @@
|
||||||
import path from 'node:path'
|
import path from 'node:path'
|
||||||
|
|
||||||
import * as dateTimeFns from '@cityssm/utils-datetime'
|
import * as dateTimeFunctions from '@cityssm/utils-datetime'
|
||||||
import compression from 'compression'
|
import compression from 'compression'
|
||||||
import cookieParser from 'cookie-parser'
|
import cookieParser from 'cookie-parser'
|
||||||
import csurf from 'csurf'
|
import csurf from 'csurf'
|
||||||
|
|
@ -230,7 +230,7 @@ app.use((request, response, next) => {
|
||||||
|
|
||||||
response.locals.configFunctions = configFunctions
|
response.locals.configFunctions = configFunctions
|
||||||
response.locals.printFunctions = printFunctions
|
response.locals.printFunctions = printFunctions
|
||||||
response.locals.dateTimeFunctions = dateTimeFns
|
response.locals.dateTimeFunctions = dateTimeFunctions
|
||||||
|
|
||||||
response.locals.urlPrefix = configFunctions.getConfigProperty(
|
response.locals.urlPrefix = configFunctions.getConfigProperty(
|
||||||
'reverseProxy.urlPrefix'
|
'reverseProxy.urlPrefix'
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ function buildEventSummary(milestone) {
|
||||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||||
function buildEventDescriptionHTML_occupancies(request, milestone) {
|
function buildEventDescriptionHTML_occupancies(request, milestone) {
|
||||||
let descriptionHTML = '';
|
let descriptionHTML = '';
|
||||||
if (milestone.workOrderContracts.length > 0) {
|
if ((milestone.workOrderContracts ?? []).length > 0) {
|
||||||
const urlRoot = getUrlRoot(request);
|
const urlRoot = getUrlRoot(request);
|
||||||
descriptionHTML = `<h2>
|
descriptionHTML = `<h2>
|
||||||
Related Contracts
|
Related Contracts
|
||||||
|
|
@ -248,7 +248,7 @@ export default async function handler(request, response) {
|
||||||
const location = buildEventLocation(milestone);
|
const location = buildEventLocation(milestone);
|
||||||
calendarEvent.location(location);
|
calendarEvent.location(location);
|
||||||
// Set organizer / attendees
|
// Set organizer / attendees
|
||||||
if (milestone.workOrderContracts.length > 0) {
|
if ((milestone.workOrderContracts ?? []).length > 0) {
|
||||||
let organizerSet = false;
|
let organizerSet = false;
|
||||||
for (const contract of milestone.workOrderContracts ?? []) {
|
for (const contract of milestone.workOrderContracts ?? []) {
|
||||||
for (const interment of contract.contractInterments ?? []) {
|
for (const interment of contract.contractInterments ?? []) {
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ function buildEventDescriptionHTML_occupancies(
|
||||||
): string {
|
): string {
|
||||||
let descriptionHTML = ''
|
let descriptionHTML = ''
|
||||||
|
|
||||||
if (milestone.workOrderContracts!.length > 0) {
|
if ((milestone.workOrderContracts ?? []).length > 0) {
|
||||||
const urlRoot = getUrlRoot(request)
|
const urlRoot = getUrlRoot(request)
|
||||||
|
|
||||||
descriptionHTML = `<h2>
|
descriptionHTML = `<h2>
|
||||||
|
|
@ -366,7 +366,7 @@ export default async function handler(
|
||||||
calendarEvent.location(location)
|
calendarEvent.location(location)
|
||||||
|
|
||||||
// Set organizer / attendees
|
// Set organizer / attendees
|
||||||
if (milestone.workOrderContracts!.length > 0) {
|
if ((milestone.workOrderContracts ?? []).length > 0) {
|
||||||
let organizerSet = false
|
let organizerSet = false
|
||||||
for (const contract of milestone.workOrderContracts ?? []) {
|
for (const contract of milestone.workOrderContracts ?? []) {
|
||||||
for (const interment of contract.contractInterments ?? []) {
|
for (const interment of contract.contractInterments ?? []) {
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const contractCommentId = Number.parseInt(clickEvent.currentTarget.closest('tr')?.dataset
|
const contractCommentId = Number.parseInt(clickEvent.currentTarget.closest('tr')?.dataset
|
||||||
.contractCommentId ?? '', 10);
|
.contractCommentId ?? '', 10);
|
||||||
const contractComment = contractComments.find((currentComment) => currentComment.contractCommentId === contractCommentId);
|
const contractComment = contractComments.find((currentComment) => currentComment.contractCommentId === contractCommentId);
|
||||||
let editFormElement = undefined;
|
let editFormElement;
|
||||||
let editCloseModalFunction = undefined;
|
let editCloseModalFunction;
|
||||||
function editContractComment(submitEvent) {
|
function editContractComment(submitEvent) {
|
||||||
submitEvent.preventDefault();
|
submitEvent.preventDefault();
|
||||||
cityssm.postJSON(`${sunrise.urlPrefix}/contracts/doUpdateContractComment`, editFormElement, (rawResponseJSON) => {
|
cityssm.postJSON(`${sunrise.urlPrefix}/contracts/doUpdateContractComment`, editFormElement, (rawResponseJSON) => {
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,8 @@ declare const exports: Record<string, unknown>
|
||||||
(currentComment) => currentComment.contractCommentId === contractCommentId
|
(currentComment) => currentComment.contractCommentId === contractCommentId
|
||||||
) as ContractComment
|
) as ContractComment
|
||||||
|
|
||||||
let editFormElement: HTMLFormElement | undefined = undefined
|
let editFormElement: HTMLFormElement | undefined
|
||||||
let editCloseModalFunction: (() => void) | undefined = undefined
|
let editCloseModalFunction: (() => void) | undefined
|
||||||
|
|
||||||
function editContractComment(submitEvent: SubmitEvent): void {
|
function editContractComment(submitEvent: SubmitEvent): void {
|
||||||
submitEvent.preventDefault()
|
submitEvent.preventDefault()
|
||||||
|
|
|
||||||
|
|
@ -419,12 +419,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
?.addEventListener('click', deleteMilestone);
|
?.addEventListener('click', deleteMilestone);
|
||||||
milestonesPanelElement.append(panelBlockElement);
|
milestonesPanelElement.append(panelBlockElement);
|
||||||
}
|
}
|
||||||
|
if (workOrderMilestones.length === 0) {
|
||||||
|
milestonesPanelElement.insertAdjacentHTML('beforeend', `<div class="panel-block is-block">
|
||||||
|
<div class="message is-info">
|
||||||
|
<p class="message-body">There are no milestones on this work order.</p>
|
||||||
|
</div>
|
||||||
|
</div>`);
|
||||||
|
}
|
||||||
bulmaJS.init(milestonesPanelElement);
|
bulmaJS.init(milestonesPanelElement);
|
||||||
}
|
}
|
||||||
if (!isCreate) {
|
if (!isCreate) {
|
||||||
workOrderMilestones = exports.workOrderMilestones;
|
workOrderMilestones = exports.workOrderMilestones;
|
||||||
delete exports.workOrderMilestones;
|
delete exports.workOrderMilestones;
|
||||||
renderMilestones();
|
renderMilestones();
|
||||||
|
}
|
||||||
document
|
document
|
||||||
.querySelector('#button--addMilestone')
|
.querySelector('#button--addMilestone')
|
||||||
?.addEventListener('click', () => {
|
?.addEventListener('click', () => {
|
||||||
|
|
@ -495,5 +503,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
|
|
@ -666,6 +666,17 @@ declare const exports: Record<string, unknown>
|
||||||
milestonesPanelElement.append(panelBlockElement)
|
milestonesPanelElement.append(panelBlockElement)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (workOrderMilestones.length === 0) {
|
||||||
|
milestonesPanelElement.insertAdjacentHTML(
|
||||||
|
'beforeend',
|
||||||
|
`<div class="panel-block is-block">
|
||||||
|
<div class="message is-info">
|
||||||
|
<p class="message-body">There are no milestones on this work order.</p>
|
||||||
|
</div>
|
||||||
|
</div>`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
bulmaJS.init(milestonesPanelElement)
|
bulmaJS.init(milestonesPanelElement)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -674,6 +685,7 @@ declare const exports: Record<string, unknown>
|
||||||
delete exports.workOrderMilestones
|
delete exports.workOrderMilestones
|
||||||
|
|
||||||
renderMilestones()
|
renderMilestones()
|
||||||
|
}
|
||||||
|
|
||||||
document
|
document
|
||||||
.querySelector('#button--addMilestone')
|
.querySelector('#button--addMilestone')
|
||||||
|
|
@ -768,24 +780,19 @@ declare const exports: Record<string, unknown>
|
||||||
) as HTMLSelectElement
|
) as HTMLSelectElement
|
||||||
).focus()
|
).focus()
|
||||||
|
|
||||||
addFormElement = modalElement.querySelector(
|
addFormElement = modalElement.querySelector('form') as HTMLFormElement
|
||||||
'form'
|
|
||||||
) as HTMLFormElement
|
|
||||||
addFormElement.addEventListener('submit', doAdd)
|
addFormElement.addEventListener('submit', doAdd)
|
||||||
|
|
||||||
const conflictingMilestonePanelElement = document.querySelector(
|
const conflictingMilestonePanelElement = document.querySelector(
|
||||||
'#milestoneAdd--conflictingMilestonesPanel'
|
'#milestoneAdd--conflictingMilestonesPanel'
|
||||||
) as HTMLElement
|
) as HTMLElement
|
||||||
|
|
||||||
workOrderMilestoneDateStringElement.addEventListener(
|
workOrderMilestoneDateStringElement.addEventListener('change', () => {
|
||||||
'change',
|
|
||||||
() => {
|
|
||||||
refreshConflictingMilestones(
|
refreshConflictingMilestones(
|
||||||
workOrderMilestoneDateStringElement.value,
|
workOrderMilestoneDateStringElement.value,
|
||||||
conflictingMilestonePanelElement
|
conflictingMilestonePanelElement
|
||||||
)
|
)
|
||||||
}
|
})
|
||||||
)
|
|
||||||
|
|
||||||
refreshConflictingMilestones(
|
refreshConflictingMilestones(
|
||||||
workOrderMilestoneDateStringElement.value,
|
workOrderMilestoneDateStringElement.value,
|
||||||
|
|
@ -795,12 +802,9 @@ declare const exports: Record<string, unknown>
|
||||||
onremoved() {
|
onremoved() {
|
||||||
bulmaJS.toggleHtmlClipped()
|
bulmaJS.toggleHtmlClipped()
|
||||||
;(
|
;(
|
||||||
document.querySelector(
|
document.querySelector('#button--addMilestone') as HTMLButtonElement
|
||||||
'#button--addMilestone'
|
|
||||||
) as HTMLButtonElement
|
|
||||||
).focus()
|
).focus()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
|
||||||
})()
|
})()
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import type { DateString, TimeString } from "@cityssm/utils-datetime";
|
import type { DateString, TimeString } from '@cityssm/utils-datetime';
|
||||||
export interface Record {
|
export interface Record {
|
||||||
recordCreate_userName?: string;
|
recordCreate_userName?: string;
|
||||||
recordCreate_timeMillis?: number;
|
recordCreate_timeMillis?: number;
|
||||||
|
|
@ -199,7 +199,7 @@ export interface ContractInterment extends Record {
|
||||||
deathDate?: number;
|
deathDate?: number;
|
||||||
deathDateString?: DateString;
|
deathDateString?: DateString;
|
||||||
deathPlace?: string;
|
deathPlace?: string;
|
||||||
deathAge?: number;
|
deathAge?: number | null;
|
||||||
deathAgePeriod?: string;
|
deathAgePeriod?: string;
|
||||||
intermentContainerTypeId?: number;
|
intermentContainerTypeId?: number;
|
||||||
intermentContainerType?: string;
|
intermentContainerType?: string;
|
||||||
|
|
@ -260,6 +260,7 @@ export interface Contract extends Record {
|
||||||
funeralDateString?: DateString;
|
funeralDateString?: DateString;
|
||||||
funeralTime?: number;
|
funeralTime?: number;
|
||||||
funeralTimeString?: TimeString;
|
funeralTimeString?: TimeString;
|
||||||
|
funeralTimePeriodString?: string;
|
||||||
committalTypeId?: number;
|
committalTypeId?: number;
|
||||||
committalType?: string;
|
committalType?: string;
|
||||||
contractFields?: ContractField[];
|
contractFields?: ContractField[];
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import type { DateString, TimeString } from "@cityssm/utils-datetime"
|
import type { DateString, TimeString } from '@cityssm/utils-datetime'
|
||||||
|
|
||||||
export interface Record {
|
export interface Record {
|
||||||
recordCreate_userName?: string
|
recordCreate_userName?: string
|
||||||
|
|
@ -255,7 +255,7 @@ export interface ContractInterment extends Record {
|
||||||
deathDate?: number
|
deathDate?: number
|
||||||
deathDateString?: DateString
|
deathDateString?: DateString
|
||||||
deathPlace?: string
|
deathPlace?: string
|
||||||
deathAge?: number
|
deathAge?: number | null
|
||||||
deathAgePeriod?: string
|
deathAgePeriod?: string
|
||||||
|
|
||||||
intermentContainerTypeId?: number
|
intermentContainerTypeId?: number
|
||||||
|
|
@ -331,8 +331,11 @@ export interface Contract extends Record {
|
||||||
|
|
||||||
funeralDate?: number
|
funeralDate?: number
|
||||||
funeralDateString?: DateString
|
funeralDateString?: DateString
|
||||||
|
|
||||||
funeralTime?: number
|
funeralTime?: number
|
||||||
funeralTimeString?: TimeString
|
funeralTimeString?: TimeString
|
||||||
|
funeralTimePeriodString?: string
|
||||||
|
|
||||||
committalTypeId?: number
|
committalTypeId?: number
|
||||||
committalType?: string
|
committalType?: string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -368,7 +368,7 @@
|
||||||
<div class="columns is-mobile mb-0">
|
<div class="columns is-mobile mb-0">
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label class="label" for="contract--funeralDateString">Funeral Date</label>
|
<label class="label" for="contract--funeralDateString">Service Date</label>
|
||||||
<div class="control has-icons-left">
|
<div class="control has-icons-left">
|
||||||
<input class="input" id="contract--funeralDateString" name="funeralDateString" type="date"
|
<input class="input" id="contract--funeralDateString" name="funeralDateString" type="date"
|
||||||
value="<%= contract.funeralDateString %>" />
|
value="<%= contract.funeralDateString %>" />
|
||||||
|
|
@ -451,7 +451,9 @@
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label class="label" for="contract--purchaserCity">City</label>
|
<label class="label" for="contract--purchaserCity">City</label>
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<input class="input" id="contract--purchaserCity" name="purchaserCity" type="text" maxlength="20" value="<%= contract.purchaserCity %>" />
|
<input class="input" id="contract--purchaserCity" name="purchaserCity" type="text" maxlength="20"
|
||||||
|
value="<%= contract.purchaserCity %>"
|
||||||
|
list="datalist--cityDefault" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -560,7 +562,9 @@
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label class="label" for="contract--deceasedCity">City</label>
|
<label class="label" for="contract--deceasedCity">City</label>
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<input class="input" id="contract--deceasedCity" name="deceasedCity" type="text" maxlength="20" value="<%= contract.deceasedCity %>" />
|
<input class="input" id="contract--deceasedCity" name="deceasedCity" type="text" maxlength="20"
|
||||||
|
value="<%= contract.deceasedCity %>"
|
||||||
|
list="datalist--cityDefault" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -601,7 +605,9 @@
|
||||||
Place of Birth
|
Place of Birth
|
||||||
</label>
|
</label>
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<input class="input" id="contract--birthPlace" name="birthPlace" type="text" maxlength="100" autocomplete="off" value="<%= contract.deceasedPlaceOfBirth %>" />
|
<input class="input" id="contract--birthPlace" name="birthPlace" type="text" maxlength="100" autocomplete="off"
|
||||||
|
value="<%= contract.deceasedPlaceOfBirth %>"
|
||||||
|
list="datalist--cityDefault" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -626,7 +632,9 @@
|
||||||
Place of Death
|
Place of Death
|
||||||
</label>
|
</label>
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<input class="input" id="contract--deathPlace" name="deathPlace" type="text" maxlength="100" autocomplete="off" value="<%= contract.deathPlace %>" />
|
<input class="input" id="contract--deathPlace" name="deathPlace" type="text" maxlength="100" autocomplete="off"
|
||||||
|
value="<%= contract.deathPlace %>"
|
||||||
|
list="datalist--cityDefault" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -859,10 +867,14 @@
|
||||||
</div>
|
</div>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
|
<datalist id="datalist--cityDefault">
|
||||||
|
<option value="<%= configFunctions.getConfigProperty('settings.cityDefault') %>">
|
||||||
|
</datalist>
|
||||||
|
|
||||||
<%- include('_footerA'); -%>
|
<%- include('_footerA'); -%>
|
||||||
|
|
||||||
<script>
|
<% if (!isCreate) { %>
|
||||||
<% if (!isCreate) { %>
|
<script>
|
||||||
exports.cityDefault = "<%= configFunctions.getConfigProperty('settings.cityDefault') %>";
|
exports.cityDefault = "<%= configFunctions.getConfigProperty('settings.cityDefault') %>";
|
||||||
exports.provinceDefault = "<%= configFunctions.getConfigProperty('settings.provinceDefault') %>";
|
exports.provinceDefault = "<%= configFunctions.getConfigProperty('settings.provinceDefault') %>";
|
||||||
|
|
||||||
|
|
@ -874,8 +886,8 @@
|
||||||
exports.contractTransactions = <%- JSON.stringify(contract.contractTransactions) %>;
|
exports.contractTransactions = <%- JSON.stringify(contract.contractTransactions) %>;
|
||||||
|
|
||||||
exports.workOrderTypes = <%- JSON.stringify(workOrderTypes) %>;
|
exports.workOrderTypes = <%- JSON.stringify(workOrderTypes) %>;
|
||||||
<% } %>
|
</script>
|
||||||
</script>
|
<% } %>
|
||||||
|
|
||||||
<script src="<%= urlPrefix %>/javascripts/contract.edit.js"></script>
|
<script src="<%= urlPrefix %>/javascripts/contract.edit.js"></script>
|
||||||
<% if (!isCreate) { %>
|
<% if (!isCreate) { %>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue