Skip to content

canvas: scope erwin export to a single selected subject area - #63

Merged
dbose merged 1 commit into
mainfrom
feat-erwin-canvas-scope
Nov 2, 2026
Merged

dbose merged 1 commit into
mainfrom
feat-erwin-canvas-scope

Conversation

@dbose

@dbose dbose commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

What

Wires the scoped erwin export (shipped in 0.8.2 for CLI/API) into the canvas Export menu, so the workflow works end to end from the UI.

When exactly one subject area is filtered in the left drawer, the Export → erwin XML item scopes the download to that area (and shows a · filtered area only note). Zero or multiple areas selected → whole model, as before. Only erwin honours the filter; every other export format is always whole-model.

Why

The backend scoped export (import a mart → iterate one subject area → export just that slice → re-import into the mart's SA by GUID, no duplicates) landed CLI/API-only. Without the canvas wiring a user filtering to one area and clicking Export → erwin still got the whole model — the feature wasn't reachable where people actually work.

How

  • exportUrl(fmt, dialect?, subjectArea?) gains an optional subject_area query param (built with URLSearchParams).
  • activeAreas threads App → TopBar → ImportExportMenu as scopeSubjectArea (the single active area's id, or null).
  • ImportExportMenu applies the scope to the erwin item only; the note renders when scoped.

Verification

  • tsc clean; Vitest 55 passed.
  • Live: with one area filtered, the erwin link became /api/export/erwin?subject_area=<id> → HTTP 200, XSD-valid, carried the Subject_Area, and was smaller than the full export (4877 vs 5209 bytes). Other formats' links unchanged.

Note for the release picture

This is a new change on top of 0.8.2 (which has the backend scoped export). To ship canvas scoping to users it needs the next bump (0.8.3) or to be folded into 0.8.2 before publishing.

Scoped erwin export (export erwin --subject-area) was CLI/API only. Now the canvas Export
menu wires it to the left-bar subject-area filter: when EXACTLY one area is selected, the
erwin option scopes to it (href gains ?subject_area=<id>) and shows a '· filtered area only'
note; zero or several selected -> whole model. Every other format always exports the whole
model. Threads activeAreas (App) -> TopBar -> ImportExportMenu; exportUrl gains an optional
subjectArea param.

Verified live: filter to one area -> erwin link is /api/export/erwin?subject_area=<id>, the
download is a valid, smaller scoped slice; unfiltered -> whole model. tsc clean, Vitest 55
passed.
@dbose
dbose merged commit 7f43dc0 into main Nov 2, 2026
2 checks passed
dbose added a commit that referenced this pull request Nov 2, 2026
0.8.2 -> 0.8.3. Wires the scoped erwin export into the canvas Export menu (PR #63):
with exactly one subject area filtered in the left drawer, Export -> erwin XML downloads
just that area's slice (/api/export/erwin?subject_area=<id>); zero or multiple areas
selected export the whole model. Only erwin honours the filter. The backend scoped
export (0.8.2) was CLI/API-only; this makes it reachable from the UI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant