mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-19 01:25:36 -05:00
Fix tree refresh (#8625)
* first part * remove another refresh collapse expand * Fix scriptable nodes * Fix test
This commit is contained in:
@@ -56,7 +56,6 @@ export class RefreshAction extends Action {
|
||||
|
||||
if (treeNode) {
|
||||
try {
|
||||
await this._tree.collapse(this.element);
|
||||
try {
|
||||
await this._objectExplorerService.refreshTreeNode(treeNode.getSession(), treeNode);
|
||||
} catch (error) {
|
||||
@@ -64,7 +63,6 @@ export class RefreshAction extends Action {
|
||||
return true;
|
||||
}
|
||||
await this._tree.refresh(this.element);
|
||||
return this._tree.expand(this.element);
|
||||
} catch (ex) {
|
||||
this._logService.error(ex);
|
||||
return true;
|
||||
|
||||
@@ -187,7 +187,7 @@ export class ServerTreeActionProvider extends ContributableActionProvider {
|
||||
|
||||
// Contribute refresh action for scriptable objects via contribution
|
||||
if (!this.isScriptableObject(context)) {
|
||||
actions.push(this._instantiationService.createInstance(RefreshAction, RefreshAction.ID, RefreshAction.LABEL, context.tree, context.profile));
|
||||
actions.push(this._instantiationService.createInstance(RefreshAction, RefreshAction.ID, RefreshAction.LABEL, context.tree, context.treeNode || context.profile));
|
||||
}
|
||||
|
||||
return actions;
|
||||
|
||||
@@ -428,7 +428,6 @@ suite('SQL Connection Tree Action tests', () => {
|
||||
objectExplorerService.verify(x => x.getObjectExplorerNode(TypeMoq.It.isAny()), TypeMoq.Times.atLeastOnce());
|
||||
objectExplorerService.verify(x => x.refreshTreeNode(TypeMoq.It.isAny(), TypeMoq.It.isAny()), TypeMoq.Times.atLeastOnce());
|
||||
tree.verify(x => x.refresh(TypeMoq.It.isAny()), TypeMoq.Times.atLeastOnce());
|
||||
tree.verify(x => x.expand(TypeMoq.It.isAny()), TypeMoq.Times.atLeastOnce());
|
||||
}).then(() => done(), (err) => {
|
||||
done(err);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user