deepsource-autofix-76c6eb20
Dan Gowans 2024-06-27 15:24:23 -04:00
parent ef4be90003
commit 7da63ea3d5
10 changed files with 28 additions and 30 deletions

View File

@ -218,8 +218,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
lotOccupancyFieldsContainerElement.innerHTML = '';
let occupancyTypeFieldIds = '';
for (const occupancyTypeField of responseJSON.occupancyTypeFields) {
occupancyTypeFieldIds +=
',' + occupancyTypeField.occupancyTypeFieldId.toString();
occupancyTypeFieldIds += `,${occupancyTypeField.occupancyTypeFieldId.toString()}`;
const fieldName = `lotOccupancyFieldValue_${occupancyTypeField.occupancyTypeFieldId.toString()}`;
const fieldId = `lotOccupancy--${fieldName}`;
const fieldElement = document.createElement('div');

View File

@ -218,8 +218,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
lotOccupancyFieldsContainerElement.innerHTML = '';
let occupancyTypeFieldIds = '';
for (const occupancyTypeField of responseJSON.occupancyTypeFields) {
occupancyTypeFieldIds +=
',' + occupancyTypeField.occupancyTypeFieldId.toString();
occupancyTypeFieldIds += `,${occupancyTypeField.occupancyTypeFieldId.toString()}`;
const fieldName = `lotOccupancyFieldValue_${occupancyTypeField.occupancyTypeFieldId.toString()}`;
const fieldId = `lotOccupancy--${fieldName}`;
const fieldElement = document.createElement('div');

View File

@ -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 { 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 bulmaJS: BulmaJS
@ -332,8 +339,7 @@ declare const exports: Record<string, unknown>
let occupancyTypeFieldIds = ''
for (const occupancyTypeField of responseJSON.occupancyTypeFields) {
occupancyTypeFieldIds +=
',' + occupancyTypeField.occupancyTypeFieldId.toString()
occupancyTypeFieldIds += `,${occupancyTypeField.occupancyTypeFieldId.toString()}`
const fieldName = `lotOccupancyFieldValue_${occupancyTypeField.occupancyTypeFieldId.toString()}`

View File

@ -559,9 +559,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
${cityssm.escapeHTML((_a = lotOccupancy.occupancyType) !== null && _a !== void 0 ? _a : '')}
</td>`;
if (lotOccupancy.lotId) {
rowElement.insertAdjacentHTML('beforeend', '<td>' +
cityssm.escapeHTML((_b = lotOccupancy.lotName) !== null && _b !== void 0 ? _b : '') +
'</td>');
rowElement.insertAdjacentHTML('beforeend', `<td>${cityssm.escapeHTML((_b = lotOccupancy.lotName) !== null && _b !== void 0 ? _b : '')}</td>`);
}
else {
// eslint-disable-next-line no-unsanitized/method

View File

@ -405,9 +405,7 @@ function doAddLotOccupancy(clickEvent) {
${cityssm.escapeHTML((_a = lotOccupancy.occupancyType) !== null && _a !== void 0 ? _a : '')}
</td>`;
if (lotOccupancy.lotId) {
rowElement.insertAdjacentHTML('beforeend', '<td>' +
cityssm.escapeHTML((_b = lotOccupancy.lotName) !== null && _b !== void 0 ? _b : '') +
'</td>');
rowElement.insertAdjacentHTML('beforeend', `<td>${cityssm.escapeHTML((_b = lotOccupancy.lotName) !== null && _b !== void 0 ? _b : '')}</td>`);
}
else {
// eslint-disable-next-line no-unsanitized/method

View File

@ -598,9 +598,7 @@ document
if (lotOccupancy.lotId) {
rowElement.insertAdjacentHTML(
'beforeend',
'<td>' +
cityssm.escapeHTML(lotOccupancy.lotName ?? '') +
'</td>'
`<td>${cityssm.escapeHTML(lotOccupancy.lotName ?? '')}</td>`
)
} else {
// 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

View File

@ -5,14 +5,14 @@ async function importMaps() {
let pool;
try {
pool = await sql.connect(soMSSQL);
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' +
' from Legacy_Maps m' +
' left join Legacy_Layers l on m.ID = l.Map_ID');
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
from Legacy_Maps m
left join Legacy_Layers l on m.ID = l.Map_ID`);
for (const layer of result.recordset) {
const imageBuffer = layer.layerImage;
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) {
console.log(error);
}

View File

@ -19,19 +19,19 @@ async function importMaps(): Promise<void> {
try {
pool = await sql.connect(soMSSQL)
const result: sqlTypes.IResult<MapLayer> = await pool.query(
'select m.ID as mapId, m.Name as mapName,' +
' l.ID as layerId, l.Name as layerName, l.Image as layerImage' +
' from Legacy_Maps m' +
' left join Legacy_Layers l on m.ID = l.Map_ID'
)
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
from Legacy_Maps m
left join Legacy_Layers l on m.ID = l.Map_ID`
) as sqlTypes.IResult<MapLayer>
for (const layer of result.recordset) {
const imageBuffer = layer.layerImage as unknown as Buffer
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) {
console.log(error)
}