mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-25 09:35:37 -05:00
Remove typings and replace missing methods with vscodes (#8217)
* remove typings and replace missing methods with vscodes * fix strict-null-checks * fix tests
This commit is contained in:
@@ -27,6 +27,7 @@ import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/la
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import { find, firstIndex } from 'vs/base/common/arrays';
|
||||
|
||||
export const MODAL_SHOWING_KEY = 'modalShowing';
|
||||
export const MODAL_SHOWING_CONTEXT = new RawContextKey<Array<string>>(MODAL_SHOWING_KEY, []);
|
||||
@@ -419,7 +420,7 @@ export abstract class Modal extends Disposable implements IThemable {
|
||||
* @param onSelect The callback to call when the button is selected
|
||||
*/
|
||||
protected findFooterButton(label: string): Button {
|
||||
return this._footerButtons.find(e => {
|
||||
return find(this._footerButtons, e => {
|
||||
try {
|
||||
return e && e.element.innerText === label;
|
||||
} catch {
|
||||
@@ -433,7 +434,7 @@ export abstract class Modal extends Disposable implements IThemable {
|
||||
* @param label Label on the button
|
||||
*/
|
||||
protected removeFooterButton(label: string): void {
|
||||
let buttonIndex = this._footerButtons.findIndex(e => {
|
||||
let buttonIndex = firstIndex(this._footerButtons, e => {
|
||||
return e && e.element && e.element.innerText === label;
|
||||
});
|
||||
if (buttonIndex > -1 && buttonIndex < this._footerButtons.length) {
|
||||
|
||||
@@ -12,6 +12,7 @@ import * as types from 'vs/base/common/types';
|
||||
import * as azdata from 'azdata';
|
||||
import { localize } from 'vs/nls';
|
||||
import { ServiceOptionType } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
import { startsWith } from 'vs/base/common/strings';
|
||||
|
||||
export interface IOptionElement {
|
||||
optionWidget: any;
|
||||
@@ -150,7 +151,7 @@ export function findElement(container: HTMLElement, className: string): HTMLElem
|
||||
let elementBuilder = container;
|
||||
while (elementBuilder) {
|
||||
let htmlElement = elementBuilder;
|
||||
if (htmlElement.className.startsWith(className)) {
|
||||
if (startsWith(htmlElement.className, className)) {
|
||||
break;
|
||||
}
|
||||
elementBuilder = elementBuilder.firstChild as HTMLElement;
|
||||
|
||||
Reference in New Issue
Block a user