Skip to content

feat(template): personal document layout + owner-name on the My surface#6271

Merged
delchev merged 6 commits into
masterfrom
feat/personal-document-layout
Jul 12, 2026
Merged

feat(template): personal document layout + owner-name on the My surface#6271
delchev merged 6 commits into
masterfrom
feat/personal-document-layout

Conversation

@delchev

@delchev delchev commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Gives the personal (My) surface a document layout for function: Document entities with a personal owner — the third item from the personal-surface review, plus the "for <owner>" title (item 2).

What

A MANAGE_DOCUMENT entity that also has a personal owner now renders on the My surface as a document — header form + inline line-items table (add/edit dialog, per-row delete) + status pill + totals footer — instead of the plain my-form. It is scoped to the <Entity>MyController (header) and <Item>MyController (items, the personal one-hop), so ownership + sensitive-field stripping are enforced server-side. Item column metadata is reused from detail-register (App.detailsFor); item data goes through the personal controller.

  • generateUtils: new personalDocumentModels (MANAGE_DOCUMENT ∧ personal) + personalFormModels (personal minus document roots). personalModels is unchanged, so rest-java still generates the MyController; only the UI form is swapped for the document layout.
  • my.js: my-document-page.js + my-document-view.html for personalDocumentModels.
  • index.html routing/scripts: /my/<Doc>/create|edit → the document editor for document roots.
  • Owner name (item 2): EdmIntentGenerator emits the identity target's label field (relationshipIdentityLabel); parameterUtils propagates personalIdentityLabel; the personal controller gains GET /me returning only the display name; the document/for <owner> title renders it.

Verified live

Regenerated kf-mod-expenses (its remodeled ExpenseClaim is a personal document) and drove the My shell: the document renders with title "Edit Expense Claim EXP0000001 for Administrator", a DRAFT pill, header form, an items table (Hotel 200/40/240 + Taxi 40/8/48 with add/delete), and a totals footer (240/48/288). /me returns {"name":"Administrator"}.

Known limitation

Lookup columns in the items table show the raw FK id until the dialog first loads the options (the table doesn't pre-load lookup options) — a small polish follow-up. The dialog resolves them correctly.

🤖 Generated with Claude Code

delchev and others added 6 commits July 12, 2026 10:55
…y surface

A MANAGE_DOCUMENT entity with a personal owner now renders on the personal (My) surface as a
DOCUMENT - header form + inline line-items table (add/edit dialog) + status pill + totals footer -
instead of the plain my-form, scoped to the <Entity>MyController (header) and <Item>MyController
(items, the personal one-hop). Item metadata is reused from detail-register (App.detailsFor); item
DATA goes through the personal controller so ownership + sensitive-field stripping are enforced.

- generateUtils: new personalDocumentModels collection (MANAGE_DOCUMENT + personal); document roots
  excluded from the plain personalModels form.
- my.js: my-document-page.js + my-document-view.html for personalDocumentModels.
- index.html routing/scripts: /my/<Doc>/create|edit -> the document editor for document roots.
- Owner name ("New/Edit <Doc> for <owner>"): EdmIntentGenerator emits the identity target's label
  field (relationshipIdentityLabel); parameterUtils propagates personalIdentityLabel; the personal
  controller gains GET /me returning only the display name; the document page shows it in the title.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ersonalFormModels for the UI form

The first cut excluded document roots from personalModels, but rest-java generates the personal
<Entity>MyController from personalModels too - so a personal document lost its REST controller
(404). Restore personalModels (roots keep their MyController + list + perspective); add a separate
personalFormModels (personal minus document roots) that only the plain my-form UI uses.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…t detail-column fields

The my-document page read the item metadata with the wrong field names and resolved it too early:
detail-register publishes editColumns with col.name (not col.key) and lookup.text (not .value), and
its registration script runs AFTER the page's init - so App.detailsFor returned nothing and the items
table rendered empty (though the header aggregates were correct). Resolve itemsDef lazily (def()) and
use col.name / col.lookup.text throughout.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… param

The child items MyController.getAll requires ?<masterEntityId>=<id> (and enforces ownership);
without it it returns an empty list. loadItems now passes it instead of fetching the whole list
and filtering client-side. Verified live: the ExpenseClaim document shows its item rows + totals.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…pre-load options)

Load the item lookup options in loadItems (not only on dialog open) so the items table shows the
Category/Supplier/TaxRate labels on first render instead of raw FK ids. Verified live.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@delchev delchev merged commit a961a35 into master Jul 12, 2026
10 checks passed
@delchev delchev deleted the feat/personal-document-layout branch July 12, 2026 10:06
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