mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-19 00:41:31 +00:00
Mongo tabs UX fixes (#851)
* Fixed mongo tabs UX * changed logic for new tab index * moved index to tabs base * removed getIndex method
This commit is contained in:
committed by
GitHub
parent
f296c00a1c
commit
ee60f61cfe
@@ -690,14 +690,23 @@ export default class Collection implements ViewModels.Collection {
|
||||
}
|
||||
|
||||
public onNewMongoShellClick() {
|
||||
const id = this.container.tabsManager.getTabs(ViewModels.CollectionTabKind.MongoShell).length + 1;
|
||||
const mongoShellTabs = this.container.tabsManager.getTabs(
|
||||
ViewModels.CollectionTabKind.MongoShell
|
||||
) as MongoShellTab[];
|
||||
|
||||
let index = 1;
|
||||
if (mongoShellTabs.length > 0) {
|
||||
index = mongoShellTabs[mongoShellTabs.length - 1].index + 1;
|
||||
}
|
||||
|
||||
const mongoShellTab: MongoShellTab = new MongoShellTab({
|
||||
tabKind: ViewModels.CollectionTabKind.MongoShell,
|
||||
title: "Shell " + id,
|
||||
title: "Shell " + index,
|
||||
tabPath: "",
|
||||
collection: this,
|
||||
node: this,
|
||||
hashLocation: `${Constants.HashRoutePrefixes.collectionsWithIds(this.databaseId, this.id())}/mongoShell`,
|
||||
index: index,
|
||||
});
|
||||
|
||||
this.container.tabsManager.activateNewTab(mongoShellTab);
|
||||
|
||||
Reference in New Issue
Block a user