Add id to hierarchy filter checkbox input (#1842)

* add id to hierarchy filter checkbox input
This commit is contained in:
7dJx1qP 2021-10-14 17:55:52 -04:00 committed by GitHub
parent 655d3ae969
commit 602a32bd32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -51,6 +51,16 @@ export const HierarchicalLabelValueFilter: React.FC<IHierarchicalLabelValueFilte
onValueChanged(value);
}
function criterionOptionTypeToIncludeID(): string {
if (criterion.criterionOption.type === "studios") {
return "include-sub-studios";
}
if (criterion.criterionOption.type === "childTags") {
return "include-parent-tags";
}
return "include-sub-tags";
}
function criterionOptionTypeToIncludeUIString(): MessageDescriptor {
const optionType =
criterion.criterionOption.type === "studios"
@ -76,6 +86,7 @@ export const HierarchicalLabelValueFilter: React.FC<IHierarchicalLabelValueFilte
<Form.Group>
<Form.Check
id={criterionOptionTypeToIncludeID()}
checked={criterion.value.depth !== 0}
label={intl.formatMessage(criterionOptionTypeToIncludeUIString())}
onChange={() => onDepthChanged(criterion.value.depth !== 0 ? 0 : -1)}