Repository navigation
Conversation
…instead of waiting for a reload. pgadmin-org#8015 Renaming a node updated its label in place, but the tree sorts on the name each item was loaded with, so the node stayed where it was until the tree was reloaded. After an update, the node's sort name is now set to the new label and it is moved to its sorted position amongst its siblings, keeping its id-based path and any expanded children. Columns keep their attribute number order. Closes pgadmin-org#8015
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughRenamed tree nodes are now resorted among siblings. The browser passes the movement result to selection. Regression tests cover sorting, expanded-node children, path preservation, unchanged positions, and column nodes. ChangesTree Rename Resorting
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to
|
|
The issue only mentions server groups, but this deliberately applies to every node type renamed in the Object Explorer (servers, tables and so on), so a renamed node always ends up where a reload of the tree would put it. |
|
Squashed and merged as a6374d1. |
Renaming a node in the Object Explorer updated its label but left it where it was, because the tree sorts on the name each item was loaded with. After an update, the node's sort name is now set to the new label and the node is moved into sorted position among its siblings. Its id-based path and any expanded children are kept, and columns keep their attribute number order.
Test plan
regression/javascript/tree/tree_resort_spec.js, run against a realTreeModelXyarn jest regression/javascript/tree regression/javascript/browser: 80 passedCloses #8015
Summary by CodeRabbit