Skip to content

Commit

Permalink
Don't auto-expand Role Manager tree grid on refresh (#3912)
Browse files Browse the repository at this point in the history
* Fixes #3910
  • Loading branch information
Ryanseanlee authored Jan 30, 2025
1 parent 2f7b6df commit 9723f0e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## v73.0.0-SNAPSHOT - unreleased

### 🐞 Bug Fixes

* Fixed Role grid losing view state on refresh.

## v72.0.0 - 2025-01-27

### 💥 Breaking Changes
Expand Down
6 changes: 3 additions & 3 deletions admin/tabs/userData/roles/RoleModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class RoleModel extends HoistModel {
runInAction(() => {
this.allRoles = this.processRolesFromServer(data);
});
this.displayRoles();
this.displayRoles(loadSpec.isRefresh);
await this.gridModel.preSelectFirstAsync();
} catch (e) {
if (loadSpec.isStale) return;
Expand Down Expand Up @@ -212,13 +212,13 @@ export class RoleModel extends HoistModel {
//------------------
// Implementation
//------------------
private displayRoles() {
private displayRoles(isRefresh?: boolean) {
const {gridModel} = this,
gridData = this.showInGroups
? this.processRolesForTreeGrid(this.allRoles)
: this.allRoles;
gridModel.loadData(gridData);
gridModel.expandAll();
if (!isRefresh) gridModel.expandAll();
gridModel.autosizeAsync({includeCollapsedChildren: true});
}

Expand Down

0 comments on commit 9723f0e

Please sign in to comment.