Update provisioning to auto-detect forecast zones from AFP#1011
Open
rchlfryn wants to merge 8 commits intonav-updatesfrom
Open
Update provisioning to auto-detect forecast zones from AFP#1011rchlfryn wants to merge 8 commits intonav-updatesfrom
rchlfryn wants to merge 8 commits intonav-updatesfrom
Conversation
…lt in page function
Contributor
|
Preview deployment: https://provisioning-updates.preview.avy-fx.org |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Auto-detect single vs multi-zone avalanche centers from AFP data during provisioning, and create the appropriate zone-specific built-in pages. Non-forecast built-in pages are now sourced from DVAC's navigation rather than a hardcoded list, so changes to the template automatically propagate to new tenants. Mountain Weather is conditionally provisioned based on whether the center has weather forecasts configured in NAC.
Related Issues
Fixes #999
Key Changes
provisionTenant.tscallsgetActiveForecastZones()during provisioning. Single-zone centers get one "Avalanche Forecast" page; multi-zone centers get "All Forecasts" + per-zone pages sorted by rank. Falls back to a default "All Forecasts" page if AFP is unavailable.BUILT_IN_PAGESlist, non-forecast pages (weather stations, observations, blog, events, etc.) are extracted directly from DVAC's resolved navigation (depth: 1).extractNavReferencesnow returns{ title, url }pairs so no separate DB query is needed./weather/forecast) is no longer sourced from DVAC's nav. It's conditionally included based on whether the center hasplatforms.weatherenabled in NAC.blogandeventstab data that was causing nav creation to silently fail.resolveBuiltInPagesfunction — Deduplicates the AFP query + page resolution logic betweenprovisionTenant.tsandonboardingActions.ts.How to test
pnpm seedto seed the database/admin/collections/tenantsand create a new tenant (e.g. name: "Test Center", slug: "btac")btac(4 zones), verify "All Forecasts" + 4 zone pages are created as built-in pagesmsac), verify a single "Avalanche Forecast" built-in page is createdpnpm test— all 289 tests passScreenshots / Demo video
https://www.loom.com/share/0563513b68564b3d8265cdba9ec9519b
Migration Explanation
No new migrations in this PR's scope (provisioning changes only).
Future enhancements / Questions