linting
parent
ef4be90003
commit
7da63ea3d5
|
|
@ -218,8 +218,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
lotOccupancyFieldsContainerElement.innerHTML = '';
|
lotOccupancyFieldsContainerElement.innerHTML = '';
|
||||||
let occupancyTypeFieldIds = '';
|
let occupancyTypeFieldIds = '';
|
||||||
for (const occupancyTypeField of responseJSON.occupancyTypeFields) {
|
for (const occupancyTypeField of responseJSON.occupancyTypeFields) {
|
||||||
occupancyTypeFieldIds +=
|
occupancyTypeFieldIds += `,${occupancyTypeField.occupancyTypeFieldId.toString()}`;
|
||||||
',' + occupancyTypeField.occupancyTypeFieldId.toString();
|
|
||||||
const fieldName = `lotOccupancyFieldValue_${occupancyTypeField.occupancyTypeFieldId.toString()}`;
|
const fieldName = `lotOccupancyFieldValue_${occupancyTypeField.occupancyTypeFieldId.toString()}`;
|
||||||
const fieldId = `lotOccupancy--${fieldName}`;
|
const fieldId = `lotOccupancy--${fieldName}`;
|
||||||
const fieldElement = document.createElement('div');
|
const fieldElement = document.createElement('div');
|
||||||
|
|
|
||||||
|
|
@ -218,8 +218,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
lotOccupancyFieldsContainerElement.innerHTML = '';
|
lotOccupancyFieldsContainerElement.innerHTML = '';
|
||||||
let occupancyTypeFieldIds = '';
|
let occupancyTypeFieldIds = '';
|
||||||
for (const occupancyTypeField of responseJSON.occupancyTypeFields) {
|
for (const occupancyTypeField of responseJSON.occupancyTypeFields) {
|
||||||
occupancyTypeFieldIds +=
|
occupancyTypeFieldIds += `,${occupancyTypeField.occupancyTypeFieldId.toString()}`;
|
||||||
',' + occupancyTypeField.occupancyTypeFieldId.toString();
|
|
||||||
const fieldName = `lotOccupancyFieldValue_${occupancyTypeField.occupancyTypeFieldId.toString()}`;
|
const fieldName = `lotOccupancyFieldValue_${occupancyTypeField.occupancyTypeFieldId.toString()}`;
|
||||||
const fieldId = `lotOccupancy--${fieldName}`;
|
const fieldId = `lotOccupancy--${fieldName}`;
|
||||||
const fieldElement = document.createElement('div');
|
const fieldElement = document.createElement('div');
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,14 @@ 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.js'
|
||||||
|
|
||||||
import type { LOS } from '../../types/globalTypes.js'
|
import type { LOS } from '../../types/globalTypes.js'
|
||||||
import type { Lot, LotStatus, LotType, MapRecord, OccupancyTypeField, WorkOrderType } from '../../types/recordTypes.js'
|
import type {
|
||||||
|
Lot,
|
||||||
|
LotStatus,
|
||||||
|
LotType,
|
||||||
|
MapRecord,
|
||||||
|
OccupancyTypeField,
|
||||||
|
WorkOrderType
|
||||||
|
} from '../../types/recordTypes.js'
|
||||||
|
|
||||||
declare const cityssm: cityssmGlobal
|
declare const cityssm: cityssmGlobal
|
||||||
declare const bulmaJS: BulmaJS
|
declare const bulmaJS: BulmaJS
|
||||||
|
|
@ -332,8 +339,7 @@ declare const exports: Record<string, unknown>
|
||||||
let occupancyTypeFieldIds = ''
|
let occupancyTypeFieldIds = ''
|
||||||
|
|
||||||
for (const occupancyTypeField of responseJSON.occupancyTypeFields) {
|
for (const occupancyTypeField of responseJSON.occupancyTypeFields) {
|
||||||
occupancyTypeFieldIds +=
|
occupancyTypeFieldIds += `,${occupancyTypeField.occupancyTypeFieldId.toString()}`
|
||||||
',' + occupancyTypeField.occupancyTypeFieldId.toString()
|
|
||||||
|
|
||||||
const fieldName = `lotOccupancyFieldValue_${occupancyTypeField.occupancyTypeFieldId.toString()}`
|
const fieldName = `lotOccupancyFieldValue_${occupancyTypeField.occupancyTypeFieldId.toString()}`
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -559,9 +559,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
${cityssm.escapeHTML((_a = lotOccupancy.occupancyType) !== null && _a !== void 0 ? _a : '')}
|
${cityssm.escapeHTML((_a = lotOccupancy.occupancyType) !== null && _a !== void 0 ? _a : '')}
|
||||||
</td>`;
|
</td>`;
|
||||||
if (lotOccupancy.lotId) {
|
if (lotOccupancy.lotId) {
|
||||||
rowElement.insertAdjacentHTML('beforeend', '<td>' +
|
rowElement.insertAdjacentHTML('beforeend', `<td>${cityssm.escapeHTML((_b = lotOccupancy.lotName) !== null && _b !== void 0 ? _b : '')}</td>`);
|
||||||
cityssm.escapeHTML((_b = lotOccupancy.lotName) !== null && _b !== void 0 ? _b : '') +
|
|
||||||
'</td>');
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// eslint-disable-next-line no-unsanitized/method
|
// eslint-disable-next-line no-unsanitized/method
|
||||||
|
|
|
||||||
|
|
@ -405,9 +405,7 @@ function doAddLotOccupancy(clickEvent) {
|
||||||
${cityssm.escapeHTML((_a = lotOccupancy.occupancyType) !== null && _a !== void 0 ? _a : '')}
|
${cityssm.escapeHTML((_a = lotOccupancy.occupancyType) !== null && _a !== void 0 ? _a : '')}
|
||||||
</td>`;
|
</td>`;
|
||||||
if (lotOccupancy.lotId) {
|
if (lotOccupancy.lotId) {
|
||||||
rowElement.insertAdjacentHTML('beforeend', '<td>' +
|
rowElement.insertAdjacentHTML('beforeend', `<td>${cityssm.escapeHTML((_b = lotOccupancy.lotName) !== null && _b !== void 0 ? _b : '')}</td>`);
|
||||||
cityssm.escapeHTML((_b = lotOccupancy.lotName) !== null && _b !== void 0 ? _b : '') +
|
|
||||||
'</td>');
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// eslint-disable-next-line no-unsanitized/method
|
// eslint-disable-next-line no-unsanitized/method
|
||||||
|
|
|
||||||
|
|
@ -598,9 +598,7 @@ document
|
||||||
if (lotOccupancy.lotId) {
|
if (lotOccupancy.lotId) {
|
||||||
rowElement.insertAdjacentHTML(
|
rowElement.insertAdjacentHTML(
|
||||||
'beforeend',
|
'beforeend',
|
||||||
'<td>' +
|
`<td>${cityssm.escapeHTML(lotOccupancy.lotName ?? '')}</td>`
|
||||||
cityssm.escapeHTML(lotOccupancy.lotName ?? '') +
|
|
||||||
'</td>'
|
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
// eslint-disable-next-line no-unsanitized/method
|
// eslint-disable-next-line no-unsanitized/method
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -5,14 +5,14 @@ async function importMaps() {
|
||||||
let pool;
|
let pool;
|
||||||
try {
|
try {
|
||||||
pool = await sql.connect(soMSSQL);
|
pool = await sql.connect(soMSSQL);
|
||||||
const result = await pool.query('select m.ID as mapId, m.Name as mapName,' +
|
const result = await pool.query(`select m.ID as mapId, m.Name as mapName,
|
||||||
' l.ID as layerId, l.Name as layerName, l.Image as layerImage' +
|
l.ID as layerId, l.Name as layerName, l.Image as layerImage
|
||||||
' from Legacy_Maps m' +
|
from Legacy_Maps m
|
||||||
' left join Legacy_Layers l on m.ID = l.Map_ID');
|
left join Legacy_Layers l on m.ID = l.Map_ID`);
|
||||||
for (const layer of result.recordset) {
|
for (const layer of result.recordset) {
|
||||||
const imageBuffer = layer.layerImage;
|
const imageBuffer = layer.layerImage;
|
||||||
const fileName = `${layer.mapName} - ${layer.layerName} (${layer.mapId}, ${layer.layerId}).wmf`;
|
const fileName = `${layer.mapName} - ${layer.layerName} (${layer.mapId}, ${layer.layerId}).wmf`;
|
||||||
fs.writeFile('./temp/wmf/' + fileName, imageBuffer, (error) => {
|
fs.writeFile(`./temp/wmf/${fileName}`, imageBuffer, (error) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,19 +19,19 @@ async function importMaps(): Promise<void> {
|
||||||
try {
|
try {
|
||||||
pool = await sql.connect(soMSSQL)
|
pool = await sql.connect(soMSSQL)
|
||||||
|
|
||||||
const result: sqlTypes.IResult<MapLayer> = await pool.query(
|
const result = await pool.query(
|
||||||
'select m.ID as mapId, m.Name as mapName,' +
|
`select m.ID as mapId, m.Name as mapName,
|
||||||
' l.ID as layerId, l.Name as layerName, l.Image as layerImage' +
|
l.ID as layerId, l.Name as layerName, l.Image as layerImage
|
||||||
' from Legacy_Maps m' +
|
from Legacy_Maps m
|
||||||
' left join Legacy_Layers l on m.ID = l.Map_ID'
|
left join Legacy_Layers l on m.ID = l.Map_ID`
|
||||||
)
|
) as sqlTypes.IResult<MapLayer>
|
||||||
|
|
||||||
for (const layer of result.recordset) {
|
for (const layer of result.recordset) {
|
||||||
const imageBuffer = layer.layerImage as unknown as Buffer
|
const imageBuffer = layer.layerImage as unknown as Buffer
|
||||||
|
|
||||||
const fileName = `${layer.mapName} - ${layer.layerName} (${layer.mapId}, ${layer.layerId}).wmf`
|
const fileName = `${layer.mapName} - ${layer.layerName} (${layer.mapId}, ${layer.layerId}).wmf`
|
||||||
|
|
||||||
fs.writeFile('./temp/wmf/' + fileName, imageBuffer, (error) => {
|
fs.writeFile(`./temp/wmf/${fileName}`, imageBuffer, (error) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue