committal type table maint #8
parent
b26e8b17b2
commit
1c7bc96392
|
|
@ -1,6 +1,6 @@
|
|||
export interface AddForm {
|
||||
committalType: string;
|
||||
committalTypeKey?: string;
|
||||
orderNumber?: number;
|
||||
orderNumber?: number | string;
|
||||
}
|
||||
export default function addCommittalType(addForm: AddForm, user: User): number;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { clearCacheByTableName } from '../helpers/functions.cache.js'
|
|||
export interface AddForm {
|
||||
committalType: string
|
||||
committalTypeKey?: string
|
||||
orderNumber?: number
|
||||
orderNumber?: number | string
|
||||
}
|
||||
|
||||
export default function addCommittalType(addForm: AddForm, user: User): number {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
type RecordTable = 'BurialSiteComments' | 'BurialSiteStatuses' | 'BurialSiteTypeFields' | 'BurialSiteTypes' | 'ContractComments' | 'Contracts' | 'ContractTypeFields' | 'ContractTypes' | 'FeeCategories' | 'Fees' | 'FuneralHomes' | 'WorkOrderComments' | 'WorkOrderMilestones' | 'WorkOrderMilestoneTypes' | 'WorkOrders' | 'WorkOrderTypes';
|
||||
type RecordTable = 'BurialSiteComments' | 'BurialSiteStatuses' | 'BurialSiteTypeFields' | 'BurialSiteTypes' | 'CommittalTypes' | 'ContractComments' | 'Contracts' | 'ContractTypeFields' | 'ContractTypes' | 'FeeCategories' | 'Fees' | 'FuneralHomes' | 'WorkOrderComments' | 'WorkOrderMilestones' | 'WorkOrderMilestoneTypes' | 'WorkOrders' | 'WorkOrderTypes';
|
||||
export declare function deleteRecord(recordTable: RecordTable, recordId: number | string, user: User): boolean;
|
||||
export {};
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ const recordIdColumns = new Map([
|
|||
['BurialSiteStatuses', 'burialSiteStatusId'],
|
||||
['BurialSiteTypeFields', 'burialSiteTypeFieldId'],
|
||||
['BurialSiteTypes', 'burialSiteTypeId'],
|
||||
['CommittalTypes', 'committalTypeId'],
|
||||
['ContractComments', 'contractCommentId'],
|
||||
['Contracts', 'contractId'],
|
||||
['ContractTypeFields', 'contractTypeFieldId'],
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ type RecordTable =
|
|||
| 'BurialSiteStatuses'
|
||||
| 'BurialSiteTypeFields'
|
||||
| 'BurialSiteTypes'
|
||||
| 'CommittalTypes'
|
||||
| 'ContractComments'
|
||||
| 'Contracts'
|
||||
| 'ContractTypeFields'
|
||||
|
|
@ -26,6 +27,7 @@ const recordIdColumns = new Map<RecordTable, string>([
|
|||
['BurialSiteStatuses', 'burialSiteStatusId'],
|
||||
['BurialSiteTypeFields', 'burialSiteTypeFieldId'],
|
||||
['BurialSiteTypes', 'burialSiteTypeId'],
|
||||
['CommittalTypes', 'committalTypeId'],
|
||||
['ContractComments', 'contractCommentId'],
|
||||
['Contracts', 'contractId'],
|
||||
['ContractTypeFields', 'contractTypeFieldId'],
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
type RecordTable = 'BurialSiteStatuses' | 'BurialSiteTypes' | 'ContractTypes' | 'FeeCategories' | 'WorkOrderMilestoneTypes' | 'WorkOrderTypes';
|
||||
type RecordTable = 'BurialSiteStatuses' | 'BurialSiteTypes' | 'CommittalTypes' | 'ContractTypes' | 'FeeCategories' | 'WorkOrderMilestoneTypes' | 'WorkOrderTypes';
|
||||
export declare function moveRecordDown(recordTable: RecordTable, recordId: number | string): boolean;
|
||||
export declare function moveRecordDownToBottom(recordTable: RecordTable, recordId: number | string): boolean;
|
||||
export declare function moveRecordUp(recordTable: RecordTable, recordId: number | string): boolean;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import { updateRecordOrderNumber } from './updateRecordOrderNumber.js';
|
|||
const recordIdColumns = new Map([
|
||||
['BurialSiteStatuses', 'burialSiteStatusId'],
|
||||
['BurialSiteTypes', 'burialSiteTypeId'],
|
||||
['CommittalTypes', 'committalTypeId'],
|
||||
['ContractTypes', 'contractTypeId'],
|
||||
['FeeCategories', 'feeCategoryId'],
|
||||
['WorkOrderMilestoneTypes', 'workOrderMilestoneTypeId'],
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import { updateRecordOrderNumber } from './updateRecordOrderNumber.js'
|
|||
type RecordTable =
|
||||
| 'BurialSiteStatuses'
|
||||
| 'BurialSiteTypes'
|
||||
| 'CommittalTypes'
|
||||
| 'ContractTypes'
|
||||
| 'FeeCategories'
|
||||
| 'WorkOrderMilestoneTypes'
|
||||
|
|
@ -16,6 +17,7 @@ type RecordTable =
|
|||
const recordIdColumns = new Map<RecordTable, string>([
|
||||
['BurialSiteStatuses', 'burialSiteStatusId'],
|
||||
['BurialSiteTypes', 'burialSiteTypeId'],
|
||||
['CommittalTypes', 'committalTypeId'],
|
||||
['ContractTypes', 'contractTypeId'],
|
||||
['FeeCategories', 'feeCategoryId'],
|
||||
['WorkOrderMilestoneTypes', 'workOrderMilestoneTypeId'],
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
type RecordTable = 'BurialSiteStatuses' | 'BurialSiteTypes' | 'WorkOrderMilestoneTypes' | 'WorkOrderTypes';
|
||||
type RecordTable = 'BurialSiteStatuses' | 'BurialSiteTypes' | 'CommittalTypes' | 'WorkOrderMilestoneTypes' | 'WorkOrderTypes';
|
||||
export declare function updateRecord(recordTable: RecordTable, recordId: number | string, recordName: string, user: User): boolean;
|
||||
export {};
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { clearCacheByTableName } from '../helpers/functions.cache.js';
|
|||
const recordNameIdColumns = new Map([
|
||||
['BurialSiteStatuses', ['burialSiteStatus', 'burialSiteStatusId']],
|
||||
['BurialSiteTypes', ['burialSiteType', 'burialSiteTypeId']],
|
||||
['CommittalTypes', ['committalType', 'committalTypeId']],
|
||||
[
|
||||
'WorkOrderMilestoneTypes',
|
||||
['workOrderMilestoneType', 'workOrderMilestoneTypeId']
|
||||
|
|
|
|||
|
|
@ -6,12 +6,14 @@ import { clearCacheByTableName } from '../helpers/functions.cache.js'
|
|||
type RecordTable =
|
||||
| 'BurialSiteStatuses'
|
||||
| 'BurialSiteTypes'
|
||||
| 'CommittalTypes'
|
||||
| 'WorkOrderMilestoneTypes'
|
||||
| 'WorkOrderTypes'
|
||||
|
||||
const recordNameIdColumns = new Map<RecordTable, string[]>([
|
||||
['BurialSiteStatuses', ['burialSiteStatus', 'burialSiteStatusId']],
|
||||
['BurialSiteTypes', ['burialSiteType', 'burialSiteTypeId']],
|
||||
['CommittalTypes', ['committalType', 'committalTypeId']],
|
||||
[
|
||||
'WorkOrderMilestoneTypes',
|
||||
['workOrderMilestoneType', 'workOrderMilestoneTypeId']
|
||||
|
|
|
|||
|
|
@ -1,11 +1,15 @@
|
|||
import { getBurialSiteStatuses, getWorkOrderMilestoneTypes, getWorkOrderTypes } from '../../helpers/functions.cache.js';
|
||||
import { getBurialSiteStatuses, getCommittalTypes, getIntermentContainerTypes, getWorkOrderMilestoneTypes, getWorkOrderTypes } from '../../helpers/functions.cache.js';
|
||||
export default function handler(_request, response) {
|
||||
const workOrderTypes = getWorkOrderTypes();
|
||||
const workOrderMilestoneTypes = getWorkOrderMilestoneTypes();
|
||||
const burialSiteStatuses = getBurialSiteStatuses();
|
||||
const committalTypes = getCommittalTypes();
|
||||
const intermentContainerTypes = getIntermentContainerTypes();
|
||||
const workOrderMilestoneTypes = getWorkOrderMilestoneTypes();
|
||||
const workOrderTypes = getWorkOrderTypes();
|
||||
response.render('admin-tables', {
|
||||
headTitle: 'Config Table Management',
|
||||
burialSiteStatuses,
|
||||
committalTypes,
|
||||
intermentContainerTypes,
|
||||
workOrderMilestoneTypes,
|
||||
workOrderTypes
|
||||
});
|
||||
|
|
|
|||
|
|
@ -2,19 +2,25 @@ import type { Request, Response } from 'express'
|
|||
|
||||
import {
|
||||
getBurialSiteStatuses,
|
||||
getCommittalTypes,
|
||||
getIntermentContainerTypes,
|
||||
getWorkOrderMilestoneTypes,
|
||||
getWorkOrderTypes
|
||||
} from '../../helpers/functions.cache.js'
|
||||
|
||||
export default function handler(_request: Request, response: Response): void {
|
||||
const workOrderTypes = getWorkOrderTypes()
|
||||
const workOrderMilestoneTypes = getWorkOrderMilestoneTypes()
|
||||
const burialSiteStatuses = getBurialSiteStatuses()
|
||||
const committalTypes = getCommittalTypes()
|
||||
const intermentContainerTypes = getIntermentContainerTypes()
|
||||
const workOrderMilestoneTypes = getWorkOrderMilestoneTypes()
|
||||
const workOrderTypes = getWorkOrderTypes()
|
||||
|
||||
response.render('admin-tables', {
|
||||
headTitle: 'Config Table Management',
|
||||
|
||||
burialSiteStatuses,
|
||||
committalTypes,
|
||||
intermentContainerTypes,
|
||||
workOrderMilestoneTypes,
|
||||
workOrderTypes
|
||||
})
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
import type { Request, Response } from 'express';
|
||||
export default function handler(request: Request<unknown, unknown, {
|
||||
committalType: string;
|
||||
orderNumber?: number | string;
|
||||
}>, response: Response): void;
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
import addCommittalType from '../../database/addCommittalType.js';
|
||||
import { getCommittalTypes } from '../../helpers/functions.cache.js';
|
||||
export default function handler(request, response) {
|
||||
const committalTypeId = addCommittalType(request.body, request.session.user);
|
||||
const committalTypes = getCommittalTypes();
|
||||
response.json({
|
||||
success: true,
|
||||
committalTypeId,
|
||||
committalTypes
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
import type { Request, Response } from 'express'
|
||||
|
||||
import addCommittalType from '../../database/addCommittalType.js'
|
||||
import { getCommittalTypes } from '../../helpers/functions.cache.js'
|
||||
|
||||
export default function handler(
|
||||
request: Request<
|
||||
unknown,
|
||||
unknown,
|
||||
{ committalType: string; orderNumber?: number | string }
|
||||
>,
|
||||
response: Response
|
||||
): void {
|
||||
const committalTypeId = addCommittalType(
|
||||
request.body,
|
||||
request.session.user as User
|
||||
)
|
||||
|
||||
const committalTypes = getCommittalTypes()
|
||||
|
||||
response.json({
|
||||
success: true,
|
||||
|
||||
committalTypeId,
|
||||
committalTypes
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
import type { Request, Response } from 'express';
|
||||
export default function handler(request: Request<unknown, unknown, {
|
||||
committalTypeId: string;
|
||||
}>, response: Response): void;
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
import { deleteRecord } from '../../database/deleteRecord.js';
|
||||
import { getCommittalTypes } from '../../helpers/functions.cache.js';
|
||||
export default function handler(request, response) {
|
||||
const success = deleteRecord('CommittalTypes', request.body.committalTypeId, request.session.user);
|
||||
const committalTypes = getCommittalTypes();
|
||||
response.json({
|
||||
success,
|
||||
committalTypes
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
import type { Request, Response } from 'express'
|
||||
|
||||
import { deleteRecord } from '../../database/deleteRecord.js'
|
||||
import { getCommittalTypes } from '../../helpers/functions.cache.js'
|
||||
|
||||
export default function handler(
|
||||
request: Request<unknown, unknown, { committalTypeId: string }>,
|
||||
response: Response
|
||||
): void {
|
||||
const success = deleteRecord(
|
||||
'CommittalTypes',
|
||||
request.body.committalTypeId as string,
|
||||
request.session.user as User
|
||||
)
|
||||
|
||||
const committalTypes = getCommittalTypes()
|
||||
|
||||
response.json({
|
||||
success,
|
||||
|
||||
committalTypes
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import type { Request, Response } from 'express';
|
||||
export default function handler(request: Request<unknown, unknown, {
|
||||
committalTypeId: string;
|
||||
moveToEnd: '0' | '1';
|
||||
}>, response: Response): void;
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
import { moveRecordDown, moveRecordDownToBottom } from '../../database/moveRecord.js';
|
||||
import { getCommittalTypes } from '../../helpers/functions.cache.js';
|
||||
export default function handler(request, response) {
|
||||
const success = request.body.moveToEnd === '1'
|
||||
? moveRecordDownToBottom('CommittalTypes', request.body.committalTypeId)
|
||||
: moveRecordDown('CommittalTypes', request.body.committalTypeId);
|
||||
const committalTypes = getCommittalTypes();
|
||||
response.json({
|
||||
success,
|
||||
committalTypes
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
import type { Request, Response } from 'express'
|
||||
|
||||
import {
|
||||
moveRecordDown,
|
||||
moveRecordDownToBottom
|
||||
} from '../../database/moveRecord.js'
|
||||
import { getCommittalTypes } from '../../helpers/functions.cache.js'
|
||||
|
||||
export default function handler(
|
||||
request: Request<
|
||||
unknown,
|
||||
unknown,
|
||||
{ committalTypeId: string; moveToEnd: '0' | '1' }
|
||||
>,
|
||||
response: Response
|
||||
): void {
|
||||
const success =
|
||||
request.body.moveToEnd === '1'
|
||||
? moveRecordDownToBottom('CommittalTypes', request.body.committalTypeId)
|
||||
: moveRecordDown('CommittalTypes', request.body.committalTypeId)
|
||||
|
||||
const committalTypes = getCommittalTypes()
|
||||
|
||||
response.json({
|
||||
success,
|
||||
|
||||
committalTypes
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import type { Request, Response } from 'express';
|
||||
export default function handler(request: Request<unknown, unknown, {
|
||||
committalTypeId: string;
|
||||
moveToEnd: '0' | '1';
|
||||
}>, response: Response): void;
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
import { moveRecordUp, moveRecordUpToTop } from '../../database/moveRecord.js';
|
||||
import { getCommittalTypes } from '../../helpers/functions.cache.js';
|
||||
export default function handler(request, response) {
|
||||
const success = request.body.moveToEnd === '1'
|
||||
? moveRecordUpToTop('CommittalTypes', request.body.committalTypeId)
|
||||
: moveRecordUp('CommittalTypes', request.body.committalTypeId);
|
||||
const committalTypes = getCommittalTypes();
|
||||
response.json({
|
||||
success,
|
||||
committalTypes
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
import type { Request, Response } from 'express'
|
||||
|
||||
import { moveRecordUp, moveRecordUpToTop } from '../../database/moveRecord.js'
|
||||
import { getCommittalTypes } from '../../helpers/functions.cache.js'
|
||||
|
||||
export default function handler(
|
||||
request: Request<
|
||||
unknown,
|
||||
unknown,
|
||||
{ committalTypeId: string; moveToEnd: '0' | '1' }
|
||||
>,
|
||||
response: Response
|
||||
): void {
|
||||
const success =
|
||||
request.body.moveToEnd === '1'
|
||||
? moveRecordUpToTop('CommittalTypes', request.body.committalTypeId)
|
||||
: moveRecordUp('CommittalTypes', request.body.committalTypeId)
|
||||
|
||||
const committalTypes = getCommittalTypes()
|
||||
|
||||
response.json({
|
||||
success,
|
||||
|
||||
committalTypes
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import type { Request, Response } from 'express';
|
||||
export default function handler(request: Request<unknown, unknown, {
|
||||
committalTypeId: string;
|
||||
committalType: string;
|
||||
}>, response: Response): void;
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
import { updateRecord } from '../../database/updateRecord.js';
|
||||
import { getCommittalTypes } from '../../helpers/functions.cache.js';
|
||||
export default function handler(request, response) {
|
||||
const success = updateRecord('CommittalTypes', request.body.committalTypeId, request.body.committalType, request.session.user);
|
||||
const committalTypes = getCommittalTypes();
|
||||
response.json({
|
||||
success,
|
||||
committalTypes
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
import type { Request, Response } from 'express'
|
||||
|
||||
import { updateRecord } from '../../database/updateRecord.js'
|
||||
import { getCommittalTypes } from '../../helpers/functions.cache.js'
|
||||
|
||||
export default function handler(
|
||||
request: Request<
|
||||
unknown,
|
||||
unknown,
|
||||
{ committalTypeId: string; committalType: string }
|
||||
>,
|
||||
response: Response
|
||||
): void {
|
||||
const success = updateRecord(
|
||||
'CommittalTypes',
|
||||
request.body.committalTypeId,
|
||||
request.body.committalType,
|
||||
request.session.user as User
|
||||
)
|
||||
|
||||
const committalTypes = getCommittalTypes()
|
||||
|
||||
response.json({
|
||||
success,
|
||||
|
||||
committalTypes
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
export {};
|
||||
|
|
@ -0,0 +1,170 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
const sunrise = exports.sunrise;
|
||||
let committalTypes = exports.committalTypes;
|
||||
delete exports.committalTypes;
|
||||
function updateCommittalType(submitEvent) {
|
||||
submitEvent.preventDefault();
|
||||
cityssm.postJSON(`${sunrise.urlPrefix}/admin/doUpdateCommittalType`, submitEvent.currentTarget, (rawResponseJSON) => {
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.success) {
|
||||
committalTypes = responseJSON.committalTypes;
|
||||
bulmaJS.alert({
|
||||
message: 'Committal Type Updated Successfully',
|
||||
contextualColorName: 'success'
|
||||
});
|
||||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
title: 'Error Updating Committal Type',
|
||||
message: responseJSON.errorMessage ?? '',
|
||||
contextualColorName: 'danger'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function deleteCommittalType(clickEvent) {
|
||||
const tableRowElement = clickEvent.currentTarget.closest('tr');
|
||||
const committalTypeId = tableRowElement.dataset.committalTypeId;
|
||||
function doDelete() {
|
||||
cityssm.postJSON(`${sunrise.urlPrefix}/admin/doDeleteCommittalType`, {
|
||||
committalTypeId
|
||||
}, (rawResponseJSON) => {
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.success) {
|
||||
committalTypes = responseJSON.committalTypes;
|
||||
if (committalTypes.length === 0) {
|
||||
renderCommittalTypes();
|
||||
}
|
||||
else {
|
||||
tableRowElement.remove();
|
||||
}
|
||||
bulmaJS.alert({
|
||||
message: 'Committal Type Deleted Successfully',
|
||||
contextualColorName: 'success'
|
||||
});
|
||||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
title: 'Error Deleting Committal Type',
|
||||
message: responseJSON.errorMessage ?? '',
|
||||
contextualColorName: 'danger'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
bulmaJS.confirm({
|
||||
title: 'Delete Committal Type',
|
||||
message: `Are you sure you want to delete this type?<br />
|
||||
Note that no contracts will be removed.`,
|
||||
messageIsHtml: true,
|
||||
contextualColorName: 'warning',
|
||||
okButton: {
|
||||
text: 'Yes, Delete Type',
|
||||
callbackFunction: doDelete
|
||||
}
|
||||
});
|
||||
}
|
||||
function moveCommittalType(clickEvent) {
|
||||
const buttonElement = clickEvent.currentTarget;
|
||||
const tableRowElement = buttonElement.closest('tr');
|
||||
const committalTypeId = tableRowElement.dataset.committalTypeId;
|
||||
cityssm.postJSON(`${sunrise.urlPrefix}/admin/${buttonElement.dataset.direction === 'up'
|
||||
? 'doMoveCommittalTypeUp'
|
||||
: 'doMoveCommittalTypeDown'}`, {
|
||||
committalTypeId,
|
||||
moveToEnd: clickEvent.shiftKey ? '1' : '0'
|
||||
}, (rawResponseJSON) => {
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.success) {
|
||||
committalTypes = responseJSON.committalTypes;
|
||||
renderCommittalTypes();
|
||||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
title: 'Error Moving Committal Type',
|
||||
message: responseJSON.errorMessage ?? '',
|
||||
contextualColorName: 'danger'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function renderCommittalTypes() {
|
||||
const containerElement = document.querySelector('#container--committalTypes');
|
||||
if (committalTypes.length === 0) {
|
||||
containerElement.innerHTML = `<tr><td colspan="2">
|
||||
<div class="message is-warning">
|
||||
<p class="message-body">There are no active committal types.</p>
|
||||
</div>
|
||||
</td></tr>`;
|
||||
return;
|
||||
}
|
||||
containerElement.innerHTML = '';
|
||||
for (const committalType of committalTypes) {
|
||||
const tableRowElement = document.createElement('tr');
|
||||
tableRowElement.dataset.committalTypeId =
|
||||
committalType.committalTypeId.toString();
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
tableRowElement.innerHTML = `<td>
|
||||
<form>
|
||||
<input name="committalTypeId" type="hidden" value="${committalType.committalTypeId.toString()}" />
|
||||
<div class="field has-addons">
|
||||
<div class="control">
|
||||
<input class="input" name="committalType" type="text"
|
||||
value="${cityssm.escapeHTML(committalType.committalType)}"
|
||||
aria-label="Committal Type" maxlength="100" required />
|
||||
</div>
|
||||
<div class="control">
|
||||
<button class="button is-success" type="submit" aria-label="Save">
|
||||
<span class="icon"><i class="fas fa-save" aria-hidden="true"></i></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</td><td class="is-nowrap">
|
||||
<div class="field is-grouped">
|
||||
<div class="control">
|
||||
${sunrise.getMoveUpDownButtonFieldHTML('button--moveCommittalTypeUp', 'button--moveCommittalTypeDown', false)}
|
||||
</div>
|
||||
<div class="control">
|
||||
<button class="button is-danger is-light button--deleteCommittalType" data-tooltip="Delete Type" type="button" aria-label="Delete Type">
|
||||
<span class="icon"><i class="fas fa-trash" aria-hidden="true"></i></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</td>`;
|
||||
tableRowElement
|
||||
.querySelector('form')
|
||||
?.addEventListener('submit', updateCommittalType);
|
||||
tableRowElement.querySelector('.button--moveCommittalTypeUp').addEventListener('click', moveCommittalType);
|
||||
tableRowElement.querySelector('.button--moveCommittalTypeDown').addEventListener('click', moveCommittalType);
|
||||
tableRowElement
|
||||
.querySelector('.button--deleteCommittalType')
|
||||
?.addEventListener('click', deleteCommittalType);
|
||||
containerElement.append(tableRowElement);
|
||||
}
|
||||
}
|
||||
;
|
||||
document.querySelector('#form--addCommittalType').addEventListener('submit', (submitEvent) => {
|
||||
submitEvent.preventDefault();
|
||||
const formElement = submitEvent.currentTarget;
|
||||
cityssm.postJSON(`${sunrise.urlPrefix}/admin/doAddCommittalType`, formElement, (rawResponseJSON) => {
|
||||
const responseJSON = rawResponseJSON;
|
||||
if (responseJSON.success) {
|
||||
committalTypes = responseJSON.committalTypes;
|
||||
renderCommittalTypes();
|
||||
formElement.reset();
|
||||
formElement.querySelector('input')?.focus();
|
||||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
title: 'Error Adding Committal Type',
|
||||
message: responseJSON.errorMessage ?? '',
|
||||
contextualColorName: 'danger'
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
renderCommittalTypes();
|
||||
})();
|
||||
|
|
@ -0,0 +1,254 @@
|
|||
import type { BulmaJS } from '@cityssm/bulma-js/types.js'
|
||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
|
||||
|
||||
import type { CommittalType } from '../../types/record.types.js'
|
||||
|
||||
import type { Sunrise } from './types.js'
|
||||
|
||||
declare const exports: {
|
||||
sunrise: Sunrise
|
||||
|
||||
committalTypes?: CommittalType[]
|
||||
}
|
||||
|
||||
declare const cityssm: cityssmGlobal
|
||||
declare const bulmaJS: BulmaJS
|
||||
;(() => {
|
||||
const sunrise = exports.sunrise as Sunrise
|
||||
|
||||
let committalTypes = exports.committalTypes as CommittalType[]
|
||||
delete exports.committalTypes
|
||||
|
||||
type CommittalTypeResponseJSON =
|
||||
| {
|
||||
success: false
|
||||
errorMessage?: string
|
||||
}
|
||||
| {
|
||||
success: true
|
||||
committalTypes: CommittalType[]
|
||||
}
|
||||
|
||||
function updateCommittalType(submitEvent: SubmitEvent): void {
|
||||
submitEvent.preventDefault()
|
||||
|
||||
cityssm.postJSON(
|
||||
`${sunrise.urlPrefix}/admin/doUpdateCommittalType`,
|
||||
submitEvent.currentTarget,
|
||||
(rawResponseJSON) => {
|
||||
const responseJSON = rawResponseJSON as CommittalTypeResponseJSON
|
||||
|
||||
if (responseJSON.success) {
|
||||
committalTypes = responseJSON.committalTypes
|
||||
|
||||
bulmaJS.alert({
|
||||
message: 'Committal Type Updated Successfully',
|
||||
contextualColorName: 'success'
|
||||
})
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
title: 'Error Updating Committal Type',
|
||||
message: responseJSON.errorMessage ?? '',
|
||||
contextualColorName: 'danger'
|
||||
})
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
function deleteCommittalType(clickEvent: Event): void {
|
||||
const tableRowElement = (clickEvent.currentTarget as HTMLElement).closest(
|
||||
'tr'
|
||||
) as HTMLTableRowElement
|
||||
|
||||
const committalTypeId = tableRowElement.dataset.committalTypeId
|
||||
|
||||
function doDelete(): void {
|
||||
cityssm.postJSON(
|
||||
`${sunrise.urlPrefix}/admin/doDeleteCommittalType`,
|
||||
{
|
||||
committalTypeId
|
||||
},
|
||||
(rawResponseJSON) => {
|
||||
const responseJSON = rawResponseJSON as CommittalTypeResponseJSON
|
||||
|
||||
if (responseJSON.success) {
|
||||
committalTypes = responseJSON.committalTypes
|
||||
|
||||
if (committalTypes.length === 0) {
|
||||
renderCommittalTypes()
|
||||
} else {
|
||||
tableRowElement.remove()
|
||||
}
|
||||
|
||||
bulmaJS.alert({
|
||||
message: 'Committal Type Deleted Successfully',
|
||||
contextualColorName: 'success'
|
||||
})
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
title: 'Error Deleting Committal Type',
|
||||
message: responseJSON.errorMessage ?? '',
|
||||
contextualColorName: 'danger'
|
||||
})
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
bulmaJS.confirm({
|
||||
title: 'Delete Committal Type',
|
||||
message: `Are you sure you want to delete this type?<br />
|
||||
Note that no contracts will be removed.`,
|
||||
messageIsHtml: true,
|
||||
contextualColorName: 'warning',
|
||||
okButton: {
|
||||
text: 'Yes, Delete Type',
|
||||
callbackFunction: doDelete
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function moveCommittalType(clickEvent: MouseEvent): void {
|
||||
const buttonElement = clickEvent.currentTarget as HTMLButtonElement
|
||||
|
||||
const tableRowElement = buttonElement.closest('tr') as HTMLTableRowElement
|
||||
|
||||
const committalTypeId = tableRowElement.dataset.committalTypeId
|
||||
|
||||
cityssm.postJSON(
|
||||
`${sunrise.urlPrefix}/admin/${
|
||||
buttonElement.dataset.direction === 'up'
|
||||
? 'doMoveCommittalTypeUp'
|
||||
: 'doMoveCommittalTypeDown'
|
||||
}`,
|
||||
{
|
||||
committalTypeId,
|
||||
moveToEnd: clickEvent.shiftKey ? '1' : '0'
|
||||
},
|
||||
(rawResponseJSON) => {
|
||||
const responseJSON = rawResponseJSON as CommittalTypeResponseJSON
|
||||
|
||||
if (responseJSON.success) {
|
||||
committalTypes = responseJSON.committalTypes
|
||||
renderCommittalTypes()
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
title: 'Error Moving Committal Type',
|
||||
message: responseJSON.errorMessage ?? '',
|
||||
contextualColorName: 'danger'
|
||||
})
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
function renderCommittalTypes(): void {
|
||||
const containerElement = document.querySelector(
|
||||
'#container--committalTypes'
|
||||
) as HTMLTableSectionElement
|
||||
|
||||
if (committalTypes.length === 0) {
|
||||
containerElement.innerHTML = `<tr><td colspan="2">
|
||||
<div class="message is-warning">
|
||||
<p class="message-body">There are no active committal types.</p>
|
||||
</div>
|
||||
</td></tr>`
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
containerElement.innerHTML = ''
|
||||
|
||||
for (const committalType of committalTypes) {
|
||||
const tableRowElement = document.createElement('tr')
|
||||
|
||||
tableRowElement.dataset.committalTypeId =
|
||||
committalType.committalTypeId.toString()
|
||||
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
tableRowElement.innerHTML = `<td>
|
||||
<form>
|
||||
<input name="committalTypeId" type="hidden" value="${committalType.committalTypeId.toString()}" />
|
||||
<div class="field has-addons">
|
||||
<div class="control">
|
||||
<input class="input" name="committalType" type="text"
|
||||
value="${cityssm.escapeHTML(committalType.committalType)}"
|
||||
aria-label="Committal Type" maxlength="100" required />
|
||||
</div>
|
||||
<div class="control">
|
||||
<button class="button is-success" type="submit" aria-label="Save">
|
||||
<span class="icon"><i class="fas fa-save" aria-hidden="true"></i></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</td><td class="is-nowrap">
|
||||
<div class="field is-grouped">
|
||||
<div class="control">
|
||||
${sunrise.getMoveUpDownButtonFieldHTML(
|
||||
'button--moveCommittalTypeUp',
|
||||
'button--moveCommittalTypeDown',
|
||||
false
|
||||
)}
|
||||
</div>
|
||||
<div class="control">
|
||||
<button class="button is-danger is-light button--deleteCommittalType" data-tooltip="Delete Type" type="button" aria-label="Delete Type">
|
||||
<span class="icon"><i class="fas fa-trash" aria-hidden="true"></i></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</td>`
|
||||
|
||||
tableRowElement
|
||||
.querySelector('form')
|
||||
?.addEventListener('submit', updateCommittalType)
|
||||
;(
|
||||
tableRowElement.querySelector(
|
||||
'.button--moveCommittalTypeUp'
|
||||
) as HTMLButtonElement
|
||||
).addEventListener('click', moveCommittalType)
|
||||
;(
|
||||
tableRowElement.querySelector(
|
||||
'.button--moveCommittalTypeDown'
|
||||
) as HTMLButtonElement
|
||||
).addEventListener('click', moveCommittalType)
|
||||
|
||||
tableRowElement
|
||||
.querySelector('.button--deleteCommittalType')
|
||||
?.addEventListener('click', deleteCommittalType)
|
||||
|
||||
containerElement.append(tableRowElement)
|
||||
}
|
||||
}
|
||||
;(
|
||||
document.querySelector('#form--addCommittalType') as HTMLFormElement
|
||||
).addEventListener('submit', (submitEvent: SubmitEvent) => {
|
||||
submitEvent.preventDefault()
|
||||
|
||||
const formElement = submitEvent.currentTarget as HTMLFormElement
|
||||
|
||||
cityssm.postJSON(
|
||||
`${sunrise.urlPrefix}/admin/doAddCommittalType`,
|
||||
formElement,
|
||||
(rawResponseJSON) => {
|
||||
const responseJSON = rawResponseJSON as CommittalTypeResponseJSON
|
||||
|
||||
if (responseJSON.success) {
|
||||
committalTypes = responseJSON.committalTypes
|
||||
renderCommittalTypes()
|
||||
formElement.reset()
|
||||
formElement.querySelector('input')?.focus()
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
title: 'Error Adding Committal Type',
|
||||
message: responseJSON.errorMessage ?? '',
|
||||
contextualColorName: 'danger'
|
||||
})
|
||||
}
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
renderCommittalTypes()
|
||||
})()
|
||||
|
|
@ -8,6 +8,7 @@ import handler_tables from '../handlers/admin-get/tables.js';
|
|||
import handler_doAddBurialSiteStatus from '../handlers/admin-post/doAddBurialSiteStatus.js';
|
||||
import handler_doAddBurialSiteType from '../handlers/admin-post/doAddBurialSiteType.js';
|
||||
import handler_doAddBurialSiteTypeField from '../handlers/admin-post/doAddBurialSiteTypeField.js';
|
||||
import handler_doAddCommittalType from '../handlers/admin-post/doAddCommittalType.js';
|
||||
import handler_doAddContractType from '../handlers/admin-post/doAddContractType.js';
|
||||
import handler_doAddContractTypeField from '../handlers/admin-post/doAddContractTypeField.js';
|
||||
import handler_doAddContractTypePrint from '../handlers/admin-post/doAddContractTypePrint.js';
|
||||
|
|
@ -20,6 +21,7 @@ import handler_doCleanupDatabase from '../handlers/admin-post/doCleanupDatabase.
|
|||
import handler_doDeleteBurialSiteStatus from '../handlers/admin-post/doDeleteBurialSiteStatus.js';
|
||||
import handler_doDeleteBurialSiteType from '../handlers/admin-post/doDeleteBurialSiteType.js';
|
||||
import handler_doDeleteBurialSiteTypeField from '../handlers/admin-post/doDeleteBurialSiteTypeField.js';
|
||||
import handler_doDeleteCommittalType from '../handlers/admin-post/doDeleteCommittalType.js';
|
||||
import handler_doDeleteContractType from '../handlers/admin-post/doDeleteContractType.js';
|
||||
import handler_doDeleteContractTypeField from '../handlers/admin-post/doDeleteContractTypeField.js';
|
||||
import handler_doDeleteContractTypePrint from '../handlers/admin-post/doDeleteContractTypePrint.js';
|
||||
|
|
@ -33,6 +35,8 @@ import handler_doMoveBurialSiteTypeDown from '../handlers/admin-post/doMoveBuria
|
|||
import handler_doMoveBurialSiteTypeFieldDown from '../handlers/admin-post/doMoveBurialSiteTypeFieldDown.js';
|
||||
import handler_doMoveBurialSiteTypeFieldUp from '../handlers/admin-post/doMoveBurialSiteTypeFieldUp.js';
|
||||
import handler_doMoveBurialSiteTypeUp from '../handlers/admin-post/doMoveBurialSiteTypeUp.js';
|
||||
import handler_doMoveCommittalTypeDown from '../handlers/admin-post/doMoveCommittalTypeDown.js';
|
||||
import handler_doMoveCommittalTypeUp from '../handlers/admin-post/doMoveCommittalTypeUp.js';
|
||||
import handler_doMoveContractTypeDown from '../handlers/admin-post/doMoveContractTypeDown.js';
|
||||
import handler_doMoveContractTypeFieldDown from '../handlers/admin-post/doMoveContractTypeFieldDown.js';
|
||||
import handler_doMoveContractTypeFieldUp from '../handlers/admin-post/doMoveContractTypeFieldUp.js';
|
||||
|
|
@ -48,8 +52,9 @@ import handler_doMoveWorkOrderMilestoneTypeUp from '../handlers/admin-post/doMov
|
|||
import handler_doMoveWorkOrderTypeDown from '../handlers/admin-post/doMoveWorkOrderTypeDown.js';
|
||||
import handler_doMoveWorkOrderTypeUp from '../handlers/admin-post/doMoveWorkOrderTypeUp.js';
|
||||
import handler_doUpdateBurialSiteStatus from '../handlers/admin-post/doUpdateBurialSiteStatus.js';
|
||||
import handler_updateBurialSiteType from '../handlers/admin-post/doUpdateBurialSiteType.js';
|
||||
import handler_doUpdateBurialSiteType from '../handlers/admin-post/doUpdateBurialSiteType.js';
|
||||
import handler_doUpdateBurialSiteTypeField from '../handlers/admin-post/doUpdateBurialSiteTypeField.js';
|
||||
import handler_doUpdateCommittalType from '../handlers/admin-post/doUpdateCommittalType.js';
|
||||
import handler_doUpdateContractType from '../handlers/admin-post/doUpdateContractType.js';
|
||||
import handler_doUpdateContractTypeField from '../handlers/admin-post/doUpdateContractTypeField.js';
|
||||
import handler_doUpdateFee from '../handlers/admin-post/doUpdateFee.js';
|
||||
|
|
@ -99,7 +104,7 @@ router.post('/doDeleteContractTypePrint', handler_doDeleteContractTypePrint);
|
|||
*/
|
||||
router.get('/burialSiteTypes', handler_burialSiteTypes);
|
||||
router.post('/doAddBurialSiteType', handler_doAddBurialSiteType);
|
||||
router.post('/doUpdateBurialSiteType', handler_updateBurialSiteType);
|
||||
router.post('/doUpdateBurialSiteType', handler_doUpdateBurialSiteType);
|
||||
router.post('/doMoveBurialSiteTypeUp', handler_doMoveBurialSiteTypeUp);
|
||||
router.post('/doMoveBurialSiteTypeDown', handler_doMoveBurialSiteTypeDown);
|
||||
router.post('/doDeleteBurialSiteType', handler_doDeleteBurialSiteType);
|
||||
|
|
@ -133,6 +138,12 @@ router.post('/doUpdateBurialSiteStatus', handler_doUpdateBurialSiteStatus);
|
|||
router.post('/doMoveBurialSiteStatusUp', handler_doMoveBurialSiteStatusUp);
|
||||
router.post('/doMoveBurialSiteStatusDown', handler_doMoveBurialSiteStatusDown);
|
||||
router.post('/doDeleteBurialSiteStatus', handler_doDeleteBurialSiteStatus);
|
||||
// Config Tables - Committal Types
|
||||
router.post('/doAddCommittalType', handler_doAddCommittalType);
|
||||
router.post('/doUpdateCommittalType', handler_doUpdateCommittalType);
|
||||
router.post('/doMoveCommittalTypeUp', handler_doMoveCommittalTypeUp);
|
||||
router.post('/doMoveCommittalTypeDown', handler_doMoveCommittalTypeDown);
|
||||
router.post('/doDeleteCommittalType', handler_doDeleteCommittalType);
|
||||
/*
|
||||
* Database Maintenance
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import handler_tables from '../handlers/admin-get/tables.js'
|
|||
import handler_doAddBurialSiteStatus from '../handlers/admin-post/doAddBurialSiteStatus.js'
|
||||
import handler_doAddBurialSiteType from '../handlers/admin-post/doAddBurialSiteType.js'
|
||||
import handler_doAddBurialSiteTypeField from '../handlers/admin-post/doAddBurialSiteTypeField.js'
|
||||
import handler_doAddCommittalType from '../handlers/admin-post/doAddCommittalType.js'
|
||||
import handler_doAddContractType from '../handlers/admin-post/doAddContractType.js'
|
||||
import handler_doAddContractTypeField from '../handlers/admin-post/doAddContractTypeField.js'
|
||||
import handler_doAddContractTypePrint from '../handlers/admin-post/doAddContractTypePrint.js'
|
||||
|
|
@ -21,6 +22,7 @@ import handler_doCleanupDatabase from '../handlers/admin-post/doCleanupDatabase.
|
|||
import handler_doDeleteBurialSiteStatus from '../handlers/admin-post/doDeleteBurialSiteStatus.js'
|
||||
import handler_doDeleteBurialSiteType from '../handlers/admin-post/doDeleteBurialSiteType.js'
|
||||
import handler_doDeleteBurialSiteTypeField from '../handlers/admin-post/doDeleteBurialSiteTypeField.js'
|
||||
import handler_doDeleteCommittalType from '../handlers/admin-post/doDeleteCommittalType.js'
|
||||
import handler_doDeleteContractType from '../handlers/admin-post/doDeleteContractType.js'
|
||||
import handler_doDeleteContractTypeField from '../handlers/admin-post/doDeleteContractTypeField.js'
|
||||
import handler_doDeleteContractTypePrint from '../handlers/admin-post/doDeleteContractTypePrint.js'
|
||||
|
|
@ -34,6 +36,8 @@ import handler_doMoveBurialSiteTypeDown from '../handlers/admin-post/doMoveBuria
|
|||
import handler_doMoveBurialSiteTypeFieldDown from '../handlers/admin-post/doMoveBurialSiteTypeFieldDown.js'
|
||||
import handler_doMoveBurialSiteTypeFieldUp from '../handlers/admin-post/doMoveBurialSiteTypeFieldUp.js'
|
||||
import handler_doMoveBurialSiteTypeUp from '../handlers/admin-post/doMoveBurialSiteTypeUp.js'
|
||||
import handler_doMoveCommittalTypeDown from '../handlers/admin-post/doMoveCommittalTypeDown.js'
|
||||
import handler_doMoveCommittalTypeUp from '../handlers/admin-post/doMoveCommittalTypeUp.js'
|
||||
import handler_doMoveContractTypeDown from '../handlers/admin-post/doMoveContractTypeDown.js'
|
||||
import handler_doMoveContractTypeFieldDown from '../handlers/admin-post/doMoveContractTypeFieldDown.js'
|
||||
import handler_doMoveContractTypeFieldUp from '../handlers/admin-post/doMoveContractTypeFieldUp.js'
|
||||
|
|
@ -49,8 +53,9 @@ import handler_doMoveWorkOrderMilestoneTypeUp from '../handlers/admin-post/doMov
|
|||
import handler_doMoveWorkOrderTypeDown from '../handlers/admin-post/doMoveWorkOrderTypeDown.js'
|
||||
import handler_doMoveWorkOrderTypeUp from '../handlers/admin-post/doMoveWorkOrderTypeUp.js'
|
||||
import handler_doUpdateBurialSiteStatus from '../handlers/admin-post/doUpdateBurialSiteStatus.js'
|
||||
import handler_updateBurialSiteType from '../handlers/admin-post/doUpdateBurialSiteType.js'
|
||||
import handler_doUpdateBurialSiteType from '../handlers/admin-post/doUpdateBurialSiteType.js'
|
||||
import handler_doUpdateBurialSiteTypeField from '../handlers/admin-post/doUpdateBurialSiteTypeField.js'
|
||||
import handler_doUpdateCommittalType from '../handlers/admin-post/doUpdateCommittalType.js'
|
||||
import handler_doUpdateContractType from '../handlers/admin-post/doUpdateContractType.js'
|
||||
import handler_doUpdateContractTypeField from '../handlers/admin-post/doUpdateContractTypeField.js'
|
||||
import handler_doUpdateFee from '../handlers/admin-post/doUpdateFee.js'
|
||||
|
|
@ -137,7 +142,7 @@ router.get('/burialSiteTypes', handler_burialSiteTypes)
|
|||
|
||||
router.post('/doAddBurialSiteType', handler_doAddBurialSiteType)
|
||||
|
||||
router.post('/doUpdateBurialSiteType', handler_updateBurialSiteType)
|
||||
router.post('/doUpdateBurialSiteType', handler_doUpdateBurialSiteType)
|
||||
|
||||
router.post('/doMoveBurialSiteTypeUp', handler_doMoveBurialSiteTypeUp)
|
||||
|
||||
|
|
@ -183,7 +188,6 @@ router.post('/doDeleteWorkOrderType', handler_doDeleteWorkOrderType)
|
|||
|
||||
router.post(
|
||||
'/doAddWorkOrderMilestoneType',
|
||||
|
||||
handler_doAddWorkOrderMilestoneType
|
||||
)
|
||||
|
||||
|
|
@ -219,6 +223,18 @@ router.post('/doMoveBurialSiteStatusDown', handler_doMoveBurialSiteStatusDown)
|
|||
|
||||
router.post('/doDeleteBurialSiteStatus', handler_doDeleteBurialSiteStatus)
|
||||
|
||||
// Config Tables - Committal Types
|
||||
|
||||
router.post('/doAddCommittalType', handler_doAddCommittalType)
|
||||
|
||||
router.post('/doUpdateCommittalType', handler_doUpdateCommittalType)
|
||||
|
||||
router.post('/doMoveCommittalTypeUp', handler_doMoveCommittalTypeUp)
|
||||
|
||||
router.post('/doMoveCommittalTypeDown', handler_doMoveCommittalTypeDown)
|
||||
|
||||
router.post('/doDeleteCommittalType', handler_doDeleteCommittalType)
|
||||
|
||||
/*
|
||||
* Database Maintenance
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -129,6 +129,54 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel">
|
||||
<div class="panel-heading">
|
||||
<div class="level is-mobile">
|
||||
<div class="level-left">
|
||||
<div class="level-item">
|
||||
<button class="button is-small is-toggle-button" data-tooltip="Toggle Committal Types" type="button" aria-label="Toggle Committal Types">
|
||||
<span class="icon">
|
||||
<i class="fas fa-plus" aria-hidden="true"></i>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="level-item">
|
||||
<h2 class="title is-5 has-text-white">Committal Types</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-block is-block is-hidden">
|
||||
<table class="table is-striped is-hoverable has-sticky-header">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Committal Type</th>
|
||||
<th class="has-text-centered has-width-1">Options</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<form id="form--addCommittalType">
|
||||
<div class="field has-addons">
|
||||
<div class="control is-expanded">
|
||||
<input class="input" name="committalType" type="text" maxlength="100" placeholder="New Committal Type" required />
|
||||
</div>
|
||||
<div class="control">
|
||||
<button class="button is-success has-tooltip-bottom" data-tooltip="Add Type" type="submit" aria-label="Add Type">
|
||||
<span class="icon"><i class="fas fa-plus" aria-hidden="true"></i></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody id="container--committalTypes"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel">
|
||||
<div class="panel-heading">
|
||||
<div class="level is-mobile">
|
||||
|
|
@ -182,14 +230,17 @@
|
|||
<%- include('_footerA'); -%>
|
||||
|
||||
<script>
|
||||
exports.workOrderTypes = <%- JSON.stringify(workOrderTypes) %>;
|
||||
exports.workOrderMilestoneTypes = <%- JSON.stringify(workOrderMilestoneTypes) %>;
|
||||
exports.burialSiteStatuses = <%- JSON.stringify(burialSiteStatuses) %>;
|
||||
exports.committalTypes = <%- JSON.stringify(committalTypes) %>;
|
||||
exports.intermentContainerTypes = <%- JSON.stringify(intermentContainerTypes) %>;
|
||||
exports.workOrderMilestoneTypes = <%- JSON.stringify(workOrderMilestoneTypes) %>;
|
||||
exports.workOrderTypes = <%- JSON.stringify(workOrderTypes) %>;
|
||||
</script>
|
||||
|
||||
<script src="<%= urlPrefix %>/javascripts/tables.admin.js"></script>
|
||||
|
||||
<script src="<%= urlPrefix %>/javascripts/burialSiteStatuses.admin.js"></script>
|
||||
<script src="<%= urlPrefix %>/javascripts/committalTypes.admin.js"></script>
|
||||
<script src="<%= urlPrefix %>/javascripts/workOrderMilestoneTypes.admin.js"></script>
|
||||
<script src="<%= urlPrefix %>/javascripts/workOrderTypes.admin.js"></script>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue