@itwin/changed-elements-react v0.6.1
@itwin/changed-elements-react
About
This package provides React components that help implement iTwin version comparison workflows. These components are designed to communicate with iTwin Platform Changed Elements API, which is used to retrieve data about iModel change history.
Installation
npm install @itwin/changed-elements-react
Usage
To begin using this package in your application, you will need to:
- Add
changedelements:read
andchangedelements:modify
OAuth scopes to your iTwin Platform application. Provide
<VersionCompareContext />
somewhere in your app.<VersionCompareContext iModelsClient={iTwinIModelsClient}> <App /> </VersionCompareContext>
Initialize Version Compare module at application startup. This only needs to be done once.
import { VersionCompare } from "@itwin/changed-elements-react"; VersionCompare.initialize({ ... // Look at VersionCompareOptions interface for documentaton about the options });
Mount
<VersionCompareSelectComponent />
to begin version comparison worflow by selecting iModel versions to compare. You should also add a button in your UI that callsVersionCompare.manager.stopComparison()
.<ChangedElementsWidget />
React component lets users inspect differences in properties between versions, generate reports, search for changed elements, and control element visibility.<PropertyComparisonTable />
React component lists properties of a selected element and displays how they changed between two versions.
Contributing
We welcome contributions to make this package better. You can submit feature requests or report bugs by creating an issue.
Copyright © Bentley Systems, Incorporated. All rights reserved. See LICENSE.md for license terms and full copyright notice.