Skip to content

Commit

Permalink
Allow using readOnly property as part of group creation/patching (#62)
Browse files Browse the repository at this point in the history
- Add `readOnly` property to `CreateGroupParams`, `UpdateGroupParams`,
and `Group` interfaces
 - Update group tests to include readOnly property
  • Loading branch information
sarah-pontier authored May 8, 2024
1 parent f13733c commit e0f36cb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/saved-views-client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased](https://github.com/iTwin/saved-views/tree/HEAD/packages/saved-views-client)

### Minor changes

* Add optional readOnly property to `CreateGroupParams`, `UpdateGroupParams`, and `Group` types

## [0.2.1](https://github.com/iTwin/saved-views/tree/v0.2.1-client/packages/saved-views-client) - 2024-05-07

### Fixes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ describe("ITwinSavedViewsClient", () => {
iModelId: "test_imodelid",
displayName: "test_displayname",
shared: true,
readOnly: false,
});

verifyFetch({
Expand All @@ -230,6 +231,7 @@ describe("ITwinSavedViewsClient", () => {
iModelId: "test_imodelid",
displayName: "test_displayname",
shared: true,
readOnly: false,
}),
});
});
Expand All @@ -242,6 +244,7 @@ describe("ITwinSavedViewsClient", () => {
groupId: "test_groupid",
displayName: "test_displayname",
shared: true,
readOnly: false,
});

verifyFetch({
Expand All @@ -250,6 +253,7 @@ describe("ITwinSavedViewsClient", () => {
body: JSON.stringify({
displayName: "test_displayname",
shared: true,
readOnly: false,
}),
});
});
Expand Down
2 changes: 2 additions & 0 deletions packages/saved-views-client/src/client/SavedViewsClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,14 @@ export interface CreateGroupParams extends CommonRequestParams {
iModelId?: string;
displayName: string;
shared?: boolean;
readOnly?: boolean;
}

export interface UpdateGroupParams extends CommonRequestParams {
groupId: string;
displayName?: string;
shared?: boolean;
readOnly?: boolean;
}

export interface GroupResponse {
Expand Down
1 change: 1 addition & 0 deletions packages/saved-views-client/src/models/Group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ export interface Group {
id: string;
displayName: string;
shared: boolean;
readOnly?: boolean;
_links: HalLinks<["savedViews", "iTwin"?, "project"?, "iModel"?, "creator"?]>;
}

0 comments on commit e0f36cb

Please sign in to comment.