mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-22 17:22:59 -05:00
This reverts commit 756f77063a.
This commit is contained in:
@@ -15,6 +15,7 @@ import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
|
||||
import { ConnectionProfileGroup } from 'sql/platform/connection/common/connectionProfileGroup';
|
||||
import * as TaskUtilities from 'sql/workbench/common/taskUtilities';
|
||||
import { ITree } from 'vs/base/parts/tree/browser/tree';
|
||||
import * as Constants from 'sql/platform/connection/common/constants';
|
||||
import { IObjectExplorerService } from 'sql/workbench/services/objectExplorer/common/objectExplorerService';
|
||||
import { TreeNode } from 'sql/parts/objectExplorer/common/treeNode';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
@@ -22,7 +23,6 @@ import { ObjectExplorerActionsContext } from 'sql/parts/objectExplorer/viewlet/o
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IErrorMessageService } from 'sql/platform/errorMessage/common/errorMessageService';
|
||||
import { ConnectionViewletPanel } from 'sql/workbench/parts/dataExplorer/browser/connectionViewletPanel';
|
||||
import { UNSAVED_GROUP_ID } from 'sql/platform/connection/common/constants';
|
||||
|
||||
export class RefreshAction extends Action {
|
||||
|
||||
@@ -356,13 +356,13 @@ export class DeleteConnectionAction extends Action {
|
||||
) {
|
||||
super(id, label);
|
||||
this.class = 'delete-connection-action';
|
||||
if (element instanceof ConnectionProfileGroup && element.id === UNSAVED_GROUP_ID) {
|
||||
if (element instanceof ConnectionProfileGroup && element.id === Constants.unsavedGroupId) {
|
||||
this.enabled = false;
|
||||
}
|
||||
|
||||
if (element instanceof ConnectionProfile) {
|
||||
let parent: ConnectionProfileGroup = element.parent;
|
||||
if (parent && parent.id === UNSAVED_GROUP_ID) {
|
||||
if (parent && parent.id === Constants.unsavedGroupId) {
|
||||
this.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,11 +6,12 @@
|
||||
'use strict';
|
||||
import { ConnectionProfileGroup } from 'sql/platform/connection/common/connectionProfileGroup';
|
||||
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
|
||||
import { ITree, IDragAndDrop, IDragOverReaction, DRAG_OVER_ACCEPT_BUBBLE_DOWN, DRAG_OVER_REJECT } from 'vs/base/parts/tree/browser/tree';
|
||||
import * as Constants from 'sql/platform/connection/common/constants';
|
||||
import { DragMouseEvent } from 'vs/base/browser/mouseEvent';
|
||||
import { TreeUpdateUtils } from 'sql/parts/objectExplorer/viewlet/treeUpdateUtils';
|
||||
import { UNSAVED_GROUP_ID } from 'sql/platform/connection/common/constants';
|
||||
import { IDragAndDropData } from 'vs/base/browser/dnd';
|
||||
|
||||
/**
|
||||
@@ -18,8 +19,8 @@ import { IDragAndDropData } from 'vs/base/browser/dnd';
|
||||
*/
|
||||
export class ServerTreeDragAndDrop implements IDragAndDrop {
|
||||
|
||||
constructor(
|
||||
@IConnectionManagementService private _connectionManagementService: IConnectionManagementService
|
||||
constructor(@IConnectionManagementService private _connectionManagementService: IConnectionManagementService,
|
||||
@IInstantiationService private _instantiationService: IInstantiationService
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -142,7 +143,7 @@ export class ServerTreeDragAndDrop implements IDragAndDrop {
|
||||
|
||||
let isDropToItself = source && targetConnectionProfileGroup && (source instanceof ConnectionProfileGroup) && source.name === targetConnectionProfileGroup.name;
|
||||
let isDropToSameLevel = oldParent && oldParent.equals(targetConnectionProfileGroup);
|
||||
let isUnsavedDrag = source && (source instanceof ConnectionProfileGroup) && (source.id === UNSAVED_GROUP_ID);
|
||||
let isUnsavedDrag = source && (source instanceof ConnectionProfileGroup) && (source.id === Constants.unsavedGroupId);
|
||||
return (!isDropToSameLevel && !isDropToItself && !isUnsavedDrag);
|
||||
}
|
||||
}
|
||||
@@ -152,6 +153,11 @@ export class ServerTreeDragAndDrop implements IDragAndDrop {
|
||||
*/
|
||||
export class RecentConnectionsDragAndDrop implements IDragAndDrop {
|
||||
|
||||
constructor(@IConnectionManagementService private connectionManagementService: IConnectionManagementService,
|
||||
@IInstantiationService private instantiationService: IInstantiationService
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a uri if the given element should be allowed to drag.
|
||||
* Returns null, otherwise.
|
||||
|
||||
Reference in New Issue
Block a user