@@ -191,7 +191,7 @@ interface MessageAndValue {
191191 valueDescriptor : ValueDescriptor ;
192192}
193193
194- type MessageAndValueMap = { [ colKey : string ] : MessageAndValue [ ] } ;
194+ type MessageAndValueMap = Record < string , MessageAndValue [ ] > ;
195195
196196function resolveValueDescriptors (
197197 col : QueryColumn ,
@@ -442,12 +442,12 @@ interface CellData {
442442}
443443
444444async function convertRowToEditorModelData (
445- data : string | number | boolean ,
445+ data : boolean | number | string ,
446446 col : QueryColumn ,
447447 containerPath : string
448448) : Promise < CellData > {
449449 let message : CellMessage ;
450- let valueDescriptors = List < ValueDescriptor > ( ) ;
450+ const valueDescriptors : ValueDescriptor [ ] = [ ] ;
451451
452452 if ( data && col ?. isPublicLookup ( ) ) {
453453 // value had better be the rowId here, but it may be several in a comma-separated list.
@@ -456,18 +456,21 @@ async function convertRowToEditorModelData(
456456
457457 for ( const val of values ) {
458458 const messageAndValue = await getLookupDisplayValue ( col , parseIntIfNumber ( val ) , containerPath ) ;
459- valueDescriptors = valueDescriptors . push ( messageAndValue . valueDescriptor ) ;
460459 message = messageAndValue . message ;
460+
461+ if ( messageAndValue . valueDescriptor ) {
462+ valueDescriptors . push ( messageAndValue . valueDescriptor ) ;
463+ }
461464 }
462465 } else {
463466 let display = data ;
464467 if ( col ?. isTimeOrDateTimeColumn && typeof data === 'string' ) {
465468 display = getDateTimeDisplayValueFromStr ( data , col ) ;
466469 }
467- valueDescriptors = valueDescriptors . push ( { display, raw : data } ) ;
470+ valueDescriptors . push ( { display, raw : data } ) ;
468471 }
469472
470- return { message, valueDescriptors } ;
473+ return { message, valueDescriptors : List ( valueDescriptors ) } ;
471474}
472475
473476async function prepareInsertRowDataFromBulkForm (
@@ -510,7 +513,6 @@ async function addBulkRowsToEditorModel(
510513 const rowCount = editorModel . rowCount + numToAdd ;
511514
512515 for ( let rowIdx = editorModel . rowCount ; rowIdx < rowCount ; rowIdx ++ ) {
513- // eslint-disable-next-line no-loop-func
514516 rowData . forEach ( ( value , colIdx ) => {
515517 const fieldKey = editorModel . getFieldKeyByIndex ( colIdx ) ;
516518 const cellKey = genCellKey ( fieldKey , rowIdx ) ;
@@ -594,7 +596,6 @@ export function addColumns(
594596 let newCellValues = editorModel . cellValues ;
595597
596598 for ( let rowIdx = 0 ; rowIdx < editorModel . rowCount ; rowIdx ++ ) {
597- // eslint-disable-next-line no-loop-func
598599 queryColumns . forEach ( ( value : QueryColumn ) => {
599600 newCellValues = newCellValues . set ( genCellKey ( value . fieldKey , rowIdx ) , List < ValueDescriptor > ( ) ) ;
600601 } ) ;
@@ -745,7 +746,7 @@ export async function updateGridFromBulkForm(
745746 lockedOrReadonlyRows ?: number [ ] ,
746747 isIncludedColumn ?: ( col : QueryColumn ) => boolean ,
747748 containerPath ?: string ,
748- useEditorModelCols : boolean = false
749+ useEditorModelCols = false
749750) : Promise < Partial < EditorModel > > {
750751 let cellMessages = editorModel . cellMessages ;
751752 let cellValues = editorModel . cellValues ;
@@ -820,7 +821,7 @@ type PrefixAndNumber = [string | undefined, string | undefined];
820821 * number the number suffix is undefined. If the entire string is a number the prefix will be undefined. This method
821822 * intentionally does not parse the numbers.
822823 */
823- export function splitPrefixedNumber ( value : string | number ) : PrefixAndNumber {
824+ export function splitPrefixedNumber ( value : number | string ) : PrefixAndNumber {
824825 if ( value === undefined || value === null || value === '' ) return [ undefined , undefined ] ;
825826 const text = value . toString ( ) ;
826827 const matches = text ?. toString ( ) . match ( POSTFIX_REGEX ) ;
@@ -871,7 +872,7 @@ interface SelectionIncrement {
871872 direction : IncrementDirection ;
872873 increment ?: number ;
873874 incrementType : IncrementType ;
874- initialSelectionValues : Array < List < ValueDescriptor > > ; // yes this is a very odd type, but we can clean it up when we rip out Immutable
875+ initialSelectionValues : List < ValueDescriptor > [ ] ; // yes this is a very odd type, but we can clean it up when we rip out Immutable
875876 padLength ?: number ;
876877 prefix ?: string ;
877878 startingValue : number | string ;
@@ -1041,7 +1042,7 @@ export function generateFillCellKeys(
10411042export function parsePastedLookup (
10421043 column : QueryColumn ,
10431044 descriptors : ValueDescriptor [ ] ,
1044- value : string [ ] | string
1045+ value : string | string [ ]
10451046) : CellData {
10461047 const originalValues = List ( [ { display : value , raw : value } ] ) ;
10471048
@@ -1102,7 +1103,7 @@ async function getParsedLookup(
11021103 column : QueryColumn ,
11031104 lookupValueCache : LookupValueCache ,
11041105 display : any [ ] ,
1105- value : string [ ] | string ,
1106+ value : string | string [ ] ,
11061107 cellKey : string ,
11071108 forUpdate : boolean ,
11081109 targetContainerPath : string ,
0 commit comments