linting
parent
cbe2735151
commit
b63f8a3a47
|
|
@ -8,7 +8,7 @@ import { getWorkOrderTypes as getWorkOrderTypesFromDatabase } from './lotOccupan
|
||||||
import { getWorkOrderMilestoneTypes as getWorkOrderMilestoneTypesFromDatabase } from './lotOccupancyDB/getWorkOrderMilestoneTypes.js';
|
import { getWorkOrderMilestoneTypes as getWorkOrderMilestoneTypesFromDatabase } from './lotOccupancyDB/getWorkOrderMilestoneTypes.js';
|
||||||
let lotOccupantTypes;
|
let lotOccupantTypes;
|
||||||
export function getLotOccupantTypes() {
|
export function getLotOccupantTypes() {
|
||||||
if (!lotOccupantTypes) {
|
if (lotOccupantTypes === undefined) {
|
||||||
lotOccupantTypes = getLotOccupantTypesFromDatabase();
|
lotOccupantTypes = getLotOccupantTypesFromDatabase();
|
||||||
}
|
}
|
||||||
return lotOccupantTypes;
|
return lotOccupantTypes;
|
||||||
|
|
@ -32,7 +32,7 @@ function clearLotOccupantTypesCache() {
|
||||||
}
|
}
|
||||||
let lotStatuses;
|
let lotStatuses;
|
||||||
export function getLotStatuses() {
|
export function getLotStatuses() {
|
||||||
if (!lotStatuses) {
|
if (lotStatuses === undefined) {
|
||||||
lotStatuses = getLotStatusesFromDatabase();
|
lotStatuses = getLotStatusesFromDatabase();
|
||||||
}
|
}
|
||||||
return lotStatuses;
|
return lotStatuses;
|
||||||
|
|
@ -55,7 +55,7 @@ function clearLotStatusesCache() {
|
||||||
}
|
}
|
||||||
let lotTypes;
|
let lotTypes;
|
||||||
export function getLotTypes() {
|
export function getLotTypes() {
|
||||||
if (!lotTypes) {
|
if (lotTypes === undefined) {
|
||||||
lotTypes = getLotTypesFromDatabase();
|
lotTypes = getLotTypesFromDatabase();
|
||||||
}
|
}
|
||||||
return lotTypes;
|
return lotTypes;
|
||||||
|
|
@ -79,13 +79,13 @@ function clearLotTypesCache() {
|
||||||
let occupancyTypes;
|
let occupancyTypes;
|
||||||
let allOccupancyTypeFields;
|
let allOccupancyTypeFields;
|
||||||
export function getOccupancyTypes() {
|
export function getOccupancyTypes() {
|
||||||
if (!occupancyTypes) {
|
if (occupancyTypes === undefined) {
|
||||||
occupancyTypes = getOccupancyTypesFromDatabase();
|
occupancyTypes = getOccupancyTypesFromDatabase();
|
||||||
}
|
}
|
||||||
return occupancyTypes;
|
return occupancyTypes;
|
||||||
}
|
}
|
||||||
export function getAllOccupancyTypeFields() {
|
export function getAllOccupancyTypeFields() {
|
||||||
if (!allOccupancyTypeFields) {
|
if (allOccupancyTypeFields === undefined) {
|
||||||
allOccupancyTypeFields = getOccupancyTypeFieldsFromDatabase();
|
allOccupancyTypeFields = getOccupancyTypeFieldsFromDatabase();
|
||||||
}
|
}
|
||||||
return allOccupancyTypeFields;
|
return allOccupancyTypeFields;
|
||||||
|
|
@ -106,7 +106,7 @@ export function getOccupancyTypeByOccupancyType(occupancyTypeString) {
|
||||||
}
|
}
|
||||||
export function getOccupancyTypePrintsById(occupancyTypeId) {
|
export function getOccupancyTypePrintsById(occupancyTypeId) {
|
||||||
const occupancyType = getOccupancyTypeById(occupancyTypeId);
|
const occupancyType = getOccupancyTypeById(occupancyTypeId);
|
||||||
if (!occupancyType ||
|
if (occupancyType === undefined ||
|
||||||
(occupancyType.occupancyTypePrints ?? []).length === 0) {
|
(occupancyType.occupancyTypePrints ?? []).length === 0) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
@ -121,7 +121,7 @@ function clearOccupancyTypesCache() {
|
||||||
}
|
}
|
||||||
let workOrderTypes;
|
let workOrderTypes;
|
||||||
export function getWorkOrderTypes() {
|
export function getWorkOrderTypes() {
|
||||||
if (!workOrderTypes) {
|
if (workOrderTypes === undefined) {
|
||||||
workOrderTypes = getWorkOrderTypesFromDatabase();
|
workOrderTypes = getWorkOrderTypesFromDatabase();
|
||||||
}
|
}
|
||||||
return workOrderTypes;
|
return workOrderTypes;
|
||||||
|
|
@ -137,7 +137,7 @@ function clearWorkOrderTypesCache() {
|
||||||
}
|
}
|
||||||
let workOrderMilestoneTypes;
|
let workOrderMilestoneTypes;
|
||||||
export function getWorkOrderMilestoneTypes() {
|
export function getWorkOrderMilestoneTypes() {
|
||||||
if (!workOrderMilestoneTypes) {
|
if (workOrderMilestoneTypes === undefined) {
|
||||||
workOrderMilestoneTypes = getWorkOrderMilestoneTypesFromDatabase();
|
workOrderMilestoneTypes = getWorkOrderMilestoneTypesFromDatabase();
|
||||||
}
|
}
|
||||||
return workOrderMilestoneTypes;
|
return workOrderMilestoneTypes;
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import type * as recordTypes from '../types/recordTypes'
|
||||||
let lotOccupantTypes: recordTypes.LotOccupantType[] | undefined
|
let lotOccupantTypes: recordTypes.LotOccupantType[] | undefined
|
||||||
|
|
||||||
export function getLotOccupantTypes(): recordTypes.LotOccupantType[] {
|
export function getLotOccupantTypes(): recordTypes.LotOccupantType[] {
|
||||||
if (!lotOccupantTypes) {
|
if (lotOccupantTypes === undefined) {
|
||||||
lotOccupantTypes = getLotOccupantTypesFromDatabase()
|
lotOccupantTypes = getLotOccupantTypesFromDatabase()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -65,7 +65,7 @@ function clearLotOccupantTypesCache(): void {
|
||||||
let lotStatuses: recordTypes.LotStatus[] | undefined
|
let lotStatuses: recordTypes.LotStatus[] | undefined
|
||||||
|
|
||||||
export function getLotStatuses(): recordTypes.LotStatus[] {
|
export function getLotStatuses(): recordTypes.LotStatus[] {
|
||||||
if (!lotStatuses) {
|
if (lotStatuses === undefined) {
|
||||||
lotStatuses = getLotStatusesFromDatabase()
|
lotStatuses = getLotStatusesFromDatabase()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -105,7 +105,7 @@ function clearLotStatusesCache(): void {
|
||||||
let lotTypes: recordTypes.LotType[] | undefined
|
let lotTypes: recordTypes.LotType[] | undefined
|
||||||
|
|
||||||
export function getLotTypes(): recordTypes.LotType[] {
|
export function getLotTypes(): recordTypes.LotType[] {
|
||||||
if (!lotTypes) {
|
if (lotTypes === undefined) {
|
||||||
lotTypes = getLotTypesFromDatabase()
|
lotTypes = getLotTypesFromDatabase()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -146,7 +146,7 @@ let occupancyTypes: recordTypes.OccupancyType[] | undefined
|
||||||
let allOccupancyTypeFields: recordTypes.OccupancyTypeField[] | undefined
|
let allOccupancyTypeFields: recordTypes.OccupancyTypeField[] | undefined
|
||||||
|
|
||||||
export function getOccupancyTypes(): recordTypes.OccupancyType[] {
|
export function getOccupancyTypes(): recordTypes.OccupancyType[] {
|
||||||
if (!occupancyTypes) {
|
if (occupancyTypes === undefined) {
|
||||||
occupancyTypes = getOccupancyTypesFromDatabase()
|
occupancyTypes = getOccupancyTypesFromDatabase()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -154,7 +154,7 @@ export function getOccupancyTypes(): recordTypes.OccupancyType[] {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getAllOccupancyTypeFields(): recordTypes.OccupancyTypeField[] {
|
export function getAllOccupancyTypeFields(): recordTypes.OccupancyTypeField[] {
|
||||||
if (!allOccupancyTypeFields) {
|
if (allOccupancyTypeFields === undefined) {
|
||||||
allOccupancyTypeFields = getOccupancyTypeFieldsFromDatabase()
|
allOccupancyTypeFields = getOccupancyTypeFieldsFromDatabase()
|
||||||
}
|
}
|
||||||
return allOccupancyTypeFields
|
return allOccupancyTypeFields
|
||||||
|
|
@ -189,7 +189,7 @@ export function getOccupancyTypePrintsById(occupancyTypeId: number): string[] {
|
||||||
const occupancyType = getOccupancyTypeById(occupancyTypeId)
|
const occupancyType = getOccupancyTypeById(occupancyTypeId)
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!occupancyType ||
|
occupancyType === undefined ||
|
||||||
(occupancyType.occupancyTypePrints ?? []).length === 0
|
(occupancyType.occupancyTypePrints ?? []).length === 0
|
||||||
) {
|
) {
|
||||||
return []
|
return []
|
||||||
|
|
@ -214,7 +214,7 @@ function clearOccupancyTypesCache(): void {
|
||||||
let workOrderTypes: recordTypes.WorkOrderType[] | undefined
|
let workOrderTypes: recordTypes.WorkOrderType[] | undefined
|
||||||
|
|
||||||
export function getWorkOrderTypes(): recordTypes.WorkOrderType[] {
|
export function getWorkOrderTypes(): recordTypes.WorkOrderType[] {
|
||||||
if (!workOrderTypes) {
|
if (workOrderTypes === undefined) {
|
||||||
workOrderTypes = getWorkOrderTypesFromDatabase()
|
workOrderTypes = getWorkOrderTypesFromDatabase()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -242,7 +242,7 @@ function clearWorkOrderTypesCache(): void {
|
||||||
let workOrderMilestoneTypes: recordTypes.WorkOrderMilestoneType[] | undefined
|
let workOrderMilestoneTypes: recordTypes.WorkOrderMilestoneType[] | undefined
|
||||||
|
|
||||||
export function getWorkOrderMilestoneTypes(): recordTypes.WorkOrderMilestoneType[] {
|
export function getWorkOrderMilestoneTypes(): recordTypes.WorkOrderMilestoneType[] {
|
||||||
if (!workOrderMilestoneTypes) {
|
if (workOrderMilestoneTypes === undefined) {
|
||||||
workOrderMilestoneTypes = getWorkOrderMilestoneTypesFromDatabase()
|
workOrderMilestoneTypes = getWorkOrderMilestoneTypesFromDatabase()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ export function getProperty(propertyName) {
|
||||||
const propertyNameSplit = propertyName.split('.');
|
const propertyNameSplit = propertyName.split('.');
|
||||||
let currentObject = config;
|
let currentObject = config;
|
||||||
for (const propertyNamePiece of propertyNameSplit) {
|
for (const propertyNamePiece of propertyNameSplit) {
|
||||||
if (Object.prototype.hasOwnProperty.call(currentObject, propertyNamePiece)) {
|
if (Object.hasOwn(currentObject, propertyNamePiece)) {
|
||||||
currentObject = currentObject[propertyNamePiece];
|
currentObject = currentObject[propertyNamePiece];
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -210,9 +210,7 @@ export function getProperty(propertyName: string): unknown {
|
||||||
let currentObject = config
|
let currentObject = config
|
||||||
|
|
||||||
for (const propertyNamePiece of propertyNameSplit) {
|
for (const propertyNamePiece of propertyNameSplit) {
|
||||||
if (
|
if (Object.hasOwn(currentObject, propertyNamePiece)) {
|
||||||
Object.prototype.hasOwnProperty.call(currentObject, propertyNamePiece)
|
|
||||||
) {
|
|
||||||
currentObject = currentObject[propertyNamePiece]
|
currentObject = currentObject[propertyNamePiece]
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,7 @@ import { getLotOccupancy } from './lotOccupancyDB/getLotOccupancy.js';
|
||||||
import { getWorkOrder } from './lotOccupancyDB/getWorkOrder.js';
|
import { getWorkOrder } from './lotOccupancyDB/getWorkOrder.js';
|
||||||
const screenPrintConfigs = {
|
const screenPrintConfigs = {
|
||||||
lotOccupancy: {
|
lotOccupancy: {
|
||||||
title: configFunctions.getProperty('aliases.lot') +
|
title: `${configFunctions.getProperty('aliases.lot')} ${configFunctions.getProperty('aliases.occupancy')} Print`,
|
||||||
' ' +
|
|
||||||
configFunctions.getProperty('aliases.occupancy') +
|
|
||||||
' Print',
|
|
||||||
params: ['lotOccupancyId']
|
params: ['lotOccupancyId']
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -11,11 +11,9 @@ interface PrintConfig {
|
||||||
|
|
||||||
const screenPrintConfigs: Record<string, PrintConfig> = {
|
const screenPrintConfigs: Record<string, PrintConfig> = {
|
||||||
lotOccupancy: {
|
lotOccupancy: {
|
||||||
title:
|
title: `${configFunctions.getProperty(
|
||||||
configFunctions.getProperty('aliases.lot') +
|
'aliases.lot'
|
||||||
' ' +
|
)} ${configFunctions.getProperty('aliases.occupancy')} Print`,
|
||||||
configFunctions.getProperty('aliases.occupancy') +
|
|
||||||
' Print',
|
|
||||||
params: ['lotOccupancyId']
|
params: ['lotOccupancyId']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -459,7 +459,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
let lotOccupancyOccupants;
|
let lotOccupancyOccupants;
|
||||||
const openEditLotOccupancyOccupant = (clickEvent) => {
|
function openEditLotOccupancyOccupant(clickEvent) {
|
||||||
const lotOccupantIndex = Number.parseInt(clickEvent.currentTarget.closest('tr').dataset
|
const lotOccupantIndex = Number.parseInt(clickEvent.currentTarget.closest('tr').dataset
|
||||||
.lotOccupantIndex, 10);
|
.lotOccupantIndex, 10);
|
||||||
const lotOccupancyOccupant = lotOccupancyOccupants.find((currentLotOccupancyOccupant) => {
|
const lotOccupancyOccupant = lotOccupancyOccupants.find((currentLotOccupancyOccupant) => {
|
||||||
|
|
@ -467,9 +467,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
});
|
});
|
||||||
let editFormElement;
|
let editFormElement;
|
||||||
let editCloseModalFunction;
|
let editCloseModalFunction;
|
||||||
const editOccupant = (submitEvent) => {
|
function editOccupant(submitEvent) {
|
||||||
submitEvent.preventDefault();
|
submitEvent.preventDefault();
|
||||||
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doUpdateLotOccupancyOccupant', editFormElement, (responseJSON) => {
|
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doUpdateLotOccupancyOccupant', editFormElement, (responseJSON) => {
|
||||||
|
var _a;
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
lotOccupancyOccupants = responseJSON.lotOccupancyOccupants;
|
lotOccupancyOccupants = responseJSON.lotOccupancyOccupants;
|
||||||
editCloseModalFunction();
|
editCloseModalFunction();
|
||||||
|
|
@ -477,13 +478,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: 'Error Updating ' + exports.aliases.occupant,
|
title: 'Error Updating ' + los.escapedAliases.Occupant,
|
||||||
message: responseJSON.errorMessage || '',
|
message: (_a = responseJSON.errorMessage) !== null && _a !== void 0 ? _a : '',
|
||||||
contextualColorName: 'danger'
|
contextualColorName: 'danger'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
cityssm.openHtmlModal('lotOccupancy-editOccupant', {
|
cityssm.openHtmlModal('lotOccupancy-editOccupant', {
|
||||||
onshow: (modalElement) => {
|
onshow: (modalElement) => {
|
||||||
los.populateAliases(modalElement);
|
los.populateAliases(modalElement);
|
||||||
|
|
@ -532,69 +533,67 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
bulmaJS.toggleHtmlClipped();
|
bulmaJS.toggleHtmlClipped();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
const deleteLotOccupancyOccupant = (clickEvent) => {
|
function deleteLotOccupancyOccupant(clickEvent) {
|
||||||
const lotOccupantIndex = clickEvent.currentTarget.closest('tr').dataset.lotOccupantIndex;
|
const lotOccupantIndex = clickEvent.currentTarget.closest('tr').dataset.lotOccupantIndex;
|
||||||
const doDelete = () => {
|
function doDelete() {
|
||||||
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doDeleteLotOccupancyOccupant', {
|
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doDeleteLotOccupancyOccupant', {
|
||||||
lotOccupancyId,
|
lotOccupancyId,
|
||||||
lotOccupantIndex
|
lotOccupantIndex
|
||||||
}, (responseJSON) => {
|
}, (responseJSON) => {
|
||||||
|
var _a;
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
lotOccupancyOccupants = responseJSON.lotOccupancyOccupants;
|
lotOccupancyOccupants = responseJSON.lotOccupancyOccupants;
|
||||||
renderLotOccupancyOccupants();
|
renderLotOccupancyOccupants();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: 'Error Removing ' + exports.aliases.occupant,
|
title: 'Error Removing ' + los.escapedAliases.Occupant,
|
||||||
message: responseJSON.errorMessage || '',
|
message: (_a = responseJSON.errorMessage) !== null && _a !== void 0 ? _a : '',
|
||||||
contextualColorName: 'danger'
|
contextualColorName: 'danger'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
bulmaJS.confirm({
|
bulmaJS.confirm({
|
||||||
title: 'Remove ' + exports.aliases.occupant + '?',
|
title: `Remove ${los.escapedAliases.Occupant}?`,
|
||||||
message: 'Are you sure you want to remove this ' +
|
message: `Are you sure you want to remove this ${los.escapedAliases.occupant}?`,
|
||||||
exports.aliases.occupant.toLowerCase() +
|
|
||||||
'?',
|
|
||||||
okButton: {
|
okButton: {
|
||||||
text: 'Yes, Remove ' + exports.aliases.occupant,
|
text: 'Yes, Remove ' + los.escapedAliases.Occupant,
|
||||||
callbackFunction: doDelete
|
callbackFunction: doDelete
|
||||||
},
|
},
|
||||||
contextualColorName: 'warning'
|
contextualColorName: 'warning'
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
const renderLotOccupancyOccupants = () => {
|
function renderLotOccupancyOccupants() {
|
||||||
|
var _a, _b, _c;
|
||||||
const occupantsContainer = document.querySelector('#container--lotOccupancyOccupants');
|
const occupantsContainer = document.querySelector('#container--lotOccupancyOccupants');
|
||||||
cityssm.clearElement(occupantsContainer);
|
cityssm.clearElement(occupantsContainer);
|
||||||
if (lotOccupancyOccupants.length === 0) {
|
if (lotOccupancyOccupants.length === 0) {
|
||||||
occupantsContainer.innerHTML =
|
occupantsContainer.innerHTML = `<div class="message is-warning">
|
||||||
'<div class="message is-warning">' +
|
<p class="message-body">There are no ${los.escapedAliases.occupants} associated with this record.</p>
|
||||||
'<p class="message-body">There are no ' +
|
</div>`;
|
||||||
exports.aliases.occupants.toLowerCase() +
|
|
||||||
' associated with this record.</p>' +
|
|
||||||
'</div>';
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const tableElement = document.createElement('table');
|
const tableElement = document.createElement('table');
|
||||||
tableElement.className = 'table is-fullwidth is-striped is-hoverable';
|
tableElement.className = 'table is-fullwidth is-striped is-hoverable';
|
||||||
tableElement.innerHTML =
|
tableElement.innerHTML = `<thead><tr>
|
||||||
'<thead><tr>' +
|
<th>${los.escapedAliases.Occupant}</th>
|
||||||
('<th>' + exports.aliases.occupant + '</th>') +
|
<th>Address</th>
|
||||||
'<th>Address</th>' +
|
<th>Other Contact</th>
|
||||||
'<th>Other Contact</th>' +
|
<th>Comment</th>
|
||||||
'<th>Comment</th>' +
|
<th class="is-hidden-print"><span class="is-sr-only">Options</span></th>
|
||||||
'<th class="is-hidden-print"><span class="is-sr-only">Options</span></th>' +
|
</tr></thead>
|
||||||
'</tr></thead>' +
|
<tbody></tbody>`;
|
||||||
'<tbody></tbody>';
|
|
||||||
for (const lotOccupancyOccupant of lotOccupancyOccupants) {
|
for (const lotOccupancyOccupant of lotOccupancyOccupants) {
|
||||||
const tableRowElement = document.createElement('tr');
|
const tableRowElement = document.createElement('tr');
|
||||||
tableRowElement.dataset.lotOccupantIndex =
|
tableRowElement.dataset.lotOccupantIndex =
|
||||||
lotOccupancyOccupant.lotOccupantIndex.toString();
|
lotOccupancyOccupant.lotOccupantIndex.toString();
|
||||||
tableRowElement.innerHTML =
|
tableRowElement.innerHTML =
|
||||||
'<td>' +
|
'<td>' +
|
||||||
cityssm.escapeHTML(lotOccupancyOccupant.occupantName || '(No Name)') +
|
cityssm.escapeHTML(((_a = lotOccupancyOccupant.occupantName) !== null && _a !== void 0 ? _a : '') === ''
|
||||||
|
? '(No Name)'
|
||||||
|
: lotOccupancyOccupant.occupantName) +
|
||||||
'<br />' +
|
'<br />' +
|
||||||
('<span class="tag">' +
|
('<span class="tag">' +
|
||||||
'<i class="fas fa-fw fa-' +
|
'<i class="fas fa-fw fa-' +
|
||||||
|
|
@ -615,9 +614,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
(lotOccupancyOccupant.occupantCity
|
(lotOccupancyOccupant.occupantCity
|
||||||
? cityssm.escapeHTML(lotOccupancyOccupant.occupantCity) + ', '
|
? cityssm.escapeHTML(lotOccupancyOccupant.occupantCity) + ', '
|
||||||
: '') +
|
: '') +
|
||||||
cityssm.escapeHTML(lotOccupancyOccupant.occupantProvince || '') +
|
cityssm.escapeHTML((_b = lotOccupancyOccupant.occupantProvince) !== null && _b !== void 0 ? _b : '') +
|
||||||
'<br />' +
|
'<br />' +
|
||||||
cityssm.escapeHTML(lotOccupancyOccupant.occupantPostalCode || '') +
|
cityssm.escapeHTML((_c = lotOccupancyOccupant.occupantPostalCode) !== null && _c !== void 0 ? _c : '') +
|
||||||
'</td>') +
|
'</td>') +
|
||||||
('<td>' +
|
('<td>' +
|
||||||
(lotOccupancyOccupant.occupantPhoneNumber
|
(lotOccupancyOccupant.occupantPhoneNumber
|
||||||
|
|
@ -653,7 +652,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
tableElement.querySelector('tbody').append(tableRowElement);
|
tableElement.querySelector('tbody').append(tableRowElement);
|
||||||
}
|
}
|
||||||
occupantsContainer.append(tableElement);
|
occupantsContainer.append(tableElement);
|
||||||
};
|
}
|
||||||
if (isCreate) {
|
if (isCreate) {
|
||||||
const lotOccupantTypeIdElement = document.querySelector('#lotOccupancy--lotOccupantTypeId');
|
const lotOccupantTypeIdElement = document.querySelector('#lotOccupancy--lotOccupantTypeId');
|
||||||
lotOccupantTypeIdElement.addEventListener('change', () => {
|
lotOccupantTypeIdElement.addEventListener('change', () => {
|
||||||
|
|
@ -673,8 +672,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
let addFormElement;
|
let addFormElement;
|
||||||
let searchFormElement;
|
let searchFormElement;
|
||||||
let searchResultsElement;
|
let searchResultsElement;
|
||||||
const addOccupant = (formOrObject) => {
|
function addOccupant(formOrObject) {
|
||||||
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doAddLotOccupancyOccupant', formOrObject, (responseJSON) => {
|
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doAddLotOccupancyOccupant', formOrObject, (responseJSON) => {
|
||||||
|
var _a;
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
lotOccupancyOccupants = responseJSON.lotOccupancyOccupants;
|
lotOccupancyOccupants = responseJSON.lotOccupancyOccupants;
|
||||||
addCloseModalFunction();
|
addCloseModalFunction();
|
||||||
|
|
@ -682,19 +682,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: 'Error Adding ' + exports.aliases.occupant,
|
title: `Error Adding ${los.escapedAliases.Occupant}`,
|
||||||
message: responseJSON.errorMessage || '',
|
message: (_a = responseJSON.errorMessage) !== null && _a !== void 0 ? _a : '',
|
||||||
contextualColorName: 'danger'
|
contextualColorName: 'danger'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
const addOccupantFromForm = (submitEvent) => {
|
function addOccupantFromForm(submitEvent) {
|
||||||
submitEvent.preventDefault();
|
submitEvent.preventDefault();
|
||||||
addOccupant(addFormElement);
|
addOccupant(addFormElement);
|
||||||
};
|
}
|
||||||
let pastOccupantSearchResults = [];
|
let pastOccupantSearchResults = [];
|
||||||
const addOccupantFromCopy = (clickEvent) => {
|
function addOccupantFromCopy(clickEvent) {
|
||||||
clickEvent.preventDefault();
|
clickEvent.preventDefault();
|
||||||
const panelBlockElement = clickEvent.currentTarget;
|
const panelBlockElement = clickEvent.currentTarget;
|
||||||
const occupant = pastOccupantSearchResults[Number.parseInt(panelBlockElement.dataset.index, 10)];
|
const occupant = pastOccupantSearchResults[Number.parseInt(panelBlockElement.dataset.index, 10)];
|
||||||
|
|
@ -703,10 +703,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
.querySelector('#lotOccupancyOccupantCopy--lotOccupantTypeId').value;
|
.querySelector('#lotOccupancyOccupantCopy--lotOccupantTypeId').value;
|
||||||
if (lotOccupantTypeId === '') {
|
if (lotOccupantTypeId === '') {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: 'No ' + exports.aliases.occupant + ' Type Selected',
|
title: `No ${los.escapedAliases.Occupant} Type Selected`,
|
||||||
message: 'Select a type to apply to the newly added ' +
|
message: `Select a type to apply to the newly added ${los.escapedAliases.occupant}.`,
|
||||||
exports.aliases.occupant.toLowerCase() +
|
|
||||||
'.',
|
|
||||||
contextualColorName: 'warning'
|
contextualColorName: 'warning'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -715,8 +713,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
occupant.lotOccupancyId = Number.parseInt(lotOccupancyId, 10);
|
occupant.lotOccupancyId = Number.parseInt(lotOccupancyId, 10);
|
||||||
addOccupant(occupant);
|
addOccupant(occupant);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
const searchOccupants = (event) => {
|
function searchOccupants(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if (searchFormElement.querySelector('#lotOccupancyOccupantCopy--searchFilter').value === '') {
|
if (searchFormElement.querySelector('#lotOccupancyOccupantCopy--searchFilter').value === '') {
|
||||||
searchResultsElement.innerHTML =
|
searchResultsElement.innerHTML =
|
||||||
|
|
@ -728,6 +726,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
searchResultsElement.innerHTML =
|
searchResultsElement.innerHTML =
|
||||||
los.getLoadingParagraphHTML('Searching...');
|
los.getLoadingParagraphHTML('Searching...');
|
||||||
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doSearchPastOccupants', searchFormElement, (responseJSON) => {
|
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doSearchPastOccupants', searchFormElement, (responseJSON) => {
|
||||||
|
var _a, _b, _c, _d, _e, _f;
|
||||||
pastOccupantSearchResults = responseJSON.occupants;
|
pastOccupantSearchResults = responseJSON.occupants;
|
||||||
const panelElement = document.createElement('div');
|
const panelElement = document.createElement('div');
|
||||||
panelElement.className = 'panel';
|
panelElement.className = 'panel';
|
||||||
|
|
@ -737,28 +736,28 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
panelBlockElement.dataset.index = index.toString();
|
panelBlockElement.dataset.index = index.toString();
|
||||||
panelBlockElement.innerHTML =
|
panelBlockElement.innerHTML =
|
||||||
'<strong>' +
|
'<strong>' +
|
||||||
cityssm.escapeHTML(occupant.occupantName || '') +
|
cityssm.escapeHTML((_a = occupant.occupantName) !== null && _a !== void 0 ? _a : '') +
|
||||||
'</strong>' +
|
'</strong>' +
|
||||||
'<br />' +
|
'<br />' +
|
||||||
'<div class="columns">' +
|
'<div class="columns">' +
|
||||||
('<div class="column">' +
|
('<div class="column">' +
|
||||||
cityssm.escapeHTML(occupant.occupantAddress1 || '') +
|
cityssm.escapeHTML((_b = occupant.occupantAddress1) !== null && _b !== void 0 ? _b : '') +
|
||||||
'<br />' +
|
'<br />' +
|
||||||
(occupant.occupantAddress2
|
(occupant.occupantAddress2
|
||||||
? cityssm.escapeHTML(occupant.occupantAddress2) + '<br />'
|
? cityssm.escapeHTML(occupant.occupantAddress2) + '<br />'
|
||||||
: '') +
|
: '') +
|
||||||
cityssm.escapeHTML(occupant.occupantCity || '') +
|
cityssm.escapeHTML((_c = occupant.occupantCity) !== null && _c !== void 0 ? _c : '') +
|
||||||
', ' +
|
', ' +
|
||||||
cityssm.escapeHTML(occupant.occupantProvince || '') +
|
cityssm.escapeHTML((_d = occupant.occupantProvince) !== null && _d !== void 0 ? _d : '') +
|
||||||
'<br />' +
|
'<br />' +
|
||||||
cityssm.escapeHTML(occupant.occupantPostalCode || '') +
|
cityssm.escapeHTML((_e = occupant.occupantPostalCode) !== null && _e !== void 0 ? _e : '') +
|
||||||
'</div>') +
|
'</div>') +
|
||||||
('<div class="column">' +
|
('<div class="column">' +
|
||||||
(occupant.occupantPhoneNumber
|
(occupant.occupantPhoneNumber
|
||||||
? cityssm.escapeHTML(occupant.occupantPhoneNumber) +
|
? cityssm.escapeHTML(occupant.occupantPhoneNumber) +
|
||||||
'<br />'
|
'<br />'
|
||||||
: '') +
|
: '') +
|
||||||
cityssm.escapeHTML(occupant.occupantEmailAddress || '') +
|
cityssm.escapeHTML((_f = occupant.occupantEmailAddress) !== null && _f !== void 0 ? _f : '') +
|
||||||
'<br />' +
|
'<br />' +
|
||||||
'</div>') +
|
'</div>') +
|
||||||
'</div>';
|
'</div>';
|
||||||
|
|
@ -768,7 +767,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
searchResultsElement.innerHTML = '';
|
searchResultsElement.innerHTML = '';
|
||||||
searchResultsElement.append(panelElement);
|
searchResultsElement.append(panelElement);
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
cityssm.openHtmlModal('lotOccupancy-addOccupant', {
|
cityssm.openHtmlModal('lotOccupancy-addOccupant', {
|
||||||
onshow: (modalElement) => {
|
onshow: (modalElement) => {
|
||||||
los.populateAliases(modalElement);
|
los.populateAliases(modalElement);
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
let lotOccupancyOccupants;
|
let lotOccupancyOccupants;
|
||||||
const openEditLotOccupancyOccupant = (clickEvent) => {
|
function openEditLotOccupancyOccupant(clickEvent) {
|
||||||
const lotOccupantIndex = Number.parseInt(clickEvent.currentTarget.closest('tr').dataset
|
const lotOccupantIndex = Number.parseInt(clickEvent.currentTarget.closest('tr').dataset
|
||||||
.lotOccupantIndex, 10);
|
.lotOccupantIndex, 10);
|
||||||
const lotOccupancyOccupant = lotOccupancyOccupants.find((currentLotOccupancyOccupant) => {
|
const lotOccupancyOccupant = lotOccupancyOccupants.find((currentLotOccupancyOccupant) => {
|
||||||
|
|
@ -10,9 +10,10 @@ const openEditLotOccupancyOccupant = (clickEvent) => {
|
||||||
});
|
});
|
||||||
let editFormElement;
|
let editFormElement;
|
||||||
let editCloseModalFunction;
|
let editCloseModalFunction;
|
||||||
const editOccupant = (submitEvent) => {
|
function editOccupant(submitEvent) {
|
||||||
submitEvent.preventDefault();
|
submitEvent.preventDefault();
|
||||||
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doUpdateLotOccupancyOccupant', editFormElement, (responseJSON) => {
|
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doUpdateLotOccupancyOccupant', editFormElement, (responseJSON) => {
|
||||||
|
var _a;
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
lotOccupancyOccupants = responseJSON.lotOccupancyOccupants;
|
lotOccupancyOccupants = responseJSON.lotOccupancyOccupants;
|
||||||
editCloseModalFunction();
|
editCloseModalFunction();
|
||||||
|
|
@ -20,13 +21,13 @@ const openEditLotOccupancyOccupant = (clickEvent) => {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: 'Error Updating ' + exports.aliases.occupant,
|
title: 'Error Updating ' + los.escapedAliases.Occupant,
|
||||||
message: responseJSON.errorMessage || '',
|
message: (_a = responseJSON.errorMessage) !== null && _a !== void 0 ? _a : '',
|
||||||
contextualColorName: 'danger'
|
contextualColorName: 'danger'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
cityssm.openHtmlModal('lotOccupancy-editOccupant', {
|
cityssm.openHtmlModal('lotOccupancy-editOccupant', {
|
||||||
onshow: (modalElement) => {
|
onshow: (modalElement) => {
|
||||||
los.populateAliases(modalElement);
|
los.populateAliases(modalElement);
|
||||||
|
|
@ -75,69 +76,67 @@ const openEditLotOccupancyOccupant = (clickEvent) => {
|
||||||
bulmaJS.toggleHtmlClipped();
|
bulmaJS.toggleHtmlClipped();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
const deleteLotOccupancyOccupant = (clickEvent) => {
|
function deleteLotOccupancyOccupant(clickEvent) {
|
||||||
const lotOccupantIndex = clickEvent.currentTarget.closest('tr').dataset.lotOccupantIndex;
|
const lotOccupantIndex = clickEvent.currentTarget.closest('tr').dataset.lotOccupantIndex;
|
||||||
const doDelete = () => {
|
function doDelete() {
|
||||||
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doDeleteLotOccupancyOccupant', {
|
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doDeleteLotOccupancyOccupant', {
|
||||||
lotOccupancyId,
|
lotOccupancyId,
|
||||||
lotOccupantIndex
|
lotOccupantIndex
|
||||||
}, (responseJSON) => {
|
}, (responseJSON) => {
|
||||||
|
var _a;
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
lotOccupancyOccupants = responseJSON.lotOccupancyOccupants;
|
lotOccupancyOccupants = responseJSON.lotOccupancyOccupants;
|
||||||
renderLotOccupancyOccupants();
|
renderLotOccupancyOccupants();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: 'Error Removing ' + exports.aliases.occupant,
|
title: 'Error Removing ' + los.escapedAliases.Occupant,
|
||||||
message: responseJSON.errorMessage || '',
|
message: (_a = responseJSON.errorMessage) !== null && _a !== void 0 ? _a : '',
|
||||||
contextualColorName: 'danger'
|
contextualColorName: 'danger'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
bulmaJS.confirm({
|
bulmaJS.confirm({
|
||||||
title: 'Remove ' + exports.aliases.occupant + '?',
|
title: `Remove ${los.escapedAliases.Occupant}?`,
|
||||||
message: 'Are you sure you want to remove this ' +
|
message: `Are you sure you want to remove this ${los.escapedAliases.occupant}?`,
|
||||||
exports.aliases.occupant.toLowerCase() +
|
|
||||||
'?',
|
|
||||||
okButton: {
|
okButton: {
|
||||||
text: 'Yes, Remove ' + exports.aliases.occupant,
|
text: 'Yes, Remove ' + los.escapedAliases.Occupant,
|
||||||
callbackFunction: doDelete
|
callbackFunction: doDelete
|
||||||
},
|
},
|
||||||
contextualColorName: 'warning'
|
contextualColorName: 'warning'
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
const renderLotOccupancyOccupants = () => {
|
function renderLotOccupancyOccupants() {
|
||||||
|
var _a, _b, _c;
|
||||||
const occupantsContainer = document.querySelector('#container--lotOccupancyOccupants');
|
const occupantsContainer = document.querySelector('#container--lotOccupancyOccupants');
|
||||||
cityssm.clearElement(occupantsContainer);
|
cityssm.clearElement(occupantsContainer);
|
||||||
if (lotOccupancyOccupants.length === 0) {
|
if (lotOccupancyOccupants.length === 0) {
|
||||||
occupantsContainer.innerHTML =
|
occupantsContainer.innerHTML = `<div class="message is-warning">
|
||||||
'<div class="message is-warning">' +
|
<p class="message-body">There are no ${los.escapedAliases.occupants} associated with this record.</p>
|
||||||
'<p class="message-body">There are no ' +
|
</div>`;
|
||||||
exports.aliases.occupants.toLowerCase() +
|
|
||||||
' associated with this record.</p>' +
|
|
||||||
'</div>';
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const tableElement = document.createElement('table');
|
const tableElement = document.createElement('table');
|
||||||
tableElement.className = 'table is-fullwidth is-striped is-hoverable';
|
tableElement.className = 'table is-fullwidth is-striped is-hoverable';
|
||||||
tableElement.innerHTML =
|
tableElement.innerHTML = `<thead><tr>
|
||||||
'<thead><tr>' +
|
<th>${los.escapedAliases.Occupant}</th>
|
||||||
('<th>' + exports.aliases.occupant + '</th>') +
|
<th>Address</th>
|
||||||
'<th>Address</th>' +
|
<th>Other Contact</th>
|
||||||
'<th>Other Contact</th>' +
|
<th>Comment</th>
|
||||||
'<th>Comment</th>' +
|
<th class="is-hidden-print"><span class="is-sr-only">Options</span></th>
|
||||||
'<th class="is-hidden-print"><span class="is-sr-only">Options</span></th>' +
|
</tr></thead>
|
||||||
'</tr></thead>' +
|
<tbody></tbody>`;
|
||||||
'<tbody></tbody>';
|
|
||||||
for (const lotOccupancyOccupant of lotOccupancyOccupants) {
|
for (const lotOccupancyOccupant of lotOccupancyOccupants) {
|
||||||
const tableRowElement = document.createElement('tr');
|
const tableRowElement = document.createElement('tr');
|
||||||
tableRowElement.dataset.lotOccupantIndex =
|
tableRowElement.dataset.lotOccupantIndex =
|
||||||
lotOccupancyOccupant.lotOccupantIndex.toString();
|
lotOccupancyOccupant.lotOccupantIndex.toString();
|
||||||
tableRowElement.innerHTML =
|
tableRowElement.innerHTML =
|
||||||
'<td>' +
|
'<td>' +
|
||||||
cityssm.escapeHTML(lotOccupancyOccupant.occupantName || '(No Name)') +
|
cityssm.escapeHTML(((_a = lotOccupancyOccupant.occupantName) !== null && _a !== void 0 ? _a : '') === ''
|
||||||
|
? '(No Name)'
|
||||||
|
: lotOccupancyOccupant.occupantName) +
|
||||||
'<br />' +
|
'<br />' +
|
||||||
('<span class="tag">' +
|
('<span class="tag">' +
|
||||||
'<i class="fas fa-fw fa-' +
|
'<i class="fas fa-fw fa-' +
|
||||||
|
|
@ -158,9 +157,9 @@ const renderLotOccupancyOccupants = () => {
|
||||||
(lotOccupancyOccupant.occupantCity
|
(lotOccupancyOccupant.occupantCity
|
||||||
? cityssm.escapeHTML(lotOccupancyOccupant.occupantCity) + ', '
|
? cityssm.escapeHTML(lotOccupancyOccupant.occupantCity) + ', '
|
||||||
: '') +
|
: '') +
|
||||||
cityssm.escapeHTML(lotOccupancyOccupant.occupantProvince || '') +
|
cityssm.escapeHTML((_b = lotOccupancyOccupant.occupantProvince) !== null && _b !== void 0 ? _b : '') +
|
||||||
'<br />' +
|
'<br />' +
|
||||||
cityssm.escapeHTML(lotOccupancyOccupant.occupantPostalCode || '') +
|
cityssm.escapeHTML((_c = lotOccupancyOccupant.occupantPostalCode) !== null && _c !== void 0 ? _c : '') +
|
||||||
'</td>') +
|
'</td>') +
|
||||||
('<td>' +
|
('<td>' +
|
||||||
(lotOccupancyOccupant.occupantPhoneNumber
|
(lotOccupancyOccupant.occupantPhoneNumber
|
||||||
|
|
@ -196,7 +195,7 @@ const renderLotOccupancyOccupants = () => {
|
||||||
tableElement.querySelector('tbody').append(tableRowElement);
|
tableElement.querySelector('tbody').append(tableRowElement);
|
||||||
}
|
}
|
||||||
occupantsContainer.append(tableElement);
|
occupantsContainer.append(tableElement);
|
||||||
};
|
}
|
||||||
if (isCreate) {
|
if (isCreate) {
|
||||||
const lotOccupantTypeIdElement = document.querySelector('#lotOccupancy--lotOccupantTypeId');
|
const lotOccupantTypeIdElement = document.querySelector('#lotOccupancy--lotOccupantTypeId');
|
||||||
lotOccupantTypeIdElement.addEventListener('change', () => {
|
lotOccupantTypeIdElement.addEventListener('change', () => {
|
||||||
|
|
@ -216,8 +215,9 @@ else {
|
||||||
let addFormElement;
|
let addFormElement;
|
||||||
let searchFormElement;
|
let searchFormElement;
|
||||||
let searchResultsElement;
|
let searchResultsElement;
|
||||||
const addOccupant = (formOrObject) => {
|
function addOccupant(formOrObject) {
|
||||||
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doAddLotOccupancyOccupant', formOrObject, (responseJSON) => {
|
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doAddLotOccupancyOccupant', formOrObject, (responseJSON) => {
|
||||||
|
var _a;
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
lotOccupancyOccupants = responseJSON.lotOccupancyOccupants;
|
lotOccupancyOccupants = responseJSON.lotOccupancyOccupants;
|
||||||
addCloseModalFunction();
|
addCloseModalFunction();
|
||||||
|
|
@ -225,19 +225,19 @@ else {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: 'Error Adding ' + exports.aliases.occupant,
|
title: `Error Adding ${los.escapedAliases.Occupant}`,
|
||||||
message: responseJSON.errorMessage || '',
|
message: (_a = responseJSON.errorMessage) !== null && _a !== void 0 ? _a : '',
|
||||||
contextualColorName: 'danger'
|
contextualColorName: 'danger'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
const addOccupantFromForm = (submitEvent) => {
|
function addOccupantFromForm(submitEvent) {
|
||||||
submitEvent.preventDefault();
|
submitEvent.preventDefault();
|
||||||
addOccupant(addFormElement);
|
addOccupant(addFormElement);
|
||||||
};
|
}
|
||||||
let pastOccupantSearchResults = [];
|
let pastOccupantSearchResults = [];
|
||||||
const addOccupantFromCopy = (clickEvent) => {
|
function addOccupantFromCopy(clickEvent) {
|
||||||
clickEvent.preventDefault();
|
clickEvent.preventDefault();
|
||||||
const panelBlockElement = clickEvent.currentTarget;
|
const panelBlockElement = clickEvent.currentTarget;
|
||||||
const occupant = pastOccupantSearchResults[Number.parseInt(panelBlockElement.dataset.index, 10)];
|
const occupant = pastOccupantSearchResults[Number.parseInt(panelBlockElement.dataset.index, 10)];
|
||||||
|
|
@ -246,10 +246,8 @@ else {
|
||||||
.querySelector('#lotOccupancyOccupantCopy--lotOccupantTypeId').value;
|
.querySelector('#lotOccupancyOccupantCopy--lotOccupantTypeId').value;
|
||||||
if (lotOccupantTypeId === '') {
|
if (lotOccupantTypeId === '') {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: 'No ' + exports.aliases.occupant + ' Type Selected',
|
title: `No ${los.escapedAliases.Occupant} Type Selected`,
|
||||||
message: 'Select a type to apply to the newly added ' +
|
message: `Select a type to apply to the newly added ${los.escapedAliases.occupant}.`,
|
||||||
exports.aliases.occupant.toLowerCase() +
|
|
||||||
'.',
|
|
||||||
contextualColorName: 'warning'
|
contextualColorName: 'warning'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -258,8 +256,8 @@ else {
|
||||||
occupant.lotOccupancyId = Number.parseInt(lotOccupancyId, 10);
|
occupant.lotOccupancyId = Number.parseInt(lotOccupancyId, 10);
|
||||||
addOccupant(occupant);
|
addOccupant(occupant);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
const searchOccupants = (event) => {
|
function searchOccupants(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if (searchFormElement.querySelector('#lotOccupancyOccupantCopy--searchFilter').value === '') {
|
if (searchFormElement.querySelector('#lotOccupancyOccupantCopy--searchFilter').value === '') {
|
||||||
searchResultsElement.innerHTML =
|
searchResultsElement.innerHTML =
|
||||||
|
|
@ -271,6 +269,7 @@ else {
|
||||||
searchResultsElement.innerHTML =
|
searchResultsElement.innerHTML =
|
||||||
los.getLoadingParagraphHTML('Searching...');
|
los.getLoadingParagraphHTML('Searching...');
|
||||||
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doSearchPastOccupants', searchFormElement, (responseJSON) => {
|
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doSearchPastOccupants', searchFormElement, (responseJSON) => {
|
||||||
|
var _a, _b, _c, _d, _e, _f;
|
||||||
pastOccupantSearchResults = responseJSON.occupants;
|
pastOccupantSearchResults = responseJSON.occupants;
|
||||||
const panelElement = document.createElement('div');
|
const panelElement = document.createElement('div');
|
||||||
panelElement.className = 'panel';
|
panelElement.className = 'panel';
|
||||||
|
|
@ -280,28 +279,28 @@ else {
|
||||||
panelBlockElement.dataset.index = index.toString();
|
panelBlockElement.dataset.index = index.toString();
|
||||||
panelBlockElement.innerHTML =
|
panelBlockElement.innerHTML =
|
||||||
'<strong>' +
|
'<strong>' +
|
||||||
cityssm.escapeHTML(occupant.occupantName || '') +
|
cityssm.escapeHTML((_a = occupant.occupantName) !== null && _a !== void 0 ? _a : '') +
|
||||||
'</strong>' +
|
'</strong>' +
|
||||||
'<br />' +
|
'<br />' +
|
||||||
'<div class="columns">' +
|
'<div class="columns">' +
|
||||||
('<div class="column">' +
|
('<div class="column">' +
|
||||||
cityssm.escapeHTML(occupant.occupantAddress1 || '') +
|
cityssm.escapeHTML((_b = occupant.occupantAddress1) !== null && _b !== void 0 ? _b : '') +
|
||||||
'<br />' +
|
'<br />' +
|
||||||
(occupant.occupantAddress2
|
(occupant.occupantAddress2
|
||||||
? cityssm.escapeHTML(occupant.occupantAddress2) + '<br />'
|
? cityssm.escapeHTML(occupant.occupantAddress2) + '<br />'
|
||||||
: '') +
|
: '') +
|
||||||
cityssm.escapeHTML(occupant.occupantCity || '') +
|
cityssm.escapeHTML((_c = occupant.occupantCity) !== null && _c !== void 0 ? _c : '') +
|
||||||
', ' +
|
', ' +
|
||||||
cityssm.escapeHTML(occupant.occupantProvince || '') +
|
cityssm.escapeHTML((_d = occupant.occupantProvince) !== null && _d !== void 0 ? _d : '') +
|
||||||
'<br />' +
|
'<br />' +
|
||||||
cityssm.escapeHTML(occupant.occupantPostalCode || '') +
|
cityssm.escapeHTML((_e = occupant.occupantPostalCode) !== null && _e !== void 0 ? _e : '') +
|
||||||
'</div>') +
|
'</div>') +
|
||||||
('<div class="column">' +
|
('<div class="column">' +
|
||||||
(occupant.occupantPhoneNumber
|
(occupant.occupantPhoneNumber
|
||||||
? cityssm.escapeHTML(occupant.occupantPhoneNumber) +
|
? cityssm.escapeHTML(occupant.occupantPhoneNumber) +
|
||||||
'<br />'
|
'<br />'
|
||||||
: '') +
|
: '') +
|
||||||
cityssm.escapeHTML(occupant.occupantEmailAddress || '') +
|
cityssm.escapeHTML((_f = occupant.occupantEmailAddress) !== null && _f !== void 0 ? _f : '') +
|
||||||
'<br />' +
|
'<br />' +
|
||||||
'</div>') +
|
'</div>') +
|
||||||
'</div>';
|
'</div>';
|
||||||
|
|
@ -311,7 +310,7 @@ else {
|
||||||
searchResultsElement.innerHTML = '';
|
searchResultsElement.innerHTML = '';
|
||||||
searchResultsElement.append(panelElement);
|
searchResultsElement.append(panelElement);
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
cityssm.openHtmlModal('lotOccupancy-addOccupant', {
|
cityssm.openHtmlModal('lotOccupancy-addOccupant', {
|
||||||
onshow: (modalElement) => {
|
onshow: (modalElement) => {
|
||||||
los.populateAliases(modalElement);
|
los.populateAliases(modalElement);
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ declare const formElement: HTMLFormElement
|
||||||
|
|
||||||
let lotOccupancyOccupants: recordTypes.LotOccupancyOccupant[]
|
let lotOccupancyOccupants: recordTypes.LotOccupancyOccupant[]
|
||||||
|
|
||||||
const openEditLotOccupancyOccupant = (clickEvent: Event) => {
|
function openEditLotOccupancyOccupant(clickEvent: Event): void {
|
||||||
const lotOccupantIndex = Number.parseInt(
|
const lotOccupantIndex = Number.parseInt(
|
||||||
(clickEvent.currentTarget as HTMLElement).closest('tr')!.dataset
|
(clickEvent.currentTarget as HTMLElement).closest('tr')!.dataset
|
||||||
.lotOccupantIndex!,
|
.lotOccupantIndex!,
|
||||||
|
|
@ -34,7 +34,7 @@ const openEditLotOccupancyOccupant = (clickEvent: Event) => {
|
||||||
let editFormElement: HTMLFormElement
|
let editFormElement: HTMLFormElement
|
||||||
let editCloseModalFunction: () => void
|
let editCloseModalFunction: () => void
|
||||||
|
|
||||||
const editOccupant = (submitEvent: SubmitEvent) => {
|
function editOccupant(submitEvent: SubmitEvent): void {
|
||||||
submitEvent.preventDefault()
|
submitEvent.preventDefault()
|
||||||
|
|
||||||
cityssm.postJSON(
|
cityssm.postJSON(
|
||||||
|
|
@ -51,8 +51,8 @@ const openEditLotOccupancyOccupant = (clickEvent: Event) => {
|
||||||
renderLotOccupancyOccupants()
|
renderLotOccupancyOccupants()
|
||||||
} else {
|
} else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: 'Error Updating ' + exports.aliases.occupant,
|
title: 'Error Updating ' + los.escapedAliases.Occupant,
|
||||||
message: responseJSON.errorMessage || '',
|
message: responseJSON.errorMessage ?? '',
|
||||||
contextualColorName: 'danger'
|
contextualColorName: 'danger'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -63,7 +63,6 @@ const openEditLotOccupancyOccupant = (clickEvent: Event) => {
|
||||||
cityssm.openHtmlModal('lotOccupancy-editOccupant', {
|
cityssm.openHtmlModal('lotOccupancy-editOccupant', {
|
||||||
onshow: (modalElement) => {
|
onshow: (modalElement) => {
|
||||||
los.populateAliases(modalElement)
|
los.populateAliases(modalElement)
|
||||||
|
|
||||||
;(
|
;(
|
||||||
modalElement.querySelector(
|
modalElement.querySelector(
|
||||||
'#lotOccupancyOccupantEdit--lotOccupancyId'
|
'#lotOccupancyOccupantEdit--lotOccupancyId'
|
||||||
|
|
@ -133,25 +132,21 @@ const openEditLotOccupancyOccupant = (clickEvent: Event) => {
|
||||||
'#lotOccupancyOccupantEdit--occupantProvince'
|
'#lotOccupancyOccupantEdit--occupantProvince'
|
||||||
) as HTMLInputElement
|
) as HTMLInputElement
|
||||||
).value = lotOccupancyOccupant.occupantProvince!
|
).value = lotOccupancyOccupant.occupantProvince!
|
||||||
|
|
||||||
;(
|
;(
|
||||||
modalElement.querySelector(
|
modalElement.querySelector(
|
||||||
'#lotOccupancyOccupantEdit--occupantPostalCode'
|
'#lotOccupancyOccupantEdit--occupantPostalCode'
|
||||||
) as HTMLInputElement
|
) as HTMLInputElement
|
||||||
).value = lotOccupancyOccupant.occupantPostalCode!
|
).value = lotOccupancyOccupant.occupantPostalCode!
|
||||||
|
|
||||||
;(
|
;(
|
||||||
modalElement.querySelector(
|
modalElement.querySelector(
|
||||||
'#lotOccupancyOccupantEdit--occupantPhoneNumber'
|
'#lotOccupancyOccupantEdit--occupantPhoneNumber'
|
||||||
) as HTMLInputElement
|
) as HTMLInputElement
|
||||||
).value = lotOccupancyOccupant.occupantPhoneNumber!
|
).value = lotOccupancyOccupant.occupantPhoneNumber!
|
||||||
|
|
||||||
;(
|
;(
|
||||||
modalElement.querySelector(
|
modalElement.querySelector(
|
||||||
'#lotOccupancyOccupantEdit--occupantEmailAddress'
|
'#lotOccupancyOccupantEdit--occupantEmailAddress'
|
||||||
) as HTMLInputElement
|
) as HTMLInputElement
|
||||||
).value = lotOccupancyOccupant.occupantEmailAddress!
|
).value = lotOccupancyOccupant.occupantEmailAddress!
|
||||||
|
|
||||||
;(
|
;(
|
||||||
modalElement.querySelector(
|
modalElement.querySelector(
|
||||||
'#lotOccupancyOccupantEdit--occupantComment'
|
'#lotOccupancyOccupantEdit--occupantComment'
|
||||||
|
|
@ -160,7 +155,6 @@ const openEditLotOccupancyOccupant = (clickEvent: Event) => {
|
||||||
},
|
},
|
||||||
onshown: (modalElement, closeModalFunction) => {
|
onshown: (modalElement, closeModalFunction) => {
|
||||||
bulmaJS.toggleHtmlClipped()
|
bulmaJS.toggleHtmlClipped()
|
||||||
|
|
||||||
;(
|
;(
|
||||||
modalElement.querySelector(
|
modalElement.querySelector(
|
||||||
'#lotOccupancyOccupantEdit--lotOccupantTypeId'
|
'#lotOccupancyOccupantEdit--lotOccupantTypeId'
|
||||||
|
|
@ -178,12 +172,12 @@ const openEditLotOccupancyOccupant = (clickEvent: Event) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const deleteLotOccupancyOccupant = (clickEvent: Event) => {
|
function deleteLotOccupancyOccupant(clickEvent: Event): void {
|
||||||
const lotOccupantIndex = (clickEvent.currentTarget as HTMLElement).closest(
|
const lotOccupantIndex = (clickEvent.currentTarget as HTMLElement).closest(
|
||||||
'tr'
|
'tr'
|
||||||
)!.dataset.lotOccupantIndex
|
)!.dataset.lotOccupantIndex
|
||||||
|
|
||||||
const doDelete = () => {
|
function doDelete(): void {
|
||||||
cityssm.postJSON(
|
cityssm.postJSON(
|
||||||
los.urlPrefix + '/lotOccupancies/doDeleteLotOccupancyOccupant',
|
los.urlPrefix + '/lotOccupancies/doDeleteLotOccupancyOccupant',
|
||||||
{
|
{
|
||||||
|
|
@ -200,8 +194,8 @@ const deleteLotOccupancyOccupant = (clickEvent: Event) => {
|
||||||
renderLotOccupancyOccupants()
|
renderLotOccupancyOccupants()
|
||||||
} else {
|
} else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: 'Error Removing ' + exports.aliases.occupant,
|
title: 'Error Removing ' + los.escapedAliases.Occupant,
|
||||||
message: responseJSON.errorMessage || '',
|
message: responseJSON.errorMessage ?? '',
|
||||||
contextualColorName: 'danger'
|
contextualColorName: 'danger'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -210,20 +204,17 @@ const deleteLotOccupancyOccupant = (clickEvent: Event) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
bulmaJS.confirm({
|
bulmaJS.confirm({
|
||||||
title: 'Remove ' + exports.aliases.occupant + '?',
|
title: `Remove ${los.escapedAliases.Occupant}?`,
|
||||||
message:
|
message: `Are you sure you want to remove this ${los.escapedAliases.occupant}?`,
|
||||||
'Are you sure you want to remove this ' +
|
|
||||||
exports.aliases.occupant.toLowerCase() +
|
|
||||||
'?',
|
|
||||||
okButton: {
|
okButton: {
|
||||||
text: 'Yes, Remove ' + exports.aliases.occupant,
|
text: 'Yes, Remove ' + los.escapedAliases.Occupant,
|
||||||
callbackFunction: doDelete
|
callbackFunction: doDelete
|
||||||
},
|
},
|
||||||
contextualColorName: 'warning'
|
contextualColorName: 'warning'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const renderLotOccupancyOccupants = () => {
|
function renderLotOccupancyOccupants(): void {
|
||||||
const occupantsContainer = document.querySelector(
|
const occupantsContainer = document.querySelector(
|
||||||
'#container--lotOccupancyOccupants'
|
'#container--lotOccupancyOccupants'
|
||||||
) as HTMLElement
|
) as HTMLElement
|
||||||
|
|
@ -231,12 +222,9 @@ const renderLotOccupancyOccupants = () => {
|
||||||
cityssm.clearElement(occupantsContainer)
|
cityssm.clearElement(occupantsContainer)
|
||||||
|
|
||||||
if (lotOccupancyOccupants.length === 0) {
|
if (lotOccupancyOccupants.length === 0) {
|
||||||
occupantsContainer.innerHTML =
|
occupantsContainer.innerHTML = `<div class="message is-warning">
|
||||||
'<div class="message is-warning">' +
|
<p class="message-body">There are no ${los.escapedAliases.occupants} associated with this record.</p>
|
||||||
'<p class="message-body">There are no ' +
|
</div>`
|
||||||
exports.aliases.occupants.toLowerCase() +
|
|
||||||
' associated with this record.</p>' +
|
|
||||||
'</div>'
|
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -244,15 +232,14 @@ const renderLotOccupancyOccupants = () => {
|
||||||
const tableElement = document.createElement('table')
|
const tableElement = document.createElement('table')
|
||||||
tableElement.className = 'table is-fullwidth is-striped is-hoverable'
|
tableElement.className = 'table is-fullwidth is-striped is-hoverable'
|
||||||
|
|
||||||
tableElement.innerHTML =
|
tableElement.innerHTML = `<thead><tr>
|
||||||
'<thead><tr>' +
|
<th>${los.escapedAliases.Occupant}</th>
|
||||||
('<th>' + exports.aliases.occupant + '</th>') +
|
<th>Address</th>
|
||||||
'<th>Address</th>' +
|
<th>Other Contact</th>
|
||||||
'<th>Other Contact</th>' +
|
<th>Comment</th>
|
||||||
'<th>Comment</th>' +
|
<th class="is-hidden-print"><span class="is-sr-only">Options</span></th>
|
||||||
'<th class="is-hidden-print"><span class="is-sr-only">Options</span></th>' +
|
</tr></thead>
|
||||||
'</tr></thead>' +
|
<tbody></tbody>`
|
||||||
'<tbody></tbody>'
|
|
||||||
|
|
||||||
for (const lotOccupancyOccupant of lotOccupancyOccupants) {
|
for (const lotOccupancyOccupant of lotOccupancyOccupants) {
|
||||||
const tableRowElement = document.createElement('tr')
|
const tableRowElement = document.createElement('tr')
|
||||||
|
|
@ -261,7 +248,11 @@ const renderLotOccupancyOccupants = () => {
|
||||||
|
|
||||||
tableRowElement.innerHTML =
|
tableRowElement.innerHTML =
|
||||||
'<td>' +
|
'<td>' +
|
||||||
cityssm.escapeHTML(lotOccupancyOccupant.occupantName || '(No Name)') +
|
cityssm.escapeHTML(
|
||||||
|
(lotOccupancyOccupant.occupantName ?? '') === ''
|
||||||
|
? '(No Name)'
|
||||||
|
: lotOccupancyOccupant.occupantName!
|
||||||
|
) +
|
||||||
'<br />' +
|
'<br />' +
|
||||||
('<span class="tag">' +
|
('<span class="tag">' +
|
||||||
'<i class="fas fa-fw fa-' +
|
'<i class="fas fa-fw fa-' +
|
||||||
|
|
@ -282,9 +273,9 @@ const renderLotOccupancyOccupants = () => {
|
||||||
(lotOccupancyOccupant.occupantCity
|
(lotOccupancyOccupant.occupantCity
|
||||||
? cityssm.escapeHTML(lotOccupancyOccupant.occupantCity) + ', '
|
? cityssm.escapeHTML(lotOccupancyOccupant.occupantCity) + ', '
|
||||||
: '') +
|
: '') +
|
||||||
cityssm.escapeHTML(lotOccupancyOccupant.occupantProvince || '') +
|
cityssm.escapeHTML(lotOccupancyOccupant.occupantProvince ?? '') +
|
||||||
'<br />' +
|
'<br />' +
|
||||||
cityssm.escapeHTML(lotOccupancyOccupant.occupantPostalCode || '') +
|
cityssm.escapeHTML(lotOccupancyOccupant.occupantPostalCode ?? '') +
|
||||||
'</td>') +
|
'</td>') +
|
||||||
('<td>' +
|
('<td>' +
|
||||||
(lotOccupancyOccupant.occupantPhoneNumber
|
(lotOccupancyOccupant.occupantPhoneNumber
|
||||||
|
|
@ -332,9 +323,8 @@ if (isCreate) {
|
||||||
) as HTMLSelectElement
|
) as HTMLSelectElement
|
||||||
|
|
||||||
lotOccupantTypeIdElement.addEventListener('change', () => {
|
lotOccupantTypeIdElement.addEventListener('change', () => {
|
||||||
const occupantFields = formElement.querySelectorAll(
|
const occupantFields: NodeListOf<HTMLInputElement | HTMLTextAreaElement> =
|
||||||
"[data-table='LotOccupancyOccupant']"
|
formElement.querySelectorAll("[data-table='LotOccupancyOccupant']")
|
||||||
) as NodeListOf<HTMLInputElement | HTMLTextAreaElement>
|
|
||||||
|
|
||||||
for (const occupantField of occupantFields) {
|
for (const occupantField of occupantFields) {
|
||||||
occupantField.disabled = lotOccupantTypeIdElement.value === ''
|
occupantField.disabled = lotOccupantTypeIdElement.value === ''
|
||||||
|
|
@ -354,9 +344,9 @@ if (isCreate) {
|
||||||
let searchFormElement: HTMLFormElement
|
let searchFormElement: HTMLFormElement
|
||||||
let searchResultsElement: HTMLElement
|
let searchResultsElement: HTMLElement
|
||||||
|
|
||||||
const addOccupant = (
|
function addOccupant(
|
||||||
formOrObject: HTMLFormElement | recordTypes.LotOccupancyOccupant
|
formOrObject: HTMLFormElement | recordTypes.LotOccupancyOccupant
|
||||||
) => {
|
): void {
|
||||||
cityssm.postJSON(
|
cityssm.postJSON(
|
||||||
los.urlPrefix + '/lotOccupancies/doAddLotOccupancyOccupant',
|
los.urlPrefix + '/lotOccupancies/doAddLotOccupancyOccupant',
|
||||||
formOrObject,
|
formOrObject,
|
||||||
|
|
@ -371,8 +361,8 @@ if (isCreate) {
|
||||||
renderLotOccupancyOccupants()
|
renderLotOccupancyOccupants()
|
||||||
} else {
|
} else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: 'Error Adding ' + exports.aliases.occupant,
|
title: `Error Adding ${los.escapedAliases.Occupant}`,
|
||||||
message: responseJSON.errorMessage || '',
|
message: responseJSON.errorMessage ?? '',
|
||||||
contextualColorName: 'danger'
|
contextualColorName: 'danger'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -380,14 +370,14 @@ if (isCreate) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const addOccupantFromForm = (submitEvent: SubmitEvent) => {
|
function addOccupantFromForm(submitEvent: SubmitEvent): void {
|
||||||
submitEvent.preventDefault()
|
submitEvent.preventDefault()
|
||||||
addOccupant(addFormElement)
|
addOccupant(addFormElement)
|
||||||
}
|
}
|
||||||
|
|
||||||
let pastOccupantSearchResults: recordTypes.LotOccupancyOccupant[] = []
|
let pastOccupantSearchResults: recordTypes.LotOccupancyOccupant[] = []
|
||||||
|
|
||||||
const addOccupantFromCopy = (clickEvent: MouseEvent) => {
|
function addOccupantFromCopy(clickEvent: MouseEvent): void {
|
||||||
clickEvent.preventDefault()
|
clickEvent.preventDefault()
|
||||||
|
|
||||||
const panelBlockElement = clickEvent.currentTarget as HTMLElement
|
const panelBlockElement = clickEvent.currentTarget as HTMLElement
|
||||||
|
|
@ -407,11 +397,8 @@ if (isCreate) {
|
||||||
|
|
||||||
if (lotOccupantTypeId === '') {
|
if (lotOccupantTypeId === '') {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: 'No ' + exports.aliases.occupant + ' Type Selected',
|
title: `No ${los.escapedAliases.Occupant} Type Selected`,
|
||||||
message:
|
message: `Select a type to apply to the newly added ${los.escapedAliases.occupant}.`,
|
||||||
'Select a type to apply to the newly added ' +
|
|
||||||
exports.aliases.occupant.toLowerCase() +
|
|
||||||
'.',
|
|
||||||
contextualColorName: 'warning'
|
contextualColorName: 'warning'
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -421,7 +408,7 @@ if (isCreate) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const searchOccupants = (event: Event) => {
|
function searchOccupants(event: Event): void {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
|
@ -461,28 +448,28 @@ if (isCreate) {
|
||||||
|
|
||||||
panelBlockElement.innerHTML =
|
panelBlockElement.innerHTML =
|
||||||
'<strong>' +
|
'<strong>' +
|
||||||
cityssm.escapeHTML(occupant.occupantName || '') +
|
cityssm.escapeHTML(occupant.occupantName ?? '') +
|
||||||
'</strong>' +
|
'</strong>' +
|
||||||
'<br />' +
|
'<br />' +
|
||||||
'<div class="columns">' +
|
'<div class="columns">' +
|
||||||
('<div class="column">' +
|
('<div class="column">' +
|
||||||
cityssm.escapeHTML(occupant.occupantAddress1 || '') +
|
cityssm.escapeHTML(occupant.occupantAddress1 ?? '') +
|
||||||
'<br />' +
|
'<br />' +
|
||||||
(occupant.occupantAddress2
|
(occupant.occupantAddress2
|
||||||
? cityssm.escapeHTML(occupant.occupantAddress2) + '<br />'
|
? cityssm.escapeHTML(occupant.occupantAddress2) + '<br />'
|
||||||
: '') +
|
: '') +
|
||||||
cityssm.escapeHTML(occupant.occupantCity || '') +
|
cityssm.escapeHTML(occupant.occupantCity ?? '') +
|
||||||
', ' +
|
', ' +
|
||||||
cityssm.escapeHTML(occupant.occupantProvince || '') +
|
cityssm.escapeHTML(occupant.occupantProvince ?? '') +
|
||||||
'<br />' +
|
'<br />' +
|
||||||
cityssm.escapeHTML(occupant.occupantPostalCode || '') +
|
cityssm.escapeHTML(occupant.occupantPostalCode ?? '') +
|
||||||
'</div>') +
|
'</div>') +
|
||||||
('<div class="column">' +
|
('<div class="column">' +
|
||||||
(occupant.occupantPhoneNumber
|
(occupant.occupantPhoneNumber
|
||||||
? cityssm.escapeHTML(occupant.occupantPhoneNumber) +
|
? cityssm.escapeHTML(occupant.occupantPhoneNumber) +
|
||||||
'<br />'
|
'<br />'
|
||||||
: '') +
|
: '') +
|
||||||
cityssm.escapeHTML(occupant.occupantEmailAddress || '') +
|
cityssm.escapeHTML(occupant.occupantEmailAddress ?? '') +
|
||||||
'<br />' +
|
'<br />' +
|
||||||
'</div>') +
|
'</div>') +
|
||||||
'</div>'
|
'</div>'
|
||||||
|
|
@ -501,7 +488,6 @@ if (isCreate) {
|
||||||
cityssm.openHtmlModal('lotOccupancy-addOccupant', {
|
cityssm.openHtmlModal('lotOccupancy-addOccupant', {
|
||||||
onshow: (modalElement) => {
|
onshow: (modalElement) => {
|
||||||
los.populateAliases(modalElement)
|
los.populateAliases(modalElement)
|
||||||
|
|
||||||
;(
|
;(
|
||||||
modalElement.querySelector(
|
modalElement.querySelector(
|
||||||
'#lotOccupancyOccupantAdd--lotOccupancyId'
|
'#lotOccupancyOccupantAdd--lotOccupancyId'
|
||||||
|
|
@ -533,7 +519,6 @@ if (isCreate) {
|
||||||
'#lotOccupancyOccupantAdd--occupantCity'
|
'#lotOccupancyOccupantAdd--occupantCity'
|
||||||
) as HTMLInputElement
|
) as HTMLInputElement
|
||||||
).value = exports.occupantCityDefault
|
).value = exports.occupantCityDefault
|
||||||
|
|
||||||
;(
|
;(
|
||||||
modalElement.querySelector(
|
modalElement.querySelector(
|
||||||
'#lotOccupancyOccupantAdd--occupantProvince'
|
'#lotOccupancyOccupantAdd--occupantProvince'
|
||||||
|
|
@ -543,7 +528,6 @@ if (isCreate) {
|
||||||
onshown: (modalElement, closeModalFunction) => {
|
onshown: (modalElement, closeModalFunction) => {
|
||||||
bulmaJS.toggleHtmlClipped()
|
bulmaJS.toggleHtmlClipped()
|
||||||
bulmaJS.init(modalElement)
|
bulmaJS.init(modalElement)
|
||||||
|
|
||||||
;(
|
;(
|
||||||
modalElement.querySelector(
|
modalElement.querySelector(
|
||||||
'#lotOccupancyOccupantAdd--lotOccupantTypeId'
|
'#lotOccupancyOccupantAdd--lotOccupantTypeId'
|
||||||
|
|
@ -565,7 +549,6 @@ if (isCreate) {
|
||||||
searchFormElement.addEventListener('submit', (formEvent) => {
|
searchFormElement.addEventListener('submit', (formEvent) => {
|
||||||
formEvent.preventDefault()
|
formEvent.preventDefault()
|
||||||
})
|
})
|
||||||
|
|
||||||
;(
|
;(
|
||||||
modalElement.querySelector(
|
modalElement.querySelector(
|
||||||
'#lotOccupancyOccupantCopy--searchFilter'
|
'#lotOccupancyOccupantCopy--searchFilter'
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
/* eslint-disable spaced-comment, @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
(() => {
|
(() => {
|
||||||
var _a, _b;
|
var _a, _b;
|
||||||
|
|
@ -16,6 +16,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
cityssm.postJSON(los.urlPrefix +
|
cityssm.postJSON(los.urlPrefix +
|
||||||
'/workOrders/' +
|
'/workOrders/' +
|
||||||
(isCreate ? 'doCreateWorkOrder' : 'doUpdateWorkOrder'), submitEvent.currentTarget, (responseJSON) => {
|
(isCreate ? 'doCreateWorkOrder' : 'doUpdateWorkOrder'), submitEvent.currentTarget, (responseJSON) => {
|
||||||
|
var _a;
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
cityssm.disableNavBlocker();
|
cityssm.disableNavBlocker();
|
||||||
if (isCreate) {
|
if (isCreate) {
|
||||||
|
|
@ -31,7 +32,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
else {
|
else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: 'Error Updating Work Order',
|
title: 'Error Updating Work Order',
|
||||||
message: responseJSON.errorMessage || '',
|
message: (_a = responseJSON.errorMessage) !== null && _a !== void 0 ? _a : '',
|
||||||
contextualColorName: 'danger'
|
contextualColorName: 'danger'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -48,13 +49,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
cityssm.postJSON(los.urlPrefix + '/workOrders/doCloseWorkOrder', {
|
cityssm.postJSON(los.urlPrefix + '/workOrders/doCloseWorkOrder', {
|
||||||
workOrderId
|
workOrderId
|
||||||
}, (responseJSON) => {
|
}, (responseJSON) => {
|
||||||
|
var _a;
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
window.location.href = los.urlPrefix + '/workOrders/' + workOrderId;
|
window.location.href = los.urlPrefix + '/workOrders/' + workOrderId;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: 'Error Closing Work Order',
|
title: 'Error Closing Work Order',
|
||||||
message: responseJSON.errorMessage || '',
|
message: (_a = responseJSON.errorMessage) !== null && _a !== void 0 ? _a : '',
|
||||||
contextualColorName: 'danger'
|
contextualColorName: 'danger'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -64,13 +66,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
cityssm.postJSON(los.urlPrefix + '/workOrders/doDeleteWorkOrder', {
|
cityssm.postJSON(los.urlPrefix + '/workOrders/doDeleteWorkOrder', {
|
||||||
workOrderId
|
workOrderId
|
||||||
}, (responseJSON) => {
|
}, (responseJSON) => {
|
||||||
|
var _a;
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
window.location.href = los.urlPrefix + '/workOrders';
|
window.location.href = los.urlPrefix + '/workOrders';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: 'Error Deleting Work Order',
|
title: 'Error Deleting Work Order',
|
||||||
message: responseJSON.errorMessage || '',
|
message: (_a = responseJSON.errorMessage) !== null && _a !== void 0 ? _a : '',
|
||||||
contextualColorName: 'danger'
|
contextualColorName: 'danger'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -90,18 +93,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
contextualColorName: 'warning'
|
contextualColorName: 'warning'
|
||||||
});
|
});
|
||||||
/*
|
/*
|
||||||
// Disable closing work orders with open milestones
|
// Disable closing work orders with open milestones
|
||||||
bulmaJS.confirm({
|
bulmaJS.confirm({
|
||||||
title: "Close Work Order with Outstanding Milestones",
|
title: "Close Work Order with Outstanding Milestones",
|
||||||
message:
|
message:
|
||||||
"Are you sure you want to close this work order with outstanding milestones?",
|
"Are you sure you want to close this work order with outstanding milestones?",
|
||||||
contextualColorName: "danger",
|
contextualColorName: "danger",
|
||||||
okButton: {
|
okButton: {
|
||||||
text: "Yes, Close Work Order",
|
text: "Yes, Close Work Order",
|
||||||
callbackFunction: doClose
|
callbackFunction: doClose
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bulmaJS.confirm({
|
bulmaJS.confirm({
|
||||||
|
|
@ -870,6 +873,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
* Milestones
|
* Milestones
|
||||||
*/
|
*/
|
||||||
function processMilestoneResponse(responseJSON) {
|
function processMilestoneResponse(responseJSON) {
|
||||||
|
var _a;
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
workOrderMilestones = responseJSON.workOrderMilestones;
|
workOrderMilestones = responseJSON.workOrderMilestones;
|
||||||
renderMilestones();
|
renderMilestones();
|
||||||
|
|
@ -877,7 +881,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
else {
|
else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: 'Error Reopening Milestone',
|
title: 'Error Reopening Milestone',
|
||||||
message: responseJSON.errorMessage || '',
|
message: (_a = responseJSON.errorMessage) !== null && _a !== void 0 ? _a : '',
|
||||||
contextualColorName: 'danger'
|
contextualColorName: 'danger'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -889,12 +893,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const workOrderMilestone = workOrderMilestones.find((currentMilestone) => {
|
const workOrderMilestone = workOrderMilestones.find((currentMilestone) => {
|
||||||
return currentMilestone.workOrderMilestoneId === workOrderMilestoneId;
|
return currentMilestone.workOrderMilestoneId === workOrderMilestoneId;
|
||||||
});
|
});
|
||||||
const doComplete = () => {
|
function doComplete() {
|
||||||
cityssm.postJSON(los.urlPrefix + '/workOrders/doCompleteWorkOrderMilestone', {
|
cityssm.postJSON(los.urlPrefix + '/workOrders/doCompleteWorkOrderMilestone', {
|
||||||
workOrderId,
|
workOrderId,
|
||||||
workOrderMilestoneId
|
workOrderMilestoneId
|
||||||
}, processMilestoneResponse);
|
}, processMilestoneResponse);
|
||||||
};
|
}
|
||||||
bulmaJS.confirm({
|
bulmaJS.confirm({
|
||||||
title: 'Complete Milestone',
|
title: 'Complete Milestone',
|
||||||
message: 'Are you sure you want to complete this milestone?' +
|
message: 'Are you sure you want to complete this milestone?' +
|
||||||
|
|
@ -912,12 +916,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
function reopenMilestone(clickEvent) {
|
function reopenMilestone(clickEvent) {
|
||||||
clickEvent.preventDefault();
|
clickEvent.preventDefault();
|
||||||
const workOrderMilestoneId = clickEvent.currentTarget.closest('.container--milestone').dataset.workOrderMilestoneId;
|
const workOrderMilestoneId = clickEvent.currentTarget.closest('.container--milestone').dataset.workOrderMilestoneId;
|
||||||
const doReopen = () => {
|
function doReopen() {
|
||||||
cityssm.postJSON(los.urlPrefix + '/workOrders/doReopenWorkOrderMilestone', {
|
cityssm.postJSON(los.urlPrefix + '/workOrders/doReopenWorkOrderMilestone', {
|
||||||
workOrderId,
|
workOrderId,
|
||||||
workOrderMilestoneId
|
workOrderMilestoneId
|
||||||
}, processMilestoneResponse);
|
}, processMilestoneResponse);
|
||||||
};
|
}
|
||||||
bulmaJS.confirm({
|
bulmaJS.confirm({
|
||||||
title: 'Reopen Milestone',
|
title: 'Reopen Milestone',
|
||||||
message: 'Are you sure you want to remove the completion status from this milestone, and reopen it?',
|
message: 'Are you sure you want to remove the completion status from this milestone, and reopen it?',
|
||||||
|
|
@ -931,12 +935,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
function deleteMilestone(clickEvent) {
|
function deleteMilestone(clickEvent) {
|
||||||
clickEvent.preventDefault();
|
clickEvent.preventDefault();
|
||||||
const workOrderMilestoneId = clickEvent.currentTarget.closest('.container--milestone').dataset.workOrderMilestoneId;
|
const workOrderMilestoneId = clickEvent.currentTarget.closest('.container--milestone').dataset.workOrderMilestoneId;
|
||||||
const doDelete = () => {
|
function doDelete() {
|
||||||
cityssm.postJSON(los.urlPrefix + '/workOrders/doDeleteWorkOrderMilestone', {
|
cityssm.postJSON(los.urlPrefix + '/workOrders/doDeleteWorkOrderMilestone', {
|
||||||
workOrderMilestoneId,
|
workOrderMilestoneId,
|
||||||
workOrderId
|
workOrderId
|
||||||
}, processMilestoneResponse);
|
}, processMilestoneResponse);
|
||||||
};
|
}
|
||||||
bulmaJS.confirm({
|
bulmaJS.confirm({
|
||||||
title: 'Delete Milestone',
|
title: 'Delete Milestone',
|
||||||
message: 'Are you sure you want to delete this milestone?',
|
message: 'Are you sure you want to delete this milestone?',
|
||||||
|
|
@ -954,7 +958,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
return currentMilestone.workOrderMilestoneId === workOrderMilestoneId;
|
return currentMilestone.workOrderMilestoneId === workOrderMilestoneId;
|
||||||
});
|
});
|
||||||
let editCloseModalFunction;
|
let editCloseModalFunction;
|
||||||
const doEdit = (submitEvent) => {
|
function doEdit(submitEvent) {
|
||||||
submitEvent.preventDefault();
|
submitEvent.preventDefault();
|
||||||
cityssm.postJSON(los.urlPrefix + '/workOrders/doUpdateWorkOrderMilestone', submitEvent.currentTarget, (responseJSON) => {
|
cityssm.postJSON(los.urlPrefix + '/workOrders/doUpdateWorkOrderMilestone', submitEvent.currentTarget, (responseJSON) => {
|
||||||
processMilestoneResponse(responseJSON);
|
processMilestoneResponse(responseJSON);
|
||||||
|
|
@ -962,7 +966,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
editCloseModalFunction();
|
editCloseModalFunction();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
cityssm.openHtmlModal('workOrder-editMilestone', {
|
cityssm.openHtmlModal('workOrder-editMilestone', {
|
||||||
onshow(modalElement) {
|
onshow(modalElement) {
|
||||||
;
|
;
|
||||||
|
|
@ -1013,7 +1017,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function renderMilestones() {
|
function renderMilestones() {
|
||||||
var _a, _b, _c;
|
var _a, _b, _c, _d, _e;
|
||||||
// Clear milestones panel
|
// Clear milestones panel
|
||||||
const milestonesPanelElement = document.querySelector('#panel--milestones');
|
const milestonesPanelElement = document.querySelector('#panel--milestones');
|
||||||
const panelBlockElementsToDelete = milestonesPanelElement.querySelectorAll('.panel-block');
|
const panelBlockElementsToDelete = milestonesPanelElement.querySelectorAll('.panel-block');
|
||||||
|
|
@ -1043,7 +1047,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
('<div class="column">' +
|
('<div class="column">' +
|
||||||
(milestone.workOrderMilestoneTypeId
|
(milestone.workOrderMilestoneTypeId
|
||||||
? '<strong>' +
|
? '<strong>' +
|
||||||
cityssm.escapeHTML(milestone.workOrderMilestoneType || '') +
|
cityssm.escapeHTML((_a = milestone.workOrderMilestoneType) !== null && _a !== void 0 ? _a : '') +
|
||||||
'</strong><br />'
|
'</strong><br />'
|
||||||
: '') +
|
: '') +
|
||||||
milestone.workOrderMilestoneDateString +
|
milestone.workOrderMilestoneDateString +
|
||||||
|
|
@ -1052,7 +1056,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
: '') +
|
: '') +
|
||||||
'<br />' +
|
'<br />' +
|
||||||
'<span class="is-size-7">' +
|
'<span class="is-size-7">' +
|
||||||
cityssm.escapeHTML(milestone.workOrderMilestoneDescription || '') +
|
cityssm.escapeHTML((_b = milestone.workOrderMilestoneDescription) !== null && _b !== void 0 ? _b : '') +
|
||||||
'</span>' +
|
'</span>' +
|
||||||
'</div>') +
|
'</div>') +
|
||||||
('<div class="column is-narrow">' +
|
('<div class="column is-narrow">' +
|
||||||
|
|
@ -1083,12 +1087,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'</div>') +
|
'</div>') +
|
||||||
'</div>';
|
'</div>';
|
||||||
(_a = panelBlockElement
|
|
||||||
.querySelector('.button--reopenMilestone')) === null || _a === void 0 ? void 0 : _a.addEventListener('click', reopenMilestone);
|
|
||||||
(_b = panelBlockElement
|
|
||||||
.querySelector('.button--editMilestone')) === null || _b === void 0 ? void 0 : _b.addEventListener('click', editMilestone);
|
|
||||||
(_c = panelBlockElement
|
(_c = panelBlockElement
|
||||||
.querySelector('.button--completeMilestone')) === null || _c === void 0 ? void 0 : _c.addEventListener('click', completeMilestone);
|
.querySelector('.button--reopenMilestone')) === null || _c === void 0 ? void 0 : _c.addEventListener('click', reopenMilestone);
|
||||||
|
(_d = panelBlockElement
|
||||||
|
.querySelector('.button--editMilestone')) === null || _d === void 0 ? void 0 : _d.addEventListener('click', editMilestone);
|
||||||
|
(_e = panelBlockElement
|
||||||
|
.querySelector('.button--completeMilestone')) === null || _e === void 0 ? void 0 : _e.addEventListener('click', completeMilestone);
|
||||||
panelBlockElement
|
panelBlockElement
|
||||||
.querySelector('.button--deleteMilestone')
|
.querySelector('.button--deleteMilestone')
|
||||||
.addEventListener('click', deleteMilestone);
|
.addEventListener('click', deleteMilestone);
|
||||||
|
|
@ -1107,7 +1111,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
let addModalElement;
|
let addModalElement;
|
||||||
let addFormElement;
|
let addFormElement;
|
||||||
let addCloseModalFunction;
|
let addCloseModalFunction;
|
||||||
const doAdd = (submitEvent) => {
|
function doAdd(submitEvent) {
|
||||||
if (submitEvent) {
|
if (submitEvent) {
|
||||||
submitEvent.preventDefault();
|
submitEvent.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
@ -1134,7 +1138,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
else {
|
else {
|
||||||
_doAdd();
|
_doAdd();
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
cityssm.openHtmlModal('workOrder-addMilestone', {
|
cityssm.openHtmlModal('workOrder-addMilestone', {
|
||||||
onshow(modalElement) {
|
onshow(modalElement) {
|
||||||
;
|
;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
/* eslint-disable spaced-comment, @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
(() => {
|
(() => {
|
||||||
var _a, _b;
|
var _a, _b;
|
||||||
|
|
@ -16,6 +16,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
cityssm.postJSON(los.urlPrefix +
|
cityssm.postJSON(los.urlPrefix +
|
||||||
'/workOrders/' +
|
'/workOrders/' +
|
||||||
(isCreate ? 'doCreateWorkOrder' : 'doUpdateWorkOrder'), submitEvent.currentTarget, (responseJSON) => {
|
(isCreate ? 'doCreateWorkOrder' : 'doUpdateWorkOrder'), submitEvent.currentTarget, (responseJSON) => {
|
||||||
|
var _a;
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
cityssm.disableNavBlocker();
|
cityssm.disableNavBlocker();
|
||||||
if (isCreate) {
|
if (isCreate) {
|
||||||
|
|
@ -31,7 +32,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
else {
|
else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: 'Error Updating Work Order',
|
title: 'Error Updating Work Order',
|
||||||
message: responseJSON.errorMessage || '',
|
message: (_a = responseJSON.errorMessage) !== null && _a !== void 0 ? _a : '',
|
||||||
contextualColorName: 'danger'
|
contextualColorName: 'danger'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -48,13 +49,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
cityssm.postJSON(los.urlPrefix + '/workOrders/doCloseWorkOrder', {
|
cityssm.postJSON(los.urlPrefix + '/workOrders/doCloseWorkOrder', {
|
||||||
workOrderId
|
workOrderId
|
||||||
}, (responseJSON) => {
|
}, (responseJSON) => {
|
||||||
|
var _a;
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
window.location.href = los.urlPrefix + '/workOrders/' + workOrderId;
|
window.location.href = los.urlPrefix + '/workOrders/' + workOrderId;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: 'Error Closing Work Order',
|
title: 'Error Closing Work Order',
|
||||||
message: responseJSON.errorMessage || '',
|
message: (_a = responseJSON.errorMessage) !== null && _a !== void 0 ? _a : '',
|
||||||
contextualColorName: 'danger'
|
contextualColorName: 'danger'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -64,13 +66,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
cityssm.postJSON(los.urlPrefix + '/workOrders/doDeleteWorkOrder', {
|
cityssm.postJSON(los.urlPrefix + '/workOrders/doDeleteWorkOrder', {
|
||||||
workOrderId
|
workOrderId
|
||||||
}, (responseJSON) => {
|
}, (responseJSON) => {
|
||||||
|
var _a;
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
window.location.href = los.urlPrefix + '/workOrders';
|
window.location.href = los.urlPrefix + '/workOrders';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: 'Error Deleting Work Order',
|
title: 'Error Deleting Work Order',
|
||||||
message: responseJSON.errorMessage || '',
|
message: (_a = responseJSON.errorMessage) !== null && _a !== void 0 ? _a : '',
|
||||||
contextualColorName: 'danger'
|
contextualColorName: 'danger'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -90,18 +93,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
contextualColorName: 'warning'
|
contextualColorName: 'warning'
|
||||||
});
|
});
|
||||||
/*
|
/*
|
||||||
// Disable closing work orders with open milestones
|
// Disable closing work orders with open milestones
|
||||||
bulmaJS.confirm({
|
bulmaJS.confirm({
|
||||||
title: "Close Work Order with Outstanding Milestones",
|
title: "Close Work Order with Outstanding Milestones",
|
||||||
message:
|
message:
|
||||||
"Are you sure you want to close this work order with outstanding milestones?",
|
"Are you sure you want to close this work order with outstanding milestones?",
|
||||||
contextualColorName: "danger",
|
contextualColorName: "danger",
|
||||||
okButton: {
|
okButton: {
|
||||||
text: "Yes, Close Work Order",
|
text: "Yes, Close Work Order",
|
||||||
callbackFunction: doClose
|
callbackFunction: doClose
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bulmaJS.confirm({
|
bulmaJS.confirm({
|
||||||
|
|
@ -142,6 +145,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
* Milestones
|
* Milestones
|
||||||
*/
|
*/
|
||||||
function processMilestoneResponse(responseJSON) {
|
function processMilestoneResponse(responseJSON) {
|
||||||
|
var _a;
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
workOrderMilestones = responseJSON.workOrderMilestones;
|
workOrderMilestones = responseJSON.workOrderMilestones;
|
||||||
renderMilestones();
|
renderMilestones();
|
||||||
|
|
@ -149,7 +153,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
else {
|
else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: 'Error Reopening Milestone',
|
title: 'Error Reopening Milestone',
|
||||||
message: responseJSON.errorMessage || '',
|
message: (_a = responseJSON.errorMessage) !== null && _a !== void 0 ? _a : '',
|
||||||
contextualColorName: 'danger'
|
contextualColorName: 'danger'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -161,12 +165,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const workOrderMilestone = workOrderMilestones.find((currentMilestone) => {
|
const workOrderMilestone = workOrderMilestones.find((currentMilestone) => {
|
||||||
return currentMilestone.workOrderMilestoneId === workOrderMilestoneId;
|
return currentMilestone.workOrderMilestoneId === workOrderMilestoneId;
|
||||||
});
|
});
|
||||||
const doComplete = () => {
|
function doComplete() {
|
||||||
cityssm.postJSON(los.urlPrefix + '/workOrders/doCompleteWorkOrderMilestone', {
|
cityssm.postJSON(los.urlPrefix + '/workOrders/doCompleteWorkOrderMilestone', {
|
||||||
workOrderId,
|
workOrderId,
|
||||||
workOrderMilestoneId
|
workOrderMilestoneId
|
||||||
}, processMilestoneResponse);
|
}, processMilestoneResponse);
|
||||||
};
|
}
|
||||||
bulmaJS.confirm({
|
bulmaJS.confirm({
|
||||||
title: 'Complete Milestone',
|
title: 'Complete Milestone',
|
||||||
message: 'Are you sure you want to complete this milestone?' +
|
message: 'Are you sure you want to complete this milestone?' +
|
||||||
|
|
@ -184,12 +188,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
function reopenMilestone(clickEvent) {
|
function reopenMilestone(clickEvent) {
|
||||||
clickEvent.preventDefault();
|
clickEvent.preventDefault();
|
||||||
const workOrderMilestoneId = clickEvent.currentTarget.closest('.container--milestone').dataset.workOrderMilestoneId;
|
const workOrderMilestoneId = clickEvent.currentTarget.closest('.container--milestone').dataset.workOrderMilestoneId;
|
||||||
const doReopen = () => {
|
function doReopen() {
|
||||||
cityssm.postJSON(los.urlPrefix + '/workOrders/doReopenWorkOrderMilestone', {
|
cityssm.postJSON(los.urlPrefix + '/workOrders/doReopenWorkOrderMilestone', {
|
||||||
workOrderId,
|
workOrderId,
|
||||||
workOrderMilestoneId
|
workOrderMilestoneId
|
||||||
}, processMilestoneResponse);
|
}, processMilestoneResponse);
|
||||||
};
|
}
|
||||||
bulmaJS.confirm({
|
bulmaJS.confirm({
|
||||||
title: 'Reopen Milestone',
|
title: 'Reopen Milestone',
|
||||||
message: 'Are you sure you want to remove the completion status from this milestone, and reopen it?',
|
message: 'Are you sure you want to remove the completion status from this milestone, and reopen it?',
|
||||||
|
|
@ -203,12 +207,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
function deleteMilestone(clickEvent) {
|
function deleteMilestone(clickEvent) {
|
||||||
clickEvent.preventDefault();
|
clickEvent.preventDefault();
|
||||||
const workOrderMilestoneId = clickEvent.currentTarget.closest('.container--milestone').dataset.workOrderMilestoneId;
|
const workOrderMilestoneId = clickEvent.currentTarget.closest('.container--milestone').dataset.workOrderMilestoneId;
|
||||||
const doDelete = () => {
|
function doDelete() {
|
||||||
cityssm.postJSON(los.urlPrefix + '/workOrders/doDeleteWorkOrderMilestone', {
|
cityssm.postJSON(los.urlPrefix + '/workOrders/doDeleteWorkOrderMilestone', {
|
||||||
workOrderMilestoneId,
|
workOrderMilestoneId,
|
||||||
workOrderId
|
workOrderId
|
||||||
}, processMilestoneResponse);
|
}, processMilestoneResponse);
|
||||||
};
|
}
|
||||||
bulmaJS.confirm({
|
bulmaJS.confirm({
|
||||||
title: 'Delete Milestone',
|
title: 'Delete Milestone',
|
||||||
message: 'Are you sure you want to delete this milestone?',
|
message: 'Are you sure you want to delete this milestone?',
|
||||||
|
|
@ -226,7 +230,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
return currentMilestone.workOrderMilestoneId === workOrderMilestoneId;
|
return currentMilestone.workOrderMilestoneId === workOrderMilestoneId;
|
||||||
});
|
});
|
||||||
let editCloseModalFunction;
|
let editCloseModalFunction;
|
||||||
const doEdit = (submitEvent) => {
|
function doEdit(submitEvent) {
|
||||||
submitEvent.preventDefault();
|
submitEvent.preventDefault();
|
||||||
cityssm.postJSON(los.urlPrefix + '/workOrders/doUpdateWorkOrderMilestone', submitEvent.currentTarget, (responseJSON) => {
|
cityssm.postJSON(los.urlPrefix + '/workOrders/doUpdateWorkOrderMilestone', submitEvent.currentTarget, (responseJSON) => {
|
||||||
processMilestoneResponse(responseJSON);
|
processMilestoneResponse(responseJSON);
|
||||||
|
|
@ -234,7 +238,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
editCloseModalFunction();
|
editCloseModalFunction();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
cityssm.openHtmlModal('workOrder-editMilestone', {
|
cityssm.openHtmlModal('workOrder-editMilestone', {
|
||||||
onshow(modalElement) {
|
onshow(modalElement) {
|
||||||
;
|
;
|
||||||
|
|
@ -285,7 +289,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function renderMilestones() {
|
function renderMilestones() {
|
||||||
var _a, _b, _c;
|
var _a, _b, _c, _d, _e;
|
||||||
// Clear milestones panel
|
// Clear milestones panel
|
||||||
const milestonesPanelElement = document.querySelector('#panel--milestones');
|
const milestonesPanelElement = document.querySelector('#panel--milestones');
|
||||||
const panelBlockElementsToDelete = milestonesPanelElement.querySelectorAll('.panel-block');
|
const panelBlockElementsToDelete = milestonesPanelElement.querySelectorAll('.panel-block');
|
||||||
|
|
@ -315,7 +319,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
('<div class="column">' +
|
('<div class="column">' +
|
||||||
(milestone.workOrderMilestoneTypeId
|
(milestone.workOrderMilestoneTypeId
|
||||||
? '<strong>' +
|
? '<strong>' +
|
||||||
cityssm.escapeHTML(milestone.workOrderMilestoneType || '') +
|
cityssm.escapeHTML((_a = milestone.workOrderMilestoneType) !== null && _a !== void 0 ? _a : '') +
|
||||||
'</strong><br />'
|
'</strong><br />'
|
||||||
: '') +
|
: '') +
|
||||||
milestone.workOrderMilestoneDateString +
|
milestone.workOrderMilestoneDateString +
|
||||||
|
|
@ -324,7 +328,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
: '') +
|
: '') +
|
||||||
'<br />' +
|
'<br />' +
|
||||||
'<span class="is-size-7">' +
|
'<span class="is-size-7">' +
|
||||||
cityssm.escapeHTML(milestone.workOrderMilestoneDescription || '') +
|
cityssm.escapeHTML((_b = milestone.workOrderMilestoneDescription) !== null && _b !== void 0 ? _b : '') +
|
||||||
'</span>' +
|
'</span>' +
|
||||||
'</div>') +
|
'</div>') +
|
||||||
('<div class="column is-narrow">' +
|
('<div class="column is-narrow">' +
|
||||||
|
|
@ -355,12 +359,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'</div>') +
|
'</div>') +
|
||||||
'</div>';
|
'</div>';
|
||||||
(_a = panelBlockElement
|
|
||||||
.querySelector('.button--reopenMilestone')) === null || _a === void 0 ? void 0 : _a.addEventListener('click', reopenMilestone);
|
|
||||||
(_b = panelBlockElement
|
|
||||||
.querySelector('.button--editMilestone')) === null || _b === void 0 ? void 0 : _b.addEventListener('click', editMilestone);
|
|
||||||
(_c = panelBlockElement
|
(_c = panelBlockElement
|
||||||
.querySelector('.button--completeMilestone')) === null || _c === void 0 ? void 0 : _c.addEventListener('click', completeMilestone);
|
.querySelector('.button--reopenMilestone')) === null || _c === void 0 ? void 0 : _c.addEventListener('click', reopenMilestone);
|
||||||
|
(_d = panelBlockElement
|
||||||
|
.querySelector('.button--editMilestone')) === null || _d === void 0 ? void 0 : _d.addEventListener('click', editMilestone);
|
||||||
|
(_e = panelBlockElement
|
||||||
|
.querySelector('.button--completeMilestone')) === null || _e === void 0 ? void 0 : _e.addEventListener('click', completeMilestone);
|
||||||
panelBlockElement
|
panelBlockElement
|
||||||
.querySelector('.button--deleteMilestone')
|
.querySelector('.button--deleteMilestone')
|
||||||
.addEventListener('click', deleteMilestone);
|
.addEventListener('click', deleteMilestone);
|
||||||
|
|
@ -379,7 +383,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
let addModalElement;
|
let addModalElement;
|
||||||
let addFormElement;
|
let addFormElement;
|
||||||
let addCloseModalFunction;
|
let addCloseModalFunction;
|
||||||
const doAdd = (submitEvent) => {
|
function doAdd(submitEvent) {
|
||||||
if (submitEvent) {
|
if (submitEvent) {
|
||||||
submitEvent.preventDefault();
|
submitEvent.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
@ -406,7 +410,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
else {
|
else {
|
||||||
_doAdd();
|
_doAdd();
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
cityssm.openHtmlModal('workOrder-addMilestone', {
|
cityssm.openHtmlModal('workOrder-addMilestone', {
|
||||||
onshow(modalElement) {
|
onshow(modalElement) {
|
||||||
;
|
;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
/* eslint-disable spaced-comment, @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||||
|
|
||||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types'
|
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types'
|
||||||
import type { BulmaJS } from '@cityssm/bulma-js/types'
|
import type { BulmaJS } from '@cityssm/bulma-js/types'
|
||||||
|
|
@ -8,7 +8,6 @@ import type * as recordTypes from '../../types/recordTypes'
|
||||||
|
|
||||||
declare const cityssm: cityssmGlobal
|
declare const cityssm: cityssmGlobal
|
||||||
declare const bulmaJS: BulmaJS
|
declare const bulmaJS: BulmaJS
|
||||||
|
|
||||||
;(() => {
|
;(() => {
|
||||||
const los = exports.los as globalTypes.LOS
|
const los = exports.los as globalTypes.LOS
|
||||||
|
|
||||||
|
|
@ -47,7 +46,7 @@ declare const bulmaJS: BulmaJS
|
||||||
|
|
||||||
if (isCreate) {
|
if (isCreate) {
|
||||||
window.location.href = los.getWorkOrderURL(
|
window.location.href = los.getWorkOrderURL(
|
||||||
responseJSON.workOrderId!,
|
responseJSON.workOrderId,
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -59,7 +58,7 @@ declare const bulmaJS: BulmaJS
|
||||||
} else {
|
} else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: 'Error Updating Work Order',
|
title: 'Error Updating Work Order',
|
||||||
message: responseJSON.errorMessage || '',
|
message: responseJSON.errorMessage ?? '',
|
||||||
contextualColorName: 'danger'
|
contextualColorName: 'danger'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -67,9 +66,8 @@ declare const bulmaJS: BulmaJS
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
const inputElements = workOrderFormElement.querySelectorAll(
|
const inputElements: NodeListOf<HTMLInputElement | HTMLSelectElement> =
|
||||||
'input, select'
|
workOrderFormElement.querySelectorAll('input, select')
|
||||||
) as NodeListOf<HTMLInputElement | HTMLSelectElement>
|
|
||||||
|
|
||||||
for (const inputElement of inputElements) {
|
for (const inputElement of inputElements) {
|
||||||
inputElement.addEventListener('change', cityssm.enableNavBlocker)
|
inputElement.addEventListener('change', cityssm.enableNavBlocker)
|
||||||
|
|
@ -79,7 +77,7 @@ declare const bulmaJS: BulmaJS
|
||||||
* Work Order Options
|
* Work Order Options
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function doClose() {
|
function doClose(): void {
|
||||||
cityssm.postJSON(
|
cityssm.postJSON(
|
||||||
los.urlPrefix + '/workOrders/doCloseWorkOrder',
|
los.urlPrefix + '/workOrders/doCloseWorkOrder',
|
||||||
{
|
{
|
||||||
|
|
@ -91,7 +89,7 @@ declare const bulmaJS: BulmaJS
|
||||||
} else {
|
} else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: 'Error Closing Work Order',
|
title: 'Error Closing Work Order',
|
||||||
message: responseJSON.errorMessage || '',
|
message: responseJSON.errorMessage ?? '',
|
||||||
contextualColorName: 'danger'
|
contextualColorName: 'danger'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -99,7 +97,7 @@ declare const bulmaJS: BulmaJS
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function doDelete() {
|
function doDelete(): void {
|
||||||
cityssm.postJSON(
|
cityssm.postJSON(
|
||||||
los.urlPrefix + '/workOrders/doDeleteWorkOrder',
|
los.urlPrefix + '/workOrders/doDeleteWorkOrder',
|
||||||
{
|
{
|
||||||
|
|
@ -111,7 +109,7 @@ declare const bulmaJS: BulmaJS
|
||||||
} else {
|
} else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: 'Error Deleting Work Order',
|
title: 'Error Deleting Work Order',
|
||||||
message: responseJSON.errorMessage || '',
|
message: responseJSON.errorMessage ?? '',
|
||||||
contextualColorName: 'danger'
|
contextualColorName: 'danger'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -137,18 +135,18 @@ declare const bulmaJS: BulmaJS
|
||||||
})
|
})
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// Disable closing work orders with open milestones
|
// Disable closing work orders with open milestones
|
||||||
bulmaJS.confirm({
|
bulmaJS.confirm({
|
||||||
title: "Close Work Order with Outstanding Milestones",
|
title: "Close Work Order with Outstanding Milestones",
|
||||||
message:
|
message:
|
||||||
"Are you sure you want to close this work order with outstanding milestones?",
|
"Are you sure you want to close this work order with outstanding milestones?",
|
||||||
contextualColorName: "danger",
|
contextualColorName: "danger",
|
||||||
okButton: {
|
okButton: {
|
||||||
text: "Yes, Close Work Order",
|
text: "Yes, Close Work Order",
|
||||||
callbackFunction: doClose
|
callbackFunction: doClose
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
*/
|
*/
|
||||||
} else {
|
} else {
|
||||||
bulmaJS.confirm({
|
bulmaJS.confirm({
|
||||||
title: 'Close Work Order',
|
title: 'Close Work Order',
|
||||||
|
|
@ -200,20 +198,20 @@ declare const bulmaJS: BulmaJS
|
||||||
success: boolean
|
success: boolean
|
||||||
errorMessage?: string
|
errorMessage?: string
|
||||||
workOrderMilestones?: recordTypes.WorkOrderMilestone[]
|
workOrderMilestones?: recordTypes.WorkOrderMilestone[]
|
||||||
}) {
|
}): void {
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
workOrderMilestones = responseJSON.workOrderMilestones!
|
workOrderMilestones = responseJSON.workOrderMilestones!
|
||||||
renderMilestones()
|
renderMilestones()
|
||||||
} else {
|
} else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: 'Error Reopening Milestone',
|
title: 'Error Reopening Milestone',
|
||||||
message: responseJSON.errorMessage || '',
|
message: responseJSON.errorMessage ?? '',
|
||||||
contextualColorName: 'danger'
|
contextualColorName: 'danger'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function completeMilestone(clickEvent: Event) {
|
function completeMilestone(clickEvent: Event): void {
|
||||||
clickEvent.preventDefault()
|
clickEvent.preventDefault()
|
||||||
|
|
||||||
const currentDateString = cityssm.dateToString(new Date())
|
const currentDateString = cityssm.dateToString(new Date())
|
||||||
|
|
@ -231,7 +229,7 @@ declare const bulmaJS: BulmaJS
|
||||||
return currentMilestone.workOrderMilestoneId === workOrderMilestoneId
|
return currentMilestone.workOrderMilestoneId === workOrderMilestoneId
|
||||||
})!
|
})!
|
||||||
|
|
||||||
const doComplete = () => {
|
function doComplete(): void {
|
||||||
cityssm.postJSON(
|
cityssm.postJSON(
|
||||||
los.urlPrefix + '/workOrders/doCompleteWorkOrderMilestone',
|
los.urlPrefix + '/workOrders/doCompleteWorkOrderMilestone',
|
||||||
{
|
{
|
||||||
|
|
@ -258,7 +256,7 @@ declare const bulmaJS: BulmaJS
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function reopenMilestone(clickEvent: Event) {
|
function reopenMilestone(clickEvent: Event): void {
|
||||||
clickEvent.preventDefault()
|
clickEvent.preventDefault()
|
||||||
|
|
||||||
const workOrderMilestoneId = (
|
const workOrderMilestoneId = (
|
||||||
|
|
@ -267,7 +265,7 @@ declare const bulmaJS: BulmaJS
|
||||||
) as HTMLElement
|
) as HTMLElement
|
||||||
).dataset.workOrderMilestoneId
|
).dataset.workOrderMilestoneId
|
||||||
|
|
||||||
const doReopen = () => {
|
function doReopen(): void {
|
||||||
cityssm.postJSON(
|
cityssm.postJSON(
|
||||||
los.urlPrefix + '/workOrders/doReopenWorkOrderMilestone',
|
los.urlPrefix + '/workOrders/doReopenWorkOrderMilestone',
|
||||||
{
|
{
|
||||||
|
|
@ -290,7 +288,7 @@ declare const bulmaJS: BulmaJS
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteMilestone(clickEvent: Event) {
|
function deleteMilestone(clickEvent: Event): void {
|
||||||
clickEvent.preventDefault()
|
clickEvent.preventDefault()
|
||||||
|
|
||||||
const workOrderMilestoneId = (
|
const workOrderMilestoneId = (
|
||||||
|
|
@ -299,7 +297,7 @@ declare const bulmaJS: BulmaJS
|
||||||
) as HTMLElement
|
) as HTMLElement
|
||||||
).dataset.workOrderMilestoneId
|
).dataset.workOrderMilestoneId
|
||||||
|
|
||||||
const doDelete = () => {
|
function doDelete(): void {
|
||||||
cityssm.postJSON(
|
cityssm.postJSON(
|
||||||
los.urlPrefix + '/workOrders/doDeleteWorkOrderMilestone',
|
los.urlPrefix + '/workOrders/doDeleteWorkOrderMilestone',
|
||||||
{
|
{
|
||||||
|
|
@ -321,7 +319,7 @@ declare const bulmaJS: BulmaJS
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function editMilestone(clickEvent: Event) {
|
function editMilestone(clickEvent: Event): void {
|
||||||
clickEvent.preventDefault()
|
clickEvent.preventDefault()
|
||||||
|
|
||||||
const workOrderMilestoneId = Number.parseInt(
|
const workOrderMilestoneId = Number.parseInt(
|
||||||
|
|
@ -339,7 +337,7 @@ declare const bulmaJS: BulmaJS
|
||||||
|
|
||||||
let editCloseModalFunction: () => void
|
let editCloseModalFunction: () => void
|
||||||
|
|
||||||
const doEdit = (submitEvent: SubmitEvent) => {
|
function doEdit(submitEvent: SubmitEvent): void {
|
||||||
submitEvent.preventDefault()
|
submitEvent.preventDefault()
|
||||||
|
|
||||||
cityssm.postJSON(
|
cityssm.postJSON(
|
||||||
|
|
@ -365,7 +363,6 @@ declare const bulmaJS: BulmaJS
|
||||||
'#milestoneEdit--workOrderId'
|
'#milestoneEdit--workOrderId'
|
||||||
) as HTMLInputElement
|
) as HTMLInputElement
|
||||||
).value = workOrderId
|
).value = workOrderId
|
||||||
|
|
||||||
;(
|
;(
|
||||||
modalElement.querySelector(
|
modalElement.querySelector(
|
||||||
'#milestoneEdit--workOrderMilestoneId'
|
'#milestoneEdit--workOrderMilestoneId'
|
||||||
|
|
@ -443,7 +440,7 @@ declare const bulmaJS: BulmaJS
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderMilestones() {
|
function renderMilestones(): void {
|
||||||
// Clear milestones panel
|
// Clear milestones panel
|
||||||
const milestonesPanelElement = document.querySelector(
|
const milestonesPanelElement = document.querySelector(
|
||||||
'#panel--milestones'
|
'#panel--milestones'
|
||||||
|
|
@ -481,7 +478,7 @@ declare const bulmaJS: BulmaJS
|
||||||
('<div class="column">' +
|
('<div class="column">' +
|
||||||
(milestone.workOrderMilestoneTypeId
|
(milestone.workOrderMilestoneTypeId
|
||||||
? '<strong>' +
|
? '<strong>' +
|
||||||
cityssm.escapeHTML(milestone.workOrderMilestoneType || '') +
|
cityssm.escapeHTML(milestone.workOrderMilestoneType ?? '') +
|
||||||
'</strong><br />'
|
'</strong><br />'
|
||||||
: '') +
|
: '') +
|
||||||
milestone.workOrderMilestoneDateString +
|
milestone.workOrderMilestoneDateString +
|
||||||
|
|
@ -490,7 +487,7 @@ declare const bulmaJS: BulmaJS
|
||||||
: '') +
|
: '') +
|
||||||
'<br />' +
|
'<br />' +
|
||||||
'<span class="is-size-7">' +
|
'<span class="is-size-7">' +
|
||||||
cityssm.escapeHTML(milestone.workOrderMilestoneDescription || '') +
|
cityssm.escapeHTML(milestone.workOrderMilestoneDescription ?? '') +
|
||||||
'</span>' +
|
'</span>' +
|
||||||
'</div>') +
|
'</div>') +
|
||||||
('<div class="column is-narrow">' +
|
('<div class="column is-narrow">' +
|
||||||
|
|
@ -557,14 +554,14 @@ declare const bulmaJS: BulmaJS
|
||||||
let addFormElement: HTMLFormElement
|
let addFormElement: HTMLFormElement
|
||||||
let addCloseModalFunction: () => void
|
let addCloseModalFunction: () => void
|
||||||
|
|
||||||
const doAdd = (submitEvent: SubmitEvent) => {
|
function doAdd(submitEvent: SubmitEvent): void {
|
||||||
if (submitEvent) {
|
if (submitEvent) {
|
||||||
submitEvent.preventDefault()
|
submitEvent.preventDefault()
|
||||||
}
|
}
|
||||||
|
|
||||||
const currentDateString = cityssm.dateToString(new Date())
|
const currentDateString = cityssm.dateToString(new Date())
|
||||||
|
|
||||||
function _doAdd() {
|
function _doAdd(): void {
|
||||||
cityssm.postJSON(
|
cityssm.postJSON(
|
||||||
los.urlPrefix + '/workOrders/doAddWorkOrderMilestone',
|
los.urlPrefix + '/workOrders/doAddWorkOrderMilestone',
|
||||||
addFormElement,
|
addFormElement,
|
||||||
|
|
@ -582,17 +579,14 @@ declare const bulmaJS: BulmaJS
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if ((
|
||||||
(
|
addModalElement.querySelector(
|
||||||
addModalElement.querySelector(
|
'#milestoneAdd--workOrderMilestoneDateString'
|
||||||
'#milestoneAdd--workOrderMilestoneDateString'
|
) as HTMLInputElement
|
||||||
) as HTMLInputElement
|
).value < currentDateString) {
|
||||||
).value < currentDateString
|
|
||||||
) {
|
|
||||||
bulmaJS.confirm({
|
bulmaJS.confirm({
|
||||||
title: 'Milestone Date in the Past',
|
title: 'Milestone Date in the Past',
|
||||||
message:
|
message: 'Are you sure you want to create a milestone with a date in the past?',
|
||||||
'Are you sure you want to create a milestone with a date in the past?',
|
|
||||||
contextualColorName: 'warning',
|
contextualColorName: 'warning',
|
||||||
okButton: {
|
okButton: {
|
||||||
text: 'Yes, Create a Past Milestone',
|
text: 'Yes, Create a Past Milestone',
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const workOrderMilestoneDateStringElement = workOrderSearchFiltersFormElement.querySelector('#searchFilter--workOrderMilestoneDateString');
|
const workOrderMilestoneDateStringElement = workOrderSearchFiltersFormElement.querySelector('#searchFilter--workOrderMilestoneDateString');
|
||||||
const milestoneCalendarContainerElement = document.querySelector('#container--milestoneCalendar');
|
const milestoneCalendarContainerElement = document.querySelector('#container--milestoneCalendar');
|
||||||
function renderMilestones(workOrderMilestones) {
|
function renderMilestones(workOrderMilestones) {
|
||||||
|
var _a, _b, _c, _d, _e, _f, _g;
|
||||||
if (workOrderMilestones.length === 0) {
|
if (workOrderMilestones.length === 0) {
|
||||||
milestoneCalendarContainerElement.innerHTML = `<div class="message is-info">
|
milestoneCalendarContainerElement.innerHTML = `<div class="message is-info">
|
||||||
<p class="message-body">There are no milestones that meet the search criteria.</p>
|
<p class="message-body">There are no milestones that meet the search criteria.</p>
|
||||||
|
|
@ -38,12 +39,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
for (const lot of milestone.workOrderLots) {
|
for (const lot of milestone.workOrderLots) {
|
||||||
lotOccupancyHTML +=
|
lotOccupancyHTML +=
|
||||||
'<span class="has-tooltip-left" data-tooltip="' +
|
'<span class="has-tooltip-left" data-tooltip="' +
|
||||||
cityssm.escapeHTML(lot.mapName || '') +
|
cityssm.escapeHTML((_a = lot.mapName) !== null && _a !== void 0 ? _a : '') +
|
||||||
'">' +
|
'">' +
|
||||||
'<i class="fas fa-vector-square" aria-label="' +
|
'<i class="fas fa-vector-square" aria-label="' +
|
||||||
los.escapedAliases.Lot +
|
los.escapedAliases.Lot +
|
||||||
'"></i> ' +
|
'"></i> ' +
|
||||||
cityssm.escapeHTML(lot.lotName || '') +
|
cityssm.escapeHTML((_b = lot.lotName) !== null && _b !== void 0 ? _b : '') +
|
||||||
'</span>' +
|
'</span>' +
|
||||||
'<br />';
|
'<br />';
|
||||||
}
|
}
|
||||||
|
|
@ -51,12 +52,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
for (const occupant of lotOccupancy.lotOccupancyOccupants) {
|
for (const occupant of lotOccupancy.lotOccupancyOccupants) {
|
||||||
lotOccupancyHTML +=
|
lotOccupancyHTML +=
|
||||||
'<span class="has-tooltip-left" data-tooltip="' +
|
'<span class="has-tooltip-left" data-tooltip="' +
|
||||||
cityssm.escapeHTML(occupant.lotOccupantType || '') +
|
cityssm.escapeHTML((_c = occupant.lotOccupantType) !== null && _c !== void 0 ? _c : '') +
|
||||||
'">' +
|
'">' +
|
||||||
'<i class="fas fa-user" aria-label="' +
|
'<i class="fas fa-user" aria-label="' +
|
||||||
los.escapedAliases.Occupancy +
|
los.escapedAliases.Occupancy +
|
||||||
'"></i> ' +
|
'"></i> ' +
|
||||||
cityssm.escapeHTML(occupant.occupantName || '') +
|
cityssm.escapeHTML((_d = occupant.occupantName) !== null && _d !== void 0 ? _d : '') +
|
||||||
'</span>' +
|
'</span>' +
|
||||||
'<br />';
|
'<br />';
|
||||||
}
|
}
|
||||||
|
|
@ -85,15 +86,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
'</div>') +
|
'</div>') +
|
||||||
('<div class="column">' +
|
('<div class="column">' +
|
||||||
'<i class="fas fa-circle" style="color:' +
|
'<i class="fas fa-circle" style="color:' +
|
||||||
los.getRandomColor(milestone.workOrderNumber || '') +
|
los.getRandomColor((_e = milestone.workOrderNumber) !== null && _e !== void 0 ? _e : '') +
|
||||||
'" aria-hidden="true"></i>' +
|
'" aria-hidden="true"></i>' +
|
||||||
' <a class="has-text-weight-bold" href="' +
|
' <a class="has-text-weight-bold" href="' +
|
||||||
los.getWorkOrderURL(milestone.workOrderId) +
|
los.getWorkOrderURL(milestone.workOrderId) +
|
||||||
'">' +
|
'">' +
|
||||||
cityssm.escapeHTML(milestone.workOrderNumber || '') +
|
cityssm.escapeHTML((_f = milestone.workOrderNumber) !== null && _f !== void 0 ? _f : '') +
|
||||||
'</a><br />' +
|
'</a><br />' +
|
||||||
'<span class="is-size-7">' +
|
'<span class="is-size-7">' +
|
||||||
cityssm.escapeHTML(milestone.workOrderDescription || '') +
|
cityssm.escapeHTML((_g = milestone.workOrderDescription) !== null && _g !== void 0 ? _g : '') +
|
||||||
'</span>' +
|
'</span>' +
|
||||||
'</div>') +
|
'</div>') +
|
||||||
('<div class="column is-size-7">' + lotOccupancyHTML + '</div>') +
|
('<div class="column is-size-7">' + lotOccupancyHTML + '</div>') +
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ declare const cityssm: cityssmGlobal
|
||||||
|
|
||||||
function renderMilestones(
|
function renderMilestones(
|
||||||
workOrderMilestones: recordTypes.WorkOrderMilestone[]
|
workOrderMilestones: recordTypes.WorkOrderMilestone[]
|
||||||
) {
|
): void {
|
||||||
if (workOrderMilestones.length === 0) {
|
if (workOrderMilestones.length === 0) {
|
||||||
milestoneCalendarContainerElement.innerHTML = `<div class="message is-info">
|
milestoneCalendarContainerElement.innerHTML = `<div class="message is-info">
|
||||||
<p class="message-body">There are no milestones that meet the search criteria.</p>
|
<p class="message-body">There are no milestones that meet the search criteria.</p>
|
||||||
|
|
@ -52,7 +52,7 @@ declare const cityssm: cityssmGlobal
|
||||||
currentPanelElement = document.createElement('div')
|
currentPanelElement = document.createElement('div')
|
||||||
currentPanelElement.className = 'panel'
|
currentPanelElement.className = 'panel'
|
||||||
|
|
||||||
currentPanelElement.innerHTML = `<h2 class="panel-heading">${milestone.workOrderMilestoneDateString}</h2>`
|
currentPanelElement.innerHTML = `<h2 class="panel-heading">${milestone.workOrderMilestoneDateString!}</h2>`
|
||||||
|
|
||||||
currentPanelDateString = milestone.workOrderMilestoneDateString!
|
currentPanelDateString = milestone.workOrderMilestoneDateString!
|
||||||
}
|
}
|
||||||
|
|
@ -73,12 +73,12 @@ declare const cityssm: cityssmGlobal
|
||||||
for (const lot of milestone.workOrderLots!) {
|
for (const lot of milestone.workOrderLots!) {
|
||||||
lotOccupancyHTML +=
|
lotOccupancyHTML +=
|
||||||
'<span class="has-tooltip-left" data-tooltip="' +
|
'<span class="has-tooltip-left" data-tooltip="' +
|
||||||
cityssm.escapeHTML(lot.mapName || '') +
|
cityssm.escapeHTML(lot.mapName ?? '') +
|
||||||
'">' +
|
'">' +
|
||||||
'<i class="fas fa-vector-square" aria-label="' +
|
'<i class="fas fa-vector-square" aria-label="' +
|
||||||
los.escapedAliases.Lot +
|
los.escapedAliases.Lot +
|
||||||
'"></i> ' +
|
'"></i> ' +
|
||||||
cityssm.escapeHTML(lot.lotName || '') +
|
cityssm.escapeHTML(lot.lotName ?? '') +
|
||||||
'</span>' +
|
'</span>' +
|
||||||
'<br />'
|
'<br />'
|
||||||
}
|
}
|
||||||
|
|
@ -87,12 +87,12 @@ declare const cityssm: cityssmGlobal
|
||||||
for (const occupant of lotOccupancy.lotOccupancyOccupants!) {
|
for (const occupant of lotOccupancy.lotOccupancyOccupants!) {
|
||||||
lotOccupancyHTML +=
|
lotOccupancyHTML +=
|
||||||
'<span class="has-tooltip-left" data-tooltip="' +
|
'<span class="has-tooltip-left" data-tooltip="' +
|
||||||
cityssm.escapeHTML(occupant.lotOccupantType || '') +
|
cityssm.escapeHTML(occupant.lotOccupantType ?? '') +
|
||||||
'">' +
|
'">' +
|
||||||
'<i class="fas fa-user" aria-label="' +
|
'<i class="fas fa-user" aria-label="' +
|
||||||
los.escapedAliases.Occupancy +
|
los.escapedAliases.Occupancy +
|
||||||
'"></i> ' +
|
'"></i> ' +
|
||||||
cityssm.escapeHTML(occupant.occupantName || '') +
|
cityssm.escapeHTML(occupant.occupantName ?? '') +
|
||||||
'</span>' +
|
'</span>' +
|
||||||
'<br />'
|
'<br />'
|
||||||
}
|
}
|
||||||
|
|
@ -122,15 +122,15 @@ declare const cityssm: cityssmGlobal
|
||||||
'</div>') +
|
'</div>') +
|
||||||
('<div class="column">' +
|
('<div class="column">' +
|
||||||
'<i class="fas fa-circle" style="color:' +
|
'<i class="fas fa-circle" style="color:' +
|
||||||
los.getRandomColor(milestone.workOrderNumber || '') +
|
los.getRandomColor(milestone.workOrderNumber ?? '') +
|
||||||
'" aria-hidden="true"></i>' +
|
'" aria-hidden="true"></i>' +
|
||||||
' <a class="has-text-weight-bold" href="' +
|
' <a class="has-text-weight-bold" href="' +
|
||||||
los.getWorkOrderURL(milestone.workOrderId!) +
|
los.getWorkOrderURL(milestone.workOrderId) +
|
||||||
'">' +
|
'">' +
|
||||||
cityssm.escapeHTML(milestone.workOrderNumber || '') +
|
cityssm.escapeHTML(milestone.workOrderNumber ?? '') +
|
||||||
'</a><br />' +
|
'</a><br />' +
|
||||||
'<span class="is-size-7">' +
|
'<span class="is-size-7">' +
|
||||||
cityssm.escapeHTML(milestone.workOrderDescription || '') +
|
cityssm.escapeHTML(milestone.workOrderDescription ?? '') +
|
||||||
'</span>' +
|
'</span>' +
|
||||||
'</div>') +
|
'</div>') +
|
||||||
('<div class="column is-size-7">' + lotOccupancyHTML + '</div>') +
|
('<div class="column is-size-7">' + lotOccupancyHTML + '</div>') +
|
||||||
|
|
@ -141,7 +141,7 @@ declare const cityssm: cityssmGlobal
|
||||||
milestoneCalendarContainerElement.append(currentPanelElement!)
|
milestoneCalendarContainerElement.append(currentPanelElement!)
|
||||||
}
|
}
|
||||||
|
|
||||||
function getMilestones(event?: Event) {
|
function getMilestones(event?: Event): void {
|
||||||
if (event) {
|
if (event) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,s=document.querySelector("#form--searchFilters"),r=s.querySelector("#searchFilter--workOrderMilestoneDateFilter"),a=s.querySelector("#searchFilter--workOrderMilestoneDateString"),t=document.querySelector("#container--milestoneCalendar");function i(r){r&&r.preventDefault(),t.innerHTML=e.getLoadingParagraphHTML("Loading Milestones..."),cityssm.postJSON(e.urlPrefix+"/workOrders/doGetWorkOrderMilestones",s,s=>{!function(s){if(0===s.length)return void(t.innerHTML='<div class="message is-info">\n <p class="message-body">There are no milestones that meet the search criteria.</p>\n </div>');t.innerHTML="";const r=cityssm.dateToString(new Date);let a,i="";for(const o of s){i!==o.workOrderMilestoneDateString&&(a&&t.append(a),(a=document.createElement("div")).className="panel",a.innerHTML=`<h2 class="panel-heading">${o.workOrderMilestoneDateString}</h2>`,i=o.workOrderMilestoneDateString);const s=document.createElement("div");s.className="panel-block is-block",!o.workOrderMilestoneCompletionDate&&o.workOrderMilestoneDateString<r&&s.classList.add("has-background-warning-light");let n="";for(const s of o.workOrderLots)n+='<span class="has-tooltip-left" data-tooltip="'+cityssm.escapeHTML(s.mapName||"")+'"><i class="fas fa-vector-square" aria-label="'+e.escapedAliases.Lot+'"></i> '+cityssm.escapeHTML(s.lotName||"")+"</span><br />";for(const s of o.workOrderLotOccupancies)for(const r of s.lotOccupancyOccupants)n+='<span class="has-tooltip-left" data-tooltip="'+cityssm.escapeHTML(r.lotOccupantType||"")+'"><i class="fas fa-user" aria-label="'+e.escapedAliases.Occupancy+'"></i> '+cityssm.escapeHTML(r.occupantName||"")+"</span><br />";s.innerHTML='<div class="columns"><div class="column is-narrow"><span class="icon is-small">'+(o.workOrderMilestoneCompletionDate?'<i class="fas fa-check" aria-label="Completed"></i>':'<i class="far fa-square has-text-grey" aria-label="Incomplete"></i>')+'</span></div><div class="column">'+(0===o.workOrderMilestoneTime?"":o.workOrderMilestoneTimeString+"<br />")+(o.workOrderMilestoneTypeId?"<strong>"+cityssm.escapeHTML(o.workOrderMilestoneType)+"</strong><br />":"")+'<span class="is-size-7">'+cityssm.escapeHTML(o.workOrderMilestoneDescription)+'</span></div><div class="column"><i class="fas fa-circle" style="color:'+e.getRandomColor(o.workOrderNumber||"")+'" aria-hidden="true"></i> <a class="has-text-weight-bold" href="'+e.getWorkOrderURL(o.workOrderId)+'">'+cityssm.escapeHTML(o.workOrderNumber||"")+'</a><br /><span class="is-size-7">'+cityssm.escapeHTML(o.workOrderDescription||"")+'</span></div><div class="column is-size-7">'+n+"</div></div>",a.append(s)}t.append(a)}(s.workOrderMilestones)})}r.addEventListener("change",()=>{a.closest("fieldset").disabled="date"!==r.value,i()}),e.initializeDatePickers(s),a.addEventListener("change",i),s.addEventListener("submit",i),i()})();
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,s=document.querySelector("#form--searchFilters"),r=s.querySelector("#searchFilter--workOrderMilestoneDateFilter"),a=s.querySelector("#searchFilter--workOrderMilestoneDateString"),t=document.querySelector("#container--milestoneCalendar");function i(r){r&&r.preventDefault(),t.innerHTML=e.getLoadingParagraphHTML("Loading Milestones..."),cityssm.postJSON(e.urlPrefix+"/workOrders/doGetWorkOrderMilestones",s,s=>{!function(s){var r,a,i,o,n,l,c;if(0===s.length)return void(t.innerHTML='<div class="message is-info">\n <p class="message-body">There are no milestones that meet the search criteria.</p>\n </div>');t.innerHTML="";const d=cityssm.dateToString(new Date);let p,m="";for(const u of s){m!==u.workOrderMilestoneDateString&&(p&&t.append(p),(p=document.createElement("div")).className="panel",p.innerHTML=`<h2 class="panel-heading">${u.workOrderMilestoneDateString}</h2>`,m=u.workOrderMilestoneDateString);const s=document.createElement("div");s.className="panel-block is-block",!u.workOrderMilestoneCompletionDate&&u.workOrderMilestoneDateString<d&&s.classList.add("has-background-warning-light");let M="";for(const s of u.workOrderLots)M+='<span class="has-tooltip-left" data-tooltip="'+cityssm.escapeHTML(null!==(r=s.mapName)&&void 0!==r?r:"")+'"><i class="fas fa-vector-square" aria-label="'+e.escapedAliases.Lot+'"></i> '+cityssm.escapeHTML(null!==(a=s.lotName)&&void 0!==a?a:"")+"</span><br />";for(const s of u.workOrderLotOccupancies)for(const r of s.lotOccupancyOccupants)M+='<span class="has-tooltip-left" data-tooltip="'+cityssm.escapeHTML(null!==(i=r.lotOccupantType)&&void 0!==i?i:"")+'"><i class="fas fa-user" aria-label="'+e.escapedAliases.Occupancy+'"></i> '+cityssm.escapeHTML(null!==(o=r.occupantName)&&void 0!==o?o:"")+"</span><br />";s.innerHTML='<div class="columns"><div class="column is-narrow"><span class="icon is-small">'+(u.workOrderMilestoneCompletionDate?'<i class="fas fa-check" aria-label="Completed"></i>':'<i class="far fa-square has-text-grey" aria-label="Incomplete"></i>')+'</span></div><div class="column">'+(0===u.workOrderMilestoneTime?"":u.workOrderMilestoneTimeString+"<br />")+(u.workOrderMilestoneTypeId?"<strong>"+cityssm.escapeHTML(u.workOrderMilestoneType)+"</strong><br />":"")+'<span class="is-size-7">'+cityssm.escapeHTML(u.workOrderMilestoneDescription)+'</span></div><div class="column"><i class="fas fa-circle" style="color:'+e.getRandomColor(null!==(n=u.workOrderNumber)&&void 0!==n?n:"")+'" aria-hidden="true"></i> <a class="has-text-weight-bold" href="'+e.getWorkOrderURL(u.workOrderId)+'">'+cityssm.escapeHTML(null!==(l=u.workOrderNumber)&&void 0!==l?l:"")+'</a><br /><span class="is-size-7">'+cityssm.escapeHTML(null!==(c=u.workOrderDescription)&&void 0!==c?c:"")+'</span></div><div class="column is-size-7">'+M+"</div></div>",p.append(s)}t.append(p)}(s.workOrderMilestones)})}r.addEventListener("change",()=>{a.closest("fieldset").disabled="date"!==r.value,i()}),e.initializeDatePickers(s),a.addEventListener("change",i),s.addEventListener("submit",i),i()})();
|
||||||
|
|
@ -1,168 +1,168 @@
|
||||||
* {
|
* {
|
||||||
font-family: Arial, Helvetica, sans-serif;
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
margin: 20px;
|
margin: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Elements */
|
/* Elements */
|
||||||
|
|
||||||
.box {
|
.box {
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.checkbox {
|
.checkbox {
|
||||||
height: 1.5em;
|
height: 1.5em;
|
||||||
width: 1.5em;
|
width: 1.5em;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.checkbox::before {
|
.checkbox::before {
|
||||||
content: ' ';
|
content: ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
.checkbox.is-checked::before {
|
.checkbox.is-checked::before {
|
||||||
content: '\2714';
|
content: '\2714';
|
||||||
}
|
}
|
||||||
|
|
||||||
.field {
|
.field {
|
||||||
border-bottom: 1px solid black;
|
border-bottom: 1px solid black;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 100px;
|
width: 100px;
|
||||||
padding: 10px 0;
|
padding: 10px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Data Table */
|
/* Data Table */
|
||||||
|
|
||||||
.data-table {
|
.data-table {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.data-table thead th,
|
.data-table thead th,
|
||||||
.data-table tfoot th {
|
.data-table tfoot th {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.data-table tbody td,
|
.data-table tbody td,
|
||||||
.data-table tfoot td {
|
.data-table tfoot td {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
border-top: 1px solid black;
|
border-top: 1px solid black;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Layout Table */
|
/* Layout Table */
|
||||||
|
|
||||||
.layout-table {
|
.layout-table {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border: 0;
|
border: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.layout-table td {
|
.layout-table td {
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Table Helpers */
|
/* Table Helpers */
|
||||||
|
|
||||||
td.is-vcentered {
|
td.is-vcentered {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
td.is-width-1 {
|
td.is-width-1 {
|
||||||
width: 1px;
|
width: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
td.has-border-bottom {
|
td.has-border-bottom {
|
||||||
border-bottom: 1px solid black;
|
border-bottom: 1px solid black;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Padding / Margins */
|
/* Padding / Margins */
|
||||||
|
|
||||||
.m-0 {
|
.m-0 {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-1 {
|
.mt-1 {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-2 {
|
.mt-2 {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-4 {
|
.mt-4 {
|
||||||
margin-top: 40px;
|
margin-top: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt-6 {
|
.mt-6 {
|
||||||
margin-top: 60px;
|
margin-top: 60px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mb-0 {
|
.mb-0 {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mb-1 {
|
.mb-1 {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mb-2 {
|
.mb-2 {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mb-4 {
|
.mb-4 {
|
||||||
margin-bottom: 40px;
|
margin-bottom: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.p-0 {
|
.p-0 {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pl-1 {
|
.pl-1 {
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Text Utilities */
|
/* Text Utilities */
|
||||||
|
|
||||||
.is-8pt {
|
.is-8pt {
|
||||||
font-size: 8pt !important;
|
font-size: 8pt !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.is-10pt {
|
.is-10pt {
|
||||||
font-size: 10pt !important;
|
font-size: 10pt !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.is-12pt {
|
.is-12pt {
|
||||||
font-size: 12pt !important;
|
font-size: 12pt !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.has-text-left {
|
.has-text-left {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.has-text-right {
|
.has-text-right {
|
||||||
text-align: right !important;
|
text-align: right !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.has-text-centered {
|
.has-text-centered {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.is-capitalized {
|
.is-capitalized {
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
|
|
||||||
.is-italic {
|
.is-italic {
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
|
|
||||||
.has-text-nowrap {
|
.has-text-nowrap {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue