Map Job Submit Feature with OGC API - #1
Draft
grallewellyn wants to merge 55 commits into
Draft
Conversation
- Frontend tool (src/essence/Tools/Workflows/): talks directly to the workflows API with paste-in Bearer token auth. Hardcoded catalog of IASS/NFSS endpoints grouped by category (Assessment / Forecasting) with auto-generated forms per endpoint (hidden + readOnly + file:// stripping supported). - Paginated job list, expand-for-details rows, inline job renaming, layer visibility toggle for auto-added outputs, Refresh button. - Output handling: STAC item URLs (from stages[].products[].prod_ description) auto-add as stac-collection: tile layers via MMGIS's existing STAC handling. WFS GetFeature JSON URLs auto-add as vector layers. Non-viewable outputs (s3://, .nc, .zarr) are listed but not auto-added. - Backend module (API/Backend/Workflows/): Postgres table workflow_submissions holds per-user submission history (endpoint, payload, display name) so history survives across browsers/devices. - Reference-Mission blueprint gains a Workflows tool entry and top-level workflows.baseUrl block.
Replace auto-add with an explicit "add as layer" button on completed jobs' addable outputs (STAC item, vector file, or WFS GeoJSON URL). Once added, the button becomes the existing show/hide layer toggle. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Move baseUrl from the ad-hoc top-level `workflows` mission-config block into the Workflows tool's variables, declared in its config.json so the Configure page renders a text field for it (same pattern as the Analysis tool's apiBaseUrl). The tool still falls back to the legacy top-level block for previously configured missions. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Now that the workflows API is reachable without cross-origin cookie restrictions, drop the Bearer-token paste UX entirely. The tool checks /api/auth-status with credentials on open; if unauthenticated, a Connect button opens /api/login in a popup and polls auth-status until the session cookie lands. Adds a sign-out link backed by /api/logout. Also remove the hardcoded CZDT server URL from the Reference-Mission blueprint and the Configure-UI placeholder — the base URL is deployment-specific and set per mission. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Move the outputs list out of the collapsed job tile into the expanded view. - Require a run name at submit and move the field above the parameter inputs. - Replace per-output "add as layer" links with a single "Add to map" button that defaults to the run's STAC item; once added it becomes a Show/Hide-on-map toggle. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Layers added via "Add to map" now nest under a shared "Workflows" header group in the Layers panel and are labeled with the user's run name (uuid-keyed internally, so duplicate names can't collide). Refreshes the Layers panel in place when it's the active tool. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Rename the Layers-panel group to "Workflow Outputs".
- Stamp time:{enabled:false} on built layers — without it Map_ turns
the missing time object into empty starttime/endtime strings and the
tile middleware emits a `datetime=/` param that pgstac rejects.
- Split the single morphing map button into two explicit controls:
"Add layer" (one-time) and a Show/Hide visibility toggle that's only
live once the layer exists.
- Populate layer.description with workflow provenance (run name, job
id, endpoint, submitted parameters as a markdown table) so the
Layers panel's Information modal shows where the layer came from.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ty checkbox - Render the job list as soon as all_ids returns and catch per-job detail-fetch errors — previously one failing detail request rejected the whole batch and skipped the re-render, leaving only locally-known jobs visible until an unrelated interaction. - Persist added layers into the mission configuration via /api/configure/addLayer (creating the "Workflow Outputs" group on first use), with a save-state hint in the expanded view. Layers loaded back from config are recognized as already added. - Fix renaming jobs this user didn't submit: write to the live job object (polling replaces job objects wholesale) and upsert the history row instead of updating zero rows. - Replace the Show/Hide button with a Layers-panel-style filled checkbox that toggles layer visibility. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…yer fix - Renaming a run now updates its layer's label and provenance description in-memory, in the Layers panel, and in the stored mission config via /api/configure/updateLayer. - Drop the raw output-URI list from the expanded drawer (s3/internal paths are noise); keep just the Add layer + visibility controls. - Fix "Add layer" requiring a visibility toggle to appear: makeLayer only constructs the Leaflet layer — restore the addVisible call that actually attaches it to the map. - Show a compact visibility checkbox on the job tile itself once the layer exists, so toggling doesn't require opening the drawer. - Add a case-insensitive text filter over run name / workflow id, with pagination and detail fetches scoped to the filtered set. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The Configure API's upsert runs uuidValidate() on every layer uuid and
rejects the whole write ("There are duplicate or bad UUIDs.") when any
fail. Our human-readable ids (workflow-<jobId>, workflows-tool-group)
were the offenders. Layers now use the workflow's own job id as their
uuid (already a genuine UUIDv4) and the group header uses a fixed
RFC-format literal.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Tile layers must carry minZoom/maxNativeZoom/maxZoom — the validator fills no defaults for them, and our STAC tile layer omitted maxNativeZoom, failing the whole config write with "Configuration object is invalid." Also log the validator's detailed errors array on persist failure so future rejections identify the offending field. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Deny submission with an inline red warning under the Run Name field
instead of a browser alert; clears as the user types.
- Hide the uuid on named run tiles (kept in the hover tooltip and
still matched by the text filter).
- Show a friendly workflow label ("Flood Prediction Inference")
instead of the raw endpoint path or template id, prettifying
server-side template ids like flood_population_impact_v1.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Named tiles hide the uuid in the collapsed header; surface it as the first line of the expanded drawer instead. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Red-outlined "Remove layer" button (with confirm) detaches the layer from the map, cleans all L_ registries and the Workflow Outputs group, and best-effort deletes it from the stored mission configuration via /api/configure/removeLayer. Add/remove/re-add round-trips cleanly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Replace the Connect button with an inline "connect" link in the not-signed-in banner, matching the sign-out link style. - Close the OAuth popup automatically once auth-status confirms sign-in — the API redirects it to /api/docs and never closes it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Purpose
Map Job Submit compatible with OGC APIs. The purpose is to be able to submit jobs with input from the map like a point or bounding box, and also be able to view job output on the map
Starting point was Josh Rodriguez's workflow code
Proposed Changes
Testing