mirror of
https://github.com/nasa/openmct.git
synced 2025-04-09 04:14:32 +00:00
* fix(#6455): fix infinite loop - When the Create modal is opened, it defaults the object selected in the tree to the parent of the currently selected object. However, if this object is static, it can sometimes have a weird navigationPath and an edge case where we try to infinitely walk up the path to find the parent. - This adds a fail-safe to verify that the navigationPath by this point contains `/browse/mine` (thus is within a creatable path). If not, it sets the default selected tree item to the "My Items" folder --------- Co-authored-by: Andrew Henry <akhenry@gmail.com>
This commit is contained in:
parent
1b7fb9b952
commit
201c669328
@ -50,7 +50,6 @@ test.describe('Main Tree', () => {
|
||||
|
||||
await expandTreePaneItemByName(page, folder.name);
|
||||
await assertTreeItemIsVisible(page, clock.name);
|
||||
|
||||
});
|
||||
|
||||
test('Creating a child object on one tab and expanding its parent on the other shows the correct composition @2p', async ({ page, openmctConfig }) => {
|
||||
|
@ -450,13 +450,14 @@ export default {
|
||||
|
||||
}, Promise.resolve()).then(() => {
|
||||
if (this.isSelectorTree) {
|
||||
let item = this.getTreeItemByPath(navigationPath);
|
||||
// If item is missing due to error in object creation,
|
||||
// walk up the navigationPath until we find an item
|
||||
let item = this.getTreeItemByPath(navigationPath);
|
||||
while (!item) {
|
||||
while (!item && navigationPath !== '') {
|
||||
const startIndex = 0;
|
||||
const endIndex = navigationPath.lastIndexOf('/');
|
||||
navigationPath = navigationPath.substring(startIndex, endIndex);
|
||||
|
||||
item = this.getTreeItemByPath(navigationPath);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user