mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-20 01:11:25 +00:00
Refactor code that uses the _rid and _self of a database or collection (#267)
This commit is contained in:
@@ -15,7 +15,10 @@ export interface OpenNotebookItem {
|
||||
path: string;
|
||||
}
|
||||
|
||||
export type OpenCollectionItem = string;
|
||||
export interface OpenCollectionItem {
|
||||
databaseId: string;
|
||||
collectionId: string;
|
||||
}
|
||||
|
||||
export interface Item {
|
||||
type: Type;
|
||||
@@ -121,7 +124,11 @@ export class MostRecentActivity {
|
||||
public onItemClicked(item: Item) {
|
||||
switch (item.type) {
|
||||
case Type.OpenCollection: {
|
||||
const collection = this.container.findCollection(item.data as OpenCollectionItem);
|
||||
const openCollectionitem = item.data as OpenCollectionItem;
|
||||
const collection = this.container.findCollection(
|
||||
openCollectionitem.databaseId,
|
||||
openCollectionitem.collectionId
|
||||
);
|
||||
if (collection) {
|
||||
collection.openTab();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user