diff --git a/src/entities/activity/ui/items/Matrix/MatrixSingleSelectItem/RadioGrid.tsx b/src/entities/activity/ui/items/Matrix/MatrixSingleSelectItem/RadioGrid.tsx index f4fb9e9eb..fd86f5dcf 100644 --- a/src/entities/activity/ui/items/Matrix/MatrixSingleSelectItem/RadioGrid.tsx +++ b/src/entities/activity/ui/items/Matrix/MatrixSingleSelectItem/RadioGrid.tsx @@ -27,7 +27,7 @@ export const RadioGrid = ({ rows, options, onChange, values }: Props) => { isEven={isEven} item={{ id: row.id, imageUrl: row.rowImage, text: row.rowName, tooltip: row.tooltip }} > - {options.map((option, optionI) => { + {options.map((option) => { const isChecked = option.text === values[rowI]; return ( diff --git a/src/widgets/ActivityDetails/model/mappers.ts b/src/widgets/ActivityDetails/model/mappers.ts index bee79abd6..e53a24ead 100644 --- a/src/widgets/ActivityDetails/model/mappers.ts +++ b/src/widgets/ActivityDetails/model/mappers.ts @@ -8,6 +8,7 @@ import { MultiSelectionRowsItem, RadioItem, SelectorItem, + SingleSelectionRowsItem, SliderItem, TextItem, TimeItem, @@ -69,6 +70,9 @@ export function mapToAnswers( case 'multiSelectRows': return convertToMatrixMultiSelectAnswer(item); + case 'singleSelectRows': + return convertToMatrixSingleSelectAnswer(item); + default: return null; } @@ -252,6 +256,16 @@ function convertToMatrixMultiSelectAnswer( }; } +function convertToMatrixSingleSelectAnswer(item: SingleSelectionRowsItem) { + return { + answer: { + value: item.answer, + text: item.additionalText || null, + }, + itemId: item.id, + }; +} + export function mapAlerts(items: Array): Array { const alerts = items.map((item) => { switch (item.responseType) {