0.15.3 • Published 5 months ago

@itwin/changed-elements-react v0.15.3

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

@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

pnpm install @itwin/changed-elements-react

Usage

To begin using this package in your application, you will need to:

  1. Add changedelements:read and changedelements:modify OAuth scopes to your iTwin Platform application App Setup.
  2. Provide <VersionCompareContext /> somewhere in your app.

    import { VersionCompareContext } from "@itwin/changed-elements-react";
    
    <VersionCompareContext iModelsClient={iTwinIModelsClient}>
      <App />
    </VersionCompareContext>
  3. 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
    });
  4. The <ChangedElementsWidget /> React component lets users inspect differences in properties between versions, generate reports, search for changed elements, and control element visibility. The following code shows an example widget initialization (does not show off all props).

    import { ChangedElementsWidget } from "@itwin/changed-elements-react";
    
    <ChangedElementsWidget
      useV2Widget
      feedbackUrl="https://example.com"
      iModelConnection={UiFramework.getIModelConnection()}
      enableComparisonJobUpdateToasts
      manageNamedVersionsSlot={<ManageNamedVersions />}
      documentationHref="https://example.com"
    />,
  5. The <NamedVersionSelectorWidget /> is an experimental React component that lets users inspect differences in properties between versions, generate reports, search for changed elements, and control element visibility. The following code shows an example widget initialization (does not show off all props).

    import { NamedVersionSelectorWidget } from "@itwin/changed-elements-react";
    
    <NamedVersionSelectorWidget
      iModel={iModel}
      manager={VersionCompare.manager}
      manageVersions={<ManageNamedVersions />}
      feedbackUrl="https://example.com"
      documentationHref="https://example.com"
    />
  6. The <PropertyComparisonTable /> React component lists properties of a selected element and displays how they changed between two versions.

    import { PropertyComparisonTable } from "@itwin/changed-elements-react";
    
    <PropertyComparisonTable
      manager={versionCompareManager}
      selection={selection}
      isSideBySide={false}
      displaySideBySideToggle={true}
      onSideBySideToggle={() => {
        // handle toggle logic here
      }}
    />

Contributing

Issues

We welcome contributions to make this package better. You can submit feature requests or report bugs by creating an issue.

Versioning with Changesets

This repository uses Changesets to manage package versioning and changelogs. When making changes that affect the public API or behavior, please add a changeset by running:

pnpm changeset

Follow the prompts to describe your changes and select the appropriate version bump (major, minor, or patch). Versioning should follow semver conventions. If no version bump is required (such as for documentation-only changes), use pnpm changeset --empty.

When changesets are added and merged into the main branch, a release pull request (PR) will be automatically created by the Changesets GitHub Action. This PR will contain the version updates and changelog entries generated from your changesets. Review the release PR to ensure the version bumps and changelog messages are accurate before merging. Once the release PR is merged, the new package version will be published automatically.

For more details, see the Changesets documentation.


Copyright © Bentley Systems, Incorporated. All rights reserved. See LICENSE.md for license terms and full copyright notice.

0.14.13

6 months ago

0.14.12

6 months ago

0.14.11

7 months ago

0.14.10

7 months ago

0.13.0

9 months ago

0.11.3

12 months ago

0.15.0

6 months ago

0.11.4

10 months ago

0.15.1

5 months ago

0.15.2

5 months ago

0.15.3

5 months ago

0.14.5

8 months ago

0.14.6

8 months ago

0.14.7

8 months ago

0.14.8

7 months ago

0.14.9

7 months ago

0.12.0

9 months ago

0.12.1

9 months ago

0.14.0

9 months ago

0.12.2

9 months ago

0.14.1

9 months ago

0.14.2

8 months ago

0.14.3

8 months ago

0.14.4

8 months ago

0.11.2

12 months ago

0.11.1

1 year ago

0.11.0

1 year ago

0.10.0

1 year ago

0.9.0

1 year ago

0.8.0

1 year ago

0.9.2

1 year ago

0.9.1

1 year ago

0.6.4

1 year ago

0.7.0

1 year ago

0.6.3

1 year ago

0.6.2

1 year ago

0.6.1

1 year ago

0.6.0

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.3.11

2 years ago

0.3.10

2 years ago

0.3.8

2 years ago

0.3.7

2 years ago

0.3.6

2 years ago

0.3.5

2 years ago

0.3.4

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.3

2 years ago

0.1.0

2 years ago