in components/RunCard.tsx [85:126]
constructor(props) {
super(props)
const {runStore} = this.props
if (runStore.showAge) {
const onActivateGroupBy = menuItem => {
runStore.groupByAge.set(menuItem.data)
this.groupByMenuItems
.filter(item => item.itemType !== MenuItemType.Divider)
.forEach(item => (item.checked as IObservableValue<boolean>).value = item.id === menuItem.id)
}
this.groupByMenuItems = [
{
data: true,
id: 'groupByAge',
text: 'Group by age',
ariaLabel: 'Group by age',
onActivate: onActivateGroupBy,
important: false,
checked: new ObservableValue(runStore.groupByAge.get()),
},
{
data: false,
id: 'groupByRule',
text: 'Group by rule',
ariaLabel: 'Group by rule',
onActivate: onActivateGroupBy,
important: false,
checked: new ObservableValue(!runStore.groupByAge.get()),
},
{ id: "separator", important: false, itemType: MenuItemType.Divider },
]
}
autorun(() => {
this.itemProvider.clear()
this.itemProvider.splice(undefined, undefined, [{ items: this.props.runStore.rulesTruncated }])
})
autorun(() => this.show = this.props.index === 0)
}