Conversation
Stacked on the station pages change. The /weather/stations index becomes an ordinary Payload page under the Weather nav, so the URL is unchanged and an editor owns the content; the native index and its built-in row go. The Accumulated Precipitation table gets a per-center Page Settings document (unique-tenant collection, titled with the center's name): which columns to show, then the ordered list of stations, built with the same stations field the pages use. That list's picker offers only stations reporting precipitation and marks a listed one that has stopped; the public table keeps the settings order, drops a station with no precipitation series and shows "missing" for a gauge that reported none. Station note icons come off the table. No migration here: the settings table is created by hand. The seed fills NWAC's document with the 19 loggers that have a gauge, in page order. The pre-commit migration scan now skips src/migrations/data, which it could not read. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Contributor
|
Preview deployment: https://featxstation-page-settings.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
Stacked on #1315. Two things on top of it:
The
/weather/stationsindex becomes a Payload page. The native index was a hardcoded list of links with an intro nobody could edit. It's now a normal page under the Weather dropdown, so the URL is unchanged and an editor owns the content. The detail, precipitation and map routes stay native. NWAC's page already exists in production; the nav still needs pointing at it and the "Weather Data" built-in row deleted.Page Settings for the Accumulated Precipitation table. The table used to be a side effect of the pages: every station on a live page, in a north-to-south sort nobody could change. It's now its own per-center document (unique-tenant collection, ADR 016), titled with the center's name, with one tab: which columns the table shows, and an ordered list of the stations it shows, built with the same stations field the pages use. The list's picker only offers stations reporting precipitation and marks a listed station that has stopped; the public table drops a station with no precipitation series and keeps the settings order. Station note icons are gone from that table.
No migration in this PR. The
weather_station_settingstable (and itsprecip_columnsselect table) is handled by hand;pnpm seedcreates it locally through Payload's schema push. The seed fills NWAC's document with the 19 loggers that have a gauge, in page order, and all columns.Related Issues
Stacked on #1315. Follow-ups: #1303, #1304.
Key Changes
collections/WeatherStationSettings("Page Settings" in the admin): one document per center;precipColumns(select, empty means all) aboveprecipStations(stationsFieldwithrequiredVariable: precip_accum_one_hour).services/stations/precipColumnsandgetWeatherStationSettings(cached under the station-pages tag).PrecipAccumulationTable:columnsprop; rows in the settings order; no note flag or legend.tableHelpers.buildPrecipAccumulationTable: keeps the requested order and drops a station whose response has no precipitation series.weather/stations/page.tsxdeleted; the seed gives NWAC astationspage under the Weather nav instead of the built-in row.NWAC_PRECIP_STATIONS, the settings document, the second collection in the Admin role grant..husky/check-migrations: the keyword scan skipssrc/migrations/data/, which it could not read anyway.custom.scss: no stray gap above a tabs field that follows only a hidden input.How to test
pnpm seed, thenpnpm dev.nwac.localhost:3000/weather/stations: the "Weather Data" Payload page, reached from the Weather dropdown./weather/stations/accumulated-precipitation; its row is gone. Drag one to the top; it leads the table. Pick 24H, 72H and Elevation only; the table has four columns.Screenshots / Demo video
TODO: Page Settings with the columns select and stations table.
Migration Explanation
None here, by design; the settings table is created by hand. #1315 carries the
station_pagesmigration.Future enhancements / Questions
variable/tracking/for per-center units and rounding.🤖 Generated with Claude Code