feat(@sap-ux/generator-odata-downloader): Adds recurisive hierarchy support#4518
Draft
feat(@sap-ux/generator-odata-downloader): Adds recurisive hierarchy support#4518
Conversation
🦋 Changeset detectedLatest commit: c2b45ef The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
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.



Internal issue: 37596
feat(@sap-ux/generator-odata-downloader): recursive hierarchy support
Adds support for downloading
Aggregation.RecursiveHierarchyOData V4 entity data and preparing it for use with the UI5 mock server.Hierarchy detection & querying
getHierarchyEntitiesscans converted metadata forRecursiveHierarchyannotations and builds typedHierarchyEntitydescriptors including qualifier, node property, parent property, draft status, and entity type keyscreateQueryFromEntitiesissues acom.sap.vocabularies.Hierarchy.v1.TopLevels$applyquery for hierarchy root entities instead of$top/$filter; draft-enabled hierarchies additionally wrap withancestors()to scope to active entitiesbuildNavPropHierarchyQueryconstructs a nav-key-rootedTopLevelsquery (e.g.Orders('ORD1')/_Items?$apply=TopLevels(...)) for navigation properties that are themselves hierarchy rootsfetchDataissues secondary nav-prop hierarchy queries and patches hierarchy properties (NodeId, DrillState, DistanceFromRoot, etc.) back onto the matching expanded records in-placeData normalisation
normalizeHierarchyNodeIdsconverts ABAP RAW16 uppercase hex NodeId values to standard GUID format (8-4-4-4-12) for correct parent–child matching in the mock serverclearRootHierarchyParentPropertyclears the parent pointer on root nodes (DistanceFromRoot === 0) so the mock server can identify hierarchy rootscreateEntitySetDataupdated to apply both normalisation steps when hierarchy entities are presentMissing referential constraint handling
ReferentialConstraintin metadata,getHierarchyEntitiesderives constraints from the entity's business keys using a property-name heuristic (e.g.PurchasingParentItemforPurchaseOrderItem)buildReferentialConstraintFileContentto emit a.jsmock server file implementinggetReferentialConstraints, written only when the entity set was downloaded and the file does not already existPrompt & UI changes
TopLevelsqueriesParentNavigationPropertyare excluded from expand choicesIsActiveEntitysemantic key is pre-populated withtruefor draft-enabled hierarchy rootsOther improvements
connectPathwhen resolving saved systemsEdm.Guid/Edm.UUIDsemantic key support added (unquoted in OData filter expressions)getEntityModelreturns an error string instead ofundefinedon failureundefined