Skip to content

Commit

Permalink
Fix small bug in validation annotations in EML
Browse files Browse the repository at this point in the history
And remove dev code

Issue #2542
  • Loading branch information
robyngit committed Nov 4, 2024
1 parent 4fd8ec0 commit 979d2a5
Showing 1 changed file with 2 additions and 26 deletions.
28 changes: 2 additions & 26 deletions src/js/models/metadata/eml211/EML211.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
);
Expand Down

0 comments on commit 979d2a5

Please sign in to comment.