Skip to content

Commit c797baa

Browse files
authored
After making the context component required, the context settings were hidden (#474)
1 parent 0c22996 commit c797baa

File tree

1 file changed

+45
-58
lines changed

1 file changed

+45
-58
lines changed

src/view/configuration/dataCollectionSection.jsx

+45-58
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ const DataCollectionSection = ({ instanceFieldName }) => {
227227
const [{ value: activityCollectorEnabled }] = useField(
228228
"components.activityCollector",
229229
);
230-
const [{ value: contextEnabled }] = useField("components.context");
231230

232231
return (
233232
<>
@@ -398,67 +397,55 @@ const DataCollectionSection = ({ instanceFieldName }) => {
398397
</InlineAlert>
399398
</View>
400399
)}
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}
406408
>
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>
420418

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
434435
key={contextOption.value}
436+
data-test-id={contextOption.testId}
437+
value={contextOption.value}
438+
width="size-5000"
435439
>
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>
462449
</FormElementContainer>
463450
</>
464451
);

0 commit comments

Comments
 (0)