From 979d2a5cdfcae2434c1a8430ed2178e528e33939 Mon Sep 17 00:00:00 2001 From: robyngit Date: Mon, 4 Nov 2024 14:27:54 -0500 Subject: [PATCH] Fix small bug in validation annotations in EML And remove dev code Issue #2542 --- src/js/models/metadata/eml211/EML211.js | 28 ++----------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/src/js/models/metadata/eml211/EML211.js b/src/js/models/metadata/eml211/EML211.js index 87aeb3bd5..d4dfe724c 100644 --- a/src/js/models/metadata/eml211/EML211.js +++ b/src/js/models/metadata/eml211/EML211.js @@ -1712,32 +1712,8 @@ define([ // Validate the EMLAnnotation models const annotations = this.get("annotations"); const annotationErrors = annotations.validate(); - // if (annotationErrors) { - // // Put canonicalDataset annotation errors in their own category - // // so they can be displayed in the special canonicalDataset field. - // const canonicalErrors = []; - // const errorsToRemove = []; - // // Check for a canonicalDataset annotation error - // annotationErrors.forEach((annotationError, i) => { - // if (annotationError.isCanonicalDataset) { - // canonicalErrors.push(annotationError); - // errorsToRemove.push(i); - // } - // }); - // // Remove canonicalDataset errors from the annotation errors - // // backwards so we don't mess up the indexes. - // errorsToRemove.reverse().forEach((i) => { - // annotationErrors.splice(i, 1); - // }); - - // if (canonicalErrors.length) { - // // The two canonicalDataset errors are the same, so just show one. - // errors.canonicalDataset = canonicalErrors[0].message; - // } - // } - // Add the rest of the annotation errors if there are any - // non-canonical left - if (annotationErrors.length) { + + if (annotationErrors?.length) { errors.annotations = annotationErrors.filter( (e) => e.attr !== "canonicalDataset", );