fix: CB-2239 metadata tabs opening

This commit is contained in:
Wroud
2022-07-05 12:52:08 +03:00
parent fe238f7a60
commit ee2e5d81ec
4 changed files with 10 additions and 5 deletions
@@ -31,17 +31,17 @@ export class TabNavigationContext implements ITabNavigationContext {
return this._handlerPriority;
}
get tab(): ITab<any> | null {
get tab(): ITab | null {
return this._tab;
}
private _isNewlyCreated = false;
private _handlerPriority = 0;
private readonly _handlerPriority = 0;
private _tab: ITab | null = null;
constructor(
private navigationTabsService: NavigationTabsService,
private userInfoResource: UserInfoResource
private readonly navigationTabsService: NavigationTabsService,
private readonly userInfoResource: UserInfoResource
) { }
openNewTab<T = any>(options: ITabOptions<T>): ITab<T> {
@@ -80,6 +80,7 @@ export class DataViewerTabService {
const {
nodeInfo,
tabInfo,
initTab,
trySwitchPage,
} = await contexts.getContext(this.objectViewerTabService.objectViewerTabContext);
@@ -89,6 +90,8 @@ export class DataViewerTabService {
return;
}
initTab();
if (tabInfo.isNewlyCreated) {
trySwitchPage(this.page);
}
@@ -53,6 +53,8 @@ export class ObjectPropertiesPageService {
try {
const tabContext = await contexts.getContext(this.objectViewerTabService.objectViewerTabContext);
tabContext.initTab();
tabContext.trySwitchPage(this.page);
} catch (exception: any) {
this.notificationService.logException(exception, 'Object Viewer Error', 'Error in Object Viewer while processing action with database node');
@@ -126,7 +126,7 @@ export class ObjectViewerTabService {
return tabInfo.tab;
}
return null;
return tabInfo.tab;
};
const getPage = () => {