@itwin/presentation-shared
Advanced tools
Comparing version 0.3.0 to 0.3.1
# @itwin/presentation-shared | ||
## 0.3.1 | ||
### Patch Changes | ||
- [#631](https://github.com/iTwin/presentation/pull/631): Fix `ECSql.createRelationshipPathJoinClause` creating an invalid JOIN clause in case of reversed relationship step that uses a navigation property. | ||
## 0.3.0 | ||
@@ -4,0 +10,0 @@ |
@@ -48,11 +48,15 @@ "use strict"; | ||
if (navigationProperty) { | ||
const propertyDirectionMatchesRelationshipDirection = navigationProperty.direction === step.relationship.direction; | ||
const isNavigationPropertyForward = navigationProperty.direction === "Forward"; | ||
const relationshipJoinPropertyNames = isNavigationPropertyForward === !step.relationshipReverse | ||
? { | ||
this: (0, ECSqlValueSelectorSnippets_1.createRawPropertyValueSelector)(step.targetAlias, "ECInstanceId"), | ||
next: (0, ECSqlValueSelectorSnippets_1.createRawPropertyValueSelector)(prev.alias, navigationProperty.name, "Id"), | ||
} | ||
: { | ||
this: (0, ECSqlValueSelectorSnippets_1.createRawPropertyValueSelector)(step.targetAlias, navigationProperty.name, "Id"), | ||
next: (0, ECSqlValueSelectorSnippets_1.createRawPropertyValueSelector)(prev.alias, prev.joinPropertyName), | ||
}; | ||
clause += ` | ||
${getJoinClause(step.joinType)} ${getClassSelectClause(step.target, step.targetAlias)} | ||
ON ${propertyDirectionMatchesRelationshipDirection | ||
? (0, ECSqlValueSelectorSnippets_1.createRawPropertyValueSelector)(step.targetAlias, "ECInstanceId") | ||
: (0, ECSqlValueSelectorSnippets_1.createRawPropertyValueSelector)(step.targetAlias, navigationProperty.name, "Id")} | ||
= ${propertyDirectionMatchesRelationshipDirection | ||
? (0, ECSqlValueSelectorSnippets_1.createRawPropertyValueSelector)(prev.alias, navigationProperty.name, "Id") | ||
: (0, ECSqlValueSelectorSnippets_1.createRawPropertyValueSelector)(prev.alias, prev.joinPropertyName)} | ||
ON ${relationshipJoinPropertyNames.this} = ${relationshipJoinPropertyNames.next} | ||
`; | ||
@@ -59,0 +63,0 @@ prev = { |
@@ -45,11 +45,15 @@ /*--------------------------------------------------------------------------------------------- | ||
if (navigationProperty) { | ||
const propertyDirectionMatchesRelationshipDirection = navigationProperty.direction === step.relationship.direction; | ||
const isNavigationPropertyForward = navigationProperty.direction === "Forward"; | ||
const relationshipJoinPropertyNames = isNavigationPropertyForward === !step.relationshipReverse | ||
? { | ||
this: createRawPropertyValueSelector(step.targetAlias, "ECInstanceId"), | ||
next: createRawPropertyValueSelector(prev.alias, navigationProperty.name, "Id"), | ||
} | ||
: { | ||
this: createRawPropertyValueSelector(step.targetAlias, navigationProperty.name, "Id"), | ||
next: createRawPropertyValueSelector(prev.alias, prev.joinPropertyName), | ||
}; | ||
clause += ` | ||
${getJoinClause(step.joinType)} ${getClassSelectClause(step.target, step.targetAlias)} | ||
ON ${propertyDirectionMatchesRelationshipDirection | ||
? createRawPropertyValueSelector(step.targetAlias, "ECInstanceId") | ||
: createRawPropertyValueSelector(step.targetAlias, navigationProperty.name, "Id")} | ||
= ${propertyDirectionMatchesRelationshipDirection | ||
? createRawPropertyValueSelector(prev.alias, navigationProperty.name, "Id") | ||
: createRawPropertyValueSelector(prev.alias, prev.joinPropertyName)} | ||
ON ${relationshipJoinPropertyNames.this} = ${relationshipJoinPropertyNames.next} | ||
`; | ||
@@ -56,0 +60,0 @@ prev = { |
{ | ||
"name": "@itwin/presentation-shared", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "The package contains types and utilities used across different iTwin.js Presentation packages.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
291609
4132