From 25f6885d7f06a76c399c9b46145df223f18ae584 Mon Sep 17 00:00:00 2001 From: Caleb German Date: Thu, 15 May 2025 16:39:50 -0500 Subject: [PATCH 1/4] Updated readme's through out repro to have new contributing section and added code examples of widgets --- README.md | 18 ++++++- packages/changed-elements-react/README.md | 61 ++++++++++++++++++++++- 2 files changed, 76 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d1c9f64a..789fe52d 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,23 @@ pnpm install ## Contributing -We welcome contributions to make this project better. You can submit feature requests or report bugs by creating an [issue](https://github.com/iTwin/changed-elements-react/issues). +### Issues + +We welcome contributions to make this package better. You can submit feature requests or report bugs by creating an [issue](https://github.com/iTwin/changed-elements-react/issues). + +### Versioning with Changesets + +This repository uses [Changesets](https://github.com/changesets/changesets) to manage package versioning and changelogs. When making changes that affect the public API or behavior, please add a changeset by running: + +```shell +npx changeset +``` + +Follow the prompts to describe your changes and select the appropriate version bump (major, minor, or patch). Versioning should follow [semver](https://semver.org/) conventions. If no version bump is required (such as for documentation-only changes), use `npx 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](https://github.com/changesets/changesets/blob/main/README.md). --- diff --git a/packages/changed-elements-react/README.md b/packages/changed-elements-react/README.md index fc0d2685..f621431d 100644 --- a/packages/changed-elements-react/README.md +++ b/packages/changed-elements-react/README.md @@ -18,6 +18,8 @@ To begin using this package in your application, you will need to: 2. Provide `` somewhere in your app. ```tsx + import { VersionCompareContext } from "@itwin/changed-elements-react"; + @@ -33,14 +35,69 @@ To begin using this package in your application, you will need to: }); ``` -4. Mount `` to begin version comparison worflow by selecting iModel versions to compare. You should also add a button in your UI that calls `VersionCompare.manager.stopComparison()`. -5. `` React component lets users inspect differences in properties between versions, generate reports, search for changed elements, and control element visibility. +4. `` React component lets users inspect differences in properties between versions, generate reports, search for changed elements, and control element visibility. The following code has example of widget use but does not show off all props for widget. + + ```ts + import { ChangedElementsWidget } from "@itwin/changed-elements-react"; + } + documentationHref="https://example.com" + />, + ``` + +5. `` **Experimental** React component lets users inspect differences in properties between versions, generate reports, search for changed elements, and control element visibility. The following code has example of widget use but does not show off all props for widget. + + ```ts + import { NamedVersionSelectorWidget } from "@itwin/changed-elements-react"; + } + feedbackUrl="https://example.com" + documentationHref="https://example.com" + /> + ``` + 6. `` React component lists properties of a selected element and displays how they changed between two versions. + ```ts + import { PropertyComparisonTable } from "@itwin/changed-elements-react"; + + { + // 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](https://github.com/iTwin/changed-elements-react/issues). +### Versioning with Changesets + +This repository uses [Changesets](https://github.com/changesets/changesets) to manage package versioning and changelogs. When making changes that affect the public API or behavior, please add a changeset by running: + +```shell +npx changeset +``` + +Follow the prompts to describe your changes and select the appropriate version bump (major, minor, or patch). Versioning should follow [semver](https://semver.org/) conventions. If no version bump is required (such as for documentation-only changes), use `npx 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](https://github.com/changesets/changesets/blob/main/README.md). + --- Copyright © Bentley Systems, Incorporated. All rights reserved. See [LICENSE.md](./LICENSE.md) for license terms and full copyright notice. From d3d8b85ed433d37f17bf741a7dcd181a775ac4c1 Mon Sep 17 00:00:00 2001 From: Caleb German Date: Thu, 15 May 2025 16:42:22 -0500 Subject: [PATCH 2/4] Added empty changeset --- .changeset/tough-zebras-feel.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .changeset/tough-zebras-feel.md diff --git a/.changeset/tough-zebras-feel.md b/.changeset/tough-zebras-feel.md new file mode 100644 index 00000000..a845151c --- /dev/null +++ b/.changeset/tough-zebras-feel.md @@ -0,0 +1,2 @@ +--- +--- From 4c4b5f8ae53aab36b1d3485e60e5cf7e7612c6f2 Mon Sep 17 00:00:00 2001 From: CalebGerman <86487204+CalebGerman@users.noreply.github.com> Date: Fri, 16 May 2025 13:47:54 -0500 Subject: [PATCH 3/4] Apply suggestions from code review Co-authored-by: Matt Jordan --- packages/changed-elements-react/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/changed-elements-react/README.md b/packages/changed-elements-react/README.md index f621431d..584219f7 100644 --- a/packages/changed-elements-react/README.md +++ b/packages/changed-elements-react/README.md @@ -35,7 +35,7 @@ To begin using this package in your application, you will need to: }); ``` -4. `` React component lets users inspect differences in properties between versions, generate reports, search for changed elements, and control element visibility. The following code has example of widget use but does not show off all props for widget. +4. The `` 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). ```ts import { ChangedElementsWidget } from "@itwin/changed-elements-react"; @@ -49,7 +49,7 @@ To begin using this package in your application, you will need to: />, ``` -5. `` **Experimental** React component lets users inspect differences in properties between versions, generate reports, search for changed elements, and control element visibility. The following code has example of widget use but does not show off all props for widget. +5. The `` 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). ```ts import { NamedVersionSelectorWidget } from "@itwin/changed-elements-react"; @@ -62,7 +62,7 @@ To begin using this package in your application, you will need to: /> ``` -6. `` React component lists properties of a selected element and displays how they changed between two versions. +6. The `` React component lists properties of a selected element and displays how they changed between two versions. ```ts import { PropertyComparisonTable } from "@itwin/changed-elements-react"; From 73aa4ba73eb98d6318203394ebbab9d9deefe1d6 Mon Sep 17 00:00:00 2001 From: Caleb German Date: Fri, 16 May 2025 13:56:22 -0500 Subject: [PATCH 4/4] Updated readmes' --- README.md | 2 +- packages/changed-elements-react/README.md | 36 ++++++++++++----------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 789fe52d..3dbbef49 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ We welcome contributions to make this package better. You can submit feature req This repository uses [Changesets](https://github.com/changesets/changesets) to manage package versioning and changelogs. When making changes that affect the public API or behavior, please add a changeset by running: ```shell -npx changeset +pnpm changeset ``` Follow the prompts to describe your changes and select the appropriate version bump (major, minor, or patch). Versioning should follow [semver](https://semver.org/) conventions. If no version bump is required (such as for documentation-only changes), use `npx changeset --empty`. diff --git a/packages/changed-elements-react/README.md b/packages/changed-elements-react/README.md index 584219f7..8ec3f9b1 100644 --- a/packages/changed-elements-react/README.md +++ b/packages/changed-elements-react/README.md @@ -2,27 +2,27 @@ ## 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](https://developer.bentley.com/apis/changed-elements/), which is used to retrieve data about iModel change history. +This package provides React components that help implement iTwin version comparison workflows. These components are designed to communicate with [iTwin Platform Changed Elements API](https://developer.bentley.com/apis/changed-elements-v2), which is used to retrieve data about iModel change history. ## Installation ```shell -npm install @itwin/changed-elements-react +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. +1. Add `changedelements:read` and `changedelements:modify` OAuth scopes to your iTwin Platform application [App Setup](https://developer.bentley.com/tutorials/quickstart-web-and-service-apps/). 2. Provide `` somewhere in your app. ```tsx - import { VersionCompareContext } from "@itwin/changed-elements-react"; + import { VersionCompareContext } from "@itwin/changed-elements-react"; - - - + + + ``` 3. Initialize Version Compare module at application startup. This only needs to be done once. @@ -39,27 +39,29 @@ To begin using this package in your application, you will need to: ```ts import { ChangedElementsWidget } from "@itwin/changed-elements-react"; + } - documentationHref="https://example.com" - />, + useV2Widget + feedbackUrl="https://example.com" + iModelConnection={UiFramework.getIModelConnection()} + enableComparisonJobUpdateToasts + manageNamedVersionsSlot={} + documentationHref="https://example.com" + />, ``` 5. The `` 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). ```ts import { NamedVersionSelectorWidget } from "@itwin/changed-elements-react"; + } feedbackUrl="https://example.com" documentationHref="https://example.com" - /> + /> ``` 6. The `` React component lists properties of a selected element and displays how they changed between two versions. @@ -89,10 +91,10 @@ We welcome contributions to make this package better. You can submit feature req This repository uses [Changesets](https://github.com/changesets/changesets) to manage package versioning and changelogs. When making changes that affect the public API or behavior, please add a changeset by running: ```shell -npx changeset +pnpm changeset ``` -Follow the prompts to describe your changes and select the appropriate version bump (major, minor, or patch). Versioning should follow [semver](https://semver.org/) conventions. If no version bump is required (such as for documentation-only changes), use `npx changeset --empty`. +Follow the prompts to describe your changes and select the appropriate version bump (major, minor, or patch). Versioning should follow [semver](https://semver.org/) 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.