@@ -227,7 +227,6 @@ const DataCollectionSection = ({ instanceFieldName }) => {
227
227
const [ { value : activityCollectorEnabled } ] = useField (
228
228
"components.activityCollector" ,
229
229
) ;
230
- const [ { value : contextEnabled } ] = useField ( "components.context" ) ;
231
230
232
231
return (
233
232
< >
@@ -398,67 +397,55 @@ const DataCollectionSection = ({ instanceFieldName }) => {
398
397
</ InlineAlert >
399
398
</ View >
400
399
) }
401
- { contextEnabled ? (
402
- < div >
403
- < FormikRadioGroup
404
- label = "When sending event data, automatically include:"
405
- name = { `${ instanceFieldName } .contextGranularity` }
400
+ < div >
401
+ < FormikRadioGroup
402
+ label = "When sending event data, automatically include:"
403
+ name = { `${ instanceFieldName } .contextGranularity` }
404
+ >
405
+ < Radio
406
+ data-test-id = "contextGranularityAllField"
407
+ value = { CONTEXT_GRANULARITY . ALL }
406
408
>
407
- < Radio
408
- data-test-id = "contextGranularityAllField"
409
- value = { CONTEXT_GRANULARITY . ALL }
410
- >
411
- All default context information
412
- </ Radio >
413
- < Radio
414
- data-test-id = "contextGranularitySpecificField"
415
- value = { CONTEXT_GRANULARITY . SPECIFIC }
416
- >
417
- Specific context information
418
- </ Radio >
419
- </ FormikRadioGroup >
409
+ All default context information
410
+ </ Radio >
411
+ < Radio
412
+ data-test-id = "contextGranularitySpecificField"
413
+ value = { CONTEXT_GRANULARITY . SPECIFIC }
414
+ >
415
+ Specific context information
416
+ </ Radio >
417
+ </ FormikRadioGroup >
420
418
421
- { instanceValues . contextGranularity ===
422
- CONTEXT_GRANULARITY . SPECIFIC && (
423
- < FieldSubset >
424
- < FormikCheckboxGroup
425
- aria-label = "Context data categories"
426
- name = { `${ instanceFieldName } .context` }
427
- >
428
- { contextOptions . map ( ( contextOption ) => {
429
- return (
430
- < FieldDescriptionAndError
431
- description = { contextOption . description }
432
- messagePaddingTop = "size-0"
433
- messagePaddingStart = "size-300"
419
+ { instanceValues . contextGranularity ===
420
+ CONTEXT_GRANULARITY . SPECIFIC && (
421
+ < FieldSubset >
422
+ < FormikCheckboxGroup
423
+ aria-label = "Context data categories"
424
+ name = { `${ instanceFieldName } .context` }
425
+ >
426
+ { contextOptions . map ( ( contextOption ) => {
427
+ return (
428
+ < FieldDescriptionAndError
429
+ description = { contextOption . description }
430
+ messagePaddingTop = "size-0"
431
+ messagePaddingStart = "size-300"
432
+ key = { contextOption . value }
433
+ >
434
+ < Checkbox
434
435
key = { contextOption . value }
436
+ data-test-id = { contextOption . testId }
437
+ value = { contextOption . value }
438
+ width = "size-5000"
435
439
>
436
- < Checkbox
437
- key = { contextOption . value }
438
- data-test-id = { contextOption . testId }
439
- value = { contextOption . value }
440
- width = "size-5000"
441
- >
442
- { contextOption . label }
443
- </ Checkbox >
444
- </ FieldDescriptionAndError >
445
- ) ;
446
- } ) }
447
- </ FormikCheckboxGroup >
448
- </ FieldSubset >
449
- ) }
450
- </ div >
451
- ) : (
452
- < View width = "size-6000" >
453
- < InlineAlert variant = "info" >
454
- < Heading > Context component disabled</ Heading >
455
- < Content >
456
- The context custom build component is disabled. Enable it above
457
- to configure context settings.
458
- </ Content >
459
- </ InlineAlert >
460
- </ View >
461
- ) }
440
+ { contextOption . label }
441
+ </ Checkbox >
442
+ </ FieldDescriptionAndError >
443
+ ) ;
444
+ } ) }
445
+ </ FormikCheckboxGroup >
446
+ </ FieldSubset >
447
+ ) }
448
+ </ div >
462
449
</ FormElementContainer >
463
450
</ >
464
451
) ;
0 commit comments