code cleanup
parent
d8e833a954
commit
f2bbcf0890
|
|
@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
var _a, _b;
|
var _a, _b;
|
||||||
const los = exports.los;
|
const los = exports.los;
|
||||||
function doBackup() {
|
function doBackup() {
|
||||||
cityssm.postJSON(los.urlPrefix + '/admin/doBackupDatabase', {}, (rawResponseJSON) => {
|
cityssm.postJSON(`${los.urlPrefix}/admin/doBackupDatabase`, {}, (rawResponseJSON) => {
|
||||||
var _a;
|
var _a;
|
||||||
const responseJSON = rawResponseJSON;
|
const responseJSON = rawResponseJSON;
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
|
|
@ -27,7 +27,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function doCleanup() {
|
function doCleanup() {
|
||||||
cityssm.postJSON(los.urlPrefix + '/admin/doCleanupDatabase', {}, (rawResponseJSON) => {
|
cityssm.postJSON(`${los.urlPrefix}/admin/doCleanupDatabase`, {}, (rawResponseJSON) => {
|
||||||
var _a;
|
var _a;
|
||||||
const responseJSON = rawResponseJSON;
|
const responseJSON = rawResponseJSON;
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,20 @@
|
||||||
/* @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
/* @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||||
|
|
||||||
import type * as globalTypes from '../types/globalTypes'
|
import type { BulmaJS } from '@cityssm/bulma-js/types.js'
|
||||||
|
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
|
||||||
|
|
||||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types'
|
import type * as globalTypes from '../types/globalTypes.js'
|
||||||
|
|
||||||
import type { BulmaJS } from '@cityssm/bulma-js/types'
|
|
||||||
|
|
||||||
declare const cityssm: cityssmGlobal
|
declare const cityssm: cityssmGlobal
|
||||||
declare const bulmaJS: BulmaJS
|
declare const bulmaJS: BulmaJS
|
||||||
|
|
||||||
|
declare const exports: Record<string, unknown>
|
||||||
;(() => {
|
;(() => {
|
||||||
const los = exports.los as globalTypes.LOS
|
const los = exports.los as globalTypes.LOS
|
||||||
|
|
||||||
function doBackup(): void {
|
function doBackup(): void {
|
||||||
cityssm.postJSON(
|
cityssm.postJSON(
|
||||||
los.urlPrefix + '/admin/doBackupDatabase',
|
`${los.urlPrefix}/admin/doBackupDatabase`,
|
||||||
{},
|
{},
|
||||||
(rawResponseJSON) => {
|
(rawResponseJSON) => {
|
||||||
const responseJSON = rawResponseJSON as
|
const responseJSON = rawResponseJSON as
|
||||||
|
|
@ -47,7 +48,7 @@ declare const bulmaJS: BulmaJS
|
||||||
|
|
||||||
function doCleanup(): void {
|
function doCleanup(): void {
|
||||||
cityssm.postJSON(
|
cityssm.postJSON(
|
||||||
los.urlPrefix + '/admin/doCleanupDatabase',
|
`${los.urlPrefix}/admin/doCleanupDatabase`,
|
||||||
{},
|
{},
|
||||||
(rawResponseJSON) => {
|
(rawResponseJSON) => {
|
||||||
const responseJSON = rawResponseJSON as
|
const responseJSON = rawResponseJSON as
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,15 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||||
|
/* eslint-disable unicorn/prefer-module */
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
(() => {
|
(() => {
|
||||||
|
var _a;
|
||||||
const los = exports.los;
|
const los = exports.los;
|
||||||
const feeCategoriesContainerElement = document.querySelector('#container--feeCategories');
|
const feeCategoriesContainerElement = document.querySelector('#container--feeCategories');
|
||||||
let feeCategories = exports.feeCategories;
|
let feeCategories = exports.feeCategories;
|
||||||
delete exports.feeCategories;
|
delete exports.feeCategories;
|
||||||
function renderFeeCategories() {
|
function renderFeeCategories() {
|
||||||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
||||||
if (feeCategories.length === 0) {
|
if (feeCategories.length === 0) {
|
||||||
feeCategoriesContainerElement.innerHTML = `<div class="message is-warning">
|
feeCategoriesContainerElement.innerHTML = `<div class="message is-warning">
|
||||||
<p class="message-body">There are no available fees.</p>
|
<p class="message-body">There are no available fees.</p>
|
||||||
|
|
@ -20,42 +22,40 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
feeCategoryContainerElement.className = 'panel container--feeCategory';
|
feeCategoryContainerElement.className = 'panel container--feeCategory';
|
||||||
feeCategoryContainerElement.dataset.feeCategoryId =
|
feeCategoryContainerElement.dataset.feeCategoryId =
|
||||||
feeCategory.feeCategoryId.toString();
|
feeCategory.feeCategoryId.toString();
|
||||||
feeCategoryContainerElement.innerHTML =
|
// eslint-disable-next-line no-unsanitized/property
|
||||||
'<div class="panel-heading">' +
|
feeCategoryContainerElement.innerHTML = `<div class="panel-heading">
|
||||||
'<div class="columns">' +
|
<div class="columns">
|
||||||
('<div class="column">' +
|
<div class="column">
|
||||||
'<h2 class="title is-4">' +
|
<h2 class="title is-4">${cityssm.escapeHTML((_a = feeCategory.feeCategory) !== null && _a !== void 0 ? _a : '')}</h2>
|
||||||
cityssm.escapeHTML((_a = feeCategory.feeCategory) !== null && _a !== void 0 ? _a : '') +
|
</div>
|
||||||
'</h2>' +
|
<div class="column is-narrow">
|
||||||
'</div>') +
|
<div class="field is-grouped is-justify-content-end">
|
||||||
('<div class="column is-narrow">' +
|
${feeCategory.fees.length === 0
|
||||||
'<div class="field is-grouped is-justify-content-end">' +
|
? `<div class="control">
|
||||||
(feeCategory.fees.length === 0
|
<button class="button is-small is-danger button--deleteFeeCategory" type="button">
|
||||||
? '<div class="control">' +
|
<span class="icon is-small"><i class="fas fa-trash" aria-hidden="true"></i></span>
|
||||||
'<button class="button is-small is-danger button--deleteFeeCategory" type="button">' +
|
<span>Delete Category</span>
|
||||||
'<span class="icon is-small"><i class="fas fa-trash" aria-hidden="true"></i></span>' +
|
</button>
|
||||||
'<span>Delete Category</span>' +
|
</div>`
|
||||||
'</button>' +
|
: ''}
|
||||||
'</div>'
|
<div class="control">
|
||||||
: '') +
|
<button class="button is-small is-primary button--editFeeCategory" type="button">
|
||||||
('<div class="control">' +
|
<span class="icon is-small"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>
|
||||||
'<button class="button is-small is-primary button--editFeeCategory" type="button">' +
|
<span>Edit Category</span>
|
||||||
'<span class="icon is-small"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>' +
|
</button>
|
||||||
'<span>Edit Category</span>' +
|
</div>
|
||||||
'</button>' +
|
<div class="control">
|
||||||
'</div>') +
|
<button class="button is-small is-success button--addFee" data-cy="addFee" type="button">
|
||||||
('<div class="control">' +
|
<span class="icon is-small"><i class="fas fa-plus" aria-hidden="true"></i></span>
|
||||||
'<button class="button is-small is-success button--addFee" data-cy="addFee" type="button">' +
|
<span>Add Fee</span>
|
||||||
'<span class="icon is-small"><i class="fas fa-plus" aria-hidden="true"></i></span>' +
|
</button>
|
||||||
'<span>Add Fee</span>' +
|
</div>
|
||||||
'</button>' +
|
<div class="control">
|
||||||
'</div>') +
|
${los.getMoveUpDownButtonFieldHTML('button--moveFeeCategoryUp', 'button--moveFeeCategoryDown')}
|
||||||
('<div class="control">' +
|
</div>
|
||||||
los.getMoveUpDownButtonFieldHTML('button--moveFeeCategoryUp', 'button--moveFeeCategoryDown') +
|
</div>
|
||||||
'</div>') +
|
</div>
|
||||||
'</div>') +
|
</div>`;
|
||||||
'</div>' +
|
|
||||||
'</div>';
|
|
||||||
if (feeCategory.fees.length === 0) {
|
if (feeCategory.fees.length === 0) {
|
||||||
feeCategoryContainerElement.insertAdjacentHTML('beforeend', `<div class="panel-block is-block">
|
feeCategoryContainerElement.insertAdjacentHTML('beforeend', `<div class="panel-block is-block">
|
||||||
<div class="message is-info">
|
<div class="message is-info">
|
||||||
|
|
@ -66,53 +66,53 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>`);
|
</div>`);
|
||||||
feeCategoryContainerElement
|
(_c = feeCategoryContainerElement
|
||||||
.querySelector('.button--deleteFeeCategory')
|
.querySelector('.button--deleteFeeCategory')) === null || _c === void 0 ? void 0 : _c.addEventListener('click', confirmDeleteFeeCategory);
|
||||||
.addEventListener('click', confirmDeleteFeeCategory);
|
|
||||||
}
|
}
|
||||||
for (const fee of feeCategory.fees) {
|
for (const fee of feeCategory.fees) {
|
||||||
const panelBlockElement = document.createElement('div');
|
const panelBlockElement = document.createElement('div');
|
||||||
panelBlockElement.className = 'panel-block is-block container--fee';
|
panelBlockElement.className = 'panel-block is-block container--fee';
|
||||||
panelBlockElement.dataset.feeId = fee.feeId.toString();
|
panelBlockElement.dataset.feeId = fee.feeId.toString();
|
||||||
const hasTagsBlock = ((_c = fee.isRequired) !== null && _c !== void 0 ? _c : false) ||
|
const hasTagsBlock = ((_d = fee.isRequired) !== null && _d !== void 0 ? _d : false) ||
|
||||||
fee.occupancyTypeId !== undefined ||
|
fee.occupancyTypeId !== undefined ||
|
||||||
fee.lotTypeId !== undefined;
|
fee.lotTypeId !== undefined;
|
||||||
|
// eslint-disable-next-line no-unsanitized/property
|
||||||
panelBlockElement.innerHTML =
|
panelBlockElement.innerHTML =
|
||||||
'<div class="columns">' +
|
'<div class="columns">' +
|
||||||
('<div class="column is-half">' +
|
('<div class="column is-half">' +
|
||||||
'<p>' +
|
'<p>' +
|
||||||
'<a class="has-text-weight-bold" href="#">' +
|
'<a class="has-text-weight-bold" href="#">' +
|
||||||
cityssm.escapeHTML((_d = fee.feeName) !== null && _d !== void 0 ? _d : '') +
|
cityssm.escapeHTML((_e = fee.feeName) !== null && _e !== void 0 ? _e : '') +
|
||||||
'</a><br />' +
|
'</a><br />' +
|
||||||
'<small>' +
|
'<small>' +
|
||||||
cityssm
|
cityssm
|
||||||
.escapeHTML((_e = fee.feeDescription) !== null && _e !== void 0 ? _e : '')
|
.escapeHTML((_f = fee.feeDescription) !== null && _f !== void 0 ? _f : '')
|
||||||
.replace(/\n/g, '<br />') +
|
.replaceAll('\n', '<br />') +
|
||||||
'</small>' +
|
'</small>' +
|
||||||
'</p>' +
|
'</p>' +
|
||||||
(hasTagsBlock
|
(hasTagsBlock
|
||||||
? '<p class="tags">' +
|
? '<p class="tags">' +
|
||||||
(((_f = fee.isRequired) !== null && _f !== void 0 ? _f : false)
|
(((_g = fee.isRequired) !== null && _g !== void 0 ? _g : false)
|
||||||
? '<span class="tag is-warning">Required</span>'
|
? '<span class="tag is-warning">Required</span>'
|
||||||
: '') +
|
: '') +
|
||||||
(((_g = fee.occupancyTypeId) !== null && _g !== void 0 ? _g : -1) === -1
|
(((_h = fee.occupancyTypeId) !== null && _h !== void 0 ? _h : -1) === -1
|
||||||
? ''
|
? ''
|
||||||
: ' <span class="tag has-tooltip-bottom" data-tooltip="' +
|
: ' <span class="tag has-tooltip-bottom" data-tooltip="' +
|
||||||
los.escapedAliases.Occupancy +
|
los.escapedAliases.Occupancy +
|
||||||
' Type Filter">' +
|
' Type Filter">' +
|
||||||
'<span class="icon is-small"><i class="fas fa-filter" aria-hidden="true"></i></span> ' +
|
'<span class="icon is-small"><i class="fas fa-filter" aria-hidden="true"></i></span> ' +
|
||||||
'<span>' +
|
'<span>' +
|
||||||
cityssm.escapeHTML((_h = fee.occupancyType) !== null && _h !== void 0 ? _h : '') +
|
cityssm.escapeHTML((_j = fee.occupancyType) !== null && _j !== void 0 ? _j : '') +
|
||||||
'</span>' +
|
'</span>' +
|
||||||
'</span>') +
|
'</span>') +
|
||||||
(((_j = fee.lotTypeId) !== null && _j !== void 0 ? _j : -1) === -1
|
(((_k = fee.lotTypeId) !== null && _k !== void 0 ? _k : -1) === -1
|
||||||
? ''
|
? ''
|
||||||
: ' <span class="tag has-tooltip-bottom" data-tooltip="' +
|
: ' <span class="tag has-tooltip-bottom" data-tooltip="' +
|
||||||
los.escapedAliases.Lot +
|
los.escapedAliases.Lot +
|
||||||
' Type Filter">' +
|
' Type Filter">' +
|
||||||
'<span class="icon is-small"><i class="fas fa-filter" aria-hidden="true"></i></span> ' +
|
'<span class="icon is-small"><i class="fas fa-filter" aria-hidden="true"></i></span> ' +
|
||||||
'<span>' +
|
'<span>' +
|
||||||
cityssm.escapeHTML((_k = fee.lotType) !== null && _k !== void 0 ? _k : '') +
|
cityssm.escapeHTML((_l = fee.lotType) !== null && _l !== void 0 ? _l : '') +
|
||||||
'</span>' +
|
'</span>' +
|
||||||
'</span>') +
|
'</span>') +
|
||||||
'</p>'
|
'</p>'
|
||||||
|
|
@ -126,19 +126,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
'<br />' +
|
'<br />' +
|
||||||
'<small>Fee Function</small>'
|
'<small>Fee Function</small>'
|
||||||
: '$' +
|
: '$' +
|
||||||
((_l = fee.feeAmount) !== null && _l !== void 0 ? _l : 0).toFixed(2) +
|
((_m = fee.feeAmount) !== null && _m !== void 0 ? _m : 0).toFixed(2) +
|
||||||
'<br />' +
|
'<br />' +
|
||||||
'<small>Fee</small>') +
|
'<small>Fee</small>') +
|
||||||
'</div>') +
|
'</div>') +
|
||||||
('<div class="column has-text-centered">' +
|
('<div class="column has-text-centered">' +
|
||||||
(fee.taxPercentage
|
(fee.taxPercentage
|
||||||
? fee.taxPercentage.toString() + '%'
|
? fee.taxPercentage.toString() + '%'
|
||||||
: '$' + ((_m = fee.taxAmount) !== null && _m !== void 0 ? _m : 0).toFixed(2)) +
|
: '$' + ((_o = fee.taxAmount) !== null && _o !== void 0 ? _o : 0).toFixed(2)) +
|
||||||
'<br /><small>Tax</small>' +
|
'<br /><small>Tax</small>' +
|
||||||
'</div>') +
|
'</div>') +
|
||||||
('<div class="column has-text-centered">' +
|
('<div class="column has-text-centered">' +
|
||||||
(fee.includeQuantity
|
(fee.includeQuantity
|
||||||
? cityssm.escapeHTML((_o = fee.quantityUnit) !== null && _o !== void 0 ? _o : '') +
|
? cityssm.escapeHTML((_p = fee.quantityUnit) !== null && _p !== void 0 ? _p : '') +
|
||||||
'<br />' +
|
'<br />' +
|
||||||
'<small>Quantity</small>'
|
'<small>Quantity</small>'
|
||||||
: '') +
|
: '') +
|
||||||
|
|
@ -150,19 +150,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'</div>') +
|
'</div>') +
|
||||||
'</div>';
|
'</div>';
|
||||||
panelBlockElement
|
(_q = panelBlockElement
|
||||||
.querySelector('a')
|
.querySelector('a')) === null || _q === void 0 ? void 0 : _q.addEventListener('click', openEditFee);
|
||||||
.addEventListener('click', openEditFee);
|
|
||||||
panelBlockElement.querySelector('.button--moveFeeUp').addEventListener('click', moveFee);
|
panelBlockElement.querySelector('.button--moveFeeUp').addEventListener('click', moveFee);
|
||||||
panelBlockElement.querySelector('.button--moveFeeDown').addEventListener('click', moveFee);
|
panelBlockElement.querySelector('.button--moveFeeDown').addEventListener('click', moveFee);
|
||||||
feeCategoryContainerElement.append(panelBlockElement);
|
feeCategoryContainerElement.append(panelBlockElement);
|
||||||
}
|
}
|
||||||
feeCategoryContainerElement
|
(_r = feeCategoryContainerElement
|
||||||
.querySelector('.button--editFeeCategory')
|
.querySelector('.button--editFeeCategory')) === null || _r === void 0 ? void 0 : _r.addEventListener('click', openEditFeeCategory);
|
||||||
.addEventListener('click', openEditFeeCategory);
|
(_s = feeCategoryContainerElement
|
||||||
feeCategoryContainerElement
|
.querySelector('.button--addFee')) === null || _s === void 0 ? void 0 : _s.addEventListener('click', openAddFee);
|
||||||
.querySelector('.button--addFee')
|
|
||||||
.addEventListener('click', openAddFee);
|
|
||||||
feeCategoryContainerElement.querySelector('.button--moveFeeCategoryUp').addEventListener('click', moveFeeCategory);
|
feeCategoryContainerElement.querySelector('.button--moveFeeCategoryUp').addEventListener('click', moveFeeCategory);
|
||||||
feeCategoryContainerElement.querySelector('.button--moveFeeCategoryDown').addEventListener('click', moveFeeCategory);
|
feeCategoryContainerElement.querySelector('.button--moveFeeCategoryDown').addEventListener('click', moveFeeCategory);
|
||||||
feeCategoriesContainerElement.append(feeCategoryContainerElement);
|
feeCategoriesContainerElement.append(feeCategoryContainerElement);
|
||||||
|
|
@ -171,13 +168,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
/*
|
/*
|
||||||
* Fee Categories
|
* Fee Categories
|
||||||
*/
|
*/
|
||||||
document
|
(_a = document
|
||||||
.querySelector('#button--addFeeCategory')
|
.querySelector('#button--addFeeCategory')) === null || _a === void 0 ? void 0 : _a.addEventListener('click', () => {
|
||||||
.addEventListener('click', () => {
|
|
||||||
let addCloseModalFunction;
|
let addCloseModalFunction;
|
||||||
function doAddFeeCategory(submitEvent) {
|
function doAddFeeCategory(submitEvent) {
|
||||||
submitEvent.preventDefault();
|
submitEvent.preventDefault();
|
||||||
cityssm.postJSON(los.urlPrefix + '/admin/doAddFeeCategory', submitEvent.currentTarget, (rawResponseJSON) => {
|
cityssm.postJSON(`${los.urlPrefix}/admin/doAddFeeCategory`, submitEvent.currentTarget, (rawResponseJSON) => {
|
||||||
var _a;
|
var _a;
|
||||||
const responseJSON = rawResponseJSON;
|
const responseJSON = rawResponseJSON;
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
|
|
@ -196,12 +192,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
}
|
}
|
||||||
cityssm.openHtmlModal('adminFees-addFeeCategory', {
|
cityssm.openHtmlModal('adminFees-addFeeCategory', {
|
||||||
onshown(modalElement, closeModalFunction) {
|
onshown(modalElement, closeModalFunction) {
|
||||||
|
var _a;
|
||||||
bulmaJS.toggleHtmlClipped();
|
bulmaJS.toggleHtmlClipped();
|
||||||
modalElement.querySelector('#feeCategoryAdd--feeCategory').focus();
|
modalElement.querySelector('#feeCategoryAdd--feeCategory').focus();
|
||||||
addCloseModalFunction = closeModalFunction;
|
addCloseModalFunction = closeModalFunction;
|
||||||
modalElement
|
(_a = modalElement
|
||||||
.querySelector('form')
|
.querySelector('form')) === null || _a === void 0 ? void 0 : _a.addEventListener('submit', doAddFeeCategory);
|
||||||
.addEventListener('submit', doAddFeeCategory);
|
|
||||||
},
|
},
|
||||||
onremoved() {
|
onremoved() {
|
||||||
bulmaJS.toggleHtmlClipped();
|
bulmaJS.toggleHtmlClipped();
|
||||||
|
|
@ -217,7 +213,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
let editCloseModalFunction;
|
let editCloseModalFunction;
|
||||||
function doUpdateFeeCategory(submitEvent) {
|
function doUpdateFeeCategory(submitEvent) {
|
||||||
submitEvent.preventDefault();
|
submitEvent.preventDefault();
|
||||||
cityssm.postJSON(los.urlPrefix + '/admin/doUpdateFeeCategory', submitEvent.currentTarget, (rawResponseJSON) => {
|
cityssm.postJSON(`${los.urlPrefix}/admin/doUpdateFeeCategory`, submitEvent.currentTarget, (rawResponseJSON) => {
|
||||||
var _a;
|
var _a;
|
||||||
const responseJSON = rawResponseJSON;
|
const responseJSON = rawResponseJSON;
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
|
|
@ -241,11 +237,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
modalElement.querySelector('#feeCategoryEdit--feeCategory').value = feeCategory.feeCategory;
|
modalElement.querySelector('#feeCategoryEdit--feeCategory').value = feeCategory.feeCategory;
|
||||||
},
|
},
|
||||||
onshown(modalElement, closeModalFunction) {
|
onshown(modalElement, closeModalFunction) {
|
||||||
|
var _a;
|
||||||
bulmaJS.toggleHtmlClipped();
|
bulmaJS.toggleHtmlClipped();
|
||||||
editCloseModalFunction = closeModalFunction;
|
editCloseModalFunction = closeModalFunction;
|
||||||
modalElement
|
(_a = modalElement
|
||||||
.querySelector('form')
|
.querySelector('form')) === null || _a === void 0 ? void 0 : _a.addEventListener('submit', doUpdateFeeCategory);
|
||||||
.addEventListener('submit', doUpdateFeeCategory);
|
|
||||||
modalElement.querySelector('#feeCategoryEdit--feeCategory').focus();
|
modalElement.querySelector('#feeCategoryEdit--feeCategory').focus();
|
||||||
},
|
},
|
||||||
onremoved: () => {
|
onremoved: () => {
|
||||||
|
|
@ -254,9 +250,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function confirmDeleteFeeCategory(clickEvent) {
|
function confirmDeleteFeeCategory(clickEvent) {
|
||||||
const feeCategoryId = Number.parseInt(clickEvent.currentTarget.closest('.container--feeCategory').dataset.feeCategoryId, 10);
|
var _a;
|
||||||
|
const feeCategoryId = Number.parseInt((_a = clickEvent.currentTarget.closest('.container--feeCategory').dataset.feeCategoryId) !== null && _a !== void 0 ? _a : '', 10);
|
||||||
function doDelete() {
|
function doDelete() {
|
||||||
cityssm.postJSON(los.urlPrefix + '/admin/doDeleteFeeCategory', {
|
cityssm.postJSON(`${los.urlPrefix}/admin/doDeleteFeeCategory`, {
|
||||||
feeCategoryId
|
feeCategoryId
|
||||||
}, (rawResponseJSON) => {
|
}, (rawResponseJSON) => {
|
||||||
var _a;
|
var _a;
|
||||||
|
|
@ -285,8 +282,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function moveFeeCategory(clickEvent) {
|
function moveFeeCategory(clickEvent) {
|
||||||
|
var _a;
|
||||||
const buttonElement = clickEvent.currentTarget;
|
const buttonElement = clickEvent.currentTarget;
|
||||||
const feeCategoryId = buttonElement.closest('.container--feeCategory').dataset.feeCategoryId;
|
const feeCategoryId = (_a = buttonElement.closest('.container--feeCategory').dataset
|
||||||
|
.feeCategoryId) !== null && _a !== void 0 ? _a : '';
|
||||||
cityssm.postJSON(los.urlPrefix +
|
cityssm.postJSON(los.urlPrefix +
|
||||||
'/admin/' +
|
'/admin/' +
|
||||||
(buttonElement.dataset.direction === 'up'
|
(buttonElement.dataset.direction === 'up'
|
||||||
|
|
@ -314,11 +313,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
* Fees
|
* Fees
|
||||||
*/
|
*/
|
||||||
function openAddFee(clickEvent) {
|
function openAddFee(clickEvent) {
|
||||||
const feeCategoryId = Number.parseInt(clickEvent.currentTarget.closest('.container--feeCategory').dataset.feeCategoryId, 10);
|
var _a;
|
||||||
|
const feeCategoryId = Number.parseInt((_a = clickEvent.currentTarget.closest('.container--feeCategory').dataset.feeCategoryId) !== null && _a !== void 0 ? _a : '', 10);
|
||||||
let addCloseModalFunction;
|
let addCloseModalFunction;
|
||||||
function doAddFee(submitEvent) {
|
function doAddFee(submitEvent) {
|
||||||
submitEvent.preventDefault();
|
submitEvent.preventDefault();
|
||||||
cityssm.postJSON(los.urlPrefix + '/admin/doAddFee', submitEvent.currentTarget, (rawResponseJSON) => {
|
cityssm.postJSON(`${los.urlPrefix}/admin/doAddFee`, submitEvent.currentTarget, (rawResponseJSON) => {
|
||||||
var _a;
|
var _a;
|
||||||
const responseJSON = rawResponseJSON;
|
const responseJSON = rawResponseJSON;
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
|
|
@ -366,29 +366,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
los.populateAliases(modalElement);
|
los.populateAliases(modalElement);
|
||||||
},
|
},
|
||||||
onshown(modalElement, closeModalFunction) {
|
onshown(modalElement, closeModalFunction) {
|
||||||
|
var _a, _b, _c;
|
||||||
bulmaJS.toggleHtmlClipped();
|
bulmaJS.toggleHtmlClipped();
|
||||||
addCloseModalFunction = closeModalFunction;
|
addCloseModalFunction = closeModalFunction;
|
||||||
modalElement.querySelector('form').addEventListener('submit', doAddFee);
|
(_a = modalElement.querySelector('form')) === null || _a === void 0 ? void 0 : _a.addEventListener('submit', doAddFee);
|
||||||
modalElement.querySelector('#feeAdd--feeName').focus();
|
modalElement.querySelector('#feeAdd--feeName').focus();
|
||||||
modalElement.querySelector('#feeAdd--feeFunction').addEventListener('change', () => {
|
modalElement.querySelector('#feeAdd--feeFunction').addEventListener('change', () => {
|
||||||
|
var _a, _b;
|
||||||
const feeAmountElement = modalElement.querySelector('#feeAdd--feeAmount');
|
const feeAmountElement = modalElement.querySelector('#feeAdd--feeAmount');
|
||||||
const feeFunctionElement = modalElement.querySelector('#feeAdd--feeFunction');
|
const feeFunctionElement = modalElement.querySelector('#feeAdd--feeFunction');
|
||||||
if (feeFunctionElement.value === '') {
|
if (feeFunctionElement.value === '') {
|
||||||
feeFunctionElement
|
(_a = feeFunctionElement
|
||||||
.closest('.select')
|
.closest('.select')) === null || _a === void 0 ? void 0 : _a.classList.remove('is-success');
|
||||||
.classList.remove('is-success');
|
|
||||||
feeAmountElement.classList.add('is-success');
|
feeAmountElement.classList.add('is-success');
|
||||||
feeAmountElement.disabled = false;
|
feeAmountElement.disabled = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
feeFunctionElement.closest('.select').classList.add('is-success');
|
(_b = feeFunctionElement.closest('.select')) === null || _b === void 0 ? void 0 : _b.classList.add('is-success');
|
||||||
feeAmountElement.classList.remove('is-success');
|
feeAmountElement.classList.remove('is-success');
|
||||||
feeAmountElement.disabled = true;
|
feeAmountElement.disabled = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
modalElement
|
(_b = modalElement
|
||||||
.querySelector('#feeAdd--taxPercentage')
|
.querySelector('#feeAdd--taxPercentage')) === null || _b === void 0 ? void 0 : _b.addEventListener('keyup', () => {
|
||||||
.addEventListener('keyup', () => {
|
|
||||||
const taxAmountElement = modalElement.querySelector('#feeAdd--taxAmount');
|
const taxAmountElement = modalElement.querySelector('#feeAdd--taxAmount');
|
||||||
const taxPercentageElement = modalElement.querySelector('#feeAdd--taxPercentage');
|
const taxPercentageElement = modalElement.querySelector('#feeAdd--taxPercentage');
|
||||||
if (taxPercentageElement.value === '') {
|
if (taxPercentageElement.value === '') {
|
||||||
|
|
@ -402,9 +402,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
taxAmountElement.disabled = true;
|
taxAmountElement.disabled = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
modalElement
|
(_c = modalElement
|
||||||
.querySelector('#feeAdd--includeQuantity')
|
.querySelector('#feeAdd--includeQuantity')) === null || _c === void 0 ? void 0 : _c.addEventListener('change', () => {
|
||||||
.addEventListener('change', () => {
|
|
||||||
;
|
;
|
||||||
modalElement.querySelector('#feeAdd--quantityUnit').disabled =
|
modalElement.querySelector('#feeAdd--quantityUnit').disabled =
|
||||||
modalElement.querySelector('#feeAdd--includeQuantity').value === '';
|
modalElement.querySelector('#feeAdd--includeQuantity').value === '';
|
||||||
|
|
@ -416,11 +415,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function openEditFee(clickEvent) {
|
function openEditFee(clickEvent) {
|
||||||
|
var _a;
|
||||||
clickEvent.preventDefault();
|
clickEvent.preventDefault();
|
||||||
const feeContainerElement = clickEvent.currentTarget.closest('.container--fee');
|
const feeContainerElement = clickEvent.currentTarget.closest('.container--fee');
|
||||||
const feeId = Number.parseInt(feeContainerElement.dataset.feeId, 10);
|
const feeId = Number.parseInt(feeContainerElement.dataset.feeId, 10);
|
||||||
const feeCategoryId = Number.parseInt(feeContainerElement.closest('.container--feeCategory')
|
const feeCategoryId = Number.parseInt((_a = feeContainerElement.closest('.container--feeCategory')
|
||||||
.dataset.feeCategoryId);
|
.dataset.feeCategoryId) !== null && _a !== void 0 ? _a : '');
|
||||||
const feeCategory = feeCategories.find((currentFeeCategory) => {
|
const feeCategory = feeCategories.find((currentFeeCategory) => {
|
||||||
return currentFeeCategory.feeCategoryId === feeCategoryId;
|
return currentFeeCategory.feeCategoryId === feeCategoryId;
|
||||||
});
|
});
|
||||||
|
|
@ -431,7 +431,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
let editModalElement;
|
let editModalElement;
|
||||||
function doUpdateFee(submitEvent) {
|
function doUpdateFee(submitEvent) {
|
||||||
submitEvent.preventDefault();
|
submitEvent.preventDefault();
|
||||||
cityssm.postJSON(los.urlPrefix + '/admin/doUpdateFee', submitEvent.currentTarget, (rawResponseJSON) => {
|
cityssm.postJSON(`${los.urlPrefix}/admin/doUpdateFee`, submitEvent.currentTarget, (rawResponseJSON) => {
|
||||||
var _a;
|
var _a;
|
||||||
const responseJSON = rawResponseJSON;
|
const responseJSON = rawResponseJSON;
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
|
|
@ -451,7 +451,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
function confirmDeleteFee(clickEvent) {
|
function confirmDeleteFee(clickEvent) {
|
||||||
clickEvent.preventDefault();
|
clickEvent.preventDefault();
|
||||||
function doDelete() {
|
function doDelete() {
|
||||||
cityssm.postJSON(los.urlPrefix + '/admin/doDeleteFee', {
|
cityssm.postJSON(`${los.urlPrefix}/admin/doDeleteFee`, {
|
||||||
feeId
|
feeId
|
||||||
}, (rawResponseJSON) => {
|
}, (rawResponseJSON) => {
|
||||||
var _a;
|
var _a;
|
||||||
|
|
@ -481,15 +481,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function toggleFeeFields() {
|
function toggleFeeFields() {
|
||||||
|
var _a, _b;
|
||||||
const feeAmountElement = editModalElement.querySelector('#feeEdit--feeAmount');
|
const feeAmountElement = editModalElement.querySelector('#feeEdit--feeAmount');
|
||||||
const feeFunctionElement = editModalElement.querySelector('#feeEdit--feeFunction');
|
const feeFunctionElement = editModalElement.querySelector('#feeEdit--feeFunction');
|
||||||
if (feeFunctionElement.value === '') {
|
if (feeFunctionElement.value === '') {
|
||||||
feeFunctionElement.closest('.select').classList.remove('is-success');
|
(_a = feeFunctionElement.closest('.select')) === null || _a === void 0 ? void 0 : _a.classList.remove('is-success');
|
||||||
feeAmountElement.classList.add('is-success');
|
feeAmountElement.classList.add('is-success');
|
||||||
feeAmountElement.disabled = false;
|
feeAmountElement.disabled = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
feeFunctionElement.closest('.select').classList.add('is-success');
|
(_b = feeFunctionElement.closest('.select')) === null || _b === void 0 ? void 0 : _b.classList.add('is-success');
|
||||||
feeAmountElement.classList.remove('is-success');
|
feeAmountElement.classList.remove('is-success');
|
||||||
feeAmountElement.disabled = true;
|
feeAmountElement.disabled = true;
|
||||||
}
|
}
|
||||||
|
|
@ -514,7 +515,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
}
|
}
|
||||||
cityssm.openHtmlModal('adminFees-editFee', {
|
cityssm.openHtmlModal('adminFees-editFee', {
|
||||||
onshow(modalElement) {
|
onshow(modalElement) {
|
||||||
var _a, _b, _c, _d, _e, _f;
|
var _a, _b, _c, _d, _e, _f, _g;
|
||||||
editModalElement = modalElement;
|
editModalElement = modalElement;
|
||||||
modalElement.querySelector('#feeEdit--feeId').value = fee.feeId.toString();
|
modalElement.querySelector('#feeEdit--feeId').value = fee.feeId.toString();
|
||||||
const feeCategoryElement = modalElement.querySelector('#feeEdit--feeCategoryId');
|
const feeCategoryElement = modalElement.querySelector('#feeEdit--feeCategoryId');
|
||||||
|
|
@ -553,9 +554,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
modalElement.querySelector('#feeEdit--feeAmount').value = fee.feeAmount ? fee.feeAmount.toFixed(2) : '';
|
modalElement.querySelector('#feeEdit--feeAmount').value = fee.feeAmount ? fee.feeAmount.toFixed(2) : '';
|
||||||
modalElement
|
(_d = modalElement
|
||||||
.querySelector('#feeEdit--feeFunction')
|
.querySelector('#feeEdit--feeFunction')) === null || _d === void 0 ? void 0 : _d.addEventListener('change', toggleFeeFields);
|
||||||
.addEventListener('change', toggleFeeFields);
|
|
||||||
toggleFeeFields();
|
toggleFeeFields();
|
||||||
modalElement.querySelector('#feeEdit--taxAmount').value = fee.taxAmount ? fee.taxAmount.toFixed(2) : '';
|
modalElement.querySelector('#feeEdit--taxAmount').value = fee.taxAmount ? fee.taxAmount.toFixed(2) : '';
|
||||||
const taxPercentageElement = modalElement.querySelector('#feeEdit--taxPercentage');
|
const taxPercentageElement = modalElement.querySelector('#feeEdit--taxPercentage');
|
||||||
|
|
@ -565,38 +565,38 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
taxPercentageElement.addEventListener('keyup', toggleTaxFields);
|
taxPercentageElement.addEventListener('keyup', toggleTaxFields);
|
||||||
toggleTaxFields();
|
toggleTaxFields();
|
||||||
const includeQuantityElement = modalElement.querySelector('#feeEdit--includeQuantity');
|
const includeQuantityElement = modalElement.querySelector('#feeEdit--includeQuantity');
|
||||||
if ((_d = fee.includeQuantity) !== null && _d !== void 0 ? _d : false) {
|
if ((_e = fee.includeQuantity) !== null && _e !== void 0 ? _e : false) {
|
||||||
includeQuantityElement.value = '1';
|
includeQuantityElement.value = '1';
|
||||||
}
|
}
|
||||||
includeQuantityElement.addEventListener('change', toggleQuantityFields);
|
includeQuantityElement.addEventListener('change', toggleQuantityFields);
|
||||||
modalElement.querySelector('#feeEdit--quantityUnit').value = (_e = fee.quantityUnit) !== null && _e !== void 0 ? _e : '';
|
modalElement.querySelector('#feeEdit--quantityUnit').value = (_f = fee.quantityUnit) !== null && _f !== void 0 ? _f : '';
|
||||||
toggleQuantityFields();
|
toggleQuantityFields();
|
||||||
if ((_f = fee.isRequired) !== null && _f !== void 0 ? _f : false) {
|
if ((_g = fee.isRequired) !== null && _g !== void 0 ? _g : false) {
|
||||||
;
|
;
|
||||||
modalElement.querySelector('#feeEdit--isRequired').value = '1';
|
modalElement.querySelector('#feeEdit--isRequired').value = '1';
|
||||||
}
|
}
|
||||||
los.populateAliases(modalElement);
|
los.populateAliases(modalElement);
|
||||||
},
|
},
|
||||||
onshown(modalElement, closeModalFunction) {
|
onshown(modalElement, closeModalFunction) {
|
||||||
|
var _a, _b;
|
||||||
bulmaJS.toggleHtmlClipped();
|
bulmaJS.toggleHtmlClipped();
|
||||||
editCloseModalFunction = closeModalFunction;
|
editCloseModalFunction = closeModalFunction;
|
||||||
modalElement
|
(_a = modalElement
|
||||||
.querySelector('form')
|
.querySelector('form')) === null || _a === void 0 ? void 0 : _a.addEventListener('submit', doUpdateFee);
|
||||||
.addEventListener('submit', doUpdateFee);
|
|
||||||
bulmaJS.init(modalElement);
|
bulmaJS.init(modalElement);
|
||||||
modalElement
|
(_b = modalElement
|
||||||
.querySelector('.button--deleteFee')
|
.querySelector('.button--deleteFee')) === null || _b === void 0 ? void 0 : _b.addEventListener('click', confirmDeleteFee);
|
||||||
.addEventListener('click', confirmDeleteFee);
|
|
||||||
},
|
},
|
||||||
onremoved: () => {
|
onremoved() {
|
||||||
bulmaJS.toggleHtmlClipped();
|
bulmaJS.toggleHtmlClipped();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function moveFee(clickEvent) {
|
function moveFee(clickEvent) {
|
||||||
|
var _a;
|
||||||
const buttonElement = clickEvent.currentTarget;
|
const buttonElement = clickEvent.currentTarget;
|
||||||
const feeContainerElement = buttonElement.closest('.container--fee');
|
const feeContainerElement = buttonElement.closest('.container--fee');
|
||||||
const feeId = feeContainerElement.dataset.feeId;
|
const feeId = (_a = feeContainerElement.dataset.feeId) !== null && _a !== void 0 ? _a : '';
|
||||||
cityssm.postJSON(los.urlPrefix +
|
cityssm.postJSON(los.urlPrefix +
|
||||||
'/admin/' +
|
'/admin/' +
|
||||||
(buttonElement.dataset.direction === 'up'
|
(buttonElement.dataset.direction === 'up'
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,16 @@
|
||||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||||
|
/* eslint-disable unicorn/prefer-module */
|
||||||
|
|
||||||
import type * as globalTypes from '../types/globalTypes'
|
import type { BulmaJS } from '@cityssm/bulma-js/types.js'
|
||||||
import type * as recordTypes from '../types/recordTypes'
|
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
|
||||||
|
|
||||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types'
|
import type * as globalTypes from '../types/globalTypes.js'
|
||||||
|
import type * as recordTypes from '../types/recordTypes.js'
|
||||||
import type { BulmaJS } from '@cityssm/bulma-js/types'
|
|
||||||
|
|
||||||
declare const cityssm: cityssmGlobal
|
declare const cityssm: cityssmGlobal
|
||||||
declare const bulmaJS: BulmaJS
|
declare const bulmaJS: BulmaJS
|
||||||
|
|
||||||
|
declare const exports: Record<string, unknown>
|
||||||
;(() => {
|
;(() => {
|
||||||
const los = exports.los as globalTypes.LOS
|
const los = exports.los as globalTypes.LOS
|
||||||
|
|
||||||
|
|
@ -16,7 +18,7 @@ declare const bulmaJS: BulmaJS
|
||||||
'#container--feeCategories'
|
'#container--feeCategories'
|
||||||
) as HTMLElement
|
) as HTMLElement
|
||||||
|
|
||||||
let feeCategories: recordTypes.FeeCategory[] = exports.feeCategories
|
let feeCategories = exports.feeCategories as recordTypes.FeeCategory[]
|
||||||
delete exports.feeCategories
|
delete exports.feeCategories
|
||||||
|
|
||||||
type ResponseJSON =
|
type ResponseJSON =
|
||||||
|
|
@ -48,45 +50,45 @@ declare const bulmaJS: BulmaJS
|
||||||
feeCategoryContainerElement.dataset.feeCategoryId =
|
feeCategoryContainerElement.dataset.feeCategoryId =
|
||||||
feeCategory.feeCategoryId.toString()
|
feeCategory.feeCategoryId.toString()
|
||||||
|
|
||||||
feeCategoryContainerElement.innerHTML =
|
// eslint-disable-next-line no-unsanitized/property
|
||||||
'<div class="panel-heading">' +
|
feeCategoryContainerElement.innerHTML = `<div class="panel-heading">
|
||||||
'<div class="columns">' +
|
<div class="columns">
|
||||||
('<div class="column">' +
|
<div class="column">
|
||||||
'<h2 class="title is-4">' +
|
<h2 class="title is-4">${cityssm.escapeHTML(feeCategory.feeCategory ?? '')}</h2>
|
||||||
cityssm.escapeHTML(feeCategory.feeCategory ?? '') +
|
</div>
|
||||||
'</h2>' +
|
<div class="column is-narrow">
|
||||||
'</div>') +
|
<div class="field is-grouped is-justify-content-end">
|
||||||
('<div class="column is-narrow">' +
|
${
|
||||||
'<div class="field is-grouped is-justify-content-end">' +
|
feeCategory.fees.length === 0
|
||||||
(feeCategory.fees.length === 0
|
? `<div class="control">
|
||||||
? '<div class="control">' +
|
<button class="button is-small is-danger button--deleteFeeCategory" type="button">
|
||||||
'<button class="button is-small is-danger button--deleteFeeCategory" type="button">' +
|
<span class="icon is-small"><i class="fas fa-trash" aria-hidden="true"></i></span>
|
||||||
'<span class="icon is-small"><i class="fas fa-trash" aria-hidden="true"></i></span>' +
|
<span>Delete Category</span>
|
||||||
'<span>Delete Category</span>' +
|
</button>
|
||||||
'</button>' +
|
</div>`
|
||||||
'</div>'
|
: ''
|
||||||
: '') +
|
}
|
||||||
('<div class="control">' +
|
<div class="control">
|
||||||
'<button class="button is-small is-primary button--editFeeCategory" type="button">' +
|
<button class="button is-small is-primary button--editFeeCategory" type="button">
|
||||||
'<span class="icon is-small"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>' +
|
<span class="icon is-small"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>
|
||||||
'<span>Edit Category</span>' +
|
<span>Edit Category</span>
|
||||||
'</button>' +
|
</button>
|
||||||
'</div>') +
|
</div>
|
||||||
('<div class="control">' +
|
<div class="control">
|
||||||
'<button class="button is-small is-success button--addFee" data-cy="addFee" type="button">' +
|
<button class="button is-small is-success button--addFee" data-cy="addFee" type="button">
|
||||||
'<span class="icon is-small"><i class="fas fa-plus" aria-hidden="true"></i></span>' +
|
<span class="icon is-small"><i class="fas fa-plus" aria-hidden="true"></i></span>
|
||||||
'<span>Add Fee</span>' +
|
<span>Add Fee</span>
|
||||||
'</button>' +
|
</button>
|
||||||
'</div>') +
|
</div>
|
||||||
('<div class="control">' +
|
<div class="control">
|
||||||
los.getMoveUpDownButtonFieldHTML(
|
${los.getMoveUpDownButtonFieldHTML(
|
||||||
'button--moveFeeCategoryUp',
|
'button--moveFeeCategoryUp',
|
||||||
'button--moveFeeCategoryDown'
|
'button--moveFeeCategoryDown'
|
||||||
) +
|
)}
|
||||||
'</div>') +
|
</div>
|
||||||
'</div>') +
|
</div>
|
||||||
'</div>' +
|
</div>
|
||||||
'</div>'
|
</div>`
|
||||||
|
|
||||||
if (feeCategory.fees.length === 0) {
|
if (feeCategory.fees.length === 0) {
|
||||||
feeCategoryContainerElement.insertAdjacentHTML(
|
feeCategoryContainerElement.insertAdjacentHTML(
|
||||||
|
|
@ -103,8 +105,8 @@ declare const bulmaJS: BulmaJS
|
||||||
)
|
)
|
||||||
|
|
||||||
feeCategoryContainerElement
|
feeCategoryContainerElement
|
||||||
.querySelector('.button--deleteFeeCategory')!
|
.querySelector('.button--deleteFeeCategory')
|
||||||
.addEventListener('click', confirmDeleteFeeCategory)
|
?.addEventListener('click', confirmDeleteFeeCategory)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const fee of feeCategory.fees) {
|
for (const fee of feeCategory.fees) {
|
||||||
|
|
@ -118,6 +120,7 @@ declare const bulmaJS: BulmaJS
|
||||||
fee.occupancyTypeId !== undefined ||
|
fee.occupancyTypeId !== undefined ||
|
||||||
fee.lotTypeId !== undefined
|
fee.lotTypeId !== undefined
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-unsanitized/property
|
||||||
panelBlockElement.innerHTML =
|
panelBlockElement.innerHTML =
|
||||||
'<div class="columns">' +
|
'<div class="columns">' +
|
||||||
('<div class="column is-half">' +
|
('<div class="column is-half">' +
|
||||||
|
|
@ -128,7 +131,7 @@ declare const bulmaJS: BulmaJS
|
||||||
'<small>' +
|
'<small>' +
|
||||||
cityssm
|
cityssm
|
||||||
.escapeHTML(fee.feeDescription ?? '')
|
.escapeHTML(fee.feeDescription ?? '')
|
||||||
.replace(/\n/g, '<br />') +
|
.replaceAll('\n', '<br />') +
|
||||||
'</small>' +
|
'</small>' +
|
||||||
'</p>' +
|
'</p>' +
|
||||||
(hasTagsBlock
|
(hasTagsBlock
|
||||||
|
|
@ -196,8 +199,8 @@ declare const bulmaJS: BulmaJS
|
||||||
'</div>'
|
'</div>'
|
||||||
|
|
||||||
panelBlockElement
|
panelBlockElement
|
||||||
.querySelector('a')!
|
.querySelector('a')
|
||||||
.addEventListener('click', openEditFee)
|
?.addEventListener('click', openEditFee)
|
||||||
;(
|
;(
|
||||||
panelBlockElement.querySelector(
|
panelBlockElement.querySelector(
|
||||||
'.button--moveFeeUp'
|
'.button--moveFeeUp'
|
||||||
|
|
@ -213,12 +216,12 @@ declare const bulmaJS: BulmaJS
|
||||||
}
|
}
|
||||||
|
|
||||||
feeCategoryContainerElement
|
feeCategoryContainerElement
|
||||||
.querySelector('.button--editFeeCategory')!
|
.querySelector('.button--editFeeCategory')
|
||||||
.addEventListener('click', openEditFeeCategory)
|
?.addEventListener('click', openEditFeeCategory)
|
||||||
|
|
||||||
feeCategoryContainerElement
|
feeCategoryContainerElement
|
||||||
.querySelector('.button--addFee')!
|
.querySelector('.button--addFee')
|
||||||
.addEventListener('click', openAddFee)
|
?.addEventListener('click', openAddFee)
|
||||||
;(
|
;(
|
||||||
feeCategoryContainerElement.querySelector(
|
feeCategoryContainerElement.querySelector(
|
||||||
'.button--moveFeeCategoryUp'
|
'.button--moveFeeCategoryUp'
|
||||||
|
|
@ -239,15 +242,15 @@ declare const bulmaJS: BulmaJS
|
||||||
*/
|
*/
|
||||||
|
|
||||||
document
|
document
|
||||||
.querySelector('#button--addFeeCategory')!
|
.querySelector('#button--addFeeCategory')
|
||||||
.addEventListener('click', () => {
|
?.addEventListener('click', () => {
|
||||||
let addCloseModalFunction: () => void
|
let addCloseModalFunction: () => void
|
||||||
|
|
||||||
function doAddFeeCategory(submitEvent: SubmitEvent): void {
|
function doAddFeeCategory(submitEvent: SubmitEvent): void {
|
||||||
submitEvent.preventDefault()
|
submitEvent.preventDefault()
|
||||||
|
|
||||||
cityssm.postJSON(
|
cityssm.postJSON(
|
||||||
los.urlPrefix + '/admin/doAddFeeCategory',
|
`${los.urlPrefix}/admin/doAddFeeCategory`,
|
||||||
submitEvent.currentTarget,
|
submitEvent.currentTarget,
|
||||||
(rawResponseJSON) => {
|
(rawResponseJSON) => {
|
||||||
const responseJSON = rawResponseJSON as ResponseJSON
|
const responseJSON = rawResponseJSON as ResponseJSON
|
||||||
|
|
@ -278,8 +281,8 @@ declare const bulmaJS: BulmaJS
|
||||||
|
|
||||||
addCloseModalFunction = closeModalFunction
|
addCloseModalFunction = closeModalFunction
|
||||||
modalElement
|
modalElement
|
||||||
.querySelector('form')!
|
.querySelector('form')
|
||||||
.addEventListener('submit', doAddFeeCategory)
|
?.addEventListener('submit', doAddFeeCategory)
|
||||||
},
|
},
|
||||||
onremoved() {
|
onremoved() {
|
||||||
bulmaJS.toggleHtmlClipped()
|
bulmaJS.toggleHtmlClipped()
|
||||||
|
|
@ -312,7 +315,7 @@ declare const bulmaJS: BulmaJS
|
||||||
submitEvent.preventDefault()
|
submitEvent.preventDefault()
|
||||||
|
|
||||||
cityssm.postJSON(
|
cityssm.postJSON(
|
||||||
los.urlPrefix + '/admin/doUpdateFeeCategory',
|
`${los.urlPrefix}/admin/doUpdateFeeCategory`,
|
||||||
submitEvent.currentTarget,
|
submitEvent.currentTarget,
|
||||||
(rawResponseJSON) => {
|
(rawResponseJSON) => {
|
||||||
const responseJSON = rawResponseJSON as ResponseJSON
|
const responseJSON = rawResponseJSON as ResponseJSON
|
||||||
|
|
@ -343,7 +346,7 @@ declare const bulmaJS: BulmaJS
|
||||||
modalElement.querySelector(
|
modalElement.querySelector(
|
||||||
'#feeCategoryEdit--feeCategory'
|
'#feeCategoryEdit--feeCategory'
|
||||||
) as HTMLInputElement
|
) as HTMLInputElement
|
||||||
).value = feeCategory.feeCategory!
|
).value = feeCategory.feeCategory
|
||||||
},
|
},
|
||||||
onshown(modalElement, closeModalFunction) {
|
onshown(modalElement, closeModalFunction) {
|
||||||
bulmaJS.toggleHtmlClipped()
|
bulmaJS.toggleHtmlClipped()
|
||||||
|
|
@ -351,8 +354,8 @@ declare const bulmaJS: BulmaJS
|
||||||
editCloseModalFunction = closeModalFunction
|
editCloseModalFunction = closeModalFunction
|
||||||
|
|
||||||
modalElement
|
modalElement
|
||||||
.querySelector('form')!
|
.querySelector('form')
|
||||||
.addEventListener('submit', doUpdateFeeCategory)
|
?.addEventListener('submit', doUpdateFeeCategory)
|
||||||
;(
|
;(
|
||||||
modalElement.querySelector(
|
modalElement.querySelector(
|
||||||
'#feeCategoryEdit--feeCategory'
|
'#feeCategoryEdit--feeCategory'
|
||||||
|
|
@ -371,13 +374,13 @@ declare const bulmaJS: BulmaJS
|
||||||
(clickEvent.currentTarget as HTMLElement).closest(
|
(clickEvent.currentTarget as HTMLElement).closest(
|
||||||
'.container--feeCategory'
|
'.container--feeCategory'
|
||||||
) as HTMLElement
|
) as HTMLElement
|
||||||
).dataset.feeCategoryId!,
|
).dataset.feeCategoryId ?? '',
|
||||||
10
|
10
|
||||||
)
|
)
|
||||||
|
|
||||||
function doDelete(): void {
|
function doDelete(): void {
|
||||||
cityssm.postJSON(
|
cityssm.postJSON(
|
||||||
los.urlPrefix + '/admin/doDeleteFeeCategory',
|
`${los.urlPrefix}/admin/doDeleteFeeCategory`,
|
||||||
{
|
{
|
||||||
feeCategoryId
|
feeCategoryId
|
||||||
},
|
},
|
||||||
|
|
@ -385,7 +388,7 @@ declare const bulmaJS: BulmaJS
|
||||||
const responseJSON = rawResponseJSON as ResponseJSON
|
const responseJSON = rawResponseJSON as ResponseJSON
|
||||||
|
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
feeCategories = responseJSON.feeCategories!
|
feeCategories = responseJSON.feeCategories
|
||||||
renderFeeCategories()
|
renderFeeCategories()
|
||||||
} else {
|
} else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
|
|
@ -412,9 +415,9 @@ declare const bulmaJS: BulmaJS
|
||||||
function moveFeeCategory(clickEvent: MouseEvent): void {
|
function moveFeeCategory(clickEvent: MouseEvent): void {
|
||||||
const buttonElement = clickEvent.currentTarget as HTMLButtonElement
|
const buttonElement = clickEvent.currentTarget as HTMLButtonElement
|
||||||
|
|
||||||
const feeCategoryId = (
|
const feeCategoryId =
|
||||||
buttonElement.closest('.container--feeCategory') as HTMLElement
|
(buttonElement.closest('.container--feeCategory') as HTMLElement).dataset
|
||||||
).dataset.feeCategoryId!
|
.feeCategoryId ?? ''
|
||||||
|
|
||||||
cityssm.postJSON(
|
cityssm.postJSON(
|
||||||
los.urlPrefix +
|
los.urlPrefix +
|
||||||
|
|
@ -430,7 +433,7 @@ declare const bulmaJS: BulmaJS
|
||||||
const responseJSON = rawResponseJSON as ResponseJSON
|
const responseJSON = rawResponseJSON as ResponseJSON
|
||||||
|
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
feeCategories = responseJSON.feeCategories!
|
feeCategories = responseJSON.feeCategories
|
||||||
renderFeeCategories()
|
renderFeeCategories()
|
||||||
} else {
|
} else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
|
|
@ -453,7 +456,7 @@ declare const bulmaJS: BulmaJS
|
||||||
(clickEvent.currentTarget as HTMLElement).closest(
|
(clickEvent.currentTarget as HTMLElement).closest(
|
||||||
'.container--feeCategory'
|
'.container--feeCategory'
|
||||||
) as HTMLElement
|
) as HTMLElement
|
||||||
).dataset.feeCategoryId!,
|
).dataset.feeCategoryId ?? '',
|
||||||
10
|
10
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -463,7 +466,7 @@ declare const bulmaJS: BulmaJS
|
||||||
submitEvent.preventDefault()
|
submitEvent.preventDefault()
|
||||||
|
|
||||||
cityssm.postJSON(
|
cityssm.postJSON(
|
||||||
los.urlPrefix + '/admin/doAddFee',
|
`${los.urlPrefix}/admin/doAddFee`,
|
||||||
submitEvent.currentTarget,
|
submitEvent.currentTarget,
|
||||||
(rawResponseJSON) => {
|
(rawResponseJSON) => {
|
||||||
const responseJSON = rawResponseJSON as ResponseJSON
|
const responseJSON = rawResponseJSON as ResponseJSON
|
||||||
|
|
@ -492,7 +495,7 @@ declare const bulmaJS: BulmaJS
|
||||||
for (const feeCategory of feeCategories) {
|
for (const feeCategory of feeCategories) {
|
||||||
const optionElement = document.createElement('option')
|
const optionElement = document.createElement('option')
|
||||||
optionElement.value = feeCategory.feeCategoryId.toString()
|
optionElement.value = feeCategory.feeCategoryId.toString()
|
||||||
optionElement.textContent = feeCategory.feeCategory!
|
optionElement.textContent = feeCategory.feeCategory
|
||||||
|
|
||||||
if (feeCategory.feeCategoryId === feeCategoryId) {
|
if (feeCategory.feeCategoryId === feeCategoryId) {
|
||||||
optionElement.selected = true
|
optionElement.selected = true
|
||||||
|
|
@ -536,7 +539,7 @@ declare const bulmaJS: BulmaJS
|
||||||
|
|
||||||
addCloseModalFunction = closeModalFunction
|
addCloseModalFunction = closeModalFunction
|
||||||
|
|
||||||
modalElement.querySelector('form')!.addEventListener('submit', doAddFee)
|
modalElement.querySelector('form')?.addEventListener('submit', doAddFee)
|
||||||
;(
|
;(
|
||||||
modalElement.querySelector('#feeAdd--feeName') as HTMLInputElement
|
modalElement.querySelector('#feeAdd--feeName') as HTMLInputElement
|
||||||
).focus()
|
).focus()
|
||||||
|
|
@ -553,13 +556,13 @@ declare const bulmaJS: BulmaJS
|
||||||
|
|
||||||
if (feeFunctionElement.value === '') {
|
if (feeFunctionElement.value === '') {
|
||||||
feeFunctionElement
|
feeFunctionElement
|
||||||
.closest('.select')!
|
.closest('.select')
|
||||||
.classList.remove('is-success')
|
?.classList.remove('is-success')
|
||||||
|
|
||||||
feeAmountElement.classList.add('is-success')
|
feeAmountElement.classList.add('is-success')
|
||||||
feeAmountElement.disabled = false
|
feeAmountElement.disabled = false
|
||||||
} else {
|
} else {
|
||||||
feeFunctionElement.closest('.select')!.classList.add('is-success')
|
feeFunctionElement.closest('.select')?.classList.add('is-success')
|
||||||
|
|
||||||
feeAmountElement.classList.remove('is-success')
|
feeAmountElement.classList.remove('is-success')
|
||||||
feeAmountElement.disabled = true
|
feeAmountElement.disabled = true
|
||||||
|
|
@ -567,8 +570,8 @@ declare const bulmaJS: BulmaJS
|
||||||
})
|
})
|
||||||
|
|
||||||
modalElement
|
modalElement
|
||||||
.querySelector('#feeAdd--taxPercentage')!
|
.querySelector('#feeAdd--taxPercentage')
|
||||||
.addEventListener('keyup', () => {
|
?.addEventListener('keyup', () => {
|
||||||
const taxAmountElement = modalElement.querySelector(
|
const taxAmountElement = modalElement.querySelector(
|
||||||
'#feeAdd--taxAmount'
|
'#feeAdd--taxAmount'
|
||||||
) as HTMLInputElement
|
) as HTMLInputElement
|
||||||
|
|
@ -591,8 +594,8 @@ declare const bulmaJS: BulmaJS
|
||||||
})
|
})
|
||||||
|
|
||||||
modalElement
|
modalElement
|
||||||
.querySelector('#feeAdd--includeQuantity')!
|
.querySelector('#feeAdd--includeQuantity')
|
||||||
.addEventListener('change', () => {
|
?.addEventListener('change', () => {
|
||||||
;(
|
;(
|
||||||
modalElement.querySelector(
|
modalElement.querySelector(
|
||||||
'#feeAdd--quantityUnit'
|
'#feeAdd--quantityUnit'
|
||||||
|
|
@ -621,7 +624,7 @@ declare const bulmaJS: BulmaJS
|
||||||
const feeId = Number.parseInt(feeContainerElement.dataset.feeId!, 10)
|
const feeId = Number.parseInt(feeContainerElement.dataset.feeId!, 10)
|
||||||
const feeCategoryId = Number.parseInt(
|
const feeCategoryId = Number.parseInt(
|
||||||
(feeContainerElement.closest('.container--feeCategory') as HTMLElement)
|
(feeContainerElement.closest('.container--feeCategory') as HTMLElement)
|
||||||
.dataset.feeCategoryId!
|
.dataset.feeCategoryId ?? ''
|
||||||
)
|
)
|
||||||
|
|
||||||
const feeCategory = feeCategories.find((currentFeeCategory) => {
|
const feeCategory = feeCategories.find((currentFeeCategory) => {
|
||||||
|
|
@ -639,13 +642,13 @@ declare const bulmaJS: BulmaJS
|
||||||
submitEvent.preventDefault()
|
submitEvent.preventDefault()
|
||||||
|
|
||||||
cityssm.postJSON(
|
cityssm.postJSON(
|
||||||
los.urlPrefix + '/admin/doUpdateFee',
|
`${los.urlPrefix}/admin/doUpdateFee`,
|
||||||
submitEvent.currentTarget,
|
submitEvent.currentTarget,
|
||||||
(rawResponseJSON) => {
|
(rawResponseJSON) => {
|
||||||
const responseJSON = rawResponseJSON as ResponseJSON
|
const responseJSON = rawResponseJSON as ResponseJSON
|
||||||
|
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
feeCategories = responseJSON.feeCategories!
|
feeCategories = responseJSON.feeCategories
|
||||||
editCloseModalFunction()
|
editCloseModalFunction()
|
||||||
renderFeeCategories()
|
renderFeeCategories()
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -664,7 +667,7 @@ declare const bulmaJS: BulmaJS
|
||||||
|
|
||||||
function doDelete(): void {
|
function doDelete(): void {
|
||||||
cityssm.postJSON(
|
cityssm.postJSON(
|
||||||
los.urlPrefix + '/admin/doDeleteFee',
|
`${los.urlPrefix}/admin/doDeleteFee`,
|
||||||
{
|
{
|
||||||
feeId
|
feeId
|
||||||
},
|
},
|
||||||
|
|
@ -672,7 +675,7 @@ declare const bulmaJS: BulmaJS
|
||||||
const responseJSON = rawResponseJSON as ResponseJSON
|
const responseJSON = rawResponseJSON as ResponseJSON
|
||||||
|
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
feeCategories = responseJSON.feeCategories!
|
feeCategories = responseJSON.feeCategories
|
||||||
editCloseModalFunction()
|
editCloseModalFunction()
|
||||||
renderFeeCategories()
|
renderFeeCategories()
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -707,12 +710,12 @@ declare const bulmaJS: BulmaJS
|
||||||
) as HTMLSelectElement
|
) as HTMLSelectElement
|
||||||
|
|
||||||
if (feeFunctionElement.value === '') {
|
if (feeFunctionElement.value === '') {
|
||||||
feeFunctionElement.closest('.select')!.classList.remove('is-success')
|
feeFunctionElement.closest('.select')?.classList.remove('is-success')
|
||||||
|
|
||||||
feeAmountElement.classList.add('is-success')
|
feeAmountElement.classList.add('is-success')
|
||||||
feeAmountElement.disabled = false
|
feeAmountElement.disabled = false
|
||||||
} else {
|
} else {
|
||||||
feeFunctionElement.closest('.select')!.classList.add('is-success')
|
feeFunctionElement.closest('.select')?.classList.add('is-success')
|
||||||
|
|
||||||
feeAmountElement.classList.remove('is-success')
|
feeAmountElement.classList.remove('is-success')
|
||||||
feeAmountElement.disabled = true
|
feeAmountElement.disabled = true
|
||||||
|
|
@ -769,7 +772,7 @@ declare const bulmaJS: BulmaJS
|
||||||
for (const feeCategory of feeCategories) {
|
for (const feeCategory of feeCategories) {
|
||||||
const optionElement = document.createElement('option')
|
const optionElement = document.createElement('option')
|
||||||
optionElement.value = feeCategory.feeCategoryId.toString()
|
optionElement.value = feeCategory.feeCategoryId.toString()
|
||||||
optionElement.textContent = feeCategory.feeCategory!
|
optionElement.textContent = feeCategory.feeCategory
|
||||||
|
|
||||||
if (feeCategory.feeCategoryId === feeCategoryId) {
|
if (feeCategory.feeCategoryId === feeCategoryId) {
|
||||||
optionElement.selected = true
|
optionElement.selected = true
|
||||||
|
|
@ -827,8 +830,8 @@ declare const bulmaJS: BulmaJS
|
||||||
).value = fee.feeAmount ? fee.feeAmount.toFixed(2) : ''
|
).value = fee.feeAmount ? fee.feeAmount.toFixed(2) : ''
|
||||||
|
|
||||||
modalElement
|
modalElement
|
||||||
.querySelector('#feeEdit--feeFunction')!
|
.querySelector('#feeEdit--feeFunction')
|
||||||
.addEventListener('change', toggleFeeFields)
|
?.addEventListener('change', toggleFeeFields)
|
||||||
|
|
||||||
toggleFeeFields()
|
toggleFeeFields()
|
||||||
;(
|
;(
|
||||||
|
|
@ -878,16 +881,16 @@ declare const bulmaJS: BulmaJS
|
||||||
editCloseModalFunction = closeModalFunction
|
editCloseModalFunction = closeModalFunction
|
||||||
|
|
||||||
modalElement
|
modalElement
|
||||||
.querySelector('form')!
|
.querySelector('form')
|
||||||
.addEventListener('submit', doUpdateFee)
|
?.addEventListener('submit', doUpdateFee)
|
||||||
|
|
||||||
bulmaJS.init(modalElement)
|
bulmaJS.init(modalElement)
|
||||||
|
|
||||||
modalElement
|
modalElement
|
||||||
.querySelector('.button--deleteFee')!
|
.querySelector('.button--deleteFee')
|
||||||
.addEventListener('click', confirmDeleteFee)
|
?.addEventListener('click', confirmDeleteFee)
|
||||||
},
|
},
|
||||||
onremoved: () => {
|
onremoved() {
|
||||||
bulmaJS.toggleHtmlClipped()
|
bulmaJS.toggleHtmlClipped()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -900,7 +903,7 @@ declare const bulmaJS: BulmaJS
|
||||||
'.container--fee'
|
'.container--fee'
|
||||||
) as HTMLElement
|
) as HTMLElement
|
||||||
|
|
||||||
const feeId = feeContainerElement.dataset.feeId!
|
const feeId = feeContainerElement.dataset.feeId ?? ''
|
||||||
|
|
||||||
cityssm.postJSON(
|
cityssm.postJSON(
|
||||||
los.urlPrefix +
|
los.urlPrefix +
|
||||||
|
|
@ -916,7 +919,7 @@ declare const bulmaJS: BulmaJS
|
||||||
const responseJSON = rawResponseJSON as ResponseJSON
|
const responseJSON = rawResponseJSON as ResponseJSON
|
||||||
|
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
feeCategories = responseJSON.feeCategories!
|
feeCategories = responseJSON.feeCategories
|
||||||
renderFeeCategories()
|
renderFeeCategories()
|
||||||
} else {
|
} else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{var e,a;const t=exports.los;function s(){cityssm.postJSON(t.urlPrefix+"/admin/doBackupDatabase",{},e=>{var a;const t=e;t.success?bulmaJS.alert({title:"Database Backed Up Successfully",message:`Backed up to <strong>${t.fileName}</strong><br />\n To request a copy of the backup, contact your application administrator.`,messageIsHtml:!0,contextualColorName:"success"}):bulmaJS.alert({title:"Error Backing Up Database",message:null!==(a=t.errorMessage)&&void 0!==a?a:"",contextualColorName:"danger"})})}function o(){cityssm.postJSON(t.urlPrefix+"/admin/doCleanupDatabase",{},e=>{var a;const t=e;t.success?bulmaJS.alert({title:"Database Cleaned Up Successfully",message:`${t.inactivatedRecordCount} records inactivated,\n ${t.purgedRecordCount} permanently deleted.`,contextualColorName:"success"}):bulmaJS.alert({title:"Error Cleaning Database",message:null!==(a=t.errorMessage)&&void 0!==a?a:"",contextualColorName:"danger"})})}null===(e=document.querySelector("#button--cleanupDatabase"))||void 0===e||e.addEventListener("click",()=>{bulmaJS.confirm({title:"Cleanup Database",message:"Are you sure you want to cleanup up the database?",okButton:{text:"Yes, Cleanup Database",callbackFunction:o}})}),null===(a=document.querySelector("#button--backupDatabase"))||void 0===a||a.addEventListener("click",()=>{bulmaJS.confirm({title:"Backup Database",message:"Are you sure you want to backup up the database?",okButton:{text:"Yes, Backup Database",callbackFunction:s}})})})();
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{var e,a;const t=exports.los;function s(){cityssm.postJSON(`${t.urlPrefix}/admin/doBackupDatabase`,{},e=>{var a;const t=e;t.success?bulmaJS.alert({title:"Database Backed Up Successfully",message:`Backed up to <strong>${t.fileName}</strong><br />\n To request a copy of the backup, contact your application administrator.`,messageIsHtml:!0,contextualColorName:"success"}):bulmaJS.alert({title:"Error Backing Up Database",message:null!==(a=t.errorMessage)&&void 0!==a?a:"",contextualColorName:"danger"})})}function o(){cityssm.postJSON(`${t.urlPrefix}/admin/doCleanupDatabase`,{},e=>{var a;const t=e;t.success?bulmaJS.alert({title:"Database Cleaned Up Successfully",message:`${t.inactivatedRecordCount} records inactivated,\n ${t.purgedRecordCount} permanently deleted.`,contextualColorName:"success"}):bulmaJS.alert({title:"Error Cleaning Database",message:null!==(a=t.errorMessage)&&void 0!==a?a:"",contextualColorName:"danger"})})}null===(e=document.querySelector("#button--cleanupDatabase"))||void 0===e||e.addEventListener("click",()=>{bulmaJS.confirm({title:"Cleanup Database",message:"Are you sure you want to cleanup up the database?",okButton:{text:"Yes, Cleanup Database",callbackFunction:o}})}),null===(a=document.querySelector("#button--backupDatabase"))||void 0===a||a.addEventListener("click",()=>{bulmaJS.confirm({title:"Backup Database",message:"Are you sure you want to backup up the database?",okButton:{text:"Yes, Backup Database",callbackFunction:s}})})})();
|
||||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue