mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-18 09:35:39 -05:00
Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 (#7206)
* Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 * fix config changes * fix strictnull checks
This commit is contained in:
@@ -100,7 +100,7 @@ export class AutoColumnSize<T extends Object> implements Slick.Plugin<T> {
|
||||
}
|
||||
}
|
||||
|
||||
private handleDoubleClick(e: JQuery.Event<HTMLElement, string>) {
|
||||
private handleDoubleClick(e: JQuery.Event<HTMLElement, unknown>) {
|
||||
let headerEl = jQuery(e.currentTarget).closest('.slick-header-column');
|
||||
let columnDef = headerEl.data('column');
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ export class CheckboxSelectColumn<T extends Slick.SlickData> implements Slick.Pl
|
||||
delete this._selectedRowsLookup[row];
|
||||
}
|
||||
}
|
||||
dict.forEach(this._selectedRowsLookup, (e) => this._grid.invalidateRow(e.key));
|
||||
dict.forEach(this._selectedRowsLookup, (e) => this._grid.invalidateRow(Number(e.key)));
|
||||
this._selectedRowsLookup = lookup;
|
||||
this._grid.render();
|
||||
|
||||
|
||||
@@ -6,6 +6,9 @@ import { localize } from 'vs/nls';
|
||||
|
||||
import { Button } from 'sql/base/browser/ui/button/button';
|
||||
import { escape } from 'sql/base/common/strings';
|
||||
import { addDisposableListener } from 'vs/base/browser/dom';
|
||||
import { DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { withNullAsUndefined } from 'vs/base/common/types';
|
||||
|
||||
interface IExtendedColumn<T> extends Slick.Column<T> {
|
||||
filterValues?: Array<string>;
|
||||
@@ -27,6 +30,8 @@ export class HeaderFilter<T extends Slick.SlickData> {
|
||||
private columnDef: IExtendedColumn<T>;
|
||||
private buttonStyles: IButtonStyles;
|
||||
|
||||
private disposableStore = new DisposableStore();
|
||||
|
||||
public init(grid: Slick.Grid<T>): void {
|
||||
this.grid = grid;
|
||||
this.handler.subscribe(this.grid.onHeaderCellRendered, (e: Event, args: Slick.OnHeaderCellRenderedEventArgs<T>) => this.handleHeaderCellRendered(e, args))
|
||||
@@ -36,17 +41,16 @@ export class HeaderFilter<T extends Slick.SlickData> {
|
||||
.subscribe(this.grid.onKeyDown, (e: KeyboardEvent) => this.handleKeyDown(e));
|
||||
this.grid.setColumns(this.grid.getColumns());
|
||||
|
||||
jQuery(document.body).bind('mousedown', this.handleBodyMouseDown);
|
||||
jQuery(document.body).bind('keydown', this.handleKeyDown);
|
||||
this.disposableStore.add(addDisposableListener(document.body, 'mousedown', e => this.handleBodyMouseDown(e)));
|
||||
this.disposableStore.add(addDisposableListener(document.body, 'keydown', e => this.handleKeyDown(e)));
|
||||
}
|
||||
|
||||
public destroy() {
|
||||
this.handler.unsubscribeAll();
|
||||
jQuery(document.body).unbind('mousedown', this.handleBodyMouseDown);
|
||||
jQuery(document.body).unbind('keydown', this.handleKeyDown);
|
||||
this.disposableStore.dispose();
|
||||
}
|
||||
|
||||
private handleKeyDown(e: KeyboardEvent | JQuery.Event<HTMLElement, null>): void {
|
||||
private handleKeyDown(e: KeyboardEvent): void {
|
||||
if (this.$menu && (e.key === 'Escape' || e.keyCode === 27)) {
|
||||
this.hideMenu();
|
||||
e.preventDefault();
|
||||
@@ -54,7 +58,7 @@ export class HeaderFilter<T extends Slick.SlickData> {
|
||||
}
|
||||
}
|
||||
|
||||
private handleBodyMouseDown(e: MouseEvent | JQuery.Event<HTMLElement, null>): void {
|
||||
private handleBodyMouseDown(e: MouseEvent): void {
|
||||
if (this.$menu && this.$menu[0] !== e.target && !jQuery.contains(this.$menu[0], e.target as Element)) {
|
||||
this.hideMenu();
|
||||
e.preventDefault();
|
||||
@@ -78,8 +82,8 @@ export class HeaderFilter<T extends Slick.SlickData> {
|
||||
.addClass('slick-header-menubutton')
|
||||
.data('column', column);
|
||||
|
||||
$el.bind('click', (e) => this.showFilter(e)).appendTo(args.node);
|
||||
$el.bind('keydown', (e) => {
|
||||
$el.bind('click', (e: KeyboardEvent) => this.showFilter(e)).appendTo(args.node);
|
||||
$el.bind('keydown', (e: KeyboardEvent) => {
|
||||
if (e.key === 'Enter' || e.keyCode === 13) {
|
||||
this.showFilter(e);
|
||||
}
|
||||
@@ -146,8 +150,9 @@ export class HeaderFilter<T extends Slick.SlickData> {
|
||||
});
|
||||
}
|
||||
|
||||
private showFilter(e: JQuery.Event<HTMLElement, null>) {
|
||||
const $menuButton = jQuery(e.target);
|
||||
private showFilter(e: KeyboardEvent) {
|
||||
const target = withNullAsUndefined(e.target);
|
||||
const $menuButton = jQuery(target);
|
||||
this.columnDef = $menuButton.data('column');
|
||||
|
||||
this.columnDef.filterValues = this.columnDef.filterValues || [];
|
||||
@@ -222,16 +227,16 @@ export class HeaderFilter<T extends Slick.SlickData> {
|
||||
this.applyStyles();
|
||||
|
||||
jQuery(':checkbox', $filter).bind('click', (e) => {
|
||||
this.workingFilters = this.changeWorkingFilter(filterItems, this.workingFilters, jQuery(e.target));
|
||||
this.workingFilters = this.changeWorkingFilter(filterItems, this.workingFilters, jQuery(target));
|
||||
});
|
||||
|
||||
const offset = jQuery(e.target).offset();
|
||||
const left = offset.left - this.$menu.width() + jQuery(e.target).width() - 8;
|
||||
const offset = jQuery(target).offset();
|
||||
const left = offset.left - this.$menu.width() + jQuery(target).width() - 8;
|
||||
|
||||
let menutop = offset.top + jQuery(e.target).height();
|
||||
let menutop = offset.top + jQuery(target).height();
|
||||
|
||||
if (menutop + offset.top > jQuery(window).height()) {
|
||||
menutop -= (this.$menu.height() + jQuery(e.target).height() + 8);
|
||||
menutop -= (this.$menu.height() + jQuery(target).height() + 8);
|
||||
}
|
||||
this.$menu.css('top', menutop)
|
||||
.css('left', (left > 0 ? left : 0));
|
||||
|
||||
@@ -54,7 +54,7 @@ class AccountPanel extends ViewletPanel {
|
||||
}
|
||||
|
||||
protected renderBody(container: HTMLElement): void {
|
||||
this.accountList = new List<azdata.Account>(container, new AccountListDelegate(AccountDialog.ACCOUNTLIST_HEIGHT), [this.instantiationService.createInstance(AccountListRenderer)]);
|
||||
this.accountList = new List<azdata.Account>('AccountList', container, new AccountListDelegate(AccountDialog.ACCOUNTLIST_HEIGHT), [this.instantiationService.createInstance(AccountListRenderer)]);
|
||||
this._register(attachListStyler(this.accountList, this.themeService));
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import * as azdata from 'azdata';
|
||||
|
||||
export const IAccountPickerService = createDecorator<IAccountPickerService>('AccountPickerService');
|
||||
export interface IAccountPickerService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
renderAccountPicker(container: HTMLElement): void;
|
||||
addAccountCompleteEvent: Event<void>;
|
||||
addAccountErrorEvent: Event<string>;
|
||||
|
||||
@@ -87,7 +87,7 @@ export class AccountPicker extends Disposable {
|
||||
const delegate = new AccountListDelegate(AccountPicker.ACCOUNTPICKERLIST_HEIGHT);
|
||||
const accountRenderer = new AccountPickerListRenderer();
|
||||
this._listContainer = DOM.$('div.account-list-container');
|
||||
this._accountList = new List<azdata.Account>(this._listContainer, delegate, [accountRenderer]);
|
||||
this._accountList = new List<azdata.Account>('AccountPicker', this._listContainer, delegate, [accountRenderer]);
|
||||
this._register(attachListStyler(this._accountList, this._themeService));
|
||||
|
||||
this._rootElement = DOM.$('div.account-picker-container');
|
||||
|
||||
@@ -11,7 +11,7 @@ import { IAccountPickerService } from 'sql/platform/accounts/browser/accountPick
|
||||
import { AccountPicker } from 'sql/platform/accounts/browser/accountPickerImpl';
|
||||
|
||||
export class AccountPickerService implements IAccountPickerService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private _accountPicker: AccountPicker;
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ export const SERVICE_ID = 'accountManagementService';
|
||||
export const IAccountManagementService = createDecorator<IAccountManagementService>(SERVICE_ID);
|
||||
|
||||
export interface IAccountManagementService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
// ACCOUNT MANAGEMENT METHODS //////////////////////////////////////////
|
||||
accountUpdated(account: azdata.Account): Thenable<void>;
|
||||
|
||||
@@ -9,7 +9,7 @@ import { IAccountManagementService } from 'sql/platform/accounts/common/interfac
|
||||
import { AccountProviderAddedEventParams, UpdateAccountListEventParams } from 'sql/platform/accounts/common/eventTypes';
|
||||
|
||||
export class TestAccountManagementService implements IAccountManagementService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
public get addAccountProviderEvent(): Event<AccountProviderAddedEventParams> { return Event.None; }
|
||||
public get removeAccountProviderEvent(): Event<azdata.AccountProviderMetadata> { return Event.None; }
|
||||
|
||||
@@ -29,7 +29,7 @@ export interface IAngularEvent {
|
||||
}
|
||||
|
||||
export interface IAngularEventingService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
/**
|
||||
* Adds a listener for the dashboard to send events, should only be called once for each dashboard by the dashboard itself
|
||||
* @param uri Uri of the dashboard
|
||||
|
||||
@@ -10,7 +10,7 @@ import { IAngularEventingService, IAngularEvent, AngularEventType } from 'sql/pl
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
export class AngularEventingService implements IAngularEventingService {
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
private _angularMap = new Map<string, Subject<IAngularEvent>>();
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -17,7 +17,7 @@ export const SERVICE_ID = 'backupService';
|
||||
export const IBackupService = createDecorator<IBackupService>(SERVICE_ID);
|
||||
|
||||
export interface IBackupService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
getBackupConfigInfo(connectionUri: string): Thenable<azdata.BackupConfigInfo>;
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
export class BackupService implements IBackupService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
private _providers: { [handle: string]: azdata.BackupProvider; } = Object.create(null);
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -30,7 +30,7 @@ export const ICapabilitiesService = createDecorator<ICapabilitiesService>(SERVIC
|
||||
* Interface for managing provider capabilities
|
||||
*/
|
||||
export interface ICapabilitiesService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
/**
|
||||
* Retrieve a list of registered capabilities providers
|
||||
|
||||
@@ -33,7 +33,7 @@ interface CapabilitiesMomento {
|
||||
* to discover the DMP capabilities that a DMP provider offers.
|
||||
*/
|
||||
export class CapabilitiesService extends Disposable implements ICapabilitiesService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private _momento: Memento;
|
||||
private _providers = new Map<string, ProviderFeatures>();
|
||||
|
||||
@@ -14,7 +14,7 @@ import { mssqlProviderName } from 'sql/platform/connection/common/constants';
|
||||
|
||||
export class TestCapabilitiesService implements ICapabilitiesService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
public capabilities: { [id: string]: ProviderFeatures } = {};
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import { BrowserClipboardService } from 'sql/platform/clipboard/browser/clipboar
|
||||
import { clipboard, nativeImage } from 'electron';
|
||||
|
||||
export class ClipboardService extends BrowserClipboardService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
constructor(
|
||||
@vsIClipboardService _vsClipboardService: vsIClipboardService,
|
||||
|
||||
@@ -53,7 +53,7 @@ import { INotificationService } from 'vs/platform/notification/common/notificati
|
||||
|
||||
export class ConnectionManagementService extends Disposable implements IConnectionManagementService {
|
||||
|
||||
_serviceBrand!: ServiceIdentifier<IConnectionManagementService>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private _providers = new Map<string, { onReady: Promise<azdata.ConnectionProvider>, properties: ConnectionProviderProperties }>();
|
||||
private _iconProviders = new Map<string, azdata.IconProvider>();
|
||||
|
||||
@@ -65,7 +65,7 @@ export const SERVICE_ID = 'connectionManagementService';
|
||||
export const IConnectionManagementService = createDecorator<IConnectionManagementService>(SERVICE_ID);
|
||||
|
||||
export interface IConnectionManagementService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
// Event Emitters
|
||||
onAddConnectionProfile: Event<IConnectionProfile>;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { getConfigurationKeys, IConfigurationOverrides, IConfigurationService, getConfigurationValue, isConfigurationOverrides, ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
|
||||
|
||||
export class TestConfigurationService implements IConfigurationService {
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
private configuration = {
|
||||
user: {},
|
||||
|
||||
@@ -16,7 +16,7 @@ import { ConnectionProviderProperties } from 'sql/workbench/parts/connection/com
|
||||
// Test stubs for commonly used objects
|
||||
|
||||
export class TestConnectionManagementService implements IConnectionManagementService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
onAddConnectionProfile = undefined;
|
||||
onDeleteConnectionProfile = undefined;
|
||||
onConnectionChanged = undefined;
|
||||
|
||||
@@ -21,7 +21,7 @@ export interface CredentialManagementEvents {
|
||||
export const ICredentialsService = createDecorator<ICredentialsService>(SERVICE_ID);
|
||||
|
||||
export interface ICredentialsService {
|
||||
_serviceBrand: ServiceIdentifier<ICredentialsService>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
saveCredential(credentialId: string, password: string): Promise<boolean>;
|
||||
|
||||
@@ -34,7 +34,7 @@ export interface ICredentialsService {
|
||||
|
||||
export class CredentialsService implements ICredentialsService {
|
||||
|
||||
_serviceBrand: ServiceIdentifier<ICredentialsService>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private _serverEvents: { [handle: number]: CredentialManagementEvents; } = Object.create(null);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
|
||||
export class TestCredentialsService implements ICredentialsService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
public credentials = new Map<string, Credential>();
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ export const IDashboardService = createDecorator<IDashboardService>('dashboardSe
|
||||
|
||||
export interface IDashboardService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
readonly onDidOpenDashboard: Event<azdata.DashboardDocument>;
|
||||
readonly onDidChangeToDashboard: Event<azdata.DashboardDocument>;
|
||||
readonly onLayout: Event<DOM.Dimension>;
|
||||
|
||||
@@ -9,7 +9,7 @@ import * as DOM from 'vs/base/browser/dom';
|
||||
import * as azdata from 'azdata';
|
||||
|
||||
export class DashboardService implements IDashboardService {
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
private _onDidOpenDashboard = new Emitter<azdata.DashboardDocument>();
|
||||
public readonly onDidOpenDashboard: Event<azdata.DashboardDocument> = this._onDidOpenDashboard.event;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ export interface IDashboardWebview extends IView {
|
||||
}
|
||||
|
||||
export interface IDashboardViewService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
onRegisteredWebview: Event<IDashboardWebview>;
|
||||
registerWebview(widget: IDashboardWebview);
|
||||
onRegisteredModelView: Event<IModelView>;
|
||||
|
||||
@@ -8,7 +8,7 @@ import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { IModelView } from 'sql/platform/model/browser/modelViewService';
|
||||
|
||||
export class DashboardViewService implements IDashboardViewService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private _onRegisteredWebview = new Emitter<IDashboardWebview>();
|
||||
public readonly onRegisteredWebview: Event<IDashboardWebview> = this._onRegisteredWebview.event;
|
||||
|
||||
@@ -9,6 +9,6 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'
|
||||
|
||||
export const IErrorMessageService = createDecorator<IErrorMessageService>('errorMessageService');
|
||||
export interface IErrorMessageService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
showDialog(severity: Severity, headerTitle: string, message: string, messageDetails?: string, actions?: IAction[]): void;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import Severity from 'vs/base/common/severity';
|
||||
import { IErrorMessageService } from 'sql/platform/errorMessage/common/errorMessageService';
|
||||
|
||||
export class TestErrorMessageService implements IErrorMessageService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
showDialog(severity: Severity, headerTitle: string, message: string): void {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ import * as strings from 'vs/base/common/strings';
|
||||
import { invalidProvider } from 'sql/base/common/errors';
|
||||
|
||||
export class FileBrowserService implements IFileBrowserService {
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
private _providers: { [handle: string]: azdata.FileBrowserProvider; } = Object.create(null);
|
||||
private _onAddFileTree = new Emitter<FileBrowserTree>();
|
||||
private _onExpandFolder = new Emitter<FileNode>();
|
||||
|
||||
@@ -11,7 +11,7 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'
|
||||
|
||||
export const IFileBrowserService = createDecorator<IFileBrowserService>('fileBrowserService');
|
||||
export interface IFileBrowserService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
onAddFileTree: Event<FileBrowserTree>;
|
||||
onExpandFolder: Event<FileNode>;
|
||||
onPathValidate: Event<azdata.FileBrowserValidatedParams>;
|
||||
@@ -55,4 +55,4 @@ export interface IFileBrowserService {
|
||||
* Close file browser
|
||||
*/
|
||||
closeFileBrowser(ownerUri: string): Thenable<azdata.FileBrowserCloseResponse>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ export const SERVICE_ID = 'jobManagementService';
|
||||
export const IJobManagementService = createDecorator<IJobManagementService>(SERVICE_ID);
|
||||
|
||||
export interface IJobManagementService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
onDidChange: Event<void>;
|
||||
|
||||
registerProvider(providerId: string, provider: azdata.AgentServicesProvider): void;
|
||||
|
||||
@@ -10,7 +10,7 @@ import { IConnectionManagementService } from 'sql/platform/connection/common/con
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
|
||||
export class JobManagementService implements IJobManagementService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private _onDidChange = new Emitter<void>();
|
||||
public readonly onDidChange: Event<void> = this._onDidChange.event;
|
||||
@@ -213,7 +213,7 @@ export class JobManagementService implements IJobManagementService {
|
||||
* Server level caching of jobs/job histories and their views
|
||||
*/
|
||||
export class JobCacheObject {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
private _jobs: azdata.AgentJobInfo[] = [];
|
||||
private _jobHistories: { [jobID: string]: azdata.AgentJobHistoryInfo[]; } = {};
|
||||
private _jobSteps: { [jobID: string]: azdata.AgentJobStepInfo[]; } = {};
|
||||
@@ -399,7 +399,7 @@ export class NotebookCacheObject {
|
||||
* Server level caching of Operators
|
||||
*/
|
||||
export class OperatorsCacheObject {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
private _operators: azdata.AgentOperatorInfo[];
|
||||
private _dataView: Slick.Data.DataView<any>;
|
||||
private _serverName: string;
|
||||
@@ -436,7 +436,7 @@ export class OperatorsCacheObject {
|
||||
* Server level caching of job alerts and the alerts view
|
||||
*/
|
||||
export class AlertsCacheObject {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
private _alerts: azdata.AgentAlertInfo[];
|
||||
private _dataView: Slick.Data.DataView<any>;
|
||||
private _serverName: string;
|
||||
@@ -473,7 +473,7 @@ export class AlertsCacheObject {
|
||||
* Server level caching of job proxies and proxies view
|
||||
*/
|
||||
export class ProxiesCacheObject {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
private _proxies: azdata.AgentProxyInfo[];
|
||||
private _dataView: Slick.Data.DataView<any>;
|
||||
private _serverName: string;
|
||||
|
||||
@@ -12,7 +12,7 @@ export const SERVICE_ID = 'metadataService';
|
||||
export const IMetadataService = createDecorator<IMetadataService>(SERVICE_ID);
|
||||
|
||||
export interface IMetadataService {
|
||||
_serviceBrand: ServiceIdentifier<IMetadataService>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
getMetadata(connectionUri: string): Thenable<azdata.ProviderMetadata>;
|
||||
|
||||
@@ -30,7 +30,7 @@ export interface IMetadataService {
|
||||
|
||||
export class MetadataService implements IMetadataService {
|
||||
|
||||
public _serviceBrand: ServiceIdentifier<IMetadataService>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private _providers: { [handle: string]: azdata.MetadataProvider; } = Object.create(null);
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import { IModelView } from 'sql/platform/model/browser/modelViewService';
|
||||
export const SERVICE_ID = 'modelViewService';
|
||||
|
||||
export interface IModelViewService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
onRegisteredModelView: Event<IModelView>;
|
||||
registerModelView(widget: IModelView);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { IModelView } from 'sql/platform/model/browser/modelViewService';
|
||||
|
||||
export class ModelViewService implements IModelViewService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private _onRegisteredModelView = new Emitter<IModelView>();
|
||||
public readonly onRegisteredModelView: Event<IModelView> = this._onRegisteredModelView.event;
|
||||
|
||||
@@ -13,7 +13,7 @@ export const ISqlOAuthService = createDecorator<ISqlOAuthService>('sqlOAuthServi
|
||||
* electron-based services are referenced in unit testable code.
|
||||
*/
|
||||
export interface ISqlOAuthService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
/**
|
||||
* Sends request to main thread to handle OAuth request
|
||||
|
||||
@@ -12,7 +12,7 @@ import { ISqlOAuthService } from 'sql/platform/oAuth/common/sqlOAuthService';
|
||||
* electron-based services are referenced in unit testable code.
|
||||
*/
|
||||
export class SqlOAuthService implements ISqlOAuthService {
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
/**
|
||||
* Sends request to main thread to handle OAuth request
|
||||
|
||||
@@ -20,7 +20,7 @@ export const SERVICE_ID = 'queryManagementService';
|
||||
export const IQueryManagementService = createDecorator<IQueryManagementService>(SERVICE_ID);
|
||||
|
||||
export interface IQueryManagementService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
onHandlerAdded: Event<string>;
|
||||
|
||||
@@ -91,7 +91,7 @@ export interface IQueryRequestHandler {
|
||||
}
|
||||
|
||||
export class QueryManagementService implements IQueryManagementService {
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
private _requestHandlers = new Map<string, IQueryRequestHandler>();
|
||||
private _onHandlerAddedEmitter = new Emitter<string>();
|
||||
|
||||
@@ -47,7 +47,7 @@ export interface IQueryEvent {
|
||||
* Interface for the logic of handling running queries and grid interactions for all URIs.
|
||||
*/
|
||||
export interface IQueryModelService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
getQueryRunner(uri: string): QueryRunner;
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ export class QueryInfo {
|
||||
* Handles running queries and grid interactions for all URIs. Interacts with each URI's results grid via a DataService instance
|
||||
*/
|
||||
export class QueryModelService implements IQueryModelService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
// MEMBER VARIABLES ////////////////////////////////////////////////////
|
||||
private _queryInfoMap: Map<string, QueryInfo>;
|
||||
|
||||
@@ -29,7 +29,7 @@ import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
export class RestoreService implements IRestoreService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
private _providers: { [handle: string]: azdata.RestoreProvider; } = Object.create(null);
|
||||
|
||||
constructor(
|
||||
@@ -132,7 +132,7 @@ export class RestoreService implements IRestoreService {
|
||||
}
|
||||
|
||||
export class RestoreDialogController implements IRestoreDialogController {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private _restoreDialogs: { [provider: string]: RestoreDialog | OptionsDialog } = {};
|
||||
private _currentProvider: string;
|
||||
|
||||
@@ -13,7 +13,7 @@ export const SERVICE_ID = 'restoreService';
|
||||
export const IRestoreService = createDecorator<IRestoreService>(SERVICE_ID);
|
||||
|
||||
export interface IRestoreService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
/**
|
||||
* Register a disaster recovery provider
|
||||
@@ -43,6 +43,6 @@ export interface IRestoreService {
|
||||
|
||||
export const IRestoreDialogController = createDecorator<IRestoreDialogController>('restoreDialogService');
|
||||
export interface IRestoreDialogController {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
showDialog(connection: IConnectionProfile): Promise<void>;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ export enum ScriptOperation {
|
||||
}
|
||||
|
||||
export interface IScriptingService {
|
||||
_serviceBrand: ServiceIdentifier<IScriptingService>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
script(connectionUri: string, metadata: azdata.ObjectMetadata, operation: ScriptOperation, paramDetails: azdata.ScriptingParamDetails): Thenable<azdata.ScriptingResult>;
|
||||
|
||||
@@ -50,7 +50,7 @@ export interface IScriptingService {
|
||||
|
||||
export class ScriptingService implements IScriptingService {
|
||||
|
||||
public _serviceBrand: ServiceIdentifier<IScriptingService>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private _providers: { [handle: string]: azdata.ScriptingProvider; } = Object.create(null);
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ export interface SerializeDataParams {
|
||||
}
|
||||
|
||||
export interface ISerializationService {
|
||||
_serviceBrand: ServiceIdentifier<ISerializationService>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
registerProvider(providerId: string, provider: azdata.SerializationProvider): void;
|
||||
|
||||
@@ -61,7 +61,7 @@ function getBatchSize(totalRows: number, currentIndex: number): number {
|
||||
|
||||
export class SerializationService implements ISerializationService {
|
||||
|
||||
_serviceBrand: ServiceIdentifier<ISerializationService>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private providers: { providerId: string, provider: azdata.SerializationProvider }[] = [];
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ export interface IServerGroupDialogCallbacks {
|
||||
}
|
||||
export const IServerGroupController = createDecorator<IServerGroupController>('serverGroupController');
|
||||
export interface IServerGroupController {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
showCreateGroupDialog(callbacks?: IServerGroupDialogCallbacks): Promise<void>;
|
||||
showEditGroupDialog(group: ConnectionProfileGroup): Promise<void>;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ export const SERVICE_ID = 'taskHistoryService';
|
||||
export const ITaskService = createDecorator<ITaskService>(SERVICE_ID);
|
||||
|
||||
export interface ITaskService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
onTaskComplete: Event<TaskNode>;
|
||||
onAddNewTask: Event<TaskNode>;
|
||||
handleNewTask(task: TaskNode): void;
|
||||
@@ -44,7 +44,7 @@ export interface TaskStatusChangeArgs {
|
||||
}
|
||||
|
||||
export class TaskService implements ITaskService {
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
private _taskQueue: TaskNode;
|
||||
private _onTaskComplete = new Emitter<TaskNode>();
|
||||
private _onAddNewTask = new Emitter<TaskNode>();
|
||||
@@ -160,7 +160,7 @@ export class TaskService implements ITaskService {
|
||||
let numOfInprogressTasks = this.getNumberOfInProgressTasks();
|
||||
if (numOfInprogressTasks > 0) {
|
||||
this.dialogService.show(Severity.Warning, message, options).then(choice => {
|
||||
switch (choice) {
|
||||
switch (choice.choice) {
|
||||
case 0:
|
||||
let timeout: any;
|
||||
let isTimeout = false;
|
||||
|
||||
@@ -56,7 +56,7 @@ class TelemetryEventImpl implements ITelemetryEvent {
|
||||
|
||||
export class AdsTelemetryService implements IAdsTelemetryService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
constructor(
|
||||
@ITelemetryService private telemetryService: ITelemetryService,
|
||||
|
||||
@@ -65,7 +65,7 @@ export interface ITelemetryInfo {
|
||||
export interface IAdsTelemetryService {
|
||||
|
||||
// ITelemetryService functions
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
setEnabled(value: boolean): void;
|
||||
|
||||
|
||||
@@ -285,7 +285,7 @@ export class ExtHostNotebook implements ExtHostNotebookShape {
|
||||
}
|
||||
}
|
||||
|
||||
private _withServerManager<R>(handle: number, callback: (manager: azdata.nb.ServerManager) => R | PromiseLike<R>): Promise<R> {
|
||||
private _withServerManager<R>(handle: number, callback: (manager: azdata.nb.ServerManager) => PromiseLike<R>): Promise<R> {
|
||||
return this._withNotebookManager(handle, (notebookManager) => {
|
||||
let serverManager = notebookManager.serverManager;
|
||||
if (!serverManager) {
|
||||
@@ -295,7 +295,7 @@ export class ExtHostNotebook implements ExtHostNotebookShape {
|
||||
});
|
||||
}
|
||||
|
||||
private _withContentManager<R>(handle: number, callback: (manager: azdata.nb.ContentManager) => R | PromiseLike<R>): Promise<R> {
|
||||
private _withContentManager<R>(handle: number, callback: (manager: azdata.nb.ContentManager) => PromiseLike<R>): Promise<R> {
|
||||
return this._withNotebookManager(handle, (notebookManager) => {
|
||||
let contentManager = notebookManager.contentManager;
|
||||
if (!contentManager) {
|
||||
@@ -305,7 +305,7 @@ export class ExtHostNotebook implements ExtHostNotebookShape {
|
||||
});
|
||||
}
|
||||
|
||||
private _withSessionManager<R>(handle: number, callback: (manager: azdata.nb.SessionManager) => R | PromiseLike<R>): Promise<R> {
|
||||
private _withSessionManager<R>(handle: number, callback: (manager: azdata.nb.SessionManager) => PromiseLike<R>): Promise<R> {
|
||||
return this._withNotebookManager(handle, (notebookManager) => {
|
||||
let sessionManager = notebookManager.sessionManager;
|
||||
if (!sessionManager) {
|
||||
|
||||
@@ -22,7 +22,6 @@ import { StandaloneCodeEditor } from 'vs/editor/standalone/browser/standaloneCod
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
|
||||
import { Configuration } from 'vs/editor/browser/config/configuration';
|
||||
import { IWindowService } from 'vs/platform/windows/common/windows';
|
||||
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';
|
||||
@@ -151,7 +150,7 @@ export class QueryTextEditor extends BaseTextEditor {
|
||||
let shouldAddHorizontalScrollbarHeight = false;
|
||||
if (!this._editorWorkspaceConfig || configChanged) {
|
||||
this._editorWorkspaceConfig = this.workspaceConfigurationService.getValue('editor');
|
||||
this._lineHeight = editorWidget.getConfiguration().lineHeight;
|
||||
this._lineHeight = editorWidget.getRawOptions().lineHeight;
|
||||
}
|
||||
let wordWrapEnabled: boolean = this._editorWorkspaceConfig && this._editorWorkspaceConfig['wordWrap'] && this._editorWorkspaceConfig['wordWrap'] === 'on' ? true : false;
|
||||
if (wordWrapEnabled) {
|
||||
|
||||
@@ -65,6 +65,7 @@ export class CustomTreeViewPanel extends ViewletPanel {
|
||||
const { treeView } = (<ITreeViewDescriptor>Registry.as<IViewsRegistry>(Extensions.ViewsRegistry).getView(options.id));
|
||||
this.treeView = treeView as ITreeView;
|
||||
this._register(this.treeView.onDidChangeActions(() => this.updateActions(), this));
|
||||
this._register(this.treeView.onDidChangeTitle((newTitle) => this.updateTitle(newTitle)));
|
||||
this._register(toDisposable(() => this.treeView.setVisibility(false)));
|
||||
this._register(this.onDidChangeBodyVisibility(() => this.updateTreeVisibility()));
|
||||
this.updateTreeVisibility();
|
||||
@@ -200,11 +201,14 @@ export class CustomTreeView extends Disposable implements ITreeView {
|
||||
private readonly _onDidChangeActions: Emitter<void> = this._register(new Emitter<void>());
|
||||
readonly onDidChangeActions: Event<void> = this._onDidChangeActions.event;
|
||||
|
||||
private readonly _onDidChangeTitle: Emitter<string> = this._register(new Emitter<string>());
|
||||
readonly onDidChangeTitle: Event<string> = this._onDidChangeTitle.event;
|
||||
|
||||
private nodeContext: NodeContextKey;
|
||||
|
||||
constructor(
|
||||
private id: string,
|
||||
private title: string,
|
||||
private _title: string,
|
||||
private viewContainer: ViewContainer,
|
||||
@IExtensionService private readonly extensionService: IExtensionService,
|
||||
@IWorkbenchThemeService private readonly themeService: IWorkbenchThemeService,
|
||||
@@ -277,6 +281,15 @@ export class CustomTreeView extends Disposable implements ITreeView {
|
||||
this.updateMessage();
|
||||
}
|
||||
|
||||
get title(): string {
|
||||
return this._title;
|
||||
}
|
||||
|
||||
set title(name: string) {
|
||||
this._title = name;
|
||||
this._onDidChangeTitle.fire(this._title);
|
||||
}
|
||||
|
||||
get canSelectMany(): boolean {
|
||||
return this._canSelectMany;
|
||||
}
|
||||
@@ -386,26 +399,26 @@ export class CustomTreeView extends Disposable implements ITreeView {
|
||||
const aligner = new Aligner(this.themeService);
|
||||
const renderer = this.instantiationService.createInstance(TreeRenderer, this.id, treeMenus, this.treeLabels, actionViewItemProvider, aligner);
|
||||
|
||||
this.tree = this._register(this.instantiationService.createInstance(WorkbenchAsyncDataTree, this.treeContainer, new CustomTreeDelegate(), [renderer],
|
||||
this.tree = this._register(this.instantiationService.createInstance(WorkbenchAsyncDataTree, 'SqlCustomView', this.treeContainer, new CustomTreeDelegate(), [renderer],
|
||||
dataSource, {
|
||||
identityProvider: new CustomViewIdentityProvider(),
|
||||
accessibilityProvider: {
|
||||
getAriaLabel(element: ITreeItem): string {
|
||||
return element.label ? element.label.label : '';
|
||||
}
|
||||
},
|
||||
ariaLabel: this.title,
|
||||
keyboardNavigationLabelProvider: {
|
||||
getKeyboardNavigationLabel: (item: ITreeItem) => {
|
||||
return item.label ? item.label.label : (item.resourceUri ? basename(URI.revive(item.resourceUri)) : undefined);
|
||||
}
|
||||
},
|
||||
expandOnlyOnTwistieClick: (e: ITreeItem) => !!e.command,
|
||||
collapseByDefault: (e: ITreeItem): boolean => {
|
||||
return e.collapsibleState !== TreeItemCollapsibleState.Expanded;
|
||||
},
|
||||
multipleSelectionSupport: this.canSelectMany,
|
||||
}) as WorkbenchAsyncDataTree<ITreeItem, ITreeItem, FuzzyScore>);
|
||||
identityProvider: new CustomViewIdentityProvider(),
|
||||
accessibilityProvider: {
|
||||
getAriaLabel(element: ITreeItem): string {
|
||||
return element.label ? element.label.label : '';
|
||||
}
|
||||
},
|
||||
ariaLabel: this.title,
|
||||
keyboardNavigationLabelProvider: {
|
||||
getKeyboardNavigationLabel: (item: ITreeItem) => {
|
||||
return item.label ? item.label.label : (item.resourceUri ? basename(URI.revive(item.resourceUri)) : undefined);
|
||||
}
|
||||
},
|
||||
expandOnlyOnTwistieClick: (e: ITreeItem) => !!e.command,
|
||||
collapseByDefault: (e: ITreeItem): boolean => {
|
||||
return e.collapsibleState !== TreeItemCollapsibleState.Expanded;
|
||||
},
|
||||
multipleSelectionSupport: this.canSelectMany,
|
||||
}) as WorkbenchAsyncDataTree<ITreeItem, ITreeItem, FuzzyScore>);
|
||||
aligner.tree = this.tree;
|
||||
const actionRunner = new MultipleSelectionActionRunner(() => this.tree!.getSelection());
|
||||
renderer.actionRunner = actionRunner;
|
||||
|
||||
@@ -47,6 +47,6 @@ export interface IInsight {
|
||||
}
|
||||
|
||||
export interface IInsightCtor {
|
||||
new(container: HTMLElement, options: IInsightOptions, ...services: { _serviceBrand: any; }[]): IInsight;
|
||||
new(container: HTMLElement, options: IInsightOptions, ...services: { _serviceBrand: undefined; }[]): IInsight;
|
||||
readonly types: Array<InsightType | ChartType>;
|
||||
}
|
||||
|
||||
@@ -43,24 +43,24 @@ class TestParsedArgs implements ParsedArgs {
|
||||
debugPluginHost?: string;
|
||||
debugSearch?: string;
|
||||
diff?: boolean;
|
||||
'disable-crash-reporter'?: string;
|
||||
'disable-extension'?: string | string[];
|
||||
'disable-crash-reporter'?: boolean;
|
||||
'disable-extension'?: string[]; // undefined or array of 1 or more
|
||||
'disable-extensions'?: boolean;
|
||||
'disable-restore-windows'?: boolean;
|
||||
'disable-telemetry'?: boolean;
|
||||
'disable-updates'?: string;
|
||||
'disable-updates'?: boolean;
|
||||
'driver'?: string;
|
||||
'enable-proposed-api'?: string | string[];
|
||||
'enable-proposed-api'?: string[];
|
||||
'export-default-configuration'?: string;
|
||||
'extensions-dir'?: string;
|
||||
extensionDevelopmentPath?: string;
|
||||
extensionDevelopmentPath?: string[];
|
||||
extensionTestsPath?: string;
|
||||
'file-chmod'?: boolean;
|
||||
'file-write'?: boolean;
|
||||
'folder-uri'?: string | string[];
|
||||
'folder-uri'?: string[];
|
||||
goto?: boolean;
|
||||
help?: boolean;
|
||||
'install-extension'?: string | string[];
|
||||
'install-extension'?: string[];
|
||||
'install-source'?: string;
|
||||
integrated?: boolean;
|
||||
'list-extensions'?: boolean;
|
||||
@@ -72,7 +72,7 @@ class TestParsedArgs implements ParsedArgs {
|
||||
'open-url'?: boolean;
|
||||
performance?: boolean;
|
||||
'prof-append-timers'?: string;
|
||||
'prof-startup'?: string;
|
||||
'prof-startup'?: boolean;
|
||||
'prof-startup-prefix'?: string;
|
||||
'reuse-window'?: boolean;
|
||||
server?: string;
|
||||
@@ -82,7 +82,7 @@ class TestParsedArgs implements ParsedArgs {
|
||||
'skip-release-notes'?: boolean;
|
||||
status?: boolean;
|
||||
'sticky-quickopen'?: boolean;
|
||||
'uninstall-extension'?: string | string[];
|
||||
'uninstall-extension'?: string[];
|
||||
'unity-launch'?: boolean; // Always open a new window, except if opening the first window or opening a file or folder as part of the launch.
|
||||
'upload-logs'?: string;
|
||||
user?: string;
|
||||
|
||||
@@ -269,13 +269,13 @@ suite('Cell Model', function (): void {
|
||||
metadata: { language: 'python' },
|
||||
execution_count: 1
|
||||
}, {
|
||||
notebook: new NotebookModelStub({
|
||||
name: '',
|
||||
version: '',
|
||||
mimetype: 'x-scala'
|
||||
}),
|
||||
isTrusted: false
|
||||
});
|
||||
notebook: new NotebookModelStub({
|
||||
name: '',
|
||||
version: '',
|
||||
mimetype: 'x-scala'
|
||||
}),
|
||||
isTrusted: false
|
||||
});
|
||||
});
|
||||
|
||||
test('should send and handle incoming messages', async () => {
|
||||
|
||||
@@ -23,7 +23,7 @@ export const SERVICE_ID = 'oeShimService';
|
||||
export const IOEShimService = createDecorator<IOEShimService>(SERVICE_ID);
|
||||
|
||||
export interface IOEShimService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
getChildren(node: ITreeItem, viewId: string): Promise<ITreeItem[]>;
|
||||
disconnectNode(viewId: string, node: ITreeItem): Promise<boolean>;
|
||||
providerExists(providerId: string): boolean;
|
||||
@@ -32,7 +32,7 @@ export interface IOEShimService {
|
||||
}
|
||||
|
||||
export class OEShimService extends Disposable implements IOEShimService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private sessionMap = new Map<number, string>();
|
||||
private nodeHandleMap = new Map<number, string>();
|
||||
|
||||
@@ -107,7 +107,7 @@ suite('SQL Connection Tree Action tests', () => {
|
||||
});
|
||||
|
||||
const viewsService = new class implements IViewsService {
|
||||
_serviceBrand: ServiceIdentifier<any>;
|
||||
_serviceBrand: undefined;
|
||||
openView(id: string, focus?: boolean): Promise<IView> {
|
||||
return Promise.resolve({
|
||||
id: '',
|
||||
|
||||
@@ -382,9 +382,9 @@ export class ProfilerEditor extends BaseEditor {
|
||||
}
|
||||
]
|
||||
}, {
|
||||
forceFitColumns: true,
|
||||
dataItemColumnValueExtractor: slickGridDataItemColumnValueExtractor
|
||||
});
|
||||
forceFitColumns: true,
|
||||
dataItemColumnValueExtractor: slickGridDataItemColumnValueExtractor
|
||||
});
|
||||
|
||||
this._detailTableData.onRowCountChange(() => {
|
||||
this._detailTable.updateRowCount();
|
||||
|
||||
@@ -17,7 +17,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { generateUuid } from 'vs/base/common/uuid';
|
||||
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { IDialogService, IShowResult } from 'vs/platform/dialogs/common/dialogs';
|
||||
import * as types from 'vs/base/common/types';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
@@ -291,11 +291,11 @@ export class ProfilerInput extends EditorInput implements IProfilerSession {
|
||||
nls.localize('profilerClosingActions.yes', "Yes"),
|
||||
nls.localize('profilerClosingActions.no', "No"),
|
||||
nls.localize('profilerClosingActions.cancel', "Cancel")
|
||||
]).then((selection: number) => {
|
||||
if (selection === 0) {
|
||||
]).then((selection: IShowResult) => {
|
||||
if (selection.choice === 0) {
|
||||
this._profilerService.stopSession(this.id);
|
||||
return ConfirmResult.DONT_SAVE;
|
||||
} else if (selection === 1) {
|
||||
} else if (selection.choice === 1) {
|
||||
return ConfirmResult.DONT_SAVE;
|
||||
} else {
|
||||
return ConfirmResult.CANCEL;
|
||||
|
||||
@@ -92,8 +92,8 @@ export class ProfilerTableEditor extends BaseEditor implements IProfilerControll
|
||||
}
|
||||
}
|
||||
}, {
|
||||
dataItemColumnValueExtractor: slickGridDataItemColumnValueExtractor
|
||||
});
|
||||
dataItemColumnValueExtractor: slickGridDataItemColumnValueExtractor
|
||||
});
|
||||
this._profilerTable.setSelectionModel(new RowSelectionModel());
|
||||
const copyKeybind = new CopyKeybind();
|
||||
copyKeybind.onCopy((e) => {
|
||||
|
||||
@@ -28,9 +28,9 @@ export class BareResultsGridInfo extends BareFontInfo {
|
||||
public static createFromRawSettings(opts: {
|
||||
fontFamily?: string;
|
||||
fontWeight?: string;
|
||||
fontSize?: number | string;
|
||||
lineHeight?: number | string;
|
||||
letterSpacing?: number | string;
|
||||
fontSize?: number;
|
||||
lineHeight?: number;
|
||||
letterSpacing?: number;
|
||||
cellPadding?: number | number[];
|
||||
}, zoomLevel: number): BareResultsGridInfo {
|
||||
let cellPadding = !types.isUndefinedOrNull(opts.cellPadding) ? opts.cellPadding : RESULTS_GRID_DEFAULTS.cellPadding;
|
||||
|
||||
@@ -75,10 +75,10 @@ export class QueryHistoryView extends Disposable {
|
||||
return new Tree(treeContainer, {
|
||||
dataSource, renderer, controller, dnd, filter, sorter, accessibilityProvider
|
||||
}, {
|
||||
indentPixels: 10,
|
||||
twistiePixels: 20,
|
||||
ariaLabel: localize({ key: 'queryHistory.regTreeAriaLabel', comment: ['QueryHistory'] }, "Query History")
|
||||
});
|
||||
indentPixels: 10,
|
||||
twistiePixels: 20,
|
||||
ariaLabel: localize({ key: 'queryHistory.regTreeAriaLabel', comment: ['QueryHistory'] }, "Query History")
|
||||
});
|
||||
}
|
||||
|
||||
public refreshTree(): void {
|
||||
|
||||
@@ -90,10 +90,10 @@ export class TaskHistoryView extends Disposable {
|
||||
return new Tree(treeContainer, {
|
||||
dataSource, renderer, controller, dnd, filter, sorter, accessibilityProvider
|
||||
}, {
|
||||
indentPixels: 10,
|
||||
twistiePixels: 20,
|
||||
ariaLabel: localize({ key: 'taskHistory.regTreeAriaLabel', comment: ['TaskHistory'] }, "Task history")
|
||||
});
|
||||
indentPixels: 10,
|
||||
twistiePixels: 20,
|
||||
ariaLabel: localize({ key: 'taskHistory.regTreeAriaLabel', comment: ['TaskHistory'] }, "Task history")
|
||||
});
|
||||
}
|
||||
|
||||
private updateTask(task: TaskNode): void {
|
||||
|
||||
@@ -27,7 +27,7 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
|
||||
// MEMBER VARIABLES ////////////////////////////////////////////////////
|
||||
public _providers: { [id: string]: AccountProviderWithMetadata } = {};
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
private _accountStore: AccountStore;
|
||||
private _accountDialogController: AccountDialogController;
|
||||
private _autoOAuthDialogController: AutoOAuthDialogController;
|
||||
|
||||
@@ -15,7 +15,7 @@ import * as azdata from 'azdata';
|
||||
export const IAdminService = createDecorator<IAdminService>(SERVICE_ID);
|
||||
|
||||
export interface IAdminService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
registerProvider(providerId: string, provider: azdata.AdminServicesProvider): void;
|
||||
|
||||
@@ -25,7 +25,7 @@ export interface IAdminService {
|
||||
}
|
||||
|
||||
export class AdminService implements IAdminService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private _providers: { [handle: string]: azdata.AdminServicesProvider; } = Object.create(null);
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import { IBackupService, TaskExecutionMode } from 'sql/platform/backup/common/ba
|
||||
import { IBackupUiService } from 'sql/workbench/services/backup/common/backupUiService';
|
||||
|
||||
export class BackupUiService implements IBackupUiService {
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
private _backupDialogs: { [providerName: string]: BackupDialog | OptionsDialog } = {};
|
||||
private _currentProvider: string;
|
||||
private _optionValues: { [optionName: string]: any } = {};
|
||||
|
||||
@@ -11,7 +11,7 @@ export const UI_SERVICE_ID = 'backupUiService';
|
||||
export const IBackupUiService = createDecorator<IBackupUiService>(UI_SERVICE_ID);
|
||||
|
||||
export interface IBackupUiService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
/**
|
||||
* Show backup wizard
|
||||
|
||||
@@ -58,7 +58,7 @@ export interface IConnectionComponentController {
|
||||
|
||||
export class ConnectionDialogService implements IConnectionDialogService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private _connectionDialog: ConnectionDialogWidget;
|
||||
private _connectionControllerMap: { [providerName: string]: IConnectionComponentController } = {};
|
||||
@@ -277,14 +277,14 @@ export class ConnectionDialogService implements IConnectionDialogService {
|
||||
this._connectionControllerMap[providerName] =
|
||||
this._instantiationService.createInstance(CmsConnectionController,
|
||||
this._capabilitiesService.getCapabilities(providerName).connection, {
|
||||
onSetConnectButton: (enable: boolean) => this.handleSetConnectButtonEnable(enable)
|
||||
}, providerName);
|
||||
onSetConnectButton: (enable: boolean) => this.handleSetConnectButtonEnable(enable)
|
||||
}, providerName);
|
||||
} else {
|
||||
this._connectionControllerMap[providerName] =
|
||||
this._instantiationService.createInstance(ConnectionController,
|
||||
this._capabilitiesService.getCapabilities(providerName).connection, {
|
||||
onSetConnectButton: (enable: boolean) => this.handleSetConnectButtonEnable(enable)
|
||||
}, providerName);
|
||||
onSetConnectButton: (enable: boolean) => this.handleSetConnectButtonEnable(enable)
|
||||
}, providerName);
|
||||
}
|
||||
}
|
||||
return this._connectionControllerMap[providerName];
|
||||
|
||||
@@ -9,7 +9,7 @@ import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
|
||||
|
||||
export const IConnectionDialogService = createDecorator<IConnectionDialogService>('connectionDialogService');
|
||||
export interface IConnectionDialogService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
/**
|
||||
* Opens the connection dialog and returns the promise for successfully opening the dialog
|
||||
*/
|
||||
|
||||
@@ -8,7 +8,7 @@ import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
|
||||
import { IConnectionDialogService } from 'sql/workbench/services/connection/common/connectionDialogService';
|
||||
|
||||
export class TestConnectionDialogService implements IConnectionDialogService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
public showDialog(connectionManagementService: IConnectionManagementService,
|
||||
params: INewConnectionParams, model: IConnectionProfile, connectionResult?: IConnectionResult, connectionOptions?: IConnectionCompletionOptions): Promise<void> {
|
||||
|
||||
@@ -8,6 +8,6 @@ import { IDashboardTab } from 'sql/platform/dashboard/browser/dashboardRegistry'
|
||||
|
||||
export const INewDashboardTabDialogService = createDecorator<INewDashboardTabDialogService>('addNewDashboardTabService');
|
||||
export interface INewDashboardTabDialogService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
showDialog(dashboardTabs: Array<IDashboardTab>, openedTabs: Array<IDashboardTab>, uri: string): void;
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ export class NewDashboardTabDialog extends Modal {
|
||||
let extensionTabViewContainer = DOM.$('.extensionTab-view');
|
||||
let delegate = new ExtensionListDelegate();
|
||||
let extensionTabRenderer = new ExtensionListRenderer();
|
||||
this._extensionList = new List<IDashboardUITab>(extensionTabViewContainer, delegate, [extensionTabRenderer]);
|
||||
this._extensionList = new List<IDashboardUITab>('NewDashboardTabExtentionList', extensionTabViewContainer, delegate, [extensionTabRenderer]);
|
||||
|
||||
this._extensionList.onMouseDblClick(e => this.onAccept());
|
||||
this._extensionList.onKeyDown(e => {
|
||||
|
||||
@@ -12,7 +12,7 @@ import { IDashboardUITab } from 'sql/workbench/services/dashboard/browser/newDas
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
export class NewDashboardTabDialogService implements INewDashboardTabDialogService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
// MEMBER VARIABLES ////////////////////////////////////////////////////
|
||||
private _addNewTabDialog: NewDashboardTabDialog;
|
||||
|
||||
@@ -13,7 +13,7 @@ import { IErrorMessageService } from 'sql/platform/errorMessage/common/errorMess
|
||||
|
||||
export class ErrorMessageService implements IErrorMessageService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private _errorDialog: ErrorMessageDialog;
|
||||
|
||||
@@ -53,4 +53,4 @@ export class ErrorMessageService implements IErrorMessageService {
|
||||
}
|
||||
return defaultTitle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
||||
* File browser dialog service
|
||||
*/
|
||||
export class FileBrowserDialogController implements IFileBrowserDialogController {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
private _fileBrowserDialog: FileBrowserDialog;
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -76,10 +76,10 @@ export class FileBrowserTreeView extends Disposable implements IDisposable {
|
||||
return new Tree(treeContainer, {
|
||||
dataSource, renderer, controller, dnd, filter, sorter, accessibilityProvider
|
||||
}, {
|
||||
indentPixels: 10,
|
||||
twistiePixels: 12,
|
||||
ariaLabel: nls.localize({ key: 'fileBrowser.regTreeAriaLabel', comment: ['FileBrowserTree'] }, "File browser tree")
|
||||
});
|
||||
indentPixels: 10,
|
||||
twistiePixels: 12,
|
||||
ariaLabel: nls.localize({ key: 'fileBrowser.regTreeAriaLabel', comment: ['FileBrowserTree'] }, "File browser tree")
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,7 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'
|
||||
|
||||
export const IFileBrowserDialogController = createDecorator<IFileBrowserDialogController>('fileBrowserDialogService');
|
||||
export interface IFileBrowserDialogController {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
/**
|
||||
* Show file browser dialog
|
||||
*/
|
||||
|
||||
@@ -30,7 +30,7 @@ export interface ListResource {
|
||||
export const IInsightsDialogService = createDecorator<IInsightsDialogService>('insightsDialogService');
|
||||
|
||||
export interface IInsightsDialogService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
show(input: IInsightsConfig, connectionProfile: IConnectionProfile): void;
|
||||
close();
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import { IInsightsConfig } from 'sql/platform/dashboard/browser/insightRegistry'
|
||||
import { InsightsDialogController } from 'sql/workbench/services/insights/browser/insightsDialogController';
|
||||
|
||||
export class InsightsDialogService implements IInsightsDialogService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
private _insightsDialogController: InsightsDialogController;
|
||||
private _insightsDialogView: InsightsDialogView;
|
||||
private _insightsDialogModel: IInsightsDialogModel;
|
||||
|
||||
@@ -51,7 +51,7 @@ class TestEnvironmentService implements IWorkbenchEnvironmentService {
|
||||
} as IWindowConfiguration;
|
||||
}
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
args: ParsedArgs;
|
||||
execPath: string;
|
||||
cliPath: string;
|
||||
|
||||
@@ -33,7 +33,7 @@ export interface ILanguageMagic {
|
||||
}
|
||||
|
||||
export interface INotebookService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
readonly onNotebookEditorAdd: Event<INotebookEditor>;
|
||||
readonly onNotebookEditorRemove: Event<INotebookEditor>;
|
||||
|
||||
@@ -92,7 +92,7 @@ class ProviderDescriptor {
|
||||
}
|
||||
|
||||
export class NotebookService extends Disposable implements INotebookService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private _providersMemento: Memento;
|
||||
private _trustedNotebooksMemento: Memento;
|
||||
|
||||
@@ -30,7 +30,7 @@ export interface NodeExpandInfoWithProviderId extends azdata.ObjectExplorerExpan
|
||||
}
|
||||
|
||||
export interface IObjectExplorerService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
createNewSession(providerId: string, connection: ConnectionProfile): Thenable<azdata.ObjectExplorerSessionResponse>;
|
||||
|
||||
@@ -127,7 +127,7 @@ const errSessionCreateFailed = nls.localize('OeSessionFailedError', "Failed to c
|
||||
|
||||
export class ObjectExplorerService implements IObjectExplorerService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
private _providers: { [handle: string]: azdata.ObjectExplorerProvider; } = Object.create(null);
|
||||
|
||||
@@ -595,11 +595,11 @@ export class ObjectExplorerService implements IObjectExplorerService {
|
||||
|
||||
let node = new TreeNode(nodeInfo.nodeType, nodeInfo.label, isLeaf, nodeInfo.nodePath,
|
||||
nodeInfo.nodeSubType, nodeInfo.nodeStatus, parent, nodeInfo.metadata, nodeInfo.iconType, {
|
||||
getChildren: treeNode => this.getChildren(treeNode),
|
||||
isExpanded: treeNode => this.isExpanded(treeNode),
|
||||
setNodeExpandedState: async (treeNode, expandedState) => await this.setNodeExpandedState(treeNode, expandedState),
|
||||
setNodeSelected: (treeNode, selected, clearOtherSelections: boolean = undefined) => this.setNodeSelected(treeNode, selected, clearOtherSelections)
|
||||
});
|
||||
getChildren: treeNode => this.getChildren(treeNode),
|
||||
isExpanded: treeNode => this.isExpanded(treeNode),
|
||||
setNodeExpandedState: async (treeNode, expandedState) => await this.setNodeExpandedState(treeNode, expandedState),
|
||||
setNodeSelected: (treeNode, selected, clearOtherSelections: boolean = undefined) => this.setNodeSelected(treeNode, selected, clearOtherSelections)
|
||||
});
|
||||
node.childProvider = nodeInfo.childProvider;
|
||||
node.payload = nodeInfo.payload;
|
||||
return node;
|
||||
|
||||
@@ -46,7 +46,7 @@ export interface IProfilerSession {
|
||||
* A Profiler Service that handles session communication between the backends and frontends
|
||||
*/
|
||||
export interface IProfilerService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
/**
|
||||
* Registers a backend provider for profiler session. ex: mssql
|
||||
*/
|
||||
@@ -194,4 +194,4 @@ export enum ProfilerFilterClauseOperator {
|
||||
NotContains,
|
||||
StartsWith,
|
||||
NotStartsWith
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ class TwoWayMap<T, K> {
|
||||
|
||||
export class ProfilerService implements IProfilerService {
|
||||
private static readonly PROFILER_SERVICE_UI_STATE_STORAGE_KEY = 'profileservice.uiState';
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
private _providers = new Map<string, azdata.ProfilerProvider>();
|
||||
private _idMap = new TwoWayMap<ProfilerSessionID, string>();
|
||||
private _sessionMap = new Map<ProfilerSessionID, IProfilerSession>();
|
||||
|
||||
@@ -10,13 +10,13 @@ import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
export interface IEditorDescriptorService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
getEditor(input: EditorInput): IEditorDescriptor;
|
||||
}
|
||||
|
||||
export class EditorDescriptorService implements IEditorDescriptorService {
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
constructor() {
|
||||
}
|
||||
@@ -28,4 +28,4 @@ export class EditorDescriptorService implements IEditorDescriptorService {
|
||||
|
||||
export const SERVICE_ID = 'editorDescriptorService';
|
||||
|
||||
export const IEditorDescriptorService = createDecorator<IEditorDescriptorService>(SERVICE_ID);
|
||||
export const IEditorDescriptorService = createDecorator<IEditorDescriptorService>(SERVICE_ID);
|
||||
|
||||
@@ -36,7 +36,7 @@ import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileE
|
||||
*/
|
||||
export class QueryEditorService implements IQueryEditorService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
private static CHANGE_UNSUPPORTED_ERROR_MESSAGE = nls.localize(
|
||||
'queryEditorServiceChangeUnsupportedError',
|
||||
|
||||
@@ -23,7 +23,7 @@ export const IQueryEditorService = createDecorator<IQueryEditorService>('QueryEd
|
||||
|
||||
export interface IQueryEditorService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
// Creates new untitled document for SQL queries and opens it in a new editor tab
|
||||
newSqlEditor(sqlContent?: string, connectionProviderName?: string, isDirty?: boolean, objectName?: string): Promise<IConnectableInput>;
|
||||
|
||||
@@ -18,7 +18,7 @@ import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
export class ResourceProviderService implements IResourceProviderService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
private _providers: { [handle: string]: azdata.ResourceProvider; } = Object.create(null);
|
||||
private _firewallRuleDialogController: FirewallRuleDialogController;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ export interface IHandleFirewallRuleResult {
|
||||
}
|
||||
|
||||
export interface IResourceProviderService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
/**
|
||||
* Register a resource provider
|
||||
|
||||
@@ -8,7 +8,7 @@ import { IHandleFirewallRuleResult, IResourceProviderService } from 'sql/workben
|
||||
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
|
||||
|
||||
export class TestResourceProvider implements IResourceProviderService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
registerProvider(providerId: string, provider: azdata.ResourceProvider): void {
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import { ServerGroupViewModel } from 'sql/workbench/parts/objectExplorer/common/
|
||||
import { ConnectionProfileGroup, IConnectionProfileGroup } from 'sql/platform/connection/common/connectionProfileGroup';
|
||||
|
||||
export class ServerGroupController implements IServerGroupController {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private _serverGroupDialog: ServerGroupDialog;
|
||||
private _callbacks: IServerGroupDialogCallbacks;
|
||||
|
||||
@@ -11,7 +11,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions';
|
||||
import { AbstractShowReleaseNotesAction } from 'vs/workbench/contrib/update/electron-browser/update';
|
||||
import { AbstractShowReleaseNotesAction } from 'vs/workbench/contrib/update/browser/update';
|
||||
|
||||
export class OpenGettingStartedInBrowserAction extends Action {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user