mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Fixing OE nodes error handling. (#23172)
This commit is contained in:
@@ -23,7 +23,7 @@ import { IConnectionManagementService } from 'sql/platform/connection/common/con
|
|||||||
import { TreeCreationUtils } from 'sql/workbench/services/objectExplorer/browser/treeCreationUtils';
|
import { TreeCreationUtils } from 'sql/workbench/services/objectExplorer/browser/treeCreationUtils';
|
||||||
import { TreeUpdateUtils } from 'sql/workbench/services/objectExplorer/browser/treeUpdateUtils';
|
import { TreeUpdateUtils } from 'sql/workbench/services/objectExplorer/browser/treeUpdateUtils';
|
||||||
import { TreeSelectionHandler } from 'sql/workbench/services/objectExplorer/browser/treeSelectionHandler';
|
import { TreeSelectionHandler } from 'sql/workbench/services/objectExplorer/browser/treeSelectionHandler';
|
||||||
import { IObjectExplorerService, IServerTreeView, ServerTreeViewView } from 'sql/workbench/services/objectExplorer/browser/objectExplorerService';
|
import { ERROR_NODE_TYPE, IObjectExplorerService, IServerTreeView, ServerTreeViewView } from 'sql/workbench/services/objectExplorer/browser/objectExplorerService';
|
||||||
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
|
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
|
||||||
import { Button } from 'sql/base/browser/ui/button/button';
|
import { Button } from 'sql/base/browser/ui/button/button';
|
||||||
import { TreeNode, TreeItemCollapsibleState } from 'sql/workbench/services/objectExplorer/common/treeNode';
|
import { TreeNode, TreeItemCollapsibleState } from 'sql/workbench/services/objectExplorer/common/treeNode';
|
||||||
@@ -928,6 +928,13 @@ export class ServerTreeView extends Disposable implements IServerTreeView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// In case of error node, we need to show the error message
|
||||||
|
if (node instanceof TreeNode) {
|
||||||
|
if (node.objectType === ERROR_NODE_TYPE) {
|
||||||
|
this.showError(node.label);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public getActionContext(element: ServerTreeElement): any {
|
public getActionContext(element: ServerTreeElement): any {
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ export const enum ServerTreeViewView {
|
|||||||
active = 'active'
|
active = 'active'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const ERROR_NODE_TYPE = 'error';
|
||||||
|
|
||||||
export interface IServerTreeView {
|
export interface IServerTreeView {
|
||||||
readonly tree: ITree | AsyncServerTree;
|
readonly tree: ITree | AsyncServerTree;
|
||||||
readonly onSelectionOrFocusChange: Event<void>;
|
readonly onSelectionOrFocusChange: Event<void>;
|
||||||
@@ -583,12 +585,12 @@ export class ObjectExplorerService implements IObjectExplorerService {
|
|||||||
};
|
};
|
||||||
let allNodes: azdata.NodeInfo[] = [];
|
let allNodes: azdata.NodeInfo[] = [];
|
||||||
let errorNode: azdata.NodeInfo = {
|
let errorNode: azdata.NodeInfo = {
|
||||||
nodePath: nodePath,
|
nodePath: '',
|
||||||
parentNodePath: '',
|
parentNodePath: '',
|
||||||
objectType: 'error',
|
objectType: 'error',
|
||||||
label: 'Error',
|
label: 'Error',
|
||||||
errorMessage: '',
|
errorMessage: '',
|
||||||
nodeType: 'error',
|
nodeType: ERROR_NODE_TYPE,
|
||||||
isLeaf: true,
|
isLeaf: true,
|
||||||
nodeSubType: '',
|
nodeSubType: '',
|
||||||
nodeStatus: '',
|
nodeStatus: '',
|
||||||
|
|||||||
Reference in New Issue
Block a user