@@ -151,7 +151,16 @@ function FormRow({
151151function HighlightedAttributeExpressionsFormRow ( {
152152 control,
153153 watch,
154- } : TableModelProps ) {
154+ name,
155+ label,
156+ helpText,
157+ } : TableModelProps & {
158+ name :
159+ | 'highlightedTraceAttributeExpressions'
160+ | 'highlightedRowAttributeExpressions' ;
161+ label : string ;
162+ helpText ?: string ;
163+ } ) {
155164 const databaseName = watch ( `from.databaseName` , DEFAULT_DATABASE ) ;
156165 const tableName = watch ( `from.tableName` ) ;
157166 const connectionId = watch ( `connection` ) ;
@@ -162,14 +171,11 @@ function HighlightedAttributeExpressionsFormRow({
162171 remove : removeHighlightedAttribute ,
163172 } = useFieldArray ( {
164173 control,
165- name : 'highlightedTraceAttributeExpressions' ,
174+ name,
166175 } ) ;
167176
168177 return (
169- < FormRow
170- label = { 'Highlighted Attributes' }
171- helpText = "Expressions defining trace-level attributes which are displayed in the search side panel."
172- >
178+ < FormRow label = { label } helpText = { helpText } >
173179 < Grid columns = { 5 } >
174180 { highlightedAttributes . map ( ( field , index ) => (
175181 < React . Fragment key = { field . id } >
@@ -181,7 +187,7 @@ function HighlightedAttributeExpressionsFormRow({
181187 connectionId,
182188 } }
183189 control = { control }
184- name = { `highlightedTraceAttributeExpressions .${ index } .sqlExpression` }
190+ name = { `${ name } .${ index } .sqlExpression` }
185191 disableKeywordAutocomplete
186192 placeholder = "ResourceAttributes['http.host']"
187193 />
@@ -191,7 +197,7 @@ function HighlightedAttributeExpressionsFormRow({
191197 < Text c = "gray" > AS</ Text >
192198 < SQLInlineEditorControlled
193199 control = { control }
194- name = { `highlightedTraceAttributeExpressions .${ index } .alias` }
200+ name = { `${ name } .${ index } .alias` }
195201 placeholder = "Optional Alias"
196202 disableKeywordAutocomplete
197203 />
@@ -208,7 +214,7 @@ function HighlightedAttributeExpressionsFormRow({
208214 < Grid . Col span = { 3 } pe = { 0 } >
209215 < InputControlled
210216 control = { control }
211- name = { `highlightedTraceAttributeExpressions .${ index } .luceneExpression` }
217+ name = { `${ name } .${ index } .luceneExpression` }
212218 placeholder = "ResourceAttributes.http.host (Optional) "
213219 />
214220 </ Grid . Col >
@@ -489,7 +495,18 @@ export function LogTableModelForm(props: TableModelProps) {
489495 />
490496 </ FormRow >
491497 < Divider />
492- < HighlightedAttributeExpressionsFormRow { ...props } />
498+ < HighlightedAttributeExpressionsFormRow
499+ { ...props }
500+ name = "highlightedRowAttributeExpressions"
501+ label = "Highlighted Attributes"
502+ helpText = "Expressions defining row-level attributes which are displayed in the search side panel."
503+ />
504+ < HighlightedAttributeExpressionsFormRow
505+ { ...props }
506+ name = "highlightedTraceAttributeExpressions"
507+ label = "Highlighted Trace Attributes"
508+ helpText = "Expressions defining trace-level attributes which are displayed in the search side panel."
509+ />
493510 </ Stack >
494511 </ >
495512 ) ;
@@ -758,7 +775,18 @@ export function TraceTableModelForm(props: TableModelProps) {
758775 />
759776 </ FormRow >
760777 < Divider />
761- < HighlightedAttributeExpressionsFormRow { ...props } />
778+ < HighlightedAttributeExpressionsFormRow
779+ { ...props }
780+ name = "highlightedRowAttributeExpressions"
781+ label = "Highlighted Attributes"
782+ helpText = "Expressions defining row-level attributes which are displayed in the search side panel."
783+ />
784+ < HighlightedAttributeExpressionsFormRow
785+ { ...props }
786+ name = "highlightedTraceAttributeExpressions"
787+ label = "Highlighted Trace Attributes"
788+ helpText = "Expressions defining trace-level attributes which are displayed in the search side panel."
789+ />
762790 </ Stack >
763791 ) ;
764792}
0 commit comments