update occupant comment title on create
parent
584f33fb98
commit
b2077f2f9a
|
|
@ -2,7 +2,7 @@
|
||||||
/* eslint-disable spaced-comment, @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
/* eslint-disable spaced-comment, @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
(() => {
|
(() => {
|
||||||
var _a, _b, _c;
|
var _a, _b, _c, _d, _e, _f;
|
||||||
const los = exports.los;
|
const los = exports.los;
|
||||||
const lotOccupancyId = document.querySelector('#lotOccupancy--lotOccupancyId').value;
|
const lotOccupancyId = document.querySelector('#lotOccupancy--lotOccupancyId').value;
|
||||||
const isCreate = lotOccupancyId === '';
|
const isCreate = lotOccupancyId === '';
|
||||||
|
|
@ -418,9 +418,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
document
|
(_d = document
|
||||||
.querySelector('.is-lot-view-button')
|
.querySelector('.is-lot-view-button')) === null || _d === void 0 ? void 0 : _d.addEventListener('click', () => {
|
||||||
.addEventListener('click', () => {
|
|
||||||
const lotId = document.querySelector('#lotOccupancy--lotId').value;
|
const lotId = document.querySelector('#lotOccupancy--lotId').value;
|
||||||
if (lotId === '') {
|
if (lotId === '') {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
|
|
@ -432,9 +431,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
window.open(los.urlPrefix + '/lots/' + lotId);
|
window.open(los.urlPrefix + '/lots/' + lotId);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
document
|
(_e = document
|
||||||
.querySelector('.is-clear-lot-button')
|
.querySelector('.is-clear-lot-button')) === null || _e === void 0 ? void 0 : _e.addEventListener('click', () => {
|
||||||
.addEventListener('click', () => {
|
|
||||||
if (lotNameElement.disabled) {
|
if (lotNameElement.disabled) {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
message: 'You need to unlock the field before clearing it.',
|
message: 'You need to unlock the field before clearing it.',
|
||||||
|
|
@ -449,9 +447,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
});
|
});
|
||||||
// Start Date
|
// Start Date
|
||||||
los.initializeDatePickers(formElement);
|
los.initializeDatePickers(formElement);
|
||||||
document
|
(_f = document
|
||||||
.querySelector('#lotOccupancy--occupancyStartDateString')
|
.querySelector('#lotOccupancy--occupancyStartDateString')) === null || _f === void 0 ? void 0 : _f.addEventListener('change', () => {
|
||||||
.addEventListener('change', () => {
|
|
||||||
const endDatePicker = document.querySelector('#lotOccupancy--occupancyEndDateString').bulmaCalendar.datePicker;
|
const endDatePicker = document.querySelector('#lotOccupancy--occupancyEndDateString').bulmaCalendar.datePicker;
|
||||||
endDatePicker.min = document.querySelector('#lotOccupancy--occupancyStartDateString').value;
|
endDatePicker.min = document.querySelector('#lotOccupancy--occupancyStartDateString').value;
|
||||||
endDatePicker.refresh();
|
endDatePicker.refresh();
|
||||||
|
|
@ -699,10 +696,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
if (isCreate) {
|
if (isCreate) {
|
||||||
const lotOccupantTypeIdElement = document.querySelector('#lotOccupancy--lotOccupantTypeId');
|
const lotOccupantTypeIdElement = document.querySelector('#lotOccupancy--lotOccupantTypeId');
|
||||||
lotOccupantTypeIdElement.addEventListener('change', () => {
|
lotOccupantTypeIdElement.addEventListener('change', () => {
|
||||||
|
var _a;
|
||||||
const occupantFields = formElement.querySelectorAll("[data-table='LotOccupancyOccupant']");
|
const occupantFields = formElement.querySelectorAll("[data-table='LotOccupancyOccupant']");
|
||||||
for (const occupantField of occupantFields) {
|
for (const occupantField of occupantFields) {
|
||||||
occupantField.disabled = lotOccupantTypeIdElement.value === '';
|
occupantField.disabled = lotOccupantTypeIdElement.value === '';
|
||||||
}
|
}
|
||||||
|
let occupantCommentTitle = (_a = lotOccupantTypeIdElement.selectedOptions[0].dataset
|
||||||
|
.occupantCommentTitle) !== null && _a !== void 0 ? _a : '';
|
||||||
|
if (occupantCommentTitle === '') {
|
||||||
|
occupantCommentTitle = 'Comment';
|
||||||
|
}
|
||||||
|
formElement.querySelector('#lotOccupancy--occupantCommentTitle').textContent = occupantCommentTitle;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
/* eslint-disable spaced-comment, @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
/* eslint-disable spaced-comment, @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
(() => {
|
(() => {
|
||||||
var _a, _b, _c;
|
var _a, _b, _c, _d, _e, _f;
|
||||||
const los = exports.los;
|
const los = exports.los;
|
||||||
const lotOccupancyId = document.querySelector('#lotOccupancy--lotOccupancyId').value;
|
const lotOccupancyId = document.querySelector('#lotOccupancy--lotOccupancyId').value;
|
||||||
const isCreate = lotOccupancyId === '';
|
const isCreate = lotOccupancyId === '';
|
||||||
|
|
@ -418,9 +418,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
document
|
(_d = document
|
||||||
.querySelector('.is-lot-view-button')
|
.querySelector('.is-lot-view-button')) === null || _d === void 0 ? void 0 : _d.addEventListener('click', () => {
|
||||||
.addEventListener('click', () => {
|
|
||||||
const lotId = document.querySelector('#lotOccupancy--lotId').value;
|
const lotId = document.querySelector('#lotOccupancy--lotId').value;
|
||||||
if (lotId === '') {
|
if (lotId === '') {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
|
|
@ -432,9 +431,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
window.open(los.urlPrefix + '/lots/' + lotId);
|
window.open(los.urlPrefix + '/lots/' + lotId);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
document
|
(_e = document
|
||||||
.querySelector('.is-clear-lot-button')
|
.querySelector('.is-clear-lot-button')) === null || _e === void 0 ? void 0 : _e.addEventListener('click', () => {
|
||||||
.addEventListener('click', () => {
|
|
||||||
if (lotNameElement.disabled) {
|
if (lotNameElement.disabled) {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
message: 'You need to unlock the field before clearing it.',
|
message: 'You need to unlock the field before clearing it.',
|
||||||
|
|
@ -449,9 +447,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
});
|
});
|
||||||
// Start Date
|
// Start Date
|
||||||
los.initializeDatePickers(formElement);
|
los.initializeDatePickers(formElement);
|
||||||
document
|
(_f = document
|
||||||
.querySelector('#lotOccupancy--occupancyStartDateString')
|
.querySelector('#lotOccupancy--occupancyStartDateString')) === null || _f === void 0 ? void 0 : _f.addEventListener('change', () => {
|
||||||
.addEventListener('change', () => {
|
|
||||||
const endDatePicker = document.querySelector('#lotOccupancy--occupancyEndDateString').bulmaCalendar.datePicker;
|
const endDatePicker = document.querySelector('#lotOccupancy--occupancyEndDateString').bulmaCalendar.datePicker;
|
||||||
endDatePicker.min = document.querySelector('#lotOccupancy--occupancyStartDateString').value;
|
endDatePicker.min = document.querySelector('#lotOccupancy--occupancyStartDateString').value;
|
||||||
endDatePicker.refresh();
|
endDatePicker.refresh();
|
||||||
|
|
|
||||||
|
|
@ -645,8 +645,8 @@ declare const bulmaJS: BulmaJS
|
||||||
})
|
})
|
||||||
|
|
||||||
document
|
document
|
||||||
.querySelector('.is-lot-view-button')!
|
.querySelector('.is-lot-view-button')
|
||||||
.addEventListener('click', () => {
|
?.addEventListener('click', () => {
|
||||||
const lotId = (
|
const lotId = (
|
||||||
document.querySelector('#lotOccupancy--lotId') as HTMLInputElement
|
document.querySelector('#lotOccupancy--lotId') as HTMLInputElement
|
||||||
).value
|
).value
|
||||||
|
|
@ -662,8 +662,8 @@ declare const bulmaJS: BulmaJS
|
||||||
})
|
})
|
||||||
|
|
||||||
document
|
document
|
||||||
.querySelector('.is-clear-lot-button')!
|
.querySelector('.is-clear-lot-button')
|
||||||
.addEventListener('click', () => {
|
?.addEventListener('click', () => {
|
||||||
if (lotNameElement.disabled) {
|
if (lotNameElement.disabled) {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
message: 'You need to unlock the field before clearing it.',
|
message: 'You need to unlock the field before clearing it.',
|
||||||
|
|
@ -683,8 +683,8 @@ declare const bulmaJS: BulmaJS
|
||||||
los.initializeDatePickers(formElement)
|
los.initializeDatePickers(formElement)
|
||||||
|
|
||||||
document
|
document
|
||||||
.querySelector('#lotOccupancy--occupancyStartDateString')!
|
.querySelector('#lotOccupancy--occupancyStartDateString')
|
||||||
.addEventListener('change', () => {
|
?.addEventListener('change', () => {
|
||||||
const endDatePicker = (
|
const endDatePicker = (
|
||||||
document.querySelector(
|
document.querySelector(
|
||||||
'#lotOccupancy--occupancyEndDateString'
|
'#lotOccupancy--occupancyEndDateString'
|
||||||
|
|
|
||||||
|
|
@ -237,10 +237,17 @@ function renderLotOccupancyOccupants() {
|
||||||
if (isCreate) {
|
if (isCreate) {
|
||||||
const lotOccupantTypeIdElement = document.querySelector('#lotOccupancy--lotOccupantTypeId');
|
const lotOccupantTypeIdElement = document.querySelector('#lotOccupancy--lotOccupantTypeId');
|
||||||
lotOccupantTypeIdElement.addEventListener('change', () => {
|
lotOccupantTypeIdElement.addEventListener('change', () => {
|
||||||
|
var _a;
|
||||||
const occupantFields = formElement.querySelectorAll("[data-table='LotOccupancyOccupant']");
|
const occupantFields = formElement.querySelectorAll("[data-table='LotOccupancyOccupant']");
|
||||||
for (const occupantField of occupantFields) {
|
for (const occupantField of occupantFields) {
|
||||||
occupantField.disabled = lotOccupantTypeIdElement.value === '';
|
occupantField.disabled = lotOccupantTypeIdElement.value === '';
|
||||||
}
|
}
|
||||||
|
let occupantCommentTitle = (_a = lotOccupantTypeIdElement.selectedOptions[0].dataset
|
||||||
|
.occupantCommentTitle) !== null && _a !== void 0 ? _a : '';
|
||||||
|
if (occupantCommentTitle === '') {
|
||||||
|
occupantCommentTitle = 'Comment';
|
||||||
|
}
|
||||||
|
formElement.querySelector('#lotOccupancy--occupantCommentTitle').textContent = occupantCommentTitle;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
|
|
@ -392,6 +392,17 @@ if (isCreate) {
|
||||||
for (const occupantField of occupantFields) {
|
for (const occupantField of occupantFields) {
|
||||||
occupantField.disabled = lotOccupantTypeIdElement.value === ''
|
occupantField.disabled = lotOccupantTypeIdElement.value === ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let occupantCommentTitle =
|
||||||
|
lotOccupantTypeIdElement.selectedOptions[0].dataset
|
||||||
|
.occupantCommentTitle ?? ''
|
||||||
|
if (occupantCommentTitle === '') {
|
||||||
|
occupantCommentTitle = 'Comment'
|
||||||
|
}
|
||||||
|
|
||||||
|
formElement.querySelector(
|
||||||
|
'#lotOccupancy--occupantCommentTitle'
|
||||||
|
)!.textContent = occupantCommentTitle
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
renderLotOccupancyOccupants()
|
renderLotOccupancyOccupants()
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -319,9 +319,14 @@
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<div class="select is-fullwidth">
|
<div class="select is-fullwidth">
|
||||||
<select id="lotOccupancy--lotOccupantTypeId" name="lotOccupantTypeId">
|
<select id="lotOccupancy--lotOccupantTypeId" name="lotOccupantTypeId">
|
||||||
<option value="">(Select a Type to Create a <%= configFunctions.getProperty("aliases.occupant") %>)</option>
|
<option value="" data-occupant-comment-title="Comment">
|
||||||
|
(Select a Type to Create a <%= configFunctions.getProperty("aliases.occupant") %>)
|
||||||
|
</option>
|
||||||
<% for (const lotOccupantType of lotOccupantTypes) { %>
|
<% for (const lotOccupantType of lotOccupantTypes) { %>
|
||||||
<option value="<%= lotOccupantType.lotOccupantTypeId %>"><%= lotOccupantType.lotOccupantType %></option>
|
<option value="<%= lotOccupantType.lotOccupantTypeId %>"
|
||||||
|
data-occupant-comment-title="<%= lotOccupantType.occupantCommentTitle %>">
|
||||||
|
<%= lotOccupantType.lotOccupantType %>
|
||||||
|
</option>
|
||||||
<% } %>
|
<% } %>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -391,7 +396,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label class="label" for="lotOccupancy--occupantComment">Comment</label>
|
<label class="label" id="lotOccupancy--occupantCommentTitle" for="lotOccupancy--occupantComment">Comment</label>
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<textarea class="textarea" id="lotOccupancy--occupantComment" data-table="LotOccupancyOccupant" name="occupantComment" disabled></textarea>
|
<textarea class="textarea" id="lotOccupancy--occupantComment" data-table="LotOccupancyOccupant" name="occupantComment" disabled></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue