pull/11/head
Dan Gowans 2025-04-16 12:51:12 -04:00
parent 4a17f0ecfa
commit fb5c960bc7
6 changed files with 318 additions and 275 deletions

View File

@ -13,8 +13,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
const contractId = clickEvent.currentTarget.closest('.container--contract').dataset.contractId;
function doDelete() {
cityssm.postJSON(`${sunrise.urlPrefix}/workOrders/doDeleteWorkOrderContract`, {
workOrderId,
contractId
contractId,
workOrderId
}, (rawResponseJSON) => {
const responseJSON = rawResponseJSON;
if (responseJSON.success) {
@ -65,8 +65,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
}
function addContract(contractId, callbackFunction) {
cityssm.postJSON(`${sunrise.urlPrefix}/workOrders/doAddWorkOrderContract`, {
workOrderId,
contractId
contractId,
workOrderId
}, (rawResponseJSON) => {
const responseJSON = rawResponseJSON;
if (responseJSON.success) {
@ -106,7 +106,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
<th>Burial Site</th>
<th>Contract Date</th>
<th>End Date</th>
<th>Interments</th>
<th>Contacts</th>
<th class="has-width-1"></th>
</tr></thead>
<tbody></tbody>
@ -148,14 +148,32 @@ Object.defineProperty(exports, "__esModule", { value: true });
else {
rowElement.insertAdjacentHTML('beforeend', '<td><span class="has-text-grey">(No Burial Site)</span></td>');
}
let intermentsHTML = '';
let contactsHtml = '';
for (const interment of contract.contractInterments ?? []) {
intermentsHTML += `<li class="has-tooltip-left"
contactsHtml += `<li class="has-tooltip-left"
data-tooltip="${cityssm.escapeHTML(contract.isPreneed ?? false ? 'Recipient' : 'Deceased')}">
<span class="fa-li">
<i class="fas fa-fw fa-user" aria-label="${cityssm.escapeHTML(contract.isPreneed ?? false ? 'Recipient' : 'Deceased')}"></i>
</span>
${cityssm.escapeHTML(interment.deceasedName ?? '')}
</li>`;
}
if (contract.purchaserName !== '') {
contactsHtml += `<li class="has-tooltip-left"
data-tooltip="Purchaser">
<span class="fa-li">
<i class="fas fa-fw fa-hand-holding-dollar" aria-label="Purchaser"></i>
</span>
${cityssm.escapeHTML(contract.purchaserName)}
</li>`;
}
if (contract.funeralHomeName !== null) {
contactsHtml += `<li class="has-tooltip-left"
data-tooltip="Funeral Home">
<span class="fa-li">
<i class="fas fa-fw fa-place-of-worship" aria-label="Funeral Home"></i>
</span>
${cityssm.escapeHTML(contract.funeralHomeName)}
</li>`;
}
// eslint-disable-next-line no-unsanitized/method
@ -166,9 +184,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
? contract.contractEndDateString
: '<span class="has-text-grey">(No End Date)</span>'}
</td><td>
${contract.contractInterments.length === 0
? '<span class="has-text-grey">(No Interments)</span>'
: `<ul class="fa-ul ml-5">${intermentsHTML}</ul>`}
<ul class="fa-ul ml-5">
${contactsHtml}
</ul>
</td><td>
<button class="button is-small is-light is-danger button--deleteContract" data-tooltip="Delete Relationship" type="button">
<span class="icon is-small"><i class="fas fa-trash" aria-hidden="true"></i></span>
@ -253,8 +271,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
const burialSiteId = clickEvent.currentTarget.closest('.container--burialSite').dataset.burialSiteId;
function doDelete() {
cityssm.postJSON(`${sunrise.urlPrefix}/workOrders/doDeleteWorkOrderBurialSite`, {
workOrderId,
burialSiteId
burialSiteId,
workOrderId
}, (rawResponseJSON) => {
const responseJSON = rawResponseJSON;
if (responseJSON.success) {
@ -317,8 +335,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
${burialSite.burialSiteStatusId
? cityssm.escapeHTML(burialSite.burialSiteStatus ?? '')
: '<span class="has-text-grey">(No Status)</span>'}
</td><td class="has-text-right is-nowrap">
<button class="button is-small is-light is-info button--editBurialSiteStatus" data-tooltip="Update Status" type="button">
</td><td class="has-text-right">
<button class="button is-small mb-1 is-light is-info button--editBurialSiteStatus" data-tooltip="Update Status" type="button">
<span class="icon is-small"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>
</button>
<button class="button is-small is-light is-danger button--deleteBurialSite" data-tooltip="Delete Relationship" type="button">
@ -384,7 +402,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
rowElement.dataset.contractId = contract.contractId.toString();
rowElement.innerHTML = `<td class="has-text-centered">
<button class="button is-small is-success button--addContract" data-tooltip="Add" type="button" aria-label="Add">
<i class="fas fa-plus" aria-hidden="true"></i>
<span class="icon is-small"><i class="fas fa-plus" aria-hidden="true"></i></span>
</button>
</td>
<td class="has-text-weight-bold">
@ -492,7 +510,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
burialSite.burialSiteId.toString();
rowElement.innerHTML = `<td class="has-text-centered">
<button class="button is-small is-success button--addBurialSite" data-tooltip="Add" type="button" aria-label="Add">
<i class="fas fa-plus" aria-hidden="true"></i>
<span class="icon is-small"><i class="fas fa-plus" aria-hidden="true"></i></span>
</button>
</td><td class="has-text-weight-bold">
${cityssm.escapeHTML(burialSite.burialSiteName ?? '')}

View File

@ -40,8 +40,8 @@ declare const exports: Record<string, unknown>
cityssm.postJSON(
`${sunrise.urlPrefix}/workOrders/doDeleteWorkOrderContract`,
{
workOrderId,
contractId
contractId,
workOrderId
},
(rawResponseJSON) => {
const responseJSON = rawResponseJSON as {
@ -118,8 +118,8 @@ declare const exports: Record<string, unknown>
cityssm.postJSON(
`${sunrise.urlPrefix}/workOrders/doAddWorkOrderContract`,
{
workOrderId,
contractId
contractId,
workOrderId
},
(rawResponseJSON) => {
const responseJSON = rawResponseJSON as {
@ -179,7 +179,7 @@ declare const exports: Record<string, unknown>
<th>Burial Site</th>
<th>Contract Date</th>
<th>End Date</th>
<th>Interments</th>
<th>Contacts</th>
<th class="has-width-1"></th>
</tr></thead>
<tbody></tbody>
@ -242,10 +242,10 @@ declare const exports: Record<string, unknown>
)
}
let intermentsHTML = ''
let contactsHtml = ''
for (const interment of contract.contractInterments ?? []) {
intermentsHTML += `<li class="has-tooltip-left"
contactsHtml += `<li class="has-tooltip-left"
data-tooltip="${cityssm.escapeHTML(contract.isPreneed ?? false ? 'Recipient' : 'Deceased')}">
<span class="fa-li">
<i class="fas fa-fw fa-user" aria-label="${cityssm.escapeHTML(contract.isPreneed ?? false ? 'Recipient' : 'Deceased')}"></i>
@ -254,6 +254,26 @@ declare const exports: Record<string, unknown>
</li>`
}
if (contract.purchaserName !== '') {
contactsHtml += `<li class="has-tooltip-left"
data-tooltip="Purchaser">
<span class="fa-li">
<i class="fas fa-fw fa-hand-holding-dollar" aria-label="Purchaser"></i>
</span>
${cityssm.escapeHTML(contract.purchaserName)}
</li>`
}
if (contract.funeralHomeName !== null) {
contactsHtml += `<li class="has-tooltip-left"
data-tooltip="Funeral Home">
<span class="fa-li">
<i class="fas fa-fw fa-place-of-worship" aria-label="Funeral Home"></i>
</span>
${cityssm.escapeHTML(contract.funeralHomeName)}
</li>`
}
// eslint-disable-next-line no-unsanitized/method
rowElement.insertAdjacentHTML(
'beforeend',
@ -266,11 +286,9 @@ declare const exports: Record<string, unknown>
: '<span class="has-text-grey">(No End Date)</span>'
}
</td><td>
${
contract.contractInterments!.length === 0
? '<span class="has-text-grey">(No Interments)</span>'
: `<ul class="fa-ul ml-5">${intermentsHTML}</ul>`
}
<ul class="fa-ul ml-5">
${contactsHtml}
</ul>
</td><td>
<button class="button is-small is-light is-danger button--deleteContract" data-tooltip="Delete Relationship" type="button">
<span class="icon is-small"><i class="fas fa-trash" aria-hidden="true"></i></span>
@ -398,6 +416,7 @@ declare const exports: Record<string, unknown>
.querySelector('form')
?.addEventListener('submit', doUpdateBurialSiteStatus)
},
onremoved() {
bulmaJS.toggleHtmlClipped()
}
@ -415,8 +434,8 @@ declare const exports: Record<string, unknown>
cityssm.postJSON(
`${sunrise.urlPrefix}/workOrders/doDeleteWorkOrderBurialSite`,
{
workOrderId,
burialSiteId
burialSiteId,
workOrderId
},
(rawResponseJSON) => {
const responseJSON = rawResponseJSON as {
@ -502,8 +521,8 @@ declare const exports: Record<string, unknown>
? cityssm.escapeHTML(burialSite.burialSiteStatus ?? '')
: '<span class="has-text-grey">(No Status)</span>'
}
</td><td class="has-text-right is-nowrap">
<button class="button is-small is-light is-info button--editBurialSiteStatus" data-tooltip="Update Status" type="button">
</td><td class="has-text-right">
<button class="button is-small mb-1 is-light is-info button--editBurialSiteStatus" data-tooltip="Update Status" type="button">
<span class="icon is-small"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>
</button>
<button class="button is-small is-light is-danger button--deleteBurialSite" data-tooltip="Delete Relationship" type="button">
@ -594,7 +613,7 @@ declare const exports: Record<string, unknown>
rowElement.innerHTML = `<td class="has-text-centered">
<button class="button is-small is-success button--addContract" data-tooltip="Add" type="button" aria-label="Add">
<i class="fas fa-plus" aria-hidden="true"></i>
<span class="icon is-small"><i class="fas fa-plus" aria-hidden="true"></i></span>
</button>
</td>
<td class="has-text-weight-bold">
@ -777,7 +796,7 @@ declare const exports: Record<string, unknown>
rowElement.innerHTML = `<td class="has-text-centered">
<button class="button is-small is-success button--addBurialSite" data-tooltip="Add" type="button" aria-label="Add">
<i class="fas fa-plus" aria-hidden="true"></i>
<span class="icon is-small"><i class="fas fa-plus" aria-hidden="true"></i></span>
</button>
</td><td class="has-text-weight-bold">
${cityssm.escapeHTML(burialSite.burialSiteName ?? '')}

View File

@ -80,12 +80,12 @@ const cemeteryKeyToCemetery = {
},
MN: {
cemeteryName: 'Mausoleum Niche',
cemeteryDescription: '',
cemeteryDescription: 'At Holy Sepulchre Cemetery',
cemeteryKey: 'MN',
cemeterySvg: '',
cemeteryLatitude: '',
cemeteryLongitude: '',
cemeteryAddress1: '',
cemeteryAddress1: 'Fourth Line East',
cemeteryAddress2: '',
cemeteryCity: 'Sault Ste. Marie',
cemeteryPostalCode: '',
@ -110,12 +110,12 @@ const cemeteryKeyToCemetery = {
},
NW: {
cemeteryName: 'Niche Wall',
cemeteryDescription: '',
cemeteryDescription: 'At New Greenwood Cemetery',
cemeteryKey: 'NW',
cemeterySvg: '',
cemeteryLatitude: '',
cemeteryLongitude: '',
cemeteryAddress1: '',
cemeteryAddress1: 'Fourth Line East',
cemeteryAddress2: '',
cemeteryCity: 'Sault Ste. Marie',
cemeteryPostalCode: '',

View File

@ -107,14 +107,14 @@ const cemeteryKeyToCemetery: Record<string, AddCemeteryForm> = {
MN: {
cemeteryName: 'Mausoleum Niche',
cemeteryDescription: '',
cemeteryDescription: 'At Holy Sepulchre Cemetery',
cemeteryKey: 'MN',
cemeterySvg: '',
cemeteryLatitude: '',
cemeteryLongitude: '',
cemeteryAddress1: '',
cemeteryAddress1: 'Fourth Line East',
cemeteryAddress2: '',
cemeteryCity: 'Sault Ste. Marie',
cemeteryPostalCode: '',
@ -146,14 +146,14 @@ const cemeteryKeyToCemetery: Record<string, AddCemeteryForm> = {
NW: {
cemeteryName: 'Niche Wall',
cemeteryDescription: '',
cemeteryDescription: 'At New Greenwood Cemetery',
cemeteryKey: 'NW',
cemeterySvg: '',
cemeteryLatitude: '',
cemeteryLongitude: '',
cemeteryAddress1: '',
cemeteryAddress1: 'Fourth Line East',
cemeteryAddress2: '',
cemeteryCity: 'Sault Ste. Marie',
cemeteryPostalCode: '',

View File

@ -179,7 +179,7 @@
<th>Burial Site</th>
<th>Contract Date</th>
<th>End Date</th>
<th>Interments</th>
<th>Contacts</th>
</tr>
</thead>
<tbody>
@ -218,20 +218,26 @@
<% } %>
</td>
<td>
<% if (contract.contractInterments.length === 0) { %>
<span class="has-text-grey">
(No Interments)
</span>
<% } else { %>
<ul class="fa-ul ml-5">
<% for (const interment of contract.contractInterments) { %>
<li>
<span class="fa-li"><i class="fas fa-user" aria-hidden="true"></i></span>
<li class="has-tooltip-left" data-tooltip="<%= contract.isPreneed ? 'Recipient' : 'Deceased' %>">
<span class="fa-li"><i class="fas fa-user" aria-label="Recipient"></i></span>
<%= interment.deceasedName %>
</li>
<% } %>
</ul>
<% if (contract.purchaserName !== '') { %>
<li class="has-tooltip-left" data-tooltip="Purchaser">
<span class="fa-li"><i class="fas fa-hand-holding-dollar" aria-label="Purchase"></i></span>
<%= contract.purchaserName %>
</li>
<% } %>
<% if (contract.funeralHomeName) { %>
<li class="has-tooltip-left" data-tooltip="Funeral Home">
<span class="fa-li"><i class="fas fa-place-of-worship" aria-label="Funeral Home"></i></span>
<%= contract.funeralHomeName %>
</li>
<% } %>
</ul>
</td>
</tr>
<% } %>