Skip to content

Commit

Permalink
chore: publish ui@0.3.68
Browse files Browse the repository at this point in the history
  • Loading branch information
tnrich committed Jan 25, 2024
1 parent b01823f commit 01fd761
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- Export validateSequenceArray [`#2`](https://github.com/TeselaGen/tg-oss/pull/2)
- genbank ss-DNA should not be overwirte to DNA [`#1`](https://github.com/TeselaGen/tg-oss/pull/1)
- closes #35 [`#35`](https://github.com/TeselaGen/tg-oss/issues/35)
- chore: publish ui@0.3.67 [`b01823f`](https://github.com/TeselaGen/tg-oss/commit/b01823f9f11b11679ad4e573c13ccb050fda39ee)
- bump [`c80c7bc`](https://github.com/TeselaGen/tg-oss/commit/c80c7bc2c8463a9a4cff9643011f12ff88bd469c)
- updating table styling to remove table last row bottom margin, removing unused S3Download, removing axios dep, updating deps [`8a6fb1f`](https://github.com/TeselaGen/tg-oss/commit/8a6fb1f047550f617c3e56b8c3ebf145967076ef)
- Add example file [`79f356f`](https://github.com/TeselaGen/tg-oss/commit/79f356faac0dc5fa0afc882eccdbf9ed5f41d047)
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@teselagen/ui",
"version": "0.3.67",
"version": "0.3.68",
"main": "./src/index.js",
"exports": {
".": {
Expand Down
20 changes: 19 additions & 1 deletion packages/ui/src/FormComponents/tryToMatchSchemas.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,20 @@ async function matchSchemas({ userSchema, officialSchema }) {
"It looks like some of the headers in your uploaded file(s) do not match the expected headers. Please look over and correct any issues with the mappings below.";
}
});
const ignoredUserSchemaFields = [];
userSchema.fields.forEach(uh => {
if (
!officialSchema.fields.find(
h =>
norm(h.path) === norm(uh.path) ||
norm(h.displayName) === norm(uh.path) ||
matchedAltPaths.includes(uh.path)
)
) {
ignoredUserSchemaFields.push(uh);
}
});

if (officialSchema.coerceUserSchema) {
officialSchema.coerceUserSchema({ userSchema, officialSchema });
}
Expand Down Expand Up @@ -214,7 +228,11 @@ async function matchSchemas({ userSchema, officialSchema }) {
// //all the headers match up as does the actual data
// return { csvValidationIssue };
// }

if (!csvValidationIssue && ignoredUserSchemaFields.length) {
csvValidationIssue = `It looks like the following headers in your file didn't map to any of the accepted headers: ${ignoredUserSchemaFields
.map(f => f.displayName || f.path)
.join(", ")}`;
}
return {
searchResults: officialSchema.fields,
csvValidationIssue
Expand Down

0 comments on commit 01fd761

Please sign in to comment.