Skip to content

Expand discipline choice to full ISO 19115 topic categories#484

Open
coltonbooth wants to merge 5 commits into
developmentfrom
feature/expand-discipline-choice
Open

Expand discipline choice to full ISO 19115 topic categories#484
coltonbooth wants to merge 5 commits into
developmentfrom
feature/expand-discipline-choice

Conversation

@coltonbooth

@coltonbooth coltonbooth commented Apr 16, 2026

Copy link
Copy Markdown
Member

Summary

  • Replace the 3-value theme selector (Oceanographic, Biological, Other) with the full set of ISO 19115 MD_TopicCategoryCode values, each with bilingual titles and definitions
  • Prominent categories (Oceans, Biota, Climate, Environment, Society) are shown by default; remaining categories are accessible via an expandable accordion
  • Add backward compatibility layer (normalizeResourceType) to transparently map legacy oceanographic/biological values to their ISO equivalents (oceans/biota) in existing
    records

Changes

  • src/utils/themes.js — Replaced simple theme list with a structured topicCategories object (22 ISO codes + "other") including en/fr titles, definitions, and a prominent
    flag
  • src/utils/normalizeResourceType.js — New utility to normalize legacy resource type values to ISO codes
  • src/components/Tabs/StartTab.jsx — Reworked the theme selector UI with prominent/non-prominent split and accordion
  • src/utils/validate.js, MapSelect.jsx, IdentificationTab.jsx — Updated to use normalizer instead of hardcoded string checks
  • src/utils/blankRecord.js — Default resource type set to ["oceans"]
  • src/categoryList.js — Removed (consolidated into themes.js)
  • Added tests for normalizeResourceType and expanded validate tests for legacy/ISO compatibility

Test plan

  • Verify prominent categories render on the Start tab with tooltip definitions
  • Expand accordion and confirm all remaining ISO categories appear
  • Create a new record and verify default is "Oceans"
  • Open an existing record with legacy oceanographic/biological values and confirm they display correctly as Oceans/Biota
  • Select only "Other" and confirm EOV behavior still triggers
  • Select "Biota" and verify map description is required on the spatial tab
  • Run npm test — all new and existing tests pass

@github-actions github-actions Bot added the enhancement New feature or request label Apr 16, 2026
@github-actions

github-actions Bot commented Apr 16, 2026

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 561dc82):

https://cioos-metadata-form-dev-258dc--pr484-feature-expand-di-bgimvyrg.web.app

(expires Thu, 16 Jul 2026 15:59:36 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: c9b6275cb4b6311b719349f5e25e457b5691d09c

@JessyBarrette

Copy link
Copy Markdown
Member

In order to fully integrate this change, we will need to fix within the ISO-19115-3 xml output generated by the form this specific field which is right always defaulting to add the category oceans:

TODO

  • In cioos-siooc/cioos-metadata-conversion: confirm that category is pass from the cioos firebase schema to the cioos schema.
  • Apply changes to cioos-siooc/metadata-xml to retrieve the new category field and stop hard coding always ocean to all xml.
  • In metadata-xml, still Default that if no category asign ocean
  • Commit to main branch metadata-xml
  • Upgrate cioos-metadata-conversion metadata-xml dependancies
  • Add tests to cioos-metadata-conversion for this specific category and default value
  • Commit to main
  • Upgrade local firebase python function dependancy to the latest main version of cioos-metadata-conversion

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

Labels

enhancement New feature or request

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants