Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Presentation: Can't remove related properties from supplemental rulesets #3547

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
160 changes: 160 additions & 0 deletions docs/changehistory/NextVersion.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,166 @@ iTwin.js applications can now check [WebGLRenderCompatibilityInfo.usingIntegrate
alert("Integrated graphics are in use. If a discrete GPU is available, consider switching your device or browser to use it.");
```

### Fixed inconsistent property representation in a property grid

Previously when using `nestedRelatedProperties` attribute, nested related properties were merged or not merged depending on whether at least one property of an intermediate class was selected. Now in both cases properties are not merged.
grigasp marked this conversation as resolved.
Show resolved Hide resolved

```json
{
"id": "example",
"rules": [
grigasp marked this conversation as resolved.
Show resolved Hide resolved
{
"ruleType": "Content",
"specifications": [
{
"specType": "ContentInstancesOfSpecificClasses",
"classes": {
"schemaName": "BisCore",
"classNames": ["GeometricModel3d"],
"arePolymorphic": true
}
}
]
},
{
"ruleType": "ContentModifier",
"class": {
"schemaName": "BisCore",
"className": "Model"
},
"relatedProperties": [
{
"propertiesSource": {
"relationship": {
"schemaName": "BisCore",
"className": "ModelContainsElements"
},
"direction": "Forward",
"targetClass": {
"schemaName": "Generic",
"className": "PhysicalObject"
}
},
"properties": "_none_",
"nestedRelatedProperties": [
{
"propertiesSource": {
"relationship": {
"schemaName": "BisCore",
"className": "GeometricElement3dIsInCategory"
},
"direction": "Forward",
"targetClass": {
"schemaName": "BisCore",
"className": "Category"
}
grigasp marked this conversation as resolved.
Show resolved Hide resolved
},
"properties": "*",
"handleTargetClassPolymorphically": true
grigasp marked this conversation as resolved.
Show resolved Hide resolved
}
],
"handleTargetClassPolymorphically": true
}
]
}
]
}
```

| | before | after |
grigasp marked this conversation as resolved.
Show resolved Hide resolved
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| "properties": "\_none\_" | ![Properties of Spatial Category are merged](./media/SpatialCategoryPropertiesMerged.png) | ![Properties of Spatial Category not merged](./media/SpatialCategoryPropertiesNotMerged.png) |
| "properties": \["UserLabel"\] | ![Properties of Physical Object and Spatial Category not merged](./media/PhysicalObjectAndSpatialCategoryPropertiesNotMerged.png) | ![Properties of Physical Object and Spatial Category not merged](./media/PhysicalObjectAndSpatialCategoryPropertiesNotMerged.png) |

### Fixed a bug that prevented disabling `relatedProperties` specifications

The bug made it impossible to remove related properties if a lower priority rule specified that the property should be included.

For example, it is now possible to remove all properties of a class `ExternalSourceAspect`, which is owned by a class `Element`. In order to do that, the following rules can be used:

```json
{
"ruleType": "ContentModifier",
"class": {
"schemaName": "BisCore",
"className": "Element"
},
"relatedProperties": [
{
"propertiesSource": {
"relationship": {
"schemaName": "BisCore",
"className": "ElementOwnsMultiAspects"
},
"direction": "Forward",
"targetClass": {
"schemaName": "BisCore",
"className": "ExternalSourceAspect"
}
},
"properties": []
}
]
}
```

```json
{
"ruleType": "ContentModifier",
"class": {
"schemaName": "BisCore",
"className": "Element"
},
"relatedProperties": [
{
"propertiesSource": {
"relationship": {
"schemaName": "BisCore",
"className": "ElementOwnsMultiAspects"
},
"direction": "Forward",
"targetClass": {
"schemaName": "BisCore",
"className": "ExternalSourceAspect"
}
},
"properties": "_none_"
}
]
}
```

```json
{
"ruleType": "ContentModifier",
"class": {
"schemaName": "BisCore",
"className": "Element"
},
"relatedProperties": [
{
"propertiesSource": {
"relationship": {
"schemaName": "BisCore",
"className": "ElementOwnsMultiAspects"
},
"direction": "Forward",
"targetClass": {
"schemaName": "BisCore",
"className": "ExternalSourceAspect"
}
},
"properties": [
{
"name": "Identifier",
"isDisplayed": false
}
]
}
]
}
```
grigasp marked this conversation as resolved.
Show resolved Hide resolved

## ColorDef validation

[ColorDef.fromString]($common) returns [ColorDef.black]($common) if the input is not a valid color string. [ColorDef.create]($common) coerces the input numeric representation into a 32-bit unsigned integer. In either case, this occurs silently. Now, you can use [ColorDef.isValidColor]($common) to determine if your input is valid.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/presentation/content/RelatedPropertiesSpecification.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ Specifies an [ECExpression](./ECExpressions.md#instance-filter) for filtering in
| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ |
| ![Example when selecting all related instances](./media/relatedpropertiesspecification-with-instancefilter-attribute-unfiltered.png) | ![Example when filtering related instances](./media/relatedpropertiesspecification-with-instancefilter-attribute-filtered.png) |

**Note:** A specification with higher priority and no instance filter overrides a specification with lower priority whether or not it has a filter.

### Attribute: `handleTargetClassPolymorphically`

The attribute tells whether the target class specified through [`propertiesSource` attribute](#attribute-propertiessource) should be handled
Expand Down