From 8c345a6988f8dd053c191bc1d8998dfd55009e5f Mon Sep 17 00:00:00 2001 From: Biao Li <31789355+biaoli0@users.noreply.github.com> Date: Fri, 31 Mar 2023 11:14:22 +1100 Subject: [PATCH] HotFix: Validation too strict on fetchDataGroup result (#4413) --- .../report-server/src/aggregator/ReportServerAggregator.ts | 3 ++- .../output/functions/rawDataExport/rawDataExportBuilder.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/report-server/src/aggregator/ReportServerAggregator.ts b/packages/report-server/src/aggregator/ReportServerAggregator.ts index d44f9c16d5..602c5f44d8 100644 --- a/packages/report-server/src/aggregator/ReportServerAggregator.ts +++ b/packages/report-server/src/aggregator/ReportServerAggregator.ts @@ -95,7 +95,8 @@ export class ReportServerAggregator { .of( yup.object().shape({ code: yup.string().required(), - text: yup.string().required(), + text: yup.string(), + name: yup.string(), }), ) .required(), diff --git a/packages/report-server/src/reportBuilder/output/functions/rawDataExport/rawDataExportBuilder.ts b/packages/report-server/src/reportBuilder/output/functions/rawDataExport/rawDataExportBuilder.ts index bf3ccad7f7..76d21ae229 100644 --- a/packages/report-server/src/reportBuilder/output/functions/rawDataExport/rawDataExportBuilder.ts +++ b/packages/report-server/src/reportBuilder/output/functions/rawDataExport/rawDataExportBuilder.ts @@ -50,7 +50,7 @@ export class RawDataExportBuilder { const { dataElements } = await this.aggregator.fetchDataGroup(surveyCode); return dataElements.map(dataElement => ({ key: dataElement.code, - title: dataElement.text, + title: dataElement.text || dataElement.name || '', })); }), )