icons in occupant modals

deepsource-autofix-76c6eb20
Dan Gowans 2023-02-01 10:27:04 -05:00
parent 09d4898b20
commit 06ad0503ae
7 changed files with 187 additions and 83 deletions

View File

@ -476,8 +476,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
let editCloseModalFunction; let editCloseModalFunction;
function editOccupant(submitEvent) { function editOccupant(submitEvent) {
submitEvent.preventDefault(); submitEvent.preventDefault();
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doUpdateLotOccupancyOccupant', editFormElement, (responseJSON) => { cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doUpdateLotOccupancyOccupant', editFormElement, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
lotOccupancyOccupants = responseJSON.lotOccupancyOccupants; lotOccupancyOccupants = responseJSON.lotOccupancyOccupants;
editCloseModalFunction(); editCloseModalFunction();
@ -506,6 +507,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
optionElement.textContent = lotOccupantType.lotOccupantType; optionElement.textContent = lotOccupantType.lotOccupantType;
optionElement.dataset.occupantCommentTitle = optionElement.dataset.occupantCommentTitle =
lotOccupantType.occupantCommentTitle; lotOccupantType.occupantCommentTitle;
optionElement.dataset.fontAwesomeIconClass =
lotOccupantType.fontAwesomeIconClass;
if (lotOccupantType.lotOccupantTypeId === if (lotOccupantType.lotOccupantTypeId ===
lotOccupancyOccupant.lotOccupantTypeId) { lotOccupancyOccupant.lotOccupantTypeId) {
optionElement.selected = true; optionElement.selected = true;
@ -519,10 +522,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
optionElement.textContent = lotOccupancyOccupant.lotOccupantType; optionElement.textContent = lotOccupancyOccupant.lotOccupantType;
optionElement.dataset.occupantCommentTitle = optionElement.dataset.occupantCommentTitle =
lotOccupancyOccupant.occupantCommentTitle; lotOccupancyOccupant.occupantCommentTitle;
optionElement.dataset.fontAwesomeIconClass =
lotOccupancyOccupant.fontAwesomeIconClass;
optionElement.selected = true; optionElement.selected = true;
lotOccupantTypeSelectElement.append(optionElement); lotOccupantTypeSelectElement.append(optionElement);
} }
; modalElement.querySelector('#lotOccupancyOccupantEdit--fontAwesomeIconClass').innerHTML = `<i class="fas fa-fw fa-${lotOccupancyOccupant.fontAwesomeIconClass}" aria-hidden="true"></i>`;
modalElement.querySelector('#lotOccupancyOccupantEdit--occupantName').value = lotOccupancyOccupant.occupantName; modalElement.querySelector('#lotOccupancyOccupantEdit--occupantName').value = lotOccupancyOccupant.occupantName;
modalElement.querySelector('#lotOccupancyOccupantEdit--occupantAddress1').value = lotOccupancyOccupant.occupantAddress1; modalElement.querySelector('#lotOccupancyOccupantEdit--occupantAddress1').value = lotOccupancyOccupant.occupantAddress1;
modalElement.querySelector('#lotOccupancyOccupantEdit--occupantAddress2').value = lotOccupancyOccupant.occupantAddress2; modalElement.querySelector('#lotOccupancyOccupantEdit--occupantAddress2').value = lotOccupancyOccupant.occupantAddress2;
@ -542,9 +547,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
const lotOccupantTypeIdElement = modalElement.querySelector('#lotOccupancyOccupantEdit--lotOccupantTypeId'); const lotOccupantTypeIdElement = modalElement.querySelector('#lotOccupancyOccupantEdit--lotOccupantTypeId');
lotOccupantTypeIdElement.focus(); lotOccupantTypeIdElement.focus();
lotOccupantTypeIdElement.addEventListener('change', () => { lotOccupantTypeIdElement.addEventListener('change', () => {
var _a; var _a, _b;
let occupantCommentTitle = (_a = lotOccupantTypeIdElement.selectedOptions[0].dataset const fontAwesomeIconClass = (_a = lotOccupantTypeIdElement.selectedOptions[0].dataset
.occupantCommentTitle) !== null && _a !== void 0 ? _a : ''; .fontAwesomeIconClass) !== null && _a !== void 0 ? _a : 'user';
modalElement.querySelector('#lotOccupancyOccupantEdit--fontAwesomeIconClass').innerHTML = `<i class="fas fa-fw fa-${fontAwesomeIconClass}" aria-hidden="true"></i>`;
let occupantCommentTitle = (_b = lotOccupantTypeIdElement.selectedOptions[0].dataset
.occupantCommentTitle) !== null && _b !== void 0 ? _b : '';
if (occupantCommentTitle === '') { if (occupantCommentTitle === '') {
occupantCommentTitle = 'Comment'; occupantCommentTitle = 'Comment';
} }
@ -566,8 +574,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doDeleteLotOccupancyOccupant', { cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doDeleteLotOccupancyOccupant', {
lotOccupancyId, lotOccupancyId,
lotOccupantIndex lotOccupantIndex
}, (responseJSON) => { }, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
lotOccupancyOccupants = responseJSON.lotOccupancyOccupants; lotOccupancyOccupants = responseJSON.lotOccupancyOccupants;
renderLotOccupancyOccupants(); renderLotOccupancyOccupants();
@ -706,8 +715,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
let searchFormElement; let searchFormElement;
let searchResultsElement; let searchResultsElement;
function addOccupant(formOrObject) { function addOccupant(formOrObject) {
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doAddLotOccupancyOccupant', formOrObject, (responseJSON) => { cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doAddLotOccupancyOccupant', formOrObject, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
lotOccupancyOccupants = responseJSON.lotOccupancyOccupants; lotOccupancyOccupants = responseJSON.lotOccupancyOccupants;
addCloseModalFunction(); addCloseModalFunction();
@ -758,8 +768,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
} }
searchResultsElement.innerHTML = searchResultsElement.innerHTML =
los.getLoadingParagraphHTML('Searching...'); los.getLoadingParagraphHTML('Searching...');
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doSearchPastOccupants', searchFormElement, (responseJSON) => { cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doSearchPastOccupants', searchFormElement, (rawResponseJSON) => {
var _a, _b, _c, _d, _e, _f, _g, _h; var _a, _b, _c, _d, _e, _f, _g, _h;
const responseJSON = rawResponseJSON;
pastOccupantSearchResults = responseJSON.occupants; pastOccupantSearchResults = responseJSON.occupants;
const panelElement = document.createElement('div'); const panelElement = document.createElement('div');
panelElement.className = 'panel'; panelElement.className = 'panel';
@ -813,6 +824,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
optionElement.textContent = lotOccupantType.lotOccupantType; optionElement.textContent = lotOccupantType.lotOccupantType;
optionElement.dataset.occupantCommentTitle = optionElement.dataset.occupantCommentTitle =
lotOccupantType.occupantCommentTitle; lotOccupantType.occupantCommentTitle;
optionElement.dataset.fontAwesomeIconClass =
lotOccupantType.fontAwesomeIconClass;
lotOccupantTypeSelectElement.append(optionElement); lotOccupantTypeSelectElement.append(optionElement);
lotOccupantTypeCopySelectElement.append(optionElement.cloneNode(true)); lotOccupantTypeCopySelectElement.append(optionElement.cloneNode(true));
} }
@ -826,9 +839,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
const lotOccupantTypeIdElement = modalElement.querySelector('#lotOccupancyOccupantAdd--lotOccupantTypeId'); const lotOccupantTypeIdElement = modalElement.querySelector('#lotOccupancyOccupantAdd--lotOccupantTypeId');
lotOccupantTypeIdElement.focus(); lotOccupantTypeIdElement.focus();
lotOccupantTypeIdElement.addEventListener('change', () => { lotOccupantTypeIdElement.addEventListener('change', () => {
var _a; var _a, _b;
let occupantCommentTitle = (_a = lotOccupantTypeIdElement.selectedOptions[0].dataset const fontAwesomeIconClass = (_a = lotOccupantTypeIdElement.selectedOptions[0].dataset
.occupantCommentTitle) !== null && _a !== void 0 ? _a : ''; .fontAwesomeIconClass) !== null && _a !== void 0 ? _a : 'user';
modalElement.querySelector('#lotOccupancyOccupantAdd--fontAwesomeIconClass').innerHTML = `<i class="fas fa-fw fa-${fontAwesomeIconClass}" aria-hidden="true"></i>`;
let occupantCommentTitle = (_b = lotOccupantTypeIdElement.selectedOptions[0].dataset
.occupantCommentTitle) !== null && _b !== void 0 ? _b : '';
if (occupantCommentTitle === '') { if (occupantCommentTitle === '') {
occupantCommentTitle = 'Comment'; occupantCommentTitle = 'Comment';
} }

View File

@ -14,8 +14,9 @@ function openEditLotOccupancyOccupant(clickEvent) {
let editCloseModalFunction; let editCloseModalFunction;
function editOccupant(submitEvent) { function editOccupant(submitEvent) {
submitEvent.preventDefault(); submitEvent.preventDefault();
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doUpdateLotOccupancyOccupant', editFormElement, (responseJSON) => { cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doUpdateLotOccupancyOccupant', editFormElement, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
lotOccupancyOccupants = responseJSON.lotOccupancyOccupants; lotOccupancyOccupants = responseJSON.lotOccupancyOccupants;
editCloseModalFunction(); editCloseModalFunction();
@ -44,6 +45,8 @@ function openEditLotOccupancyOccupant(clickEvent) {
optionElement.textContent = lotOccupantType.lotOccupantType; optionElement.textContent = lotOccupantType.lotOccupantType;
optionElement.dataset.occupantCommentTitle = optionElement.dataset.occupantCommentTitle =
lotOccupantType.occupantCommentTitle; lotOccupantType.occupantCommentTitle;
optionElement.dataset.fontAwesomeIconClass =
lotOccupantType.fontAwesomeIconClass;
if (lotOccupantType.lotOccupantTypeId === if (lotOccupantType.lotOccupantTypeId ===
lotOccupancyOccupant.lotOccupantTypeId) { lotOccupancyOccupant.lotOccupantTypeId) {
optionElement.selected = true; optionElement.selected = true;
@ -57,10 +60,12 @@ function openEditLotOccupancyOccupant(clickEvent) {
optionElement.textContent = lotOccupancyOccupant.lotOccupantType; optionElement.textContent = lotOccupancyOccupant.lotOccupantType;
optionElement.dataset.occupantCommentTitle = optionElement.dataset.occupantCommentTitle =
lotOccupancyOccupant.occupantCommentTitle; lotOccupancyOccupant.occupantCommentTitle;
optionElement.dataset.fontAwesomeIconClass =
lotOccupancyOccupant.fontAwesomeIconClass;
optionElement.selected = true; optionElement.selected = true;
lotOccupantTypeSelectElement.append(optionElement); lotOccupantTypeSelectElement.append(optionElement);
} }
; modalElement.querySelector('#lotOccupancyOccupantEdit--fontAwesomeIconClass').innerHTML = `<i class="fas fa-fw fa-${lotOccupancyOccupant.fontAwesomeIconClass}" aria-hidden="true"></i>`;
modalElement.querySelector('#lotOccupancyOccupantEdit--occupantName').value = lotOccupancyOccupant.occupantName; modalElement.querySelector('#lotOccupancyOccupantEdit--occupantName').value = lotOccupancyOccupant.occupantName;
modalElement.querySelector('#lotOccupancyOccupantEdit--occupantAddress1').value = lotOccupancyOccupant.occupantAddress1; modalElement.querySelector('#lotOccupancyOccupantEdit--occupantAddress1').value = lotOccupancyOccupant.occupantAddress1;
modalElement.querySelector('#lotOccupancyOccupantEdit--occupantAddress2').value = lotOccupancyOccupant.occupantAddress2; modalElement.querySelector('#lotOccupancyOccupantEdit--occupantAddress2').value = lotOccupancyOccupant.occupantAddress2;
@ -80,9 +85,12 @@ function openEditLotOccupancyOccupant(clickEvent) {
const lotOccupantTypeIdElement = modalElement.querySelector('#lotOccupancyOccupantEdit--lotOccupantTypeId'); const lotOccupantTypeIdElement = modalElement.querySelector('#lotOccupancyOccupantEdit--lotOccupantTypeId');
lotOccupantTypeIdElement.focus(); lotOccupantTypeIdElement.focus();
lotOccupantTypeIdElement.addEventListener('change', () => { lotOccupantTypeIdElement.addEventListener('change', () => {
var _a; var _a, _b;
let occupantCommentTitle = (_a = lotOccupantTypeIdElement.selectedOptions[0].dataset const fontAwesomeIconClass = (_a = lotOccupantTypeIdElement.selectedOptions[0].dataset
.occupantCommentTitle) !== null && _a !== void 0 ? _a : ''; .fontAwesomeIconClass) !== null && _a !== void 0 ? _a : 'user';
modalElement.querySelector('#lotOccupancyOccupantEdit--fontAwesomeIconClass').innerHTML = `<i class="fas fa-fw fa-${fontAwesomeIconClass}" aria-hidden="true"></i>`;
let occupantCommentTitle = (_b = lotOccupantTypeIdElement.selectedOptions[0].dataset
.occupantCommentTitle) !== null && _b !== void 0 ? _b : '';
if (occupantCommentTitle === '') { if (occupantCommentTitle === '') {
occupantCommentTitle = 'Comment'; occupantCommentTitle = 'Comment';
} }
@ -104,8 +112,9 @@ function deleteLotOccupancyOccupant(clickEvent) {
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doDeleteLotOccupancyOccupant', { cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doDeleteLotOccupancyOccupant', {
lotOccupancyId, lotOccupancyId,
lotOccupantIndex lotOccupantIndex
}, (responseJSON) => { }, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
lotOccupancyOccupants = responseJSON.lotOccupancyOccupants; lotOccupancyOccupants = responseJSON.lotOccupancyOccupants;
renderLotOccupancyOccupants(); renderLotOccupancyOccupants();
@ -244,8 +253,9 @@ else {
let searchFormElement; let searchFormElement;
let searchResultsElement; let searchResultsElement;
function addOccupant(formOrObject) { function addOccupant(formOrObject) {
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doAddLotOccupancyOccupant', formOrObject, (responseJSON) => { cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doAddLotOccupancyOccupant', formOrObject, (rawResponseJSON) => {
var _a; var _a;
const responseJSON = rawResponseJSON;
if (responseJSON.success) { if (responseJSON.success) {
lotOccupancyOccupants = responseJSON.lotOccupancyOccupants; lotOccupancyOccupants = responseJSON.lotOccupancyOccupants;
addCloseModalFunction(); addCloseModalFunction();
@ -296,8 +306,9 @@ else {
} }
searchResultsElement.innerHTML = searchResultsElement.innerHTML =
los.getLoadingParagraphHTML('Searching...'); los.getLoadingParagraphHTML('Searching...');
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doSearchPastOccupants', searchFormElement, (responseJSON) => { cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doSearchPastOccupants', searchFormElement, (rawResponseJSON) => {
var _a, _b, _c, _d, _e, _f, _g, _h; var _a, _b, _c, _d, _e, _f, _g, _h;
const responseJSON = rawResponseJSON;
pastOccupantSearchResults = responseJSON.occupants; pastOccupantSearchResults = responseJSON.occupants;
const panelElement = document.createElement('div'); const panelElement = document.createElement('div');
panelElement.className = 'panel'; panelElement.className = 'panel';
@ -351,6 +362,8 @@ else {
optionElement.textContent = lotOccupantType.lotOccupantType; optionElement.textContent = lotOccupantType.lotOccupantType;
optionElement.dataset.occupantCommentTitle = optionElement.dataset.occupantCommentTitle =
lotOccupantType.occupantCommentTitle; lotOccupantType.occupantCommentTitle;
optionElement.dataset.fontAwesomeIconClass =
lotOccupantType.fontAwesomeIconClass;
lotOccupantTypeSelectElement.append(optionElement); lotOccupantTypeSelectElement.append(optionElement);
lotOccupantTypeCopySelectElement.append(optionElement.cloneNode(true)); lotOccupantTypeCopySelectElement.append(optionElement.cloneNode(true));
} }
@ -364,9 +377,12 @@ else {
const lotOccupantTypeIdElement = modalElement.querySelector('#lotOccupancyOccupantAdd--lotOccupantTypeId'); const lotOccupantTypeIdElement = modalElement.querySelector('#lotOccupancyOccupantAdd--lotOccupantTypeId');
lotOccupantTypeIdElement.focus(); lotOccupantTypeIdElement.focus();
lotOccupantTypeIdElement.addEventListener('change', () => { lotOccupantTypeIdElement.addEventListener('change', () => {
var _a; var _a, _b;
let occupantCommentTitle = (_a = lotOccupantTypeIdElement.selectedOptions[0].dataset const fontAwesomeIconClass = (_a = lotOccupantTypeIdElement.selectedOptions[0].dataset
.occupantCommentTitle) !== null && _a !== void 0 ? _a : ''; .fontAwesomeIconClass) !== null && _a !== void 0 ? _a : 'user';
modalElement.querySelector('#lotOccupancyOccupantAdd--fontAwesomeIconClass').innerHTML = `<i class="fas fa-fw fa-${fontAwesomeIconClass}" aria-hidden="true"></i>`;
let occupantCommentTitle = (_b = lotOccupantTypeIdElement.selectedOptions[0].dataset
.occupantCommentTitle) !== null && _b !== void 0 ? _b : '';
if (occupantCommentTitle === '') { if (occupantCommentTitle === '') {
occupantCommentTitle = 'Comment'; occupantCommentTitle = 'Comment';
} }

View File

@ -42,11 +42,13 @@ function openEditLotOccupancyOccupant(clickEvent: Event): void {
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/lotOccupancies/doUpdateLotOccupancyOccupant', los.urlPrefix + '/lotOccupancies/doUpdateLotOccupancyOccupant',
editFormElement, editFormElement,
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as {
errorMessage?: string success: boolean
lotOccupancyOccupants?: recordTypes.LotOccupancyOccupant[] errorMessage?: string
}) => { lotOccupancyOccupants?: recordTypes.LotOccupancyOccupant[]
}
if (responseJSON.success) { if (responseJSON.success) {
lotOccupancyOccupants = responseJSON.lotOccupancyOccupants! lotOccupancyOccupants = responseJSON.lotOccupancyOccupants!
editCloseModalFunction() editCloseModalFunction()
@ -86,9 +88,13 @@ function openEditLotOccupancyOccupant(clickEvent: Event): void {
const optionElement = document.createElement('option') const optionElement = document.createElement('option')
optionElement.value = lotOccupantType.lotOccupantTypeId.toString() optionElement.value = lotOccupantType.lotOccupantTypeId.toString()
optionElement.textContent = lotOccupantType.lotOccupantType optionElement.textContent = lotOccupantType.lotOccupantType
optionElement.dataset.occupantCommentTitle = optionElement.dataset.occupantCommentTitle =
lotOccupantType.occupantCommentTitle lotOccupantType.occupantCommentTitle
optionElement.dataset.fontAwesomeIconClass =
lotOccupantType.fontAwesomeIconClass
if ( if (
lotOccupantType.lotOccupantTypeId === lotOccupantType.lotOccupantTypeId ===
lotOccupancyOccupant.lotOccupantTypeId lotOccupancyOccupant.lotOccupantTypeId
@ -105,13 +111,21 @@ function openEditLotOccupancyOccupant(clickEvent: Event): void {
optionElement.value = lotOccupancyOccupant.lotOccupantTypeId!.toString() optionElement.value = lotOccupancyOccupant.lotOccupantTypeId!.toString()
optionElement.textContent = lotOccupancyOccupant.lotOccupantType! optionElement.textContent = lotOccupancyOccupant.lotOccupantType!
optionElement.dataset.occupantCommentTitle = optionElement.dataset.occupantCommentTitle =
lotOccupancyOccupant.occupantCommentTitle! lotOccupancyOccupant.occupantCommentTitle!
optionElement.dataset.fontAwesomeIconClass =
lotOccupancyOccupant.fontAwesomeIconClass!
optionElement.selected = true optionElement.selected = true
lotOccupantTypeSelectElement.append(optionElement) lotOccupantTypeSelectElement.append(optionElement)
} }
modalElement.querySelector(
'#lotOccupancyOccupantEdit--fontAwesomeIconClass'
)!.innerHTML = `<i class="fas fa-fw fa-${lotOccupancyOccupant.fontAwesomeIconClass!}" aria-hidden="true"></i>`
;( ;(
modalElement.querySelector( modalElement.querySelector(
'#lotOccupancyOccupantEdit--occupantName' '#lotOccupancyOccupantEdit--occupantName'
@ -176,6 +190,14 @@ function openEditLotOccupancyOccupant(clickEvent: Event): void {
lotOccupantTypeIdElement.focus() lotOccupantTypeIdElement.focus()
lotOccupantTypeIdElement.addEventListener('change', () => { lotOccupantTypeIdElement.addEventListener('change', () => {
const fontAwesomeIconClass =
lotOccupantTypeIdElement.selectedOptions[0].dataset
.fontAwesomeIconClass ?? 'user'
modalElement.querySelector(
'#lotOccupancyOccupantEdit--fontAwesomeIconClass'
)!.innerHTML = `<i class="fas fa-fw fa-${fontAwesomeIconClass}" aria-hidden="true"></i>`
let occupantCommentTitle = let occupantCommentTitle =
lotOccupantTypeIdElement.selectedOptions[0].dataset lotOccupantTypeIdElement.selectedOptions[0].dataset
.occupantCommentTitle ?? '' .occupantCommentTitle ?? ''
@ -213,11 +235,13 @@ function deleteLotOccupancyOccupant(clickEvent: Event): void {
lotOccupancyId, lotOccupancyId,
lotOccupantIndex lotOccupantIndex
}, },
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as {
errorMessage?: string success: boolean
lotOccupancyOccupants: recordTypes.LotOccupancyOccupant[] errorMessage?: string
}) => { lotOccupancyOccupants: recordTypes.LotOccupancyOccupant[]
}
if (responseJSON.success) { if (responseJSON.success) {
lotOccupancyOccupants = responseJSON.lotOccupancyOccupants lotOccupancyOccupants = responseJSON.lotOccupancyOccupants
renderLotOccupancyOccupants() renderLotOccupancyOccupants()
@ -389,11 +413,13 @@ document
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/lotOccupancies/doAddLotOccupancyOccupant', los.urlPrefix + '/lotOccupancies/doAddLotOccupancyOccupant',
formOrObject, formOrObject,
(responseJSON: { (rawResponseJSON) => {
success: boolean const responseJSON = rawResponseJSON as {
errorMessage?: string success: boolean
lotOccupancyOccupants?: recordTypes.LotOccupancyOccupant[] errorMessage?: string
}) => { lotOccupancyOccupants?: recordTypes.LotOccupancyOccupant[]
}
if (responseJSON.success) { if (responseJSON.success) {
lotOccupancyOccupants = responseJSON.lotOccupancyOccupants! lotOccupancyOccupants = responseJSON.lotOccupancyOccupants!
addCloseModalFunction() addCloseModalFunction()
@ -471,7 +497,11 @@ document
cityssm.postJSON( cityssm.postJSON(
los.urlPrefix + '/lotOccupancies/doSearchPastOccupants', los.urlPrefix + '/lotOccupancies/doSearchPastOccupants',
searchFormElement, searchFormElement,
(responseJSON: { occupants: recordTypes.LotOccupancyOccupant[] }) => { (rawResponseJSON) => {
const responseJSON = rawResponseJSON as {
occupants: recordTypes.LotOccupancyOccupant[]
}
pastOccupantSearchResults = responseJSON.occupants pastOccupantSearchResults = responseJSON.occupants
const panelElement = document.createElement('div') const panelElement = document.createElement('div')
@ -542,9 +572,13 @@ document
const optionElement = document.createElement('option') const optionElement = document.createElement('option')
optionElement.value = lotOccupantType.lotOccupantTypeId.toString() optionElement.value = lotOccupantType.lotOccupantTypeId.toString()
optionElement.textContent = lotOccupantType.lotOccupantType optionElement.textContent = lotOccupantType.lotOccupantType
optionElement.dataset.occupantCommentTitle = optionElement.dataset.occupantCommentTitle =
lotOccupantType.occupantCommentTitle lotOccupantType.occupantCommentTitle
optionElement.dataset.fontAwesomeIconClass =
lotOccupantType.fontAwesomeIconClass
lotOccupantTypeSelectElement.append(optionElement) lotOccupantTypeSelectElement.append(optionElement)
lotOccupantTypeCopySelectElement.append(optionElement.cloneNode(true)) lotOccupantTypeCopySelectElement.append(optionElement.cloneNode(true))
@ -572,6 +606,14 @@ document
lotOccupantTypeIdElement.focus() lotOccupantTypeIdElement.focus()
lotOccupantTypeIdElement.addEventListener('change', () => { lotOccupantTypeIdElement.addEventListener('change', () => {
const fontAwesomeIconClass =
lotOccupantTypeIdElement.selectedOptions[0].dataset
.fontAwesomeIconClass ?? 'user'
modalElement.querySelector(
'#lotOccupancyOccupantAdd--fontAwesomeIconClass'
)!.innerHTML = `<i class="fas fa-fw fa-${fontAwesomeIconClass}" aria-hidden="true"></i>`
let occupantCommentTitle = let occupantCommentTitle =
lotOccupantTypeIdElement.selectedOptions[0].dataset lotOccupantTypeIdElement.selectedOptions[0].dataset
.occupantCommentTitle ?? '' .occupantCommentTitle ?? ''

View File

@ -15,10 +15,20 @@
<div class="tabs is-boxed"> <div class="tabs is-boxed">
<ul> <ul>
<li class="is-active"> <li class="is-active">
<a href="#tab--lotOccupancyOccupantAdd-new">Create New</a> <a href="#tab--lotOccupancyOccupantAdd-new">
<span class="icon is-small">
<i class="fas fa-plus" aria-hidden="true"></i>
</span>
<span>Create New</span>
</a>
</li> </li>
<li> <li>
<a href="#tab--lotOccupancyOccupantAdd-copy">Copy Previous</a> <a href="#tab--lotOccupancyOccupantAdd-copy">
<span class="icon is-small">
<i class="fas fa-copy" aria-hidden="true"></i>
</span>
<span>Copy Previous</span>
</a>
</li> </li>
</ul> </ul>
</div> </div>
@ -31,23 +41,28 @@
type="hidden" type="hidden"
value="" value=""
/> />
<div class="field"> <label
<label class="label"
class="label" for="lotOccupancyOccupantAdd--lotOccupantTypeId"
for="lotOccupancyOccupantAdd--lotOccupantTypeId" ><span class="alias" data-alias="Occupant"></span> Type</label
><span class="alias" data-alias="Occupant"></span> Type</label >
> <div class="field has-addons">
<div class="control"> <div class="control is-expanded">
<div class="select is-fullwidth"> <div class="select is-fullwidth">
<select <select
id="lotOccupancyOccupantAdd--lotOccupantTypeId" id="lotOccupancyOccupantAdd--lotOccupantTypeId"
name="lotOccupantTypeId" name="lotOccupantTypeId"
required required
> >
<option value="">(Select a Type)</option> <option value="" data-font-awesome-icon-class="user">(Select a Type)</option>
</select> </select>
</div> </div>
</div> </div>
<div class="control">
<span class="button is-static" id="lotOccupancyOccupantAdd--fontAwesomeIconClass">
<i class="fas fa-fw fa-user" aria-hidden="true"></i>
</span>
</div>
</div> </div>
<div class="field"> <div class="field">
<label class="label" for="lotOccupancyOccupantAdd--occupantName" <label class="label" for="lotOccupancyOccupantAdd--occupantName"
@ -156,13 +171,13 @@
</div> </div>
<div class="columns"> <div class="columns">
<div class="column"> <div class="column">
<label
class="label"
for="lotOccupancyOccupantAdd--occupantPhoneNumber"
>Phone Number</label
>
<div class="field"> <div class="field">
<label <div class="control has-icons-left">
class="label"
for="lotOccupancyOccupantAdd--occupantPhoneNumber"
>Phone Number</label
>
<div class="control">
<input <input
class="input" class="input"
id="lotOccupancyOccupantAdd--occupantPhoneNumber" id="lotOccupancyOccupantAdd--occupantPhoneNumber"
@ -171,17 +186,20 @@
maxlength="30" maxlength="30"
autocomplete="off" autocomplete="off"
/> />
<span class="icon is-small is-left">
<i class="fas fa-phone" aria-hidden="true"></i>
</span>
</div> </div>
</div> </div>
</div> </div>
<div class="column"> <div class="column">
<label
class="label"
for="lotOccupancyOccupantAdd--occupantEmailAddress"
>Email Address</label
>
<div class="field"> <div class="field">
<label <div class="control has-icons-left">
class="label"
for="lotOccupancyOccupantAdd--occupantEmailAddress"
>Email Address</label
>
<div class="control">
<input <input
class="input" class="input"
id="lotOccupancyOccupantAdd--occupantEmailAddress" id="lotOccupancyOccupantAdd--occupantEmailAddress"
@ -190,6 +208,9 @@
maxlength="200" maxlength="200"
autocomplete="off" autocomplete="off"
/> />
<span class="icon is-small is-left">
<i class="fas fa-envelope" aria-hidden="true"></i>
</span>
</div> </div>
</div> </div>
</div> </div>

View File

@ -25,11 +25,11 @@
type="hidden" type="hidden"
value="" value=""
/> />
<div class="field"> <label class="label" for="lotOccupancyOccupantEdit--lotOccupantTypeId"
<label class="label" for="lotOccupancyOccupantEdit--lotOccupantTypeId" ><span class="alias" data-alias="Occupant"></span> Type</label
><span class="alias" data-alias="Occupant"></span> Type</label >
> <div class="field has-addons">
<div class="control"> <div class="control is-expanded">
<div class="select is-fullwidth"> <div class="select is-fullwidth">
<select <select
id="lotOccupancyOccupantEdit--lotOccupantTypeId" id="lotOccupancyOccupantEdit--lotOccupantTypeId"
@ -38,6 +38,9 @@
></select> ></select>
</div> </div>
</div> </div>
<div class="control">
<span class="button is-static" id="lotOccupancyOccupantEdit--fontAwesomeIconClass"></span>
</div>
</div> </div>
<div class="field"> <div class="field">
<label class="label" for="lotOccupancyOccupantEdit--occupantName" <label class="label" for="lotOccupancyOccupantEdit--occupantName"
@ -142,13 +145,13 @@
</div> </div>
<div class="columns"> <div class="columns">
<div class="column"> <div class="column">
<label
class="label"
for="lotOccupancyOccupantEdit--occupantPhoneNumber"
>Phone Number</label
>
<div class="field"> <div class="field">
<label <div class="control has-icons-left">
class="label"
for="lotOccupancyOccupantEdit--occupantPhoneNumber"
>Phone Number</label
>
<div class="control">
<input <input
class="input" class="input"
id="lotOccupancyOccupantEdit--occupantPhoneNumber" id="lotOccupancyOccupantEdit--occupantPhoneNumber"
@ -157,17 +160,20 @@
maxlength="30" maxlength="30"
autocomplete="off" autocomplete="off"
/> />
<span class="icon is-small is-left">
<i class="fas fa-phone" aria-hidden="true"></i>
</span>
</div> </div>
</div> </div>
</div> </div>
<div class="column"> <div class="column">
<label
class="label"
for="lotOccupancyOccupantEdit--occupantEmailAddress"
>Email Address</label
>
<div class="field"> <div class="field">
<label <div class="control has-icons-left">
class="label"
for="lotOccupancyOccupantEdit--occupantEmailAddress"
>Email Address</label
>
<div class="control">
<input <input
class="input" class="input"
id="lotOccupancyOccupantEdit--occupantEmailAddress" id="lotOccupancyOccupantEdit--occupantEmailAddress"
@ -176,6 +182,9 @@
maxlength="200" maxlength="200"
autocomplete="off" autocomplete="off"
/> />
<span class="icon is-small is-left">
<i class="fas fa-envelope" aria-hidden="true"></i>
</span>
</div> </div>
</div> </div>
</div> </div>

File diff suppressed because one or more lines are too long

View File

@ -380,11 +380,11 @@
<% } else { %> <% } else { %>
<table class="table is-fullwidth is-striped is-hoverable"> <table class="table is-fullwidth is-striped is-hoverable">
<thead> <thead>
<tr> <tr>
<th>Date</th> <th>Date</th>
<th><%= configFunctions.getProperty("aliases.externalReceiptNumber") %></th> <th><%= configFunctions.getProperty("aliases.externalReceiptNumber") %></th>
<th class="has-text-right">Amount</th> <th class="has-text-right">Amount</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% let transactionTotal = 0; %> <% let transactionTotal = 0; %>