mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-22 18:32:00 +00:00
Add support for Schema Analyzer (#411)
* New MongoSchemaTab * Address feedback and updates * Build fixes * Rename to SchemaAnalyzer * Format Co-authored-by: Laurent Nguyen <laurent.nguyen@microsoft.com>
This commit is contained in:
@@ -59,6 +59,13 @@ export class TabRouteHandler {
|
||||
}
|
||||
);
|
||||
|
||||
this._tabRouter.addRoute(
|
||||
`${Constants.HashRoutePrefixes.collections}/schemaAnalyzer`,
|
||||
(db_id: string, coll_id: string) => {
|
||||
this._openSchemaAnalyzerTabForResource(db_id, coll_id);
|
||||
}
|
||||
);
|
||||
|
||||
this._tabRouter.addRoute(
|
||||
`${Constants.HashRoutePrefixes.collections}/mongoQuery`,
|
||||
(db_id: string, coll_id: string) => {
|
||||
@@ -175,6 +182,19 @@ export class TabRouteHandler {
|
||||
});
|
||||
}
|
||||
|
||||
private _openSchemaAnalyzerTabForResource(databaseId: string, collectionId: string): void {
|
||||
this._executeActionHelper(() => {
|
||||
const collection: ViewModels.Collection = this._findAndExpandMatchingCollectionForResource(
|
||||
databaseId,
|
||||
collectionId
|
||||
);
|
||||
collection &&
|
||||
collection.container &&
|
||||
collection.container.isPreferredApiMongoDB() &&
|
||||
collection.onSchemaAnalyzerClick();
|
||||
});
|
||||
}
|
||||
|
||||
private _openQueryTabForResource(databaseId: string, collectionId: string): void {
|
||||
this._executeActionHelper(() => {
|
||||
const collection: ViewModels.Collection = this._findAndExpandMatchingCollectionForResource(
|
||||
|
||||
Reference in New Issue
Block a user