Skip to content

Commit

Permalink
[C] update review page
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgoff authored and Blake Mason committed Apr 2, 2024
1 parent 0576f1d commit 3dce9ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions app/api/xlsx/formatter/widget/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { WidgetFormatter, WidgetFormatterFactory } from "..";
import * as formatters from "./formatters";

const widgets: Record<string, WidgetFormatter> = {
colorFilterToolBlock: formatters.colorTool,
sourceSelectorBlock: formatters.sourceSelector,
lightCurveBlock: formatters.lightCurveTool,
questionWidgetsBlock_colorFilterToolBlock_BlockType: formatters.colorTool,
questionWidgetsBlock_sourceSelectorBlock_BlockType: formatters.sourceSelector,
questionWidgetsBlock_lightCurveBlock_BlockType: formatters.lightCurveTool,
};

const widgetFormatterFactory: WidgetFormatterFactory = async ({
Expand All @@ -16,8 +16,8 @@ const widgetFormatterFactory: WidgetFormatterFactory = async ({
questionWidgetsBlock,
}) => {
const { t } = await serverTranslation(locale, "translation");
const { typeHandle, ...widgetConfig } = questionWidgetsBlock[0];
const formatter = widgets[typeHandle];
const { __typename, ...widgetConfig } = questionWidgetsBlock[0];
const formatter = widgets[__typename];

if (!formatter || !value) {
cell.value = t("review.no_answer");
Expand Down
2 changes: 1 addition & 1 deletion components/questions/Review/Calculator/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const CalculatorReview: FunctionComponent<

return (
<Styled.ReviewListItem value={number}>
{questionText}
{questionText}
{value ? (
<StaticCalculator type={equation} locale={language} {...{ value }} />
) : (
Expand Down

0 comments on commit 3dce9ef

Please sign in to comment.