From 9bc27dafe8d763c31684178e13de959327ab3595 Mon Sep 17 00:00:00 2001 From: Dan Gowans Date: Tue, 18 Mar 2025 14:52:24 -0400 Subject: [PATCH] linting --- .../workOrder.milestoneCalendar.js | 5 +- .../workOrder.milestoneCalendar.ts | 8 +- public/javascripts/workOrder.outlook.js | 2 - public/javascripts/workOrder.outlook.ts | 3 - types/recordTypes.d.ts | 2 +- types/recordTypes.ts | 2 +- views/admin-ntfyStartup.ejs | 6 +- views/print/pdf/_workOrder-header.ejs | 71 ++-- views/print/pdf/ssm.cemetery.burialPermit.ejs | 106 +++--- views/print/pdf/ssm.cemetery.contract.ejs | 8 +- views/print/screen/contract.ejs | 316 +++++++++--------- 11 files changed, 259 insertions(+), 270 deletions(-) diff --git a/public/javascripts/workOrder.milestoneCalendar.js b/public/javascripts/workOrder.milestoneCalendar.js index 0cf2035a..4535af39 100644 --- a/public/javascripts/workOrder.milestoneCalendar.js +++ b/public/javascripts/workOrder.milestoneCalendar.js @@ -1,6 +1,4 @@ "use strict"; -// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair -/* eslint-disable unicorn/prefer-module */ Object.defineProperty(exports, "__esModule", { value: true }); (() => { const sunrise = exports.sunrise; @@ -101,7 +99,8 @@ Object.defineProperty(exports, "__esModule", { value: true }); event.preventDefault(); } // eslint-disable-next-line no-unsanitized/property - milestoneCalendarContainerElement.innerHTML = sunrise.getLoadingParagraphHTML('Loading Milestones...'); + milestoneCalendarContainerElement.innerHTML = + sunrise.getLoadingParagraphHTML('Loading Milestones...'); cityssm.postJSON(`${sunrise.urlPrefix}/workOrders/doGetWorkOrderMilestones`, workOrderSearchFiltersFormElement, (responseJSON) => { renderMilestones(responseJSON.workOrderMilestones); }); diff --git a/public/javascripts/workOrder.milestoneCalendar.ts b/public/javascripts/workOrder.milestoneCalendar.ts index 91aa1057..ce450e5e 100644 --- a/public/javascripts/workOrder.milestoneCalendar.ts +++ b/public/javascripts/workOrder.milestoneCalendar.ts @@ -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 { WorkOrderMilestone } from '../../types/recordTypes.js' @@ -153,9 +150,8 @@ declare const exports: Record } // eslint-disable-next-line no-unsanitized/property - milestoneCalendarContainerElement.innerHTML = sunrise.getLoadingParagraphHTML( - 'Loading Milestones...' - ) + milestoneCalendarContainerElement.innerHTML = + sunrise.getLoadingParagraphHTML('Loading Milestones...') cityssm.postJSON( `${sunrise.urlPrefix}/workOrders/doGetWorkOrderMilestones`, diff --git a/public/javascripts/workOrder.outlook.js b/public/javascripts/workOrder.outlook.js index 35133ac3..114edd8f 100644 --- a/public/javascripts/workOrder.outlook.js +++ b/public/javascripts/workOrder.outlook.js @@ -1,6 +1,4 @@ "use strict"; -// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair -/* eslint-disable unicorn/prefer-module */ Object.defineProperty(exports, "__esModule", { value: true }); (() => { const sunrise = exports.sunrise; diff --git a/public/javascripts/workOrder.outlook.ts b/public/javascripts/workOrder.outlook.ts index 44e62c0f..31dd972e 100644 --- a/public/javascripts/workOrder.outlook.ts +++ b/public/javascripts/workOrder.outlook.ts @@ -1,6 +1,3 @@ -// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair -/* eslint-disable unicorn/prefer-module */ - import type { Sunrise } from './types.js' declare const exports: Record diff --git a/types/recordTypes.d.ts b/types/recordTypes.d.ts index 251c02ba..1dce4d9c 100644 --- a/types/recordTypes.d.ts +++ b/types/recordTypes.d.ts @@ -1,4 +1,4 @@ -import { DateString, TimeString } from "@cityssm/utils-datetime"; +import type { DateString, TimeString } from "@cityssm/utils-datetime"; export interface Record { recordCreate_userName?: string; recordCreate_timeMillis?: number; diff --git a/types/recordTypes.ts b/types/recordTypes.ts index 6d204f3b..fcfc078a 100644 --- a/types/recordTypes.ts +++ b/types/recordTypes.ts @@ -1,4 +1,4 @@ -import { DateString, TimeString } from "@cityssm/utils-datetime" +import type { DateString, TimeString } from "@cityssm/utils-datetime" export interface Record { recordCreate_userName?: string diff --git a/views/admin-ntfyStartup.ejs b/views/admin-ntfyStartup.ejs index 4b88769e..52ef7aab 100644 --- a/views/admin-ntfyStartup.ejs +++ b/views/admin-ntfyStartup.ejs @@ -15,9 +15,9 @@
  • - - Ntfy Startup Notification - + + Ntfy Startup Notification +
  • diff --git a/views/print/pdf/_workOrder-header.ejs b/views/print/pdf/_workOrder-header.ejs index e567ec22..93e9ffef 100644 --- a/views/print/pdf/_workOrder-header.ejs +++ b/views/print/pdf/_workOrder-header.ejs @@ -1,40 +1,39 @@ - - - - + + + +
    -

    Work Order #<%= workOrder.workOrderNumber %>

    -
    - - <% if (workOrder.workOrderCloseDate) { %> - CLOSED
    - <% } %> - <%= workOrder.workOrderType %> -
    -
    +

    Work Order #<%= workOrder.workOrderNumber %>

    +
    + + <% if (workOrder.workOrderCloseDate) { %> + CLOSED
    + <% } %> + <%= workOrder.workOrderType %> +
    +
    - - - - - -
    - -

    - Description
    - <%= workOrder.workOrderDescription %> -

    -
    -

    - <%= configFunctions.getConfigProperty("aliases.workOrderOpenDate") %>
    - <%= workOrder.workOrderOpenDateString %> -

    - <% if (workOrder.workOrderCloseDate) { %> -

    - <%= configFunctions.getConfigProperty("aliases.workOrderCloseDate") %>
    - <%= workOrder.workOrderCloseDateString %> -

    - <% } %> -
    + + + + + +
    +

    + Description
    + <%= workOrder.workOrderDescription %> +

    +
    +

    + <%= configFunctions.getConfigProperty("aliases.workOrderOpenDate") %>
    + <%= workOrder.workOrderOpenDateString %> +

    + <% if (workOrder.workOrderCloseDate) { %> +

    + <%= configFunctions.getConfigProperty("aliases.workOrderCloseDate") %>
    + <%= workOrder.workOrderCloseDateString %> +

    + <% } %> +
    diff --git a/views/print/pdf/ssm.cemetery.burialPermit.ejs b/views/print/pdf/ssm.cemetery.burialPermit.ejs index 0b37bb76..24b01bc6 100644 --- a/views/print/pdf/ssm.cemetery.burialPermit.ejs +++ b/views/print/pdf/ssm.cemetery.burialPermit.ejs @@ -8,67 +8,67 @@ -

    Province of Ontario

    -

    Vital Statistics Act

    -

    Burial Permit

    +

    Province of Ontario

    +

    Vital Statistics Act

    +

    Burial Permit

    -

    - Under the Vital Statistics Act - and the regulations, - subject to the limitations thereof, - this permit is granted to:
    -

    +

    + Under the Vital Statistics Act + and the regulations, + subject to the limitations thereof, + this permit is granted to:
    +

    -

    - <%= contract.funeralHomeName %>
    - <%= contract.funeralHomeAddress1 %>
    - <% if (contract.funeralHomeAddress2) { %><%= contract.funeralHomeAddress2 %>
    <% } %> - <%= contract.funeralHomeCity %>, <%= contract.funeralHomeProvince %>
    - <%= contract.funeralHomePostalCode %> -

    +

    + <%= contract.funeralHomeName %>
    + <%= contract.funeralHomeAddress1 %>
    + <% if (contract.funeralHomeAddress2) { %><%= contract.funeralHomeAddress2 %>
    <% } %> + <%= contract.funeralHomeCity %>, <%= contract.funeralHomeProvince %>
    + <%= contract.funeralHomePostalCode %> +

    -

    - for the purpose of the burial or other disposition of the body of: -

    +

    + for the purpose of the burial or other disposition of the body of: +

    -

    - <% if (!contract.isPreneed && deceased !== undefined) { %> - <%= deceased.deceasedName %> - <% } %> -

    +

    + <% if (!contract.isPreneed && deceased !== undefined) { %> + <%= deceased.deceasedName %> + <% } %> +

    -

    - who died at - -   - <%= deceased?.deathPlace ?? '' %> -   - - in Ontario on - -   - <%= deceased?.deathDateString %> -   - - . -

    - -

    -  
    - (Signature of Division Registrar) -

    - -

    - Sault Ste. Marie +

    + who died at +   + <%= deceased?.deathPlace ?? '' %>   + + in Ontario on +   - 5724 -

    + <%= deceased?.deathDateString %> +   + + . +

    -

    -  
    - (Year Month Day) -

    +

    +  
    + (Signature of Division Registrar) +

    + +

    + Sault Ste. Marie +   +   +   + 5724 +

    + +

    +  
    + (Year Month Day) +

    \ No newline at end of file diff --git a/views/print/pdf/ssm.cemetery.contract.ejs b/views/print/pdf/ssm.cemetery.contract.ejs index 0c415c0a..551c2635 100644 --- a/views/print/pdf/ssm.cemetery.contract.ejs +++ b/views/print/pdf/ssm.cemetery.contract.ejs @@ -294,25 +294,25 @@ - + - + - + - +
    Flat marker measuring less than 1,116.3 sq.m. (173 sq.in.)$0.00$0.00
    Flat marker measuring over 1,116.3 sq.m. (173 sq.in.)$50.00$50.00
    Upright monument measuring more than 1.22 m. (4 ft.) or less in height or length, including the base $100.00$100.00
    Upright monument measuring more than 1.22m. (4 ft.) either in height or length, including the base $200.00$200.00
    diff --git a/views/print/screen/contract.ejs b/views/print/screen/contract.ejs index e8762378..a61eae4f 100644 --- a/views/print/screen/contract.ejs +++ b/views/print/screen/contract.ejs @@ -6,89 +6,89 @@
    +
    +

    + Contract Type
    + <%= contract.contractType %> +

    +
    +
    +

    + Burial Site
    + <% if (contract.burialSiteId) { %> + <%= contract.burialSiteName %> + <% } else { %> + (No Burial Site) + <% } %> +

    +

    + Cemetery
    + <% if (contract.cemeteryId) { %> + <%= contract.cemeteryName %> + <% } else { %> + (No Cemetery) + <% } %> +

    +
    +
    +

    + Contract Date
    + <%= contract.contractStartDateString %> +

    +

    + End Date
    + <%= (contract.contractEndDateString === "" ? "(No End Date)" : contract.contractEndDateString) %> +

    +
    + <% if (contract.contractFields.length > 0) { %>
    -

    - Contract Type
    - <%= contract.contractType %> -

    -
    -
    + <% for (const contractField of contract.contractFields) { %>

    - Burial Site
    - <% if (contract.burialSiteId) { %> - <%= contract.burialSiteName %> - <% } else { %> - (No Burial Site) - <% } %> -

    -

    - Cemetery
    - <% if (contract.cemeteryId) { %> - <%= contract.cemeteryName %> - <% } else { %> - (No Cemetery) - <% } %> + <%= contractField.contractTypeField %>
    + <%= contractField.contractFieldValue || "(No Value)" %>

    + <% } %>
    -
    -

    - <%= configFunctions.getConfigProperty("aliases.occupancyStartDate") %>
    - <%= contract.occupancyStartDateString %> -

    -

    - End Date
    - <%= (contract.occupancyEndDateString === "" ? "(No End Date)" : contract.occupancyEndDateString) %> -

    -
    - <% if (contract.contractFields.length > 0) { %> -
    - <% for (const contractField of contract.contractFields) { %> -

    - <%= contractField.contractTypeField %>
    - <%= contractField.contractFieldValue || "(No Value)" %> -

    - <% } %> -
    - <% } %> + <% } %>
    -

    <%= configFunctions.getConfigProperty("aliases.occupants") %>

    +

    Interments

    - <% if (contract.contractOccupants.length === 0) { %> -
    -

    - There are no <%= configFunctions.getConfigProperty("aliases.occupants").toLowerCase() %> - associated with this record. -

    -
    + <% if (contract.contractInterments.length === 0) { %> +
    +

    + There are no interments + associated with this contract. +

    +
    <% } else { %> - - - - - - - - - <% for (const contractInterment of contract.contractInterments) { %> - - - - - <% } %> - -
    IntermentAddress
    <%= contractInterment.deceasedName %> - <%= contractInterment.deceasedAddress1 %>
    - <% if (contractInterment.deceasedAddress2 && contractInterment.deceasedAddress2 !== "") { %> - <%= contractInterment.deceasedAddress2 %>
    - <% } %> - <% if (contractInterment.deceasedCity) { %> - <%= contractInterment.deceasedCity %>, - <% } %> - <%= contractInterment.deceasedProvince %>
    - <%= contractInterment.deceasedPostalCode %> -
    + + + + + + + + + <% for (const contractInterment of contract.contractInterments) { %> + + + + + <% } %> + +
    IntermentAddress
    <%= contractInterment.deceasedName %> + <%= contractInterment.deceasedAddress1 %>
    + <% if (contractInterment.deceasedAddress2 && contractInterment.deceasedAddress2 !== "") { %> + <%= contractInterment.deceasedAddress2 %>
    + <% } %> + <% if (contractInterment.deceasedCity) { %> + <%= contractInterment.deceasedCity %>, + <% } %> + <%= contractInterment.deceasedProvince %>
    + <%= contractInterment.deceasedPostalCode %> +
    <% } %>
    @@ -97,25 +97,25 @@

    Comments

    - - - - - - - - - <% for (const contractComment of contract.contractComments) { %> - - - - - - <% } %> - + + + + + + + + + <% for (const contractComment of contract.contractComments) { %> + + + + + + <% } %> +
    CommentorComment DateComment
    <%= contractComment.recordCreate_userName %> - <%= contractComment.contractCommentDateString %> - <%= (contractComment.contractCommentTime === 0 ? "" : contractComment.contractCommentTimeString) %> - <%= contractComment.contractComment %>
    CommentorComment DateComment
    <%= contractComment.recordCreate_userName %> + <%= contractComment.contractCommentDateString %> + <%= (contractComment.contractCommentTime === 0 ? "" : contractComment.contractCommentTimeString) %> + <%= contractComment.contractComment %>
    <% } %> @@ -124,60 +124,60 @@

    Fees

    <% if (contract.contractFees.length === 0) { %> -
    -

    - There are no fees applied to this <%= configFunctions.getConfigProperty("aliases.occupancy").toLowerCase() %> record. -

    -
    +
    +

    + There are no fees applied to this contract. +

    +
    <% } else { %> <% - let feeAmountTotal = 0; - let taxAmountTotal = 0; + let feeAmountTotal = 0; + let taxAmountTotal = 0; %> - - - - - - - - + + + + + + + + - <% for (const contractFee of contract.contractFees) { %> - <% - feeAmountTotal += (contractFee.feeAmount * contractFee.quantity); - taxAmountTotal += (contractFee.taxAmount * contractFee.quantity); - %> - - - <% if (contractFee.quantity !== 1) { %> - - - - - <% } %> - - - <% } %> + <% for (const contractFee of contract.contractFees) { %> + <% + feeAmountTotal += (contractFee.feeAmount * contractFee.quantity); + taxAmountTotal += (contractFee.taxAmount * contractFee.quantity); + %> + + + <% if (contractFee.quantity !== 1) { %> + + + + + <% } %> + + + <% } %> - - - - - - - - - - - - + + + + + + + + + + + +
    FeeUnit Cost×Quantity=Total
    FeeUnit Cost×Quantity=Total
    "> - <%= contractFee.feeName %> - $<%= contractFee.feeAmount.toFixed(2) %>×<%= contractFee.quantity %>=$<%= (contractFee.feeAmount * contractFee.quantity).toFixed(2) %>
    "> + <%= contractFee.feeName %> + $<%= contractFee.feeAmount.toFixed(2) %>×<%= contractFee.quantity %>=$<%= (contractFee.feeAmount * contractFee.quantity).toFixed(2) %>
    Subtotal$<%= feeAmountTotal.toFixed(2) %>
    Tax$<%= taxAmountTotal.toFixed(2) %>
    Grand Total$<%= (feeAmountTotal + taxAmountTotal).toFixed(2) %>
    Subtotal$<%= feeAmountTotal.toFixed(2) %>
    Tax$<%= taxAmountTotal.toFixed(2) %>
    Grand Total$<%= (feeAmountTotal + taxAmountTotal).toFixed(2) %>
    <% } %> @@ -188,32 +188,32 @@ <% if (contract.contractTransactions.length === 0) { %>
    -

    - There are no transactions associated with this <%= configFunctions.getConfigProperty("aliases.occupancy").toLowerCase() %> record. -

    +

    + There are no transactions associated with this contract. +

    <% } else { %> - - - - - + + + + + - <% for (const contractTransaction of contract.contractTransactions) { %> - - - - - - <% } %> + <% for (const contractTransaction of contract.contractTransactions) { %> + + + + + + <% } %>
    Date<%= configFunctions.getConfigProperty("aliases.externalReceiptNumber") %>Amount
    Date<%= configFunctions.getConfigProperty("aliases.externalReceiptNumber") %>Amount
    <%= contractTransaction.transactionDateString %> - <%= contractTransaction.externalReceiptNumber %>
    - <%= contractTransaction.transactionNote %> -
    - $<%= contractTransaction.transactionAmount.toFixed(2) %> -
    <%= contractTransaction.transactionDateString %> + <%= contractTransaction.externalReceiptNumber %>
    + <%= contractTransaction.transactionNote %> +
    + $<%= contractTransaction.transactionAmount.toFixed(2) %> +
    <% } %>