Inline creation in views - #351
Merged
Merged
Conversation
Implements the Inline-Creation-in-Views proposal: views attached via ldh:view/ldh:inverseView get a Create button in the view toolbar when the View carries the new ldh:container metadata. The modal constructor form PUTs the new instance document into the container; forward views PATCH the linking triple into the current document (INSERT/WHERE form), inverse views ship it inside the PUT body. Property, direction and constructed class are inferred from the ontology (rdfs:domain/rdfs:range incl. rdfs:subPropertyOf paths); the Create button is gated on acl:Write obtained by HEADing the container for its acl:mode Link headers. Also adds optional ldh:showWhenEmpty (default true). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The creation modal now renders through the document-level bs2:Form pipeline over the instantiated resource (ldh:set-typeahead-form-resource), producing the full row-form UI with the form shell; the instance is minted as a fragment within the new document and the description ships as the PUT body. The post-creation refresh rebuilds the results context from the contents cache like the pager listeners (the view's spin:query RDFa is consumed by the initial render, so ldh:RenderRow re-entry cannot match). Also resets the progress cursor on terminal paths and floats the Create button (now btn-primary) left of the mandatory order-by/mode controls. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
LDH forms submit plain xsd:string literals, which the hardcoded langMatches(lang(?prefLabel), "en") filters excluded from every package view. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ldh:render-view restores the default cursor once the results render, same as the pager/order/mode interactions. 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.
Implements the Inline Creation in Views proposal.
Views attached to properties via
ldh:view/ldh:inverseViewget a Create button in the view toolbar when the View carries the newldh:containermetadata. The button opens a modal with the full row-form UI (SPIN constructor + SHACL shapes) for the class inferred from the ontology (rdfs:rangefor forward views,rdfs:domainfor inverse, includingrdfs:subPropertyOfpaths). Submitting issues a singlePUTthat creates the container's child document with the instance as a#id{uuid}fragment; forward views thenPATCHthe linking triple into the current document (INSERT/WHEREform), while inverse views ship it inside thePUTbody. The view re-queries in place afterwards.ldh:containerandldh:showWhenEmpty(defaulttrue— whenfalse, empty views are hidden)acl:Write, read from the container'sacl:modeLink headers via a HEAD request; forward views additionally requireacl:Writeon the current document?property, direction,?forClass,?container,?showWhenEmpty) travels through the ontology view query against/ns, so package views can be annotated from the app's own namespaceprefLabelliterals (LDH forms submit plainxsd:string)🤖 Generated with Claude Code