Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Derive Excel worksheet names from schema annotations #1311

Merged
merged 5 commits into from
Jul 25, 2024

Conversation

pkalita-lbl
Copy link
Collaborator

Fixes microbiomedata/submission-schema#213

Details

Previously we used the "display name" for each template as the worksheet name when importing from/exporting to Excel files. The problem is that some of those names are > 31 characters, making them illegal values for worksheet names.

In microbiomedata/submission-schema#215 I added annotations to the relevant classes in the submission schema to indicate what the corresponding Excel worksheet name should be. Having this in the schema instead of in the nmdc-server code is part of a broader effort to have the schema be the single source of truth (see also microbiomedata/submission-schema#186)

In these changes I am:

  • Upgrading to the latest schema versions
  • Using the new annotation to determine the Excel worksheet names (or continuing to use the "display name" as a fallback, but that shouldn't happen)
  • Presenting a new alert to the user in the event that they attempt to import an Excel file where the worksheet names do not map to a schema class.
  • Removing generation of static JSON files for individual schema classes. We didn't end up using those files in the submission portal or the Field Notes app.

Testing

  • Create a new submission with the "miscellaneous natural or artificial environment" template.
  • Click the Download XLSX button and verify that an Excel file is successfully downloaded.
  • Open the Excel file and verify that the worksheet is named "misc natural or artificial".
  • Add a value to the first column of the Excel file and save it.
  • Click the Import XLSX button and choose your updated Excel file; verify that the import succeeds and you see the value you entered in the first column.

@pkalita-lbl pkalita-lbl requested a review from naglepuff July 23, 2024 19:24
@pkalita-lbl
Copy link
Collaborator Author

Marking this as draft because there is a new version of the schema incoming. Will update this PR and un-draft shortly.

@pkalita-lbl pkalita-lbl marked this pull request as ready for review July 24, 2024 22:32
@pkalita-lbl
Copy link
Collaborator Author

@naglepuff this PR now has upgrades to the latest schema versions

Copy link
Collaborator

@naglepuff naglepuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good! Tested out the workflow outlined in the PR description and can confirm that it works as expected.

@pkalita-lbl pkalita-lbl merged commit 0fe0163 into main Jul 25, 2024
2 checks passed
@pkalita-lbl pkalita-lbl deleted the issue-submission-schema-213-excel-worksheet-names branch July 25, 2024 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Submission portal won't download .xlsx for miscellaneous natural or artificial environment
2 participants