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

imodeljs-native@4.4.4 #6446

Merged
merged 3 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
22 changes: 20 additions & 2 deletions common/api/presentation-common.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2555,6 +2555,7 @@ export interface RelatedClassInfo {
relationshipInfo: ClassInfo;
sourceClassInfo: ClassInfo;
targetClassInfo: ClassInfo;
targetInstanceIds?: Id64String[];
}

// @public (undocumented)
Expand Down Expand Up @@ -2587,6 +2588,8 @@ export interface RelatedClassInfoJSON<TClassInfoJSON = ClassInfoJSON> {
sourceClassInfo: TClassInfoJSON;
// (undocumented)
targetClassInfo: TClassInfoJSON;
// (undocumented)
targetInstanceIds?: Id64String[];
}

// @public
Expand All @@ -2605,6 +2608,19 @@ export namespace RelatedClassInfoWithOptionalRelationship {
// @public (undocumented)
export type RelatedClassInfoWithOptionalRelationshipJSON<TClassInfoJSON = ClassInfoJSON> = PartialBy<RelatedClassInfoJSON<TClassInfoJSON>, "relationshipInfo" | "isForwardRelationship" | "isPolymorphicRelationship">;

// @public
export interface RelatedInstanceByPathSpecification extends RelatedInstanceSpecificationBase {
relationshipPath: RelationshipPathSpecification;
}

// @public
export interface RelatedInstanceByTargetInstancesSpecification extends RelatedInstanceSpecificationBase {
targetInstances: {
class: SingleSchemaClassSpecification;
instanceIds: Id64String[];
};
}

// @public
export interface RelatedInstanceNodesSpecification extends ChildNodeSpecificationBase, DefaultGroupingPropertiesContainer {
instanceFilter?: string;
Expand All @@ -2613,10 +2629,12 @@ export interface RelatedInstanceNodesSpecification extends ChildNodeSpecificatio
}

// @public
export interface RelatedInstanceSpecification {
export type RelatedInstanceSpecification = RelatedInstanceByPathSpecification | RelatedInstanceByTargetInstancesSpecification;

// @public
export interface RelatedInstanceSpecificationBase {
alias: string;
isRequired?: boolean;
relationshipPath: RelationshipPathSpecification;
}

// @public
Expand Down
5 changes: 4 additions & 1 deletion common/api/summary/presentation-common.exports.csv
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,11 @@ public;RelatedClassInfoJSON
public;RelatedClassInfoWithOptionalRelationship = PartialBy
public;RelatedClassInfoWithOptionalRelationship
public;RelatedClassInfoWithOptionalRelationshipJSON
public;RelatedInstanceByPathSpecification
public;RelatedInstanceByTargetInstancesSpecification
public;RelatedInstanceNodesSpecification
public;RelatedInstanceSpecification
public;RelatedInstanceSpecification = RelatedInstanceByPathSpecification | RelatedInstanceByTargetInstancesSpecification
public;RelatedInstanceSpecificationBase
public;RelatedPropertiesSpecialValues
public;RelatedPropertiesSpecification
public;RelationshipDirection
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/core-backend",
"comment": "",
"type": "none"
}
],
"packageName": "@itwin/core-backend"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/presentation-common",
"comment": "Support creating hierarchy level descriptor for hierarchies that use `parent` symbol in their instance filters.",
"type": "none"
}
],
"packageName": "@itwin/presentation-common"
}
8 changes: 4 additions & 4 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"webpack": "^5.76.0"
},
"dependencies": {
"@bentley/imodeljs-native": "4.4.3",
"@bentley/imodeljs-native": "4.4.4",
"@itwin/cloud-agnostic-core": "^2.1.0",
"@itwin/core-telemetry": "workspace:*",
"@itwin/object-storage-azure": "^2.2.2",
Expand Down
41 changes: 30 additions & 11 deletions docs/presentation/RelatedInstanceSpecification.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,38 @@ Related instance specification is used in [content](../content/contentRule.md#at
with its related instance and allow using the related instance for:

- [Filtering](#using-related-instances-in-instance-filter), when used in `instanceFilter`.
- [Customization](#using-related-instances-for-customizing), when used in [customization rules](../customization/index.md).
- [Customization](#using-related-instances-for-customization), when used in [customization rules](../customization/index.md).
- [Grouping](#using-related-instances-for-grouping), when used in [grouping rules](../hierarchies/GroupingRule.md).

## Attributes

| Name | Required? | Type | Default |
| ------------------------------------------------ | --------- | --------------------------------------------------------------------- | ------- |
| [`relationshipPath`](#attribute-relationshipath) | Yes | [`RelationshipPathSpecification`](./RelationshipPathSpecification.md) | |
| [`alias`](#attribute-alias) | Yes | `string` | |
| [`isRequired`](#attribute-isrequired) | No | `boolean` | `false` |
| Name | Required? | Type | Default |
| ------------------------------------------------- | ---------------------------------------- | ---------------------------------------------------------------------- | ------- |
| [`relationshipPath`](#attribute-relationshippath) | Yes, if `targetInstances` not specified | [`RelationshipPathSpecification`](./RelationshipPathSpecification.md) | |
| [`targetInstances`](#attribute-targetinstances) | Yes, if `relationshipPath` not specified | `{ class: SingleSchemaClassSpecification; instanceIds: Id64String[] }` | |
| [`alias`](#attribute-alias) | Yes | `string` | |
| [`isRequired`](#attribute-isrequired) | No | `boolean` | `false` |

### Attribute: `relationshipPath`

Specifies a chain of [relationship path specifications](./RelationshipPathSpecification.md) that forms a path from the primary instance to the related instances.

| | |
| --------------- | --------------------------------------------------------------------- |
| **Type** | [`RelationshipPathSpecification`](./RelationshipPathSpecification.md) |
| **Is Required** | Yes |
| | |
| --------------- | ------------------------------------------------------------------------ |
| **Type** | [`RelationshipPathSpecification`](./RelationshipPathSpecification.md) |
| **Is Required** | Yes, if [`targetInstances`](#attribute-targetinstances) is not specified |

### Attribute: `targetInstances`

Specifies a target class and IDs of its ECInstances to relate to the primary instance.

This may be useful when you want to use information of a completely unrelated (or related by means other than an ECRelationship) ECInstance in instance filter,
conditions or grouping.

| | |
| --------------- | -------------------------------------------------------------------------- |
| **Type** | `{ class: SingleSchemaClassSpecification; instanceIds: Id64String[] }` |
| **Is Required** | Yes, if [`relationshipPath`](#attribute-relationshippath) is not specified |

### Attribute: `alias`

Expand All @@ -51,7 +64,7 @@ Specifies whether to omit the primary instance from the result if the other end

## Examples

### Using related instances in instance filter
### Using related instances with relationship path in instance filter

```ts
[[include:Presentation.RelatedInstanceSpecification.UsingInInstanceFilter.Ruleset]]
Expand All @@ -62,6 +75,12 @@ Specifies whether to omit the primary instance from the result if the other end
| Without instance filter | ![Example without instance filter](./media/relatedinstancespecification-usage-in-instancefilter-1.png) |
| With instance filter | ![Example with instance filter](./media/relatedinstancespecification-usage-in-instancefilter-2.png) |

### Using related instances with target instance IDs in instance filter

```ts
[[include:Presentation.RelatedInstanceSpecification.UsingInInstanceFilterWithTargetInstances.Ruleset]]
```

### Using related instances for customization

```ts
Expand Down
2 changes: 0 additions & 2 deletions docs/presentation/hierarchies/FilteringLimiting.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ There's a limited set of presentation rules, their attributes or attribute value

- `hideExpression` attribute on the hierarchy specifications [Instance nodes of specific classes](./InstanceNodesOfSpecificClasses.md#attribute-hideexpression), [Related instance nodes](./RelatedInstanceNodes.md#attribute-hideexpression) and [Custom query instance nodes](./CustomQueryInstanceNodes.md#attribute-hideexpression).

- Usage of the `parent` ECExpression symbol in `instanceFilter` attribute of either [Instance nodes of specific classes](./InstanceNodesOfSpecificClasses.md#attribute-instancefilter) or [Related instance nodes](./RelatedInstanceNodes.md#attribute-instancefilter) specifications.

- Usage of some deprecated, undocumented rules or attributes.

When any of the above is used to create a hierarchy level, filtering for that level is going to be disabled.
Expand Down
Loading
Loading