feat(collections): desktop GIS downloads and a table view for the datasets page - #359
Open
jirhiker wants to merge 2 commits into
Open
feat(collections): desktop GIS downloads and a table view for the datasets page#359jirhiker wants to merge 2 commits into
jirhiker wants to merge 2 commits into
Conversation
The API now serves ready-made QGIS and ArcGIS Pro artifacts for our OGC API layers, so a user can open our data in a desktop GIS without configuring a connection by hand. Nothing in the UI surfaced them. Adds a panel above the dataset groups with the QGIS connections file, the QGIS import instructions, and a copyable service URL for ArcGIS Pro, which has no importable connection file. Per-layer .qlr / .lyrx downloads render on the collection row they belong to, matched on the catalogue's `collection` field against the collection id the page already resolves. Layer ids are API-side config and change, so nothing here hardcodes them, and hrefs and filenames are used verbatim from the catalogue: CORS on the API exposes no headers, so `Content-Disposition` is unreadable from JS. Anonymous artifacts are plain anchors; the authenticated internal-connections file is the one blob round-trip, gated on AMP viewer access. Types are hand-written zod for now. The committed openapi-auth.json snapshot has no /gis paths, and the only source for them is an unmerged API branch whose spec also carries unrelated unreleased endpoints and eight changed schemas, including WellResponse and ThingResponse. Refreshing the whole snapshot to reach /gis would regenerate all of that here. src/utils/gisArtifacts.ts is scoped to the GIS surface and marked for replacement once /gis is in the deployed spec. Contract and the follow-up notes: docs/gis-artifact-downloads-contract.md Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Preview DeploymentPreview URL: https://preview-feature-gis-artifact-downloads-auejgdbofq-uc.a.run.app |
The card grid buries the catalogue: four group cards, each a column of paragraphs, so comparing datasets means scrolling past descriptions. A table puts all 24 on one screen — which is what this page is for — so it is now the default, with a Cards/Table toggle in the header to get the old layout back. Group membership is carried by row tint plus a labelled band per group rather than a repeated column, and the collection id is dropped from the dataset column: it is machine detail, and the title is what a reader scans by. The page also runs wider than the old `lg` container, which left the table cramped — full width up to a widescreen monitor, then ten of twelve columns so rows do not run the whole span of a very wide display. The "Admin View" overline is gone; the nav already gates who gets here. buildCollectionRows and the shared collection field resolution live in src/utils/collectionsView.ts so both views agree on what a dataset is called. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Preview DeploymentPreview URL: https://preview-feature-gis-artifact-downloads-auejgdbofq-uc.a.run.app |
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.
Base branch
This targets
feature/geothermal-map-layers(#356), notstaging— it edits the same collections page. #356 in turn targets #355. Retarget down the stack as each merges.What
Two commits.
feat(collections): offer desktop GIS downloads on the datasets page— the API serves ready-made QGIS and ArcGIS Pro files for our OGC API layers; nothing in the UI surfaced them.service_urlfor ArcGIS Pro, which has no importable connection file from us.collectionfield against the collection id the page already resolves.feat(collections): add a table view and make it the default— the card grid buried the catalogue: four group cards, each a column of paragraphs, so comparing datasets meant scrolling past descriptions.lgcontainer: full width up to a widescreen monitor, then ten of twelve columns so rows do not span a very wide display.Contract doc added at
docs/gis-artifact-downloads-contract.md.Following the contract
water-level-trendand you get nothing; layers come from API-side YAML config and are expected to change.hrefis used verbatim, so staging, production and an ephemeral preview API all resolve correctly.expose_headers, soContent-Dispositionis unreadable from JS even though it is on the wire.axiosInstancewithresponseType: 'blob'.The types are hand-written zod, deliberately
The committed
openapi-auth.jsonhas no/gispaths — the endpoints live on the unmerged API branchfeat/ogc-desktop-gis-artifacts. I dumped the spec from that branch to see what a refresh would cost: it adds the five/gispaths, but also two unrelated unreleased endpoints (/chemistry/results,/observation/transducer-groundwater-level/block) and changes eight existing schemas,WellResponse,ThingResponseandSpringResponseamong them — schemas the rest of the app validates against.Regenerating all of that on a branch stacked two deep to reach one new surface was the wrong trade, so
src/utils/gisArtifacts.tscarries zod for the catalogue only, scoped to this surface and marked for replacement. When the API branch merges and deploys: refresh the spec,npm run openapi:generate, drop those schemas for the generated ones. Nothing else depends on them.One gap this exposes on the API side
/gis?f=jsonlists only anonymous artifacts, so/gis/qgis/connections-internal.xmlis not in the catalogue at all.deriveInternalGisConnectionderives it from the public entry'shref— string surgery of exactly the kind the contract says to avoid, and the only place the rule is broken. Cleanest fix is the API listing the internal connection; the helper is marked for deletion when it does.Verification
npm run typecheck— clean.src/test/utils/gisArtifacts.test.ts,src/test/utils/collectionsView.test.tsandsrc/test/components/GisArtifacts.test.tsx: catalogue parses, layers index by collection, a download control carries the exacthrefandfilenamefrom the fixture, the internal control is hidden without the role and shown with it, and rows flatten out of the groups with the group key and GIS layer attached._index_payload()from the API branch (6 layers, 2 downloads each) and parsed it withzGisCatalog— clean.🤖 Generated with Claude Code