mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-19 17:01:13 +00:00
Migrate Collapse/Open Resource Tree to React (#733)
Co-authored-by: Steve Faulkner <southpolesteve@gmail.com>
This commit is contained in:
committed by
GitHub
parent
8e6d274b11
commit
d7c62ac7f1
@@ -1051,7 +1051,6 @@ exports[`SettingsComponent renders 1`] = `
|
||||
"isAutoscaleDefaultEnabled": [Function],
|
||||
"isFixedCollectionWithSharedThroughputSupported": [Function],
|
||||
"isHostedDataExplorerEnabled": [Function],
|
||||
"isLeftPaneExpanded": [Function],
|
||||
"isMongoIndexingEnabled": [Function],
|
||||
"isNotebookEnabled": [Function],
|
||||
"isNotebooksEnabledForAccount": [Function],
|
||||
@@ -1118,7 +1117,6 @@ exports[`SettingsComponent renders 1`] = `
|
||||
"activeTab": [Function],
|
||||
"openedTabs": [Function],
|
||||
},
|
||||
"toggleLeftPaneExpandedKeyPress": [Function],
|
||||
},
|
||||
"databaseId": "test",
|
||||
"defaultTtl": [Function],
|
||||
@@ -2163,7 +2161,6 @@ exports[`SettingsComponent renders 1`] = `
|
||||
"isAutoscaleDefaultEnabled": [Function],
|
||||
"isFixedCollectionWithSharedThroughputSupported": [Function],
|
||||
"isHostedDataExplorerEnabled": [Function],
|
||||
"isLeftPaneExpanded": [Function],
|
||||
"isMongoIndexingEnabled": [Function],
|
||||
"isNotebookEnabled": [Function],
|
||||
"isNotebooksEnabledForAccount": [Function],
|
||||
@@ -2230,7 +2227,6 @@ exports[`SettingsComponent renders 1`] = `
|
||||
"activeTab": [Function],
|
||||
"openedTabs": [Function],
|
||||
},
|
||||
"toggleLeftPaneExpandedKeyPress": [Function],
|
||||
}
|
||||
}
|
||||
isAutoPilotSelected={false}
|
||||
@@ -3288,7 +3284,6 @@ exports[`SettingsComponent renders 1`] = `
|
||||
"isAutoscaleDefaultEnabled": [Function],
|
||||
"isFixedCollectionWithSharedThroughputSupported": [Function],
|
||||
"isHostedDataExplorerEnabled": [Function],
|
||||
"isLeftPaneExpanded": [Function],
|
||||
"isMongoIndexingEnabled": [Function],
|
||||
"isNotebookEnabled": [Function],
|
||||
"isNotebooksEnabledForAccount": [Function],
|
||||
@@ -3355,7 +3350,6 @@ exports[`SettingsComponent renders 1`] = `
|
||||
"activeTab": [Function],
|
||||
"openedTabs": [Function],
|
||||
},
|
||||
"toggleLeftPaneExpandedKeyPress": [Function],
|
||||
},
|
||||
"databaseId": "test",
|
||||
"defaultTtl": [Function],
|
||||
@@ -4400,7 +4394,6 @@ exports[`SettingsComponent renders 1`] = `
|
||||
"isAutoscaleDefaultEnabled": [Function],
|
||||
"isFixedCollectionWithSharedThroughputSupported": [Function],
|
||||
"isHostedDataExplorerEnabled": [Function],
|
||||
"isLeftPaneExpanded": [Function],
|
||||
"isMongoIndexingEnabled": [Function],
|
||||
"isNotebookEnabled": [Function],
|
||||
"isNotebooksEnabledForAccount": [Function],
|
||||
@@ -4467,7 +4460,6 @@ exports[`SettingsComponent renders 1`] = `
|
||||
"activeTab": [Function],
|
||||
"openedTabs": [Function],
|
||||
},
|
||||
"toggleLeftPaneExpandedKeyPress": [Function],
|
||||
}
|
||||
}
|
||||
geospatialConfigType="Geometry"
|
||||
|
||||
@@ -134,7 +134,6 @@ export default class Explorer {
|
||||
public databases: ko.ObservableArray<ViewModels.Database>;
|
||||
public selectedDatabaseId: ko.Computed<string>;
|
||||
public selectedCollectionId: ko.Computed<string>;
|
||||
public isLeftPaneExpanded: ko.Observable<boolean>;
|
||||
public selectedNode: ko.Observable<ViewModels.TreeNode>;
|
||||
private resourceTree: ResourceTreeAdapter;
|
||||
|
||||
@@ -231,6 +230,7 @@ export default class Explorer {
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this.isNotebooksEnabledForAccount = ko.observable(false);
|
||||
this.isNotebooksEnabledForAccount.subscribe((isEnabledForAccount: boolean) => this.refreshCommandBarButtons());
|
||||
this.isSparkEnabledForAccount = ko.observable(false);
|
||||
@@ -335,7 +335,6 @@ export default class Explorer {
|
||||
}
|
||||
return true;
|
||||
});
|
||||
this.isLeftPaneExpanded = ko.observable<boolean>(true);
|
||||
this.selectedNode = ko.observable<ViewModels.TreeNode>();
|
||||
this.selectedNode.subscribe((nodeSelected: ViewModels.TreeNode) => {
|
||||
// Make sure switching tabs restores tabs display
|
||||
@@ -675,16 +674,8 @@ export default class Explorer {
|
||||
this.setIsNotificationConsoleExpanded(true);
|
||||
}
|
||||
|
||||
public toggleLeftPaneExpanded() {
|
||||
this.isLeftPaneExpanded(!this.isLeftPaneExpanded());
|
||||
|
||||
if (this.isLeftPaneExpanded()) {
|
||||
document.getElementById("expandToggleLeftPaneButton").focus();
|
||||
this.splitter.expandLeft();
|
||||
} else {
|
||||
document.getElementById("collapseToggleLeftPaneButton").focus();
|
||||
this.splitter.collapseLeft();
|
||||
}
|
||||
public collapseConsole(): void {
|
||||
this.setIsNotificationConsoleExpanded(false);
|
||||
}
|
||||
|
||||
public refreshDatabaseForResourceToken(): Q.Promise<any> {
|
||||
@@ -803,14 +794,6 @@ export default class Explorer {
|
||||
this.refreshNotebookList();
|
||||
};
|
||||
|
||||
public toggleLeftPaneExpandedKeyPress = (source: any, event: KeyboardEvent): boolean => {
|
||||
if (event.keyCode === Constants.KeyCodes.Space || event.keyCode === Constants.KeyCodes.Enter) {
|
||||
this.toggleLeftPaneExpanded();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
// Facade
|
||||
public provideFeedbackEmail = () => {
|
||||
window.open(Constants.Urls.feedbackEmail, "_blank");
|
||||
|
||||
@@ -1040,7 +1040,6 @@ exports[`GitHub Repos Panel should render Default properly 1`] = `
|
||||
"isAutoscaleDefaultEnabled": [Function],
|
||||
"isFixedCollectionWithSharedThroughputSupported": [Function],
|
||||
"isHostedDataExplorerEnabled": [Function],
|
||||
"isLeftPaneExpanded": [Function],
|
||||
"isMongoIndexingEnabled": [Function],
|
||||
"isNotebookEnabled": [Function],
|
||||
"isNotebooksEnabledForAccount": [Function],
|
||||
@@ -1107,7 +1106,6 @@ exports[`GitHub Repos Panel should render Default properly 1`] = `
|
||||
"activeTab": [Function],
|
||||
"openedTabs": [Function],
|
||||
},
|
||||
"toggleLeftPaneExpandedKeyPress": [Function],
|
||||
},
|
||||
"getRepo": [Function],
|
||||
"pinRepo": [Function],
|
||||
|
||||
@@ -1030,7 +1030,6 @@ exports[`StringInput Pane should render Create new directory properly 1`] = `
|
||||
"isAutoscaleDefaultEnabled": [Function],
|
||||
"isFixedCollectionWithSharedThroughputSupported": [Function],
|
||||
"isHostedDataExplorerEnabled": [Function],
|
||||
"isLeftPaneExpanded": [Function],
|
||||
"isMongoIndexingEnabled": [Function],
|
||||
"isNotebookEnabled": [Function],
|
||||
"isNotebooksEnabledForAccount": [Function],
|
||||
@@ -1097,7 +1096,6 @@ exports[`StringInput Pane should render Create new directory properly 1`] = `
|
||||
"activeTab": [Function],
|
||||
"openedTabs": [Function],
|
||||
},
|
||||
"toggleLeftPaneExpandedKeyPress": [Function],
|
||||
}
|
||||
}
|
||||
inProgressMessage="Creating directory "
|
||||
|
||||
@@ -1030,7 +1030,6 @@ exports[`Delete Database Confirmation Pane submit() Should call delete database
|
||||
"isHostedDataExplorerEnabled": [Function],
|
||||
"isLastCollection": [Function],
|
||||
"isLastNonEmptyDatabase": [Function],
|
||||
"isLeftPaneExpanded": [Function],
|
||||
"isMongoIndexingEnabled": [Function],
|
||||
"isNotebookEnabled": [Function],
|
||||
"isNotebooksEnabledForAccount": [Function],
|
||||
@@ -1099,7 +1098,6 @@ exports[`Delete Database Confirmation Pane submit() Should call delete database
|
||||
"activeTab": [Function],
|
||||
"openedTabs": [Function],
|
||||
},
|
||||
"toggleLeftPaneExpandedKeyPress": [Function],
|
||||
}
|
||||
}
|
||||
openNotificationConsole={[Function]}
|
||||
|
||||
Reference in New Issue
Block a user