From 12535a72fe1dacc86ee9fcf217ea4dd260d843fd Mon Sep 17 00:00:00 2001 From: cuenyad Date: Fri, 6 Sep 2019 14:39:42 -0300 Subject: [PATCH 1/2] Forcing use Map Ontology doesn't matter if is a new study or no. ISSUE: IBP-2757 Review: none --- .../angular/AngularSelectSheetController.java | 41 +++---------------- 1 file changed, 5 insertions(+), 36 deletions(-) diff --git a/src/main/java/com/efficio/etl/web/controller/angular/AngularSelectSheetController.java b/src/main/java/com/efficio/etl/web/controller/angular/AngularSelectSheetController.java index e2af3b263d..eb0eeddc96 100644 --- a/src/main/java/com/efficio/etl/web/controller/angular/AngularSelectSheetController.java +++ b/src/main/java/com/efficio/etl/web/controller/angular/AngularSelectSheetController.java @@ -326,46 +326,15 @@ public Map processForm( // routing logic for existing study vs new study details final Integer studyId = form.getStudyDetails().getStudyId(); this.userSelection.setStudyId(studyId); - if (studyId != null && studyId != 0) { - final List errors = new ArrayList<>(); - Map> mismatchErrors = null; - final boolean isMeansDataImport = this.userSelection.getDatasetType() != null - && this.userSelection.getDatasetType() == DatasetTypeEnum.MEANS_DATA.getId(); - try { - // check if the selected dataset still has no mapped headers - if (isMeansDataImport) { - if (!this.etlService.hasMeansDataset(studyId)) { - return this.wrapFormResult(AngularMapOntologyController.URL, request); - } - } else { - if (!this.etlService.hasMeasurementEffectDataset(studyId)) { - return this.wrapFormResult(AngularMapOntologyController.URL, request); - } - } - - mismatchErrors = this.checkForMismatchedHeaders(errors, mismatchErrors, isMeansDataImport); - - if (mismatchErrors != null && !mismatchErrors.isEmpty()) { - for (final Map.Entry> entry : mismatchErrors.entrySet()) { - errors.addAll(this.etlService.convertMessageList(entry.getValue())); - } - return this.wrapFormResult(errors); - } else { - return this.wrapFormResult(AngularOpenSheetController.URL, request); - } + final boolean isMeansDataImport = this.userSelection.getDatasetType() != null + && this.userSelection.getDatasetType() == DatasetTypeEnum.MEANS_DATA.getId(); - } catch (final Exception e) { - AngularSelectSheetController.LOG.error(e.getMessage(), e); - final List error = new ArrayList<>(); - error.add(new Message(Constants.MESSAGE_KEY_GENERIC_ERROR)); - errors.addAll(this.etlService.convertMessageList(error)); - return this.wrapFormResult(errors); - } - } else { + // check if the selected dataset still has no mapped headers + if (isMeansDataImport) { return this.wrapFormResult(AngularMapOntologyController.URL, request); } - + return this.wrapFormResult(AngularMapOntologyController.URL, request); } List validate(final ConsolidatedStepForm form) throws IOException, WorkbookParserException { From 5b58579b86c86de2f2a1a146f54b2493ab92a088 Mon Sep 17 00:00:00 2001 From: cuenyad Date: Fri, 6 Sep 2019 14:46:06 -0300 Subject: [PATCH 2/2] Adding show message error. ISSUE: IBP-2757 Review: none --- .../webapp/WEB-INF/pages/etl/angular/angularSelectSheet.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/webapp/WEB-INF/pages/etl/angular/angularSelectSheet.html b/src/main/webapp/WEB-INF/pages/etl/angular/angularSelectSheet.html index ef8ab59841..29678950e5 100644 --- a/src/main/webapp/WEB-INF/pages/etl/angular/angularSelectSheet.html +++ b/src/main/webapp/WEB-INF/pages/etl/angular/angularSelectSheet.html @@ -387,6 +387,8 @@

Select Row Containing Column Headers

$scope.messages = data.messages; $scope.userAttemptedSubmission = false; } + }).error(function (error) { + $scope.messages.push(error); }); } else { $scope.userAttemptedSubmission = false;