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:
Tanuj Mittal
2021-04-22 21:45:21 -04:00
committed by GitHub
parent 448566146f
commit 5ecc3d67b0
17 changed files with 518 additions and 40 deletions

View File

@@ -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(