work order edit add modal focus
parent
f2d481fffc
commit
82f0c902a2
|
|
@ -2,7 +2,7 @@
|
|||
/* eslint-disable spaced-comment, @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
var _a, _b;
|
||||
var _a, _b, _c;
|
||||
const los = exports.los;
|
||||
const workOrderId = document.querySelector('#workOrderEdit--workOrderId').value;
|
||||
const isCreate = workOrderId === '';
|
||||
|
|
@ -136,7 +136,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
*/
|
||||
if (!isCreate) {
|
||||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/indent */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
var _a, _b;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
let workOrderLots = exports.workOrderLots;
|
||||
delete exports.workOrderLots;
|
||||
|
|
@ -502,9 +504,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}
|
||||
});
|
||||
}
|
||||
document
|
||||
.querySelector('#button--addLotOccupancy')
|
||||
.addEventListener('click', () => {
|
||||
(_a = document
|
||||
.querySelector('#button--addLotOccupancy')) === null || _a === void 0 ? void 0 : _a.addEventListener('click', () => {
|
||||
let searchFormElement;
|
||||
let searchResultsContainerElement;
|
||||
function doSearch(event) {
|
||||
|
|
@ -517,8 +518,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
var _a, _b;
|
||||
if (responseJSON.lotOccupancies.length === 0) {
|
||||
searchResultsContainerElement.innerHTML = `<div class="message is-info">
|
||||
<p class="message-body">There are no records that meet the search criteria.</p>
|
||||
</div>`;
|
||||
<p class="message-body">There are no records that meet the search criteria.</p>
|
||||
</div>`;
|
||||
return;
|
||||
}
|
||||
searchResultsContainerElement.innerHTML = `<table class="table is-fullwidth is-striped is-hoverable">
|
||||
|
|
@ -593,12 +594,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
},
|
||||
onshown(modalElement) {
|
||||
bulmaJS.toggleHtmlClipped();
|
||||
modalElement.querySelector('#lotOccupancySearch--occupantName').addEventListener('change', doSearch);
|
||||
const occupantNameElement = modalElement.querySelector('#lotOccupancySearch--occupantName');
|
||||
occupantNameElement.addEventListener('change', doSearch);
|
||||
occupantNameElement.focus();
|
||||
modalElement.querySelector('#lotOccupancySearch--lotName').addEventListener('change', doSearch);
|
||||
searchFormElement.addEventListener('submit', doSearch);
|
||||
},
|
||||
onremoved() {
|
||||
bulmaJS.toggleHtmlClipped();
|
||||
document.querySelector('#button--addLotOccupancy').focus();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
@ -611,7 +615,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}
|
||||
});
|
||||
}
|
||||
document.querySelector('#button--addLot').addEventListener('click', () => {
|
||||
(_b = document.querySelector('#button--addLot')) === null || _b === void 0 ? void 0 : _b.addEventListener('click', () => {
|
||||
let searchFormElement;
|
||||
let searchResultsContainerElement;
|
||||
function doSearch(event) {
|
||||
|
|
@ -683,9 +687,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
},
|
||||
onshown(modalElement) {
|
||||
bulmaJS.toggleHtmlClipped();
|
||||
modalElement
|
||||
.querySelector('#lotSearch--lotName')
|
||||
.addEventListener('change', doSearch);
|
||||
const lotNameElement = modalElement.querySelector('#lotSearch--lotName');
|
||||
lotNameElement.addEventListener('change', doSearch);
|
||||
lotNameElement.focus();
|
||||
modalElement
|
||||
.querySelector('#lotSearch--lotStatusId')
|
||||
.addEventListener('change', doSearch);
|
||||
|
|
@ -693,6 +697,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
},
|
||||
onremoved() {
|
||||
bulmaJS.toggleHtmlClipped();
|
||||
document.querySelector('#button--addLot').focus();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
@ -799,17 +804,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
const containerElement = document.querySelector('#container--workOrderComments');
|
||||
if (workOrderComments.length === 0) {
|
||||
containerElement.innerHTML = `<div class="message is-info">
|
||||
<p class="message-body">There are no comments to display.</p>
|
||||
</div>`;
|
||||
<p class="message-body">There are no comments to display.</p>
|
||||
</div>`;
|
||||
return;
|
||||
}
|
||||
const tableElement = document.createElement('table');
|
||||
tableElement.className = 'table is-fullwidth is-striped is-hoverable';
|
||||
tableElement.innerHTML = `<thead><tr>
|
||||
<th>Commentor</th>
|
||||
<th>Comment Date</th>
|
||||
<th>Comment</th>
|
||||
<th class="is-hidden-print"><span class="is-sr-only">Options</span></th></tr></thead><tbody></tbody>`;
|
||||
<th>Commentor</th>
|
||||
<th>Comment Date</th>
|
||||
<th>Comment</th>
|
||||
<th class="is-hidden-print"><span class="is-sr-only">Options</span></th></tr></thead><tbody></tbody>`;
|
||||
for (const workOrderComment of workOrderComments) {
|
||||
const tableRowElement = document.createElement('tr');
|
||||
tableRowElement.dataset.workOrderCommentId =
|
||||
|
|
@ -1122,9 +1127,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
exports.workOrderMilestones;
|
||||
delete exports.workOrderMilestones;
|
||||
renderMilestones();
|
||||
document
|
||||
.querySelector('#button--addMilestone')
|
||||
.addEventListener('click', () => {
|
||||
(_c = document
|
||||
.querySelector('#button--addMilestone')) === null || _c === void 0 ? void 0 : _c.addEventListener('click', () => {
|
||||
let addModalElement;
|
||||
let addFormElement;
|
||||
let addCloseModalFunction;
|
||||
|
|
@ -1177,11 +1181,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
los.initializeDatePickers(modalElement);
|
||||
// los.initializeTimePickers(modalElement);
|
||||
bulmaJS.toggleHtmlClipped();
|
||||
modalElement.querySelector('#milestoneAdd--workOrderMilestoneTypeId').focus();
|
||||
addFormElement = modalElement.querySelector('form');
|
||||
addFormElement.addEventListener('submit', doAdd);
|
||||
},
|
||||
onremoved() {
|
||||
bulmaJS.toggleHtmlClipped();
|
||||
document.querySelector('#button--addMilestone').focus();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* eslint-disable spaced-comment, @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
(() => {
|
||||
var _a, _b;
|
||||
var _a, _b, _c;
|
||||
const los = exports.los;
|
||||
const workOrderId = document.querySelector('#workOrderEdit--workOrderId').value;
|
||||
const isCreate = workOrderId === '';
|
||||
|
|
@ -377,9 +377,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
exports.workOrderMilestones;
|
||||
delete exports.workOrderMilestones;
|
||||
renderMilestones();
|
||||
document
|
||||
.querySelector('#button--addMilestone')
|
||||
.addEventListener('click', () => {
|
||||
(_c = document
|
||||
.querySelector('#button--addMilestone')) === null || _c === void 0 ? void 0 : _c.addEventListener('click', () => {
|
||||
let addModalElement;
|
||||
let addFormElement;
|
||||
let addCloseModalFunction;
|
||||
|
|
@ -432,11 +431,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
los.initializeDatePickers(modalElement);
|
||||
// los.initializeTimePickers(modalElement);
|
||||
bulmaJS.toggleHtmlClipped();
|
||||
modalElement.querySelector('#milestoneAdd--workOrderMilestoneTypeId').focus();
|
||||
addFormElement = modalElement.querySelector('form');
|
||||
addFormElement.addEventListener('submit', doAdd);
|
||||
},
|
||||
onremoved() {
|
||||
bulmaJS.toggleHtmlClipped();
|
||||
document.querySelector('#button--addMilestone').focus();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -548,8 +548,8 @@ declare const bulmaJS: BulmaJS
|
|||
renderMilestones()
|
||||
|
||||
document
|
||||
.querySelector('#button--addMilestone')!
|
||||
.addEventListener('click', () => {
|
||||
.querySelector('#button--addMilestone')
|
||||
?.addEventListener('click', () => {
|
||||
let addModalElement: HTMLElement
|
||||
let addFormElement: HTMLFormElement
|
||||
let addCloseModalFunction: () => void
|
||||
|
|
@ -579,14 +579,17 @@ declare const bulmaJS: BulmaJS
|
|||
)
|
||||
}
|
||||
|
||||
if ((
|
||||
addModalElement.querySelector(
|
||||
'#milestoneAdd--workOrderMilestoneDateString'
|
||||
) as HTMLInputElement
|
||||
).value < currentDateString) {
|
||||
if (
|
||||
(
|
||||
addModalElement.querySelector(
|
||||
'#milestoneAdd--workOrderMilestoneDateString'
|
||||
) as HTMLInputElement
|
||||
).value < currentDateString
|
||||
) {
|
||||
bulmaJS.confirm({
|
||||
title: 'Milestone Date in the Past',
|
||||
message: 'Are you sure you want to create a milestone with a date in the past?',
|
||||
message:
|
||||
'Are you sure you want to create a milestone with a date in the past?',
|
||||
contextualColorName: 'warning',
|
||||
okButton: {
|
||||
text: 'Yes, Create a Past Milestone',
|
||||
|
|
@ -634,12 +637,22 @@ declare const bulmaJS: BulmaJS
|
|||
// los.initializeTimePickers(modalElement);
|
||||
|
||||
bulmaJS.toggleHtmlClipped()
|
||||
;(
|
||||
modalElement.querySelector(
|
||||
'#milestoneAdd--workOrderMilestoneTypeId'
|
||||
) as HTMLSelectElement
|
||||
).focus()
|
||||
|
||||
addFormElement = modalElement.querySelector('form')!
|
||||
addFormElement.addEventListener('submit', doAdd)
|
||||
},
|
||||
onremoved() {
|
||||
bulmaJS.toggleHtmlClipped()
|
||||
;(
|
||||
document.querySelector(
|
||||
'#button--addMilestone'
|
||||
) as HTMLButtonElement
|
||||
).focus()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -96,17 +96,17 @@ function renderWorkOrderComments() {
|
|||
const containerElement = document.querySelector('#container--workOrderComments');
|
||||
if (workOrderComments.length === 0) {
|
||||
containerElement.innerHTML = `<div class="message is-info">
|
||||
<p class="message-body">There are no comments to display.</p>
|
||||
</div>`;
|
||||
<p class="message-body">There are no comments to display.</p>
|
||||
</div>`;
|
||||
return;
|
||||
}
|
||||
const tableElement = document.createElement('table');
|
||||
tableElement.className = 'table is-fullwidth is-striped is-hoverable';
|
||||
tableElement.innerHTML = `<thead><tr>
|
||||
<th>Commentor</th>
|
||||
<th>Comment Date</th>
|
||||
<th>Comment</th>
|
||||
<th class="is-hidden-print"><span class="is-sr-only">Options</span></th></tr></thead><tbody></tbody>`;
|
||||
<th>Commentor</th>
|
||||
<th>Comment Date</th>
|
||||
<th>Comment</th>
|
||||
<th class="is-hidden-print"><span class="is-sr-only">Options</span></th></tr></thead><tbody></tbody>`;
|
||||
for (const workOrderComment of workOrderComments) {
|
||||
const tableRowElement = document.createElement('tr');
|
||||
tableRowElement.dataset.workOrderCommentId =
|
||||
|
|
|
|||
|
|
@ -167,18 +167,18 @@ function renderWorkOrderComments(): void {
|
|||
|
||||
if (workOrderComments.length === 0) {
|
||||
containerElement.innerHTML = `<div class="message is-info">
|
||||
<p class="message-body">There are no comments to display.</p>
|
||||
</div>`
|
||||
<p class="message-body">There are no comments to display.</p>
|
||||
</div>`
|
||||
return
|
||||
}
|
||||
|
||||
const tableElement = document.createElement('table')
|
||||
tableElement.className = 'table is-fullwidth is-striped is-hoverable'
|
||||
tableElement.innerHTML = `<thead><tr>
|
||||
<th>Commentor</th>
|
||||
<th>Comment Date</th>
|
||||
<th>Comment</th>
|
||||
<th class="is-hidden-print"><span class="is-sr-only">Options</span></th></tr></thead><tbody></tbody>`
|
||||
<th>Commentor</th>
|
||||
<th>Comment Date</th>
|
||||
<th>Comment</th>
|
||||
<th class="is-hidden-print"><span class="is-sr-only">Options</span></th></tr></thead><tbody></tbody>`
|
||||
|
||||
for (const workOrderComment of workOrderComments) {
|
||||
const tableRowElement = document.createElement('tr')
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/indent */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
var _a, _b;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
let workOrderLots = exports.workOrderLots;
|
||||
delete exports.workOrderLots;
|
||||
|
|
@ -365,9 +367,8 @@ function doAddLotOccupancy(clickEvent) {
|
|||
}
|
||||
});
|
||||
}
|
||||
document
|
||||
.querySelector('#button--addLotOccupancy')
|
||||
.addEventListener('click', () => {
|
||||
(_a = document
|
||||
.querySelector('#button--addLotOccupancy')) === null || _a === void 0 ? void 0 : _a.addEventListener('click', () => {
|
||||
let searchFormElement;
|
||||
let searchResultsContainerElement;
|
||||
function doSearch(event) {
|
||||
|
|
@ -380,8 +381,8 @@ document
|
|||
var _a, _b;
|
||||
if (responseJSON.lotOccupancies.length === 0) {
|
||||
searchResultsContainerElement.innerHTML = `<div class="message is-info">
|
||||
<p class="message-body">There are no records that meet the search criteria.</p>
|
||||
</div>`;
|
||||
<p class="message-body">There are no records that meet the search criteria.</p>
|
||||
</div>`;
|
||||
return;
|
||||
}
|
||||
searchResultsContainerElement.innerHTML = `<table class="table is-fullwidth is-striped is-hoverable">
|
||||
|
|
@ -456,12 +457,15 @@ document
|
|||
},
|
||||
onshown(modalElement) {
|
||||
bulmaJS.toggleHtmlClipped();
|
||||
modalElement.querySelector('#lotOccupancySearch--occupantName').addEventListener('change', doSearch);
|
||||
const occupantNameElement = modalElement.querySelector('#lotOccupancySearch--occupantName');
|
||||
occupantNameElement.addEventListener('change', doSearch);
|
||||
occupantNameElement.focus();
|
||||
modalElement.querySelector('#lotOccupancySearch--lotName').addEventListener('change', doSearch);
|
||||
searchFormElement.addEventListener('submit', doSearch);
|
||||
},
|
||||
onremoved() {
|
||||
bulmaJS.toggleHtmlClipped();
|
||||
document.querySelector('#button--addLotOccupancy').focus();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
@ -474,7 +478,7 @@ function doAddLot(clickEvent) {
|
|||
}
|
||||
});
|
||||
}
|
||||
document.querySelector('#button--addLot').addEventListener('click', () => {
|
||||
(_b = document.querySelector('#button--addLot')) === null || _b === void 0 ? void 0 : _b.addEventListener('click', () => {
|
||||
let searchFormElement;
|
||||
let searchResultsContainerElement;
|
||||
function doSearch(event) {
|
||||
|
|
@ -546,9 +550,9 @@ document.querySelector('#button--addLot').addEventListener('click', () => {
|
|||
},
|
||||
onshown(modalElement) {
|
||||
bulmaJS.toggleHtmlClipped();
|
||||
modalElement
|
||||
.querySelector('#lotSearch--lotName')
|
||||
.addEventListener('change', doSearch);
|
||||
const lotNameElement = modalElement.querySelector('#lotSearch--lotName');
|
||||
lotNameElement.addEventListener('change', doSearch);
|
||||
lotNameElement.focus();
|
||||
modalElement
|
||||
.querySelector('#lotSearch--lotStatusId')
|
||||
.addEventListener('change', doSearch);
|
||||
|
|
@ -556,6 +560,7 @@ document.querySelector('#button--addLot').addEventListener('click', () => {
|
|||
},
|
||||
onremoved() {
|
||||
bulmaJS.toggleHtmlClipped();
|
||||
document.querySelector('#button--addLot').focus();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable @typescript-eslint/indent */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||
|
||||
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types'
|
||||
|
|
@ -526,8 +527,8 @@ function doAddLotOccupancy(clickEvent: Event): void {
|
|||
}
|
||||
|
||||
document
|
||||
.querySelector('#button--addLotOccupancy')!
|
||||
.addEventListener('click', () => {
|
||||
.querySelector('#button--addLotOccupancy')
|
||||
?.addEventListener('click', () => {
|
||||
let searchFormElement: HTMLFormElement
|
||||
let searchResultsContainerElement: HTMLElement
|
||||
|
||||
|
|
@ -545,8 +546,8 @@ document
|
|||
(responseJSON: { lotOccupancies: recordTypes.LotOccupancy[] }) => {
|
||||
if (responseJSON.lotOccupancies.length === 0) {
|
||||
searchResultsContainerElement.innerHTML = `<div class="message is-info">
|
||||
<p class="message-body">There are no records that meet the search criteria.</p>
|
||||
</div>`
|
||||
<p class="message-body">There are no records that meet the search criteria.</p>
|
||||
</div>`
|
||||
|
||||
return
|
||||
}
|
||||
|
|
@ -658,11 +659,13 @@ document
|
|||
},
|
||||
onshown(modalElement) {
|
||||
bulmaJS.toggleHtmlClipped()
|
||||
;(
|
||||
modalElement.querySelector(
|
||||
'#lotOccupancySearch--occupantName'
|
||||
) as HTMLInputElement
|
||||
).addEventListener('change', doSearch)
|
||||
|
||||
const occupantNameElement = modalElement.querySelector(
|
||||
'#lotOccupancySearch--occupantName'
|
||||
) as HTMLInputElement
|
||||
|
||||
occupantNameElement.addEventListener('change', doSearch)
|
||||
occupantNameElement.focus()
|
||||
;(
|
||||
modalElement.querySelector(
|
||||
'#lotOccupancySearch--lotName'
|
||||
|
|
@ -673,6 +676,11 @@ document
|
|||
},
|
||||
onremoved() {
|
||||
bulmaJS.toggleHtmlClipped()
|
||||
;(
|
||||
document.querySelector(
|
||||
'#button--addLotOccupancy'
|
||||
) as HTMLButtonElement
|
||||
).focus()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
@ -689,7 +697,7 @@ function doAddLot(clickEvent: Event): void {
|
|||
})
|
||||
}
|
||||
|
||||
document.querySelector('#button--addLot')!.addEventListener('click', () => {
|
||||
document.querySelector('#button--addLot')?.addEventListener('click', () => {
|
||||
let searchFormElement: HTMLFormElement
|
||||
let searchResultsContainerElement: HTMLElement
|
||||
|
||||
|
|
@ -788,9 +796,12 @@ document.querySelector('#button--addLot')!.addEventListener('click', () => {
|
|||
onshown(modalElement) {
|
||||
bulmaJS.toggleHtmlClipped()
|
||||
|
||||
modalElement
|
||||
.querySelector('#lotSearch--lotName')!
|
||||
.addEventListener('change', doSearch)
|
||||
const lotNameElement = modalElement.querySelector(
|
||||
'#lotSearch--lotName'
|
||||
) as HTMLInputElement
|
||||
|
||||
lotNameElement.addEventListener('change', doSearch)
|
||||
lotNameElement.focus()
|
||||
|
||||
modalElement
|
||||
.querySelector('#lotSearch--lotStatusId')!
|
||||
|
|
@ -800,6 +811,8 @@ document.querySelector('#button--addLot')!.addEventListener('click', () => {
|
|||
},
|
||||
onremoved() {
|
||||
bulmaJS.toggleHtmlClipped()
|
||||
|
||||
;(document.querySelector('#button--addLot') as HTMLButtonElement).focus()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue