feat(harmonia): read-only Preview route, detail panels on the edit form, report printing#6131
Merged
Merged
Conversation
… edit form
Preview - /Entity/{id}/preview renders the same data as edit, fully read-only:
- routes registered for MANAGE, SETTING, MASTER, DOCUMENT and DETAIL entities;
the shared shell needs no change (it mirrors the embedded app's inner route
generically, so #/app/<perspective>/<Entity>/{id}/preview just works)
- form + document pages gain mode 'preview' (parsed from the live hash; loads
like edit, save/dialog paths guarded); a display:contents <fieldset
:disabled="isPreview"> disables every control at once; selects also get
:data-disabled so the dropdowns cannot open; footer swaps Cancel/Save for
Close + Edit; BPM task buttons, item Add/Edit/Delete, allocation Add/Delete
and FK Add-new/Refresh are hidden; the document Print button stays (printing
is read-only)
- Preview entry points: manage list details pane + row menu, master details
toolbar + row menu, detail-panel row menu (detailPanel.previewRow)
Detail panels on the edit form (bug fix): a master's detail collections (e.g.
Member -> Loans in sample-intent-model) rendered ONLY on the browse view's
details pane - the edit view showed just the scalar fields. The form view now
renders the same generic detail panels below the form on edit/preview
(App.detailsFor registry), outside the <form> so panel buttons cannot submit
it, with add/edit returning to the same page (returnTo override) and read-only
rendering in preview.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- report-file page (.report artefacts, the intent reports: surface): Print button next to Export - fetches the FULL filtered result set (POST /export, same as the CSV export, honoring the active per-column filters) and renders it into a minimal print document in a new window (title, row count + filtered marker + timestamp, bordered table, numeric columns right-aligned and pattern-formatted) - model report table page: same Print, with column labels/alignment/format emitted from the report model (printColumns) - model report chart page: Print snapshots the chart canvas as a PNG into the print document (printing the live canvas would clip it to the viewport) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
72455f2 to
9766f29
Compare
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.
Three additions to the Harmonia runtime UI (generated templates + the shared shell runtime), verified by rendering every touched template through Velocity with a synthetic model context and
node --check-ing the generated JS.1. Read-only Preview route
Every record page gains
/Entity/{id}/previewnext to/Entity/{id}/edit- the same data as edit, fully read-only:#/app/<perspective>/<Entity>/{id}/preview(e.g./services/web/application/#/app/sales-invoices-SalesInvoice/SalesInvoice/1/preview) works out of the box, as does the standalone SPA.previewmode (parsed from the live hash; loads like edit;save()/item dialogs guarded). Adisplay: contents<fieldset :disabled="isPreview">disables every control in one place; selects additionally get:data-disabledso dropdowns cannot open.detailPanel.previewRow).2. Detail panels on the edit form (bug fix)
In
dirigiblelabs/sample-intent-model, a Member's Loans table showed only on the browse view's details pane - the Edit view rendered just the scalar fields. The shared form view now renders the master's registered detail collections (App.detailsFor) as the same generic panels below the form on edit and preview, outside the<form>element (so panel buttons cannot submit it), with add/edit routing back to the same page via areturnTooverride and read-only rendering in preview.3. Print on the generated report pages
.reportartefacts - the intentreports:surface): Print fetches the FULL filtered result set (POST /export, honoring the active per-column filters) and renders a minimal print document (title, row count + filtered marker + timestamp, bordered table, numeric columns right-aligned and pattern-formatted).Also fixes a latent generation bug found while verifying:
report-file/report.js.templatecontained a literal'##0'display pattern -##starts a mid-line Velocity comment, so every generatedreport.jswas truncated into a JS syntax error at that line. The pattern is now emitted through a#setreference (string literals inside directives are safe from comment parsing).Verification
All 16 touched/affected templates rendered through Velocity 2.4.1 with a synthetic context covering both branches of every conditional (dropdown + dependsOn + lookupColumns, float, date, audit, document number/status, all entity layout types); all 8 generated JS files pass
node --check(the pre-existing report.js failure reproduced and is fixed here);detailPanel.jschecked directly; both Maven modules build.Regenerate an app (or re-publish the templates) to pick the changes up - generated copies in existing workspaces keep the old markup until regenerated.
🤖 Generated with Claude Code