Skip to content

feat: Graphical Calculation View Editor (Phases 1-5)#141

Merged
jung-thomas merged 40 commits into
mainfrom
feature/analytics-reporting
May 17, 2026
Merged

feat: Graphical Calculation View Editor (Phases 1-5)#141
jung-thomas merged 40 commits into
mainfrom
feature/analytics-reporting

Conversation

@jung-thomas
Copy link
Copy Markdown
Contributor

@jung-thomas jung-thomas commented May 17, 2026

Summary

  • Implements a full graphical Calculation View editor in the Vue web UI, replicating core SAP BAS Calculation View editor UX
  • DAG-based node canvas (Vue Flow) with bottom-to-top data flow, 10 node types, drag-and-drop palette, column mapping, join condition builder, undo/redo, auto-layout (elkjs), multi-tab support, file management, and full semantics editing
  • XML parser/serializer for .hdbcalculationview files with comprehensive round-trip fidelity
  • Backend routes for project file listing, reading, and writing
  • 46 frontend unit tests covering parser, serializer, commands, and undo/redo

Phases delivered:

  1. Foundation — Types, XML parser/serializer, Vue Flow canvas, basic nodes
  2. Core Editing — All 10 node types, edge connect/disconnect, column mapping, join builder, command-pattern undo/redo
  3. Advanced Features — Calculated columns, filter expressions (Monaco), auto-layout, input parameters, multi-tab
  4. File Management — Project browser, create/open/save, data source picker with DB search
  5. Full BAS Parity — Semantics column table, hierarchies, restricted measures, node rename/delete, drag-to-reposition

Test plan

  • cd app/vue && npx vitest run — all 46 tests pass
  • npm test — backend route tests pass
  • Open browser to /calc-view-editor — demo model renders with Join_1 → Projection_1/Projection_2 graph
  • Verify undo/redo (Ctrl+Z / Ctrl+Shift+Z) works across all operations
  • Verify save/open via /calc-view-browser file listing
  • Verify node drag persists position on undo/redo

Comprehensive design spec covering architecture, UI layout, node types,
properties panel, file management, and implementation phasing for a
BAS-equivalent Calculation View editor in the hana-cli Vue web UI.
Addresses reviewer feedback:
- Add DEFAULT to dataCategory type union
- Prioritize HANA Cloud (SYS.CALCULATION_SCENARIOS) over legacy _SYS_REPO
- Explicit CalcViewNode.id === NodeShape.modelObjectName relationship
- Downgrade web worker to async microtasks (worker as future optimization)
- Align route prefix to /hana/calcview/ matching existing convention
- Remove separate dirty state composable (derived from undo stack per-tab)
- Add Variable, VariableMapping, RestrictedMeasure, Hierarchy interfaces
- Add path traversal security validation for file endpoints
- Move lineage/performance analysis to Future Considerations
- Rename DataSourcePicker to CalcViewDataSourcePicker to avoid collision
- Clarify Non Equi Join reuses JoinConfig with all operators
- Clarify JoinNode.vue shared by join and nonEquiJoin canvas rendering
- Add tableFunctionConfig and hierarchyFunctionConfig to CalcViewNode
- Specify components are locally imported (not globally registered)
- Clarify Save As updates current tab path + calls markSaved()
9-task TDD plan covering XML parser/serializer, backend routes,
Vue Flow canvas, node palette, and properties panel shell.
Add parseCalcView() function using fast-xml-parser to parse SAP HANA
.hdbcalculationview XML files into typed CalcViewModel objects.
Includes Vitest setup and test fixtures for minimal and projection views.
Add Express routes for listing, reading, and writing .hdbcalculationview
files on disk. Includes path traversal protection and file extension
validation. These routes serve the calculation view editor frontend.
Implements 10 Command classes (AddNode, RemoveNode, ConnectNodes, DisconnectNodes, MapColumn, UnmapColumn, ChangeProperty, AddJoinCondition, RemoveJoinCondition, Batch) with full execute/undo support, plus 9 Vitest unit tests covering all classes.
Implements Phase 2 Tasks 6-7: MappingTab with drag-and-drop column
mapping and JoinConditionSection for managing join conditions.
Updates PropertiesPanel to integrate both components with event
propagation to CalcViewEditor, including batch "Map All" support.
@jung-thomas jung-thomas merged commit 56b71d2 into main May 17, 2026
14 checks passed
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