Conversation
Preview DeploymentPreview URL: $PREVIEW_URL Note: This preview uses the staging API endpoints and has auth disabled for testing. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3766f19915
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| </Box> | ||
| ) | ||
|
|
||
| if (!canManageAmp && !loadedQuery.isLoading) { |
There was a problem hiding this comment.
Allow AMP editors to access the well edit page
This access gate only allows canManageAmp, which restricts the page to AMP admins. The resource policy for ocotillo.thing-well grants edit to editorRoles (including AMP.Editor), so this change blocks valid editor users from /ocotillo/well/edit/:id and removes an expected production workflow for non-admin editors.
Useful? React with 👍 / 👎.
| sampling_procedure_notes: | ||
| joinNotes(aggregate.well.sampling_procedure_notes as any) ?? null, | ||
| water_notes: joinNotes(aggregate.well.water_notes as any) ?? null, | ||
| measuring_notes: joinNotes(currentLocation?.properties?.notes) ?? null, |
There was a problem hiding this comment.
Map measuring notes from well notes, not location notes
This assigns notes.measuring_notes from currentLocation.properties.notes, which is already used for location.notes, so well-level measuring notes are discarded during form load. For wells where measuring notes differ from location notes, saving the form can overwrite the measuring notes with the location note text.
Useful? React with 👍 / 👎.
… for well attributes
Preview DeploymentPreview URL: $PREVIEW_URL Note: This preview uses the staging API endpoints and has auth disabled for testing. |
Preview DeploymentPreview URL: https://preview-well-edit-ocotillo-auejgdbofq-uc.a.run.app Note: This preview uses the staging API endpoints and has auth disabled for testing. |
Summary
This PR adds a dedicated well editor for Ocotillo that edits the full well aggregate through a single backend POST endpoint instead of the current flat well-only PATCH flow.
The editor groups related fields into logical sections like
well,location,contacts, andwellScreens, packages the full form state into one payload, and sends that payload to a dedicated well-edit endpoint. It also adds an Edit entry point on the well show page forAMP.Adminusers and updates the editor layout to work cleanly on mobile and tablet.Changes
/ocotillo/well/edit/:idexperience with a dedicated aggregate well editorAMP.AdminAPI Contract
This work introduces a dedicated aggregate edit endpoint for wells, expected to support a grouped payload like:
welllocationcontactswellScreensnotesThe frontend no longer orchestrates multiple resource saves for this workflow. The backend becomes the single persistence boundary for the edit operation.
UI Notes
AMP.AdminTesting
Notes