Skip to content

feat(dwc): DwC Mapping and Archive Export frontend#7943

Open
foozleface wants to merge 1 commit intospecify:mainfrom
calacademy-research:cas/dwc-frontend
Open

feat(dwc): DwC Mapping and Archive Export frontend#7943
foozleface wants to merge 1 commit intospecify:mainfrom
calacademy-research:cas/dwc-frontend

Conversation

@foozleface
Copy link
Copy Markdown
Collaborator

Contributed by @foozleface

Adds the React frontend for the DwC export pipeline: a Schema Mapping tool for building and editing DwC mappings, and an Archive Export tool for generating and downloading DwC Archives. Both are accessible from the User Tools menu (admin-only).

Implementation

  • DwC Mapping tool (User Tools > DwC Mapping, SchemaMapper/index.tsx):
    • List view showing all mappings with field completion stats (mapped/total)
    • Create new mapping (blank or from existing query via "Use Existing Query" option)
    • Full mapping editor (MappingEditor.tsx): assign DwC terms to query fields via searchable dropdown, auto-map button, duplicate term prevention, locked occurrenceID row
    • Clone and rename mappings (CloneMapping.tsx)
    • Delete with confirmation dialog
    • Term dropdown (TermDropdown.tsx) with grouped display (Occurrence, Event, Location, etc.) and IRI tooltips (TermTooltip.tsx)
    • Auto-map algorithm (autoMap.ts) matches field names to DwC terms using the vocabulary
    • Vocabulary dialog (VocabularyDialog.tsx) for browsing the full DwC term set
  • DwC Archive Export tool (User Tools > DwC Archive Export, ExportPackages/index.tsx):
    • List view of all archive packages with last-exported timestamp
    • Create archive from any core mapping (PackageForm.tsx), with export name and filename
    • Generate/download DwCA ZIP with progress indicator and elapsed timer
    • Clone archive packages (ClonePackage.tsx)
    • Import EML metadata from file, preview EML XML (EmlEditor.tsx)
    • Per-archive RSS toggle with copy-URL button (CopyRssUrl.tsx)
    • GBIF validator link (GbifValidator.tsx) for quick validation of downloaded archives
    • Delete with confirmation dialog
  • Routing (OverlayRoutes.tsx): two new overlay routes at /specify/overlay/schema-mapper/ and /specify/overlay/export-packages/
  • User Tools menu (userToolDefinitions.ts): replaces the old "Make DwCA" and "Update Export Feed" entries with "DwC Mapping" and "DwC Archive Export"
  • Localization (header.ts): new localization strings for all UI labels
  • Permissions: both tools check userInformation.isadmin and show a permission-denied dialog for non-admin users
  • Unit tests (__tests__/): tests for the auto-map algorithm, vocabulary parsing, and toolbar component

Note: Depends on the DwC backend PR being merged first.

This is part of the DwC export pipeline addressing issues #7709-#7748 (40 GitHub issues for Darwin Core Archive support).

Testing instructions

  • Log in as an admin user
  • Open the User Tools menu — verify "DwC Mapping" and "DwC Archive Export" appear under the Export section
  • Click "DwC Mapping" — verify the mapping list loads (empty if no mappings exist yet)
  • Create a new mapping: enter a name, select a context table, click Create
  • In the mapping editor: click "Auto Map" to auto-assign DwC terms, verify terms appear in the dropdowns
  • Manually assign a term via the dropdown — verify duplicate terms show a warning
  • Save the mapping, return to the list, verify the field count updates
  • Clone the mapping — verify a copy appears with "(clone)" suffix
  • Navigate to "DwC Archive Export" — create a new archive package using the mapping
  • Click "Generate & Download" — verify a DwCA ZIP downloads successfully
  • Toggle RSS on for the archive, copy the RSS URL, verify it returns valid XML
  • Log in as a non-admin user — verify both tools show a permission-denied message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📋Back Log

Development

Successfully merging this pull request may close these issues.

1 participant