mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-25 09:35:37 -05:00
Merge vscode source through release 1.79.2 (#23482)
* log when an editor action doesn't run because of enablement * notebooks create/dispose editors. this means controllers must be created eagerly (😢) and that notebooks need a custom way of plugging comparision keys for session. works unless creating another session for the same cell of a duplicated editor * Set offSide to sql lang configuration to true (#183461) * Fixes #181764 (#183550) * fix typo * Always scroll down and focus the input (#183557) * Fixes #180386 (#183561) * cli: ensure ordering of rpc server messages (#183558) * cli: ensure ordering of rpc server messages Sending lots of messages to a stream would block them around the async tokio mutex, which is "fair" so doesn't preserve ordering. Instead, use the write_loop approach I introduced to the server_multiplexer for the same reason some time ago. * fix clippy * update for May endgame * testing: allow invalidateTestResults to take an array (#183569) * Document `ShareProvider` API proposal (#183568) * Document `ShareProvider` API proposal * Remove mention of VS Code from JSDoc * Add support for rendering svg and md in welcome message (#183580) * Remove toggle setting more eagerly (#183584) * rm message abt macOS * Change text (#183589) * Change text * Accidentally changed the wrong file * cli: improve output for code tunnel status (#183571) * testing: allow invalidateTestResults to take an array * cli: improve output for code tunnel status Fixes #183570 * [json/css/html] update services (#183595) * Add experimental setting to enable this dialog * Fix exporting chat model to JSON before it is initialized (#183597) * minimum scrolling to reveal the next cell on shift+enter (#183600) do minimum scrolling to reveal the next cell on Execute cell and select next * Fixing Jupyter notebook issue 13263 (#183527) fix for the issue, still need to understand why there is strange focusing * Tweak proposed API JSDoc (#183590) * Tweak proposed API JSDoc * workbench -> workspace * fix ? operator * Use active editor and show progress when sharing (#183603) Use active editor and show progress * use scroll setting variable correctly * Schedule welcome widget to show once between typing. (#183606) * Schedule dialog to show once between typing * Don't re-render if already displayed once * Add F10 keybinding for debugger step, even on Web. (#183510) Fixes #181792. Previously, for Web the keyboard shortcut was Alt-F10, because it was believed that F10 could not be bound on browsers. This turned out to be incorrect, so we make the shortcut consistent (F10) with desktop VSCode which is also what many other debuggers use. We keep Alt-F10 on web as a secondary keybinding to keep the experience some web users may have gotten used to by now. * Also pass process.env * Restore missing chat clear commands (#183651) * chore: update electron@22.5.4 (#183716) * Show remote indicator in web when remoteAuthority is set (#183728) * feat: .vuerc as json file (#153017) Co-authored-by: Martin Aeschlimann <martinae@microsoft.com> * Delete --compatibility=1.63 code from the server (#183738) * Copy vscode.dev link to tunnel generates an invalid link when an untitled workspace is open (#183739) * Recent devcontainer display string corrupted on Get Started page (#183740) * Improve "next codeblock" navigation (#183744) * Improve "next codeblock" navigation Operate on the current focused response, or the last one, and scroll to the selected item * Normalize command title * Git - run git status if similarityThreshold changes (#183762) * fix aria-label issue in kb editor fixes A11y_GradeB_VSCode_Keyboard shortcut reads words together - Blind: Arrow key navigation to row Find the binding keys and "when" cell data are read together resulting in a word " CTRL + FeditorFocus instead of CTRL + F editorFocus" #182490 * Status - fix compact padding (#183768) * Remove angle brackets from VB brackets (#183782) Fixes #183359 * Update language config schema with more details about brackets. (#183779) * fix comment (#183812) * Support for `Notebook` CodeAction Kind (#183457) * nb kind support -- wip * allow notebook codeactions around single cell edit check * move notebook code action type out of editor --------- Co-authored-by: rebornix <penn.lv@gmail.com> * cli: fix connection default being applied (#183827) * cli: bump to openssl 1.1.1u (#183828) * Implement "delete" action for chat history (#183609) * Use desired file name when generating new md pasted file paths (#183861) Fixes #183851 * Default to filename for markdown new file if empty (#183864) Fixes #183848 * Fix small typo (#183865) Fixes #183819 * Noop when moving a symbol into the file it is already in (#183866) Fixes #183793 * Adjust codeAction validation to account for notebook kind (#183859) * Make JS/TS `go to configuration` commands work on non-`file:` file systems (#183688) Make `go to project` commands work on non-`file:` file systems Fixes #183685 * Can't do regex search after opening notebook (#183884) Fixes #183858 * Default to current dir for `move to file` select (#183875) Fixes #183870 `showOpenDialog` seems to ignore `defaultUri` if the file doesn't exist * Use `<...>` style markdown links when needed (#183876) Fixes #183849 * Remove check for context keys * Update xterm package * Enable updating a chat model without triggering incremental typing (#183894) * Enable chat "move" commands on empty sessions (#183895) * Enable chat "move" commands on empty sessions and also imported sessions * Fix command name * Fix some chat keybindings on windows (#183896) * "Revert File" on inactive editors are ignored (fix #177557) (#183903) * Empty reason while switching profile (fix #183775) (#183904) * fix https://github.com/microsoft/vscode-internalbacklog/issues/4278 (#183910) * fix https://github.com/microsoft/vscode/issues/183770 (#183914) * code --status displays a lot of errors before actual status output (fix #183787) (#183915) * joh/icy manatee (#183917) * Use idle value for widget of interactive editor controller https://github.com/microsoft/vscode/issues/183820 * also make preview editors idle values https://github.com/microsoft/vscode/issues/183820 * Fix #183777 (#183929) * Fix #182309 (#183925) * Tree checkbox item -> items (#183931) Fixes #183826 * Fixes #183909 (#183940) * Fix #183837 (#183943) fix #183837 * Git - fix #183941 (#183944) * Update xterm.css Fixes #181242 * chore: add @ulugbekna and @aiday-mar to my-endgame notebook (#183946) * Revert "When snippet mode is active, make `Tab` not accept suggestion but advance placeholder" This reverts commit 50a80cdb61511343996ff1d41d0b676c3d329f48. * revert not focusing completion list when quick suggest happens during snippet * change `snippetsPreventQuickSuggestions` default to false * Fix #181446 (#183956) * fix https://github.com/microsoft/vscode-internalbacklog/issues/4298 (#183957) * fix: remove extraneous incorrect context keys (#183959) These were actually getting added in getTestItemContextOverlay, and the test ID was using the extended ID which extensions do not know about. Fixes #183612 * Fixes https://github.com/microsoft/monaco-editor/issues/3920 (#183960) * fix https://github.com/microsoft/vscode-internalbacklog/issues/4324 (#183961) * fix #183030 * fix #180826 (#183962) * make message more generic for interactive editor help * . * fix #183968 * Keep codeblock toolbar visible when focused * Fix when clause on "Run in terminal" command * add important info to help menu * fix #183970 * Set `isRefactoring` for all TS refactoring edits (#183982) * consolidate * Disable move to file in TS versions < 5.2 (#183992) There are still a few key bugs with refactoring. We will ship this as a preview for TS 5.2+ instead of for 5.1 * Polish query accepting (#183995) We shouldn't send the same request to Copilot if the query hasn't changed. So if the query is the same, we short circut. Fixes https://github.com/microsoft/vscode-internalbacklog/issues/4286 Also, when we open in chat, we should use the last accepted query, not what's in the input box. Fixes https://github.com/microsoft/vscode-internalbacklog/issues/4280 * Allow widget to have focus (#184000) So that selecting non-code text works. Fixes https://github.com/microsoft/vscode-internalbacklog/issues/4294 * Fix microsoft/vscode-internalbacklog#4257. Mitigate zindex for zone widgets. (#184001) * Change welcome dialog contribution to Eventually * Misc fixes * Workspace folder picker entry descriptions are suboptimal for some filesystems (fix #183418) (#184018) * cli - ignore std error unless verbose (#183787) (#184031) * joh/inquisitive meerkat (#184034) * only stash sessions that are none empty https://github.com/microsoft/vscode-internalbacklog/issues/4281 * only unstash a session once - unless new exchanges are made, https://github.com/microsoft/vscode-internalbacklog/issues/4281 * account for all exchange types * Improve declared components (#184039) * make sure to read setting (#184040) d'oh, related to https://github.com/microsoft/vscode/issues/173387#issuecomment-1571696644 * [html] update service (#184049) [html] update service. FIxes #181176 * reset context keys on reset/hide (#184042) fixes https://github.com/microsoft/vscode-internalbacklog/issues/4330 * use `Lazy`, not `IdleValue` for the IE widget held by the eager controller (#184048) https://github.com/microsoft/vscode/issues/183820 * fix https://github.com/microsoft/vscode-internalbacklog/issues/4333 (#184067) * use undo-loop instead of undo-edit when discarding chat session (#184063) * use undo-loop instead of undo-edit when discarding chat session fixes https://github.com/microsoft/vscode-internalbacklog/issues/4118 * fix tests, wait for correct state * Add logging to node download (#184070) Add logging to node download. For #182951 * re-enable default zone widget revealing when showing (#184072) fixes https://github.com/microsoft/vscode-internalbacklog/issues/4332, also fixes https://github.com/microsoft/vscode-internalbacklog/issues/3784 * fix #178202 * Allow APIs in stable (#184062) * Fix microsoft/vscode-internalbacklog#4206. Override List view whitespace css for monaco editor (#184087) * Fix JSDoc grammatical error (#184090) * Pick up TS 5.1.3 (#184091) Fixes #182931 * Misc fixes * update distro (#184097) * chore: update electron@22.5.5 (#184116) * Extension host veto is registered multiple times on restart (fix #183778) (#184127) Extension host veto is registered multiple times on restart (#183778) * Do not auto start the local web worker extension host (#184137) * Allow embedders to intercept trustedTypes.createPolicy calls (#184136) Allow embedders to intercept trustedTypes.createPolicy calls (#184100) * fix: reading from console output for --status on windows and linux (#184138) fix: reading from console output for --status on windows and linux (#184118) * Misc fixes * code --status displays a lot of errors before actual status output (fix #183787) (#184200) fix 183787 * (cherry-pick to 1.79 from main) Handle galleryExtension failure in featuredExtensionService (#184205) Handle galleryExtension failure in featuredExtensionService (#184198) Handle galleryExtension failure * Fix #184183. Multiple output height updates are skipped. (#184188) * Post merge init fixes * Misc build issues * disable toggle inline diff of `alt` down https://github.com/microsoft/vscode-internalbacklog/issues/4342 * Take into account already activated extensions when computing running locations (#184303) Take into account already activated extensions when computing running locations (fixes #184180) * Avoid `extensionService.getExtension` and use `ActivationKind.Immediate` to allow that URI handling works while resolving (#184310) Avoid `extensionService.getExtension` and use `ActivationKind.Immediate` to allow that URI handling works while resolving (fixes #182217) * WIP * rm fish auto injection * More breaks * Fix Port Attributes constructor (#184412) * WIP * WIP * Allow extensions to get at the exports of other extensions during resolving (#184487) Allow extensions to get at the exports of other extensions during resolving (fixes #184472) * do not auto finish session when inline chat widgets have focus re https://github.com/microsoft/vscode-internalbacklog/issues/4354 * fix compile errors caused by new base method * WIP * WIP * WIP * WIP * Build errors * unc - fix path traversal bypass * Bump version * cherry-pick prod changes from main * Disable sandbox * Build break from merge * bump version * Merge pull request #184739 from max06/max06/issue184659 Restore ShellIntegration for fish (#184659) * Git - only add --find-renames if the value is not the default one (#185053) Git - only add --find-renames if the value is not the default one (#184992) * Cherry-pick: Revert changes to render featured extensions when available (#184747) Revert changes to render featured extensions when available. (#184573) * Lower timeouts for experimentation and gallery service * Revert changes to render extensions when available * Add audio cues * fix: disable app sandbox when --no-sandbox is present (#184913) * fix: disable app sandbox when --no-sandbox is present (#184897) * fix: loading minimist in packaged builds * Runtime errors * UNC allow list checks cannot be disabled in extension host (fix #184989) (#185085) * UNC allow list checks cannot be disabled in extension host (#184989) * Update src/vs/base/node/unc.js Co-authored-by: Robo <hop2deep@gmail.com> --------- Co-authored-by: Robo <hop2deep@gmail.com> * Add notebook extension * Fix mangling issues * Fix mangling issues * npm install * npm install * Issues blocking bundle * Fix build folder compile errors * Fix windows bundle build * Linting fixes * Fix sqllint issues * Update yarn.lock files * Fix unit tests * Fix a couple breaks from test fixes * Bump distro * redo the checkbox style * Update linux build container dockerfile * Bump build image tag * Bump native watch dog package * Bump node-pty * Bump distro * Fix documnetation error * Update distro * redo the button styles * Update datasource TS * Add missing yarn.lock files * Windows setup fix * Turn off extension unit tests while investigating * color box style * Remove appx * Turn off test log upload * update dropdownlist style * fix universal app build error (#23488) * Skip flaky bufferContext vscode test --------- Co-authored-by: Johannes <johannes.rieken@gmail.com> Co-authored-by: Henning Dieterichs <hdieterichs@microsoft.com> Co-authored-by: Julien Richard <jairbubbles@hotmail.com> Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> Co-authored-by: Megan Rogge <merogge@microsoft.com> Co-authored-by: meganrogge <megan.rogge@microsoft.com> Co-authored-by: Rob Lourens <roblourens@gmail.com> Co-authored-by: Connor Peet <connor@peet.io> Co-authored-by: Joyce Er <joyce.er@microsoft.com> Co-authored-by: Bhavya U <bhavyau@microsoft.com> Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com> Co-authored-by: Martin Aeschlimann <martinae@microsoft.com> Co-authored-by: Aaron Munger <aamunger@microsoft.com> Co-authored-by: Aiday Marlen Kyzy <amarlenkyzy@microsoft.com> Co-authored-by: rebornix <penn.lv@gmail.com> Co-authored-by: Ole <oler@google.com> Co-authored-by: Jean Pierre <jeanp413@hotmail.com> Co-authored-by: Robo <hop2deep@gmail.com> Co-authored-by: Yash Singh <saiansh2525@gmail.com> Co-authored-by: Ladislau Szomoru <3372902+lszomoru@users.noreply.github.com> Co-authored-by: Ulugbek Abdullaev <ulugbekna@gmail.com> Co-authored-by: Alex Ross <alros@microsoft.com> Co-authored-by: Michael Lively <milively@microsoft.com> Co-authored-by: Matt Bierner <matb@microsoft.com> Co-authored-by: Andrea Mah <31675041+andreamah@users.noreply.github.com> Co-authored-by: Benjamin Pasero <benjamin.pasero@microsoft.com> Co-authored-by: Sandeep Somavarapu <sasomava@microsoft.com> Co-authored-by: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Co-authored-by: Tyler James Leonhardt <me@tylerleonhardt.com> Co-authored-by: Alexandru Dima <alexdima@microsoft.com> Co-authored-by: Joao Moreno <Joao.Moreno@microsoft.com> Co-authored-by: Alan Ren <alanren@microsoft.com>
This commit is contained in:
@@ -9,7 +9,7 @@ import { List } from 'vs/base/browser/ui/list/listWidget';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { localize } from 'vs/nls';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { attachButtonStyler, attachListStyler } from 'vs/platform/theme/common/styler';
|
||||
import { attachListStyler } from 'sql/platform/theme/common/vsstyler';
|
||||
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
@@ -48,6 +48,7 @@ import { LoadingSpinner } from 'sql/base/browser/ui/loadingSpinner/loadingSpinne
|
||||
import { Tenant, TenantListDelegate, TenantListRenderer } from 'sql/workbench/services/accountManagement/browser/tenantListRenderer';
|
||||
import { IAccountManagementService } from 'sql/platform/accounts/common/interfaces';
|
||||
import { ADAL_AUTH_LIBRARY, AuthLibrary, getAuthLibrary } from 'sql/workbench/services/accountManagement/utils';
|
||||
import { defaultButtonStyles } from 'vs/platform/theme/browser/defaultStyles';
|
||||
|
||||
export const VIEWLET_ID = 'workbench.view.accountpanel';
|
||||
|
||||
@@ -224,7 +225,7 @@ export class AccountDialog extends Modal {
|
||||
|
||||
// Show the add account button for the first provider
|
||||
const buttonSection = DOM.append(this._noaccountViewContainer, DOM.$('div.button-section'));
|
||||
this._addAccountButton = new Button(buttonSection);
|
||||
this._addAccountButton = new Button(buttonSection, defaultButtonStyles);
|
||||
this._addAccountButton.label = localize('accountDialog.addConnection', "Add an account");
|
||||
|
||||
this._register(this._addAccountButton.onDidClick(async () => {
|
||||
@@ -236,8 +237,8 @@ export class AccountDialog extends Modal {
|
||||
|
||||
private registerListeners(): void {
|
||||
// Theme styler
|
||||
this._register(attachButtonStyler(this._closeButton!, this._themeService));
|
||||
this._register(attachButtonStyler(this._addAccountButton!, this._themeService));
|
||||
this._register(this._closeButton!);
|
||||
this._register(this._addAccountButton!);
|
||||
}
|
||||
|
||||
/* Overwrite escape key behavior */
|
||||
@@ -270,7 +271,6 @@ export class AccountDialog extends Modal {
|
||||
else {
|
||||
this.showNoAccountContainer();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private showNoAccountContainer() {
|
||||
|
||||
@@ -8,23 +8,23 @@ import * as DOM from 'vs/base/browser/dom';
|
||||
import { localize } from 'vs/nls';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { List } from 'vs/base/browser/ui/list/listWidget';
|
||||
import { IDropdownOptions } from 'vs/base/browser/ui/dropdown/dropdown';
|
||||
import { IListEvent } from 'vs/base/browser/ui/list/list';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { buttonBackground } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { attachListStyler } from 'vs/platform/theme/common/styler';
|
||||
import { attachListStyler } from 'sql/platform/theme/common/vsstyler';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { IThemeService, IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
import { DropdownList } from 'sql/base/browser/ui/dropdownList/dropdownList';
|
||||
import { attachDropdownStyler } from 'sql/platform/theme/common/styler';
|
||||
import { DropdownList, IDropdownOptions } from 'sql/base/browser/ui/dropdownList/dropdownList';
|
||||
import { AddAccountAction, RefreshAccountAction } from 'sql/platform/accounts/common/accountActions';
|
||||
import { AccountPickerListRenderer, AccountListDelegate } from 'sql/workbench/services/accountManagement/browser/accountListRenderer';
|
||||
import { AccountPickerViewModel } from 'sql/platform/accounts/common/accountPickerViewModel';
|
||||
import { Tenant, TenantListDelegate, TenantPickerListRenderer } from 'sql/workbench/services/accountManagement/browser/tenantListRenderer';
|
||||
import { defaultButtonStyles } from 'vs/platform/theme/browser/defaultStyles';
|
||||
import { defaultDropdownStyles } from 'sql/platform/theme/browser/defaultStyles';
|
||||
|
||||
export class AccountPicker extends Disposable {
|
||||
public static ACCOUNTPICKERLIST_HEIGHT = 47;
|
||||
@@ -136,12 +136,16 @@ export class AccountPicker extends Disposable {
|
||||
// Create dropdowns for account and tenant pickers
|
||||
const accountOptions: IDropdownOptions = {
|
||||
contextViewProvider: this._contextViewService,
|
||||
labelRenderer: (container) => this.renderAccountLabel(container)
|
||||
labelRenderer: (container) => this.renderAccountLabel(container),
|
||||
buttonStyles: defaultButtonStyles,
|
||||
dropdownStyles: defaultDropdownStyles
|
||||
};
|
||||
|
||||
const tenantOption: IDropdownOptions = {
|
||||
contextViewProvider: this._contextViewService,
|
||||
labelRenderer: (container) => this.renderTenantLabel(container)
|
||||
labelRenderer: (container) => this.renderTenantLabel(container),
|
||||
buttonStyles: defaultButtonStyles,
|
||||
dropdownStyles: defaultDropdownStyles
|
||||
};
|
||||
|
||||
// Create the add account action
|
||||
@@ -153,9 +157,6 @@ export class AccountPicker extends Disposable {
|
||||
this._dropdown = this._register(new DropdownList(this._accountContainer, accountOptions, this._accountListContainer, this._accountList, addAccountAction));
|
||||
this._tenantDropdown = this._register(new DropdownList(this._tenantContainer, tenantOption, this._tenantListContainer, this._tenantList));
|
||||
|
||||
this._register(attachDropdownStyler(this._dropdown, this._themeService));
|
||||
this._register(attachDropdownStyler(this._tenantDropdown, this._themeService));
|
||||
|
||||
this._register(this._accountList.onDidChangeSelection((e: IListEvent<azdata.Account>) => {
|
||||
if (e.elements.length === 1) {
|
||||
this._dropdown!.renderLabel();
|
||||
|
||||
@@ -6,12 +6,11 @@
|
||||
import 'vs/css!./media/autoOAuthDialog';
|
||||
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { attachButtonStyler, attachInputBoxStyler } from 'vs/platform/theme/common/styler';
|
||||
import { attachInputBoxStyler } from 'sql/platform/theme/common/vsstyler';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { localize } from 'vs/nls';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
import { $, append } from 'vs/base/browser/dom';
|
||||
|
||||
import { Button } from 'sql/base/browser/ui/button/button';
|
||||
@@ -24,6 +23,7 @@ import { ITextResourcePropertiesService } from 'vs/editor/common/services/textRe
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import { attachModalDialogStyler } from 'sql/workbench/common/styler';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
import { defaultInputBoxStyles } from 'vs/platform/theme/browser/defaultStyles';
|
||||
|
||||
export class AutoOAuthDialog extends Modal {
|
||||
private _copyAndOpenButton?: Button;
|
||||
@@ -75,7 +75,7 @@ export class AutoOAuthDialog extends Modal {
|
||||
super.render();
|
||||
attachModalDialogStyler(this, this._themeService);
|
||||
this.backButton!.onDidClick(() => this.cancel());
|
||||
this._register(attachButtonStyler(this.backButton!, this._themeService, { buttonBackground: SIDE_BAR_BACKGROUND, buttonHoverBackground: SIDE_BAR_BACKGROUND }));
|
||||
this._register(this.backButton);
|
||||
|
||||
this._copyAndOpenButton = this.addFooterButton(localize('copyAndOpen', "Copy & Open"), () => this.addAccount());
|
||||
this._closeButton = this.addFooterButton(localize('oauthDialog.cancel', "Cancel"), () => this.cancel(), 'right', true);
|
||||
@@ -103,14 +103,15 @@ export class AutoOAuthDialog extends Modal {
|
||||
const inputCellContainer = append(inputContainer, $('.dialog-input'));
|
||||
|
||||
return new InputBox(inputCellContainer, this._contextViewService, {
|
||||
ariaLabel: label
|
||||
ariaLabel: label,
|
||||
inputBoxStyles: defaultInputBoxStyles
|
||||
});
|
||||
}
|
||||
|
||||
private registerListeners(): void {
|
||||
// Theme styler
|
||||
this._register(attachButtonStyler(this._copyAndOpenButton!, this._themeService));
|
||||
this._register(attachButtonStyler(this._closeButton!, this._themeService));
|
||||
this._register(this._copyAndOpenButton!);
|
||||
this._register(this._closeButton!);
|
||||
this._register(attachInputBoxStyler(this._userCodeInputBox!, this._themeService));
|
||||
this._register(attachInputBoxStyler(this._websiteInputBox!, this._themeService));
|
||||
|
||||
|
||||
@@ -535,7 +535,7 @@ function getTestState(): AccountManagementState {
|
||||
// Create instantiation service
|
||||
let mockInstantiationService = TypeMoq.Mock.ofType(InstantiationService, TypeMoq.MockBehavior.Strict);
|
||||
mockInstantiationService.setup(x => x.createInstance(TypeMoq.It.isValue(AccountStore), TypeMoq.It.isAny()))
|
||||
.returns(() => mockAccountStore.object);
|
||||
.returns(() => <any>mockAccountStore.object);
|
||||
|
||||
const testNotificationService = new TestNotificationService();
|
||||
const testConfigurationService = new TestConfigurationService();
|
||||
|
||||
@@ -13,8 +13,7 @@ import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { localize } from 'vs/nls';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { attachButtonStyler, attachInputBoxStyler, attachSelectBoxStyler } from 'vs/platform/theme/common/styler';
|
||||
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
import { attachInputBoxStyler, attachSelectBoxStyler } from 'sql/platform/theme/common/vsstyler';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import * as strings from 'vs/base/common/strings';
|
||||
import { IClipboardService } from 'sql/platform/clipboard/common/clipboardService';
|
||||
@@ -33,6 +32,7 @@ import { Link } from 'vs/platform/opener/browser/link';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { Deferred } from 'sql/base/common/promise';
|
||||
import { defaultButtonStyles, defaultInputBoxStyles } from 'vs/platform/theme/browser/defaultStyles';
|
||||
|
||||
/**
|
||||
* This function adds one year to the current date and returns it in the UTC format.
|
||||
@@ -110,7 +110,10 @@ export class BackupRestoreUrlBrowserDialog extends Modal {
|
||||
this.close();
|
||||
}));
|
||||
|
||||
this._register(attachButtonStyler(this.backButton, this._themeService, { buttonBackground: SIDE_BAR_BACKGROUND, buttonHoverBackground: SIDE_BAR_BACKGROUND }));
|
||||
this._register(this.backButton);
|
||||
|
||||
// {{SQL CARBON TODO}} - style
|
||||
//this._register(attachButtonStyler(this.backButton, this._themeService, { buttonBackground: SIDE_BAR_BACKGROUND, buttonHoverBackground: SIDE_BAR_BACKGROUND }));
|
||||
}
|
||||
|
||||
let tableContainer: HTMLElement = DOM.append(DOM.append(this._body, DOM.$('.option-section')), DOM.$('table.url-table-content'));
|
||||
@@ -174,13 +177,16 @@ export class BackupRestoreUrlBrowserDialog extends Modal {
|
||||
|
||||
let sharedAccessSignatureLabel = localize('backupRestoreUrlBrowserDialog.sharedAccessSignature', "Shared access signature generated");
|
||||
let sasInput = DialogHelper.appendRow(tableContainer, sharedAccessSignatureLabel, 'url-input-label', 'url-input-box', null, true);
|
||||
this._sasInputBox = this._register(new InputBox(sasInput, this._contextViewService, { flexibleHeight: true }));
|
||||
this._sasInputBox = this._register(new InputBox(sasInput, this._contextViewService, {
|
||||
flexibleHeight: true,
|
||||
inputBoxStyles: defaultInputBoxStyles
|
||||
}));
|
||||
this._sasInputBox.disable();
|
||||
this._register(this._sasInputBox.onDidChange(() => this.enableOkButton()));
|
||||
|
||||
let sasButtonContainer = DialogHelper.appendRow(tableContainer, '', 'url-input-label', 'url-input-box');
|
||||
let sasButtonLabel = localize('backupRestoreUrlBrowserDialog.sharedAccessSignatureButton', "Create Credentials");
|
||||
this._sasButton = this._register(new Button(sasButtonContainer, { title: sasButtonLabel }));
|
||||
this._sasButton = this._register(new Button(sasButtonContainer, { title: sasButtonLabel, ...defaultButtonStyles }));
|
||||
this._sasButton.label = sasButtonLabel;
|
||||
this._sasButton.title = sasButtonLabel;
|
||||
this._register(this._sasButton.onDidClick(e => this.generateSharedAccessSignature()));
|
||||
@@ -195,7 +201,10 @@ export class BackupRestoreUrlBrowserDialog extends Modal {
|
||||
this._backupFileSelectorBox.disable();
|
||||
} else {
|
||||
let fileInput = DialogHelper.appendRow(tableContainer, backupFileLabel, 'url-input-label', 'url-input-box', null, true);
|
||||
this._backupFileInputBox = this._register(new InputBox(fileInput, this._contextViewService, { flexibleHeight: true }));
|
||||
this._backupFileInputBox = this._register(new InputBox(fileInput, this._contextViewService, {
|
||||
flexibleHeight: true,
|
||||
inputBoxStyles: defaultInputBoxStyles
|
||||
}));
|
||||
this._backupFileInputBox.value = this._defaultBackupName;
|
||||
}
|
||||
|
||||
@@ -444,8 +453,9 @@ export class BackupRestoreUrlBrowserDialog extends Modal {
|
||||
if (this._backupFileSelectorBox) {
|
||||
this._register(attachSelectBoxStyler(this._backupFileSelectorBox, this._themeService));
|
||||
}
|
||||
this._register(attachButtonStyler(this._sasButton, this._themeService));
|
||||
this._register(attachButtonStyler(this._okButton, this._themeService));
|
||||
this._register(attachButtonStyler(this._cancelButton, this._themeService));
|
||||
|
||||
this._register(this._sasButton);
|
||||
this._register(this._okButton);
|
||||
this._register(this._cancelButton);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ const selectorCounter = new Map<string, number>();
|
||||
export function providerIterator(service: IInstantiationService): Provider[] {
|
||||
return Array.from(_util.serviceIds.values()).map(v => {
|
||||
let factory = () => {
|
||||
return (<any>service)._getOrCreateServiceInstance(v, Trace.traceCreation(v));
|
||||
return (<any>service)._getOrCreateServiceInstance(v, Trace.traceCreation(false, v));
|
||||
};
|
||||
factory.prototype = factory;
|
||||
return {
|
||||
|
||||
@@ -27,6 +27,7 @@ import { ConnectionWidget } from 'sql/workbench/services/connection/browser/conn
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IErrorMessageService } from 'sql/platform/errorMessage/common/errorMessageService';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { defaultInputBoxStyles } from 'vs/platform/theme/browser/defaultStyles';
|
||||
|
||||
/**
|
||||
* Connection Widget clas for CMS Connections
|
||||
@@ -119,7 +120,11 @@ export class CmsConnectionWidget extends ConnectionWidget {
|
||||
if (serverDescriptionOption) {
|
||||
serverDescriptionOption.displayName = localize('serverDescription', "Server Description (optional)");
|
||||
let serverDescriptionBuilder = DialogHelper.appendRow(this._tableContainer, serverDescriptionOption.displayName, 'connection-label', 'connection-input', 'server-description-input');
|
||||
this._serverDescriptionInputBox = new InputBox(serverDescriptionBuilder, this._contextViewService, { type: 'textarea', flexibleHeight: true });
|
||||
this._serverDescriptionInputBox = new InputBox(serverDescriptionBuilder, this._contextViewService, {
|
||||
type: 'textarea',
|
||||
flexibleHeight: true,
|
||||
inputBoxStyles: defaultInputBoxStyles
|
||||
});
|
||||
this._serverDescriptionInputBox.setHeight('75px');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,11 +17,15 @@ import { EditDataInput } from 'sql/workbench/browser/editData/editDataInput';
|
||||
import { DashboardInput } from 'sql/workbench/browser/editor/profiler/dashboardInput';
|
||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
|
||||
import { Action2 } from 'vs/platform/actions/common/actions';
|
||||
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { FileAccess } from 'vs/base/common/network';
|
||||
|
||||
/**
|
||||
* Workbench action to clear the recent connnections list
|
||||
*/
|
||||
export class ClearRecentConnectionsAction extends Action {
|
||||
// {{SQL CARBON TODO}} - remove old action that is used by ActionBar class
|
||||
export class ClearRecentConnectionsAction1 extends Action {
|
||||
|
||||
public static ID = 'clearRecentConnectionsAction';
|
||||
public static LABEL = nls.localize('ClearRecentlyUsedLabel', "Clear List");
|
||||
@@ -40,7 +44,7 @@ export class ClearRecentConnectionsAction extends Action {
|
||||
@IQuickInputService private _quickInputService: IQuickInputService,
|
||||
@IDialogService private _dialogService: IDialogService,
|
||||
) {
|
||||
super(id, label, ClearRecentConnectionsAction.ICON);
|
||||
super(id, label, ClearRecentConnectionsAction1.ICON);
|
||||
this.enabled = true;
|
||||
}
|
||||
|
||||
@@ -92,7 +96,7 @@ export class ClearRecentConnectionsAction extends Action {
|
||||
let confirm: IConfirmation = {
|
||||
message: nls.localize('clearRecentConnectionMessage', "Are you sure you want to delete all the connections from the list?"),
|
||||
primaryButton: nls.localize('connectionDialog.yes', "Yes"),
|
||||
secondaryButton: nls.localize('connectionDialog.no', "No"),
|
||||
cancelButton: nls.localize('connectionDialog.no', "No"),
|
||||
type: 'question'
|
||||
};
|
||||
|
||||
@@ -104,6 +108,98 @@ export class ClearRecentConnectionsAction extends Action {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Workbench action to clear the recent connnections list
|
||||
*/
|
||||
export class ClearRecentConnectionsAction extends Action2 {
|
||||
|
||||
public static ID = 'clearRecentConnectionsAction';
|
||||
public static LABEL_ORG = 'Clear List';
|
||||
public static LABEL = nls.localize('ClearRecentlyUsedLabel', "Clear List");
|
||||
public static ICON = 'search-action clear-search-results';
|
||||
|
||||
private _onRecentConnectionsRemoved = new Emitter<void>();
|
||||
public onRecentConnectionsRemoved: Event<void> = this._onRecentConnectionsRemoved.event;
|
||||
|
||||
private _useConfirmationMessage = false;
|
||||
|
||||
constructor() {
|
||||
super({
|
||||
id: ClearRecentConnectionsAction.ID,
|
||||
// {{SQL CARBON TODO}} - does this work for icons?
|
||||
icon: {
|
||||
light: FileAccess.asBrowserUri(`sql/workbench/services/connection/browser/media/clear-search-results.svg`),
|
||||
dark: FileAccess.asBrowserUri(`sql/workbench/services/connection/browser/media/clear-search-results-dark.svg`)
|
||||
},
|
||||
title: { value: ClearRecentConnectionsAction.LABEL, original: ClearRecentConnectionsAction.LABEL_ORG },
|
||||
f1: true
|
||||
});
|
||||
}
|
||||
|
||||
public set useConfirmationMessage(value: boolean) {
|
||||
this._useConfirmationMessage = value;
|
||||
}
|
||||
|
||||
public override run(accessor: ServicesAccessor): Promise<void> {
|
||||
const connectionManagementService = accessor.get(IConnectionManagementService);
|
||||
const notificationService = accessor.get(INotificationService);
|
||||
const quickInputService = accessor.get(IQuickInputService);
|
||||
const dialogService = accessor.get(IDialogService);
|
||||
|
||||
if (this._useConfirmationMessage) {
|
||||
return this.promptConfirmationMessage(dialogService).then(result => {
|
||||
if (result.confirmed) {
|
||||
connectionManagementService.clearRecentConnectionsList();
|
||||
this._onRecentConnectionsRemoved.fire();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return this.promptQuickOpenService(quickInputService).then(result => {
|
||||
if (result) {
|
||||
connectionManagementService.clearRecentConnectionsList();
|
||||
|
||||
const actions: INotificationActions = { primary: [] };
|
||||
notificationService.notify({
|
||||
severity: Severity.Info,
|
||||
message: nls.localize('ClearedRecentConnections', "Recent connections list cleared"),
|
||||
actions
|
||||
});
|
||||
this._onRecentConnectionsRemoved.fire();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private promptQuickOpenService(quickInputService: IQuickInputService): Promise<boolean> {
|
||||
return new Promise<boolean>((resolve, reject) => {
|
||||
let choices: { key, value }[] = [
|
||||
{ key: nls.localize('connectionAction.yes', "Yes"), value: true },
|
||||
{ key: nls.localize('connectionAction.no', "No"), value: false }
|
||||
];
|
||||
|
||||
quickInputService.pick(choices.map(x => x.key), { placeHolder: nls.localize('ClearRecentlyUsedLabel', "Clear List"), ignoreFocusLost: true }).then((choice) => {
|
||||
let confirm = choices.find(x => x.key === choice);
|
||||
resolve(confirm && confirm.value);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private promptConfirmationMessage(dialogService: IDialogService): Promise<IConfirmationResult> {
|
||||
let confirm: IConfirmation = {
|
||||
message: nls.localize('clearRecentConnectionMessage', "Are you sure you want to delete all the connections from the list?"),
|
||||
primaryButton: nls.localize('connectionDialog.yes', "Yes"),
|
||||
cancelButton: nls.localize('connectionDialog.no', "No"),
|
||||
type: 'question'
|
||||
};
|
||||
|
||||
return new Promise<IConfirmationResult>((resolve, reject) => {
|
||||
dialogService.confirm(confirm).then((confirmed) => {
|
||||
resolve(confirmed);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Action to delete one recently used connection from the MRU
|
||||
*/
|
||||
@@ -135,43 +231,46 @@ export class ClearSingleRecentConnectionAction extends Action {
|
||||
/**
|
||||
* Action to retrieve the current connection string
|
||||
*/
|
||||
export class GetCurrentConnectionStringAction extends Action {
|
||||
export class GetCurrentConnectionStringAction extends Action2 {
|
||||
|
||||
public static ID = 'getCurrentConnectionStringAction';
|
||||
public static LABEL_ORG = 'Get Current Connection String';
|
||||
public static LABEL = nls.localize('connectionAction.GetCurrentConnectionString', "Get Current Connection String");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@IConnectionManagementService private _connectionManagementService: IConnectionManagementService,
|
||||
@IEditorService private _editorService: IEditorService,
|
||||
@INotificationService private readonly _notificationService: INotificationService,
|
||||
@IClipboardService private _clipboardService: IClipboardService,
|
||||
) {
|
||||
super(GetCurrentConnectionStringAction.ID, GetCurrentConnectionStringAction.LABEL);
|
||||
this.enabled = true;
|
||||
constructor() {
|
||||
//super(GetCurrentConnectionStringAction.ID, GetCurrentConnectionStringAction.LABEL);
|
||||
super({
|
||||
id: ClearRecentConnectionsAction.ID,
|
||||
title: { value: ClearRecentConnectionsAction.LABEL, original: ClearRecentConnectionsAction.LABEL_ORG },
|
||||
f1: true
|
||||
});
|
||||
}
|
||||
|
||||
public override run(): Promise<void> {
|
||||
public override run(accessor: ServicesAccessor): Promise<void> {
|
||||
const connectionManagementService = accessor.get(IConnectionManagementService);
|
||||
const editorService = accessor.get(IEditorService);
|
||||
const notificationService = accessor.get(INotificationService);
|
||||
const clipboardService = accessor.get(IClipboardService);
|
||||
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
let activeInput = this._editorService.activeEditor;
|
||||
let activeInput = editorService.activeEditor;
|
||||
if (activeInput && (activeInput instanceof QueryEditorInput || activeInput instanceof EditDataInput || activeInput instanceof DashboardInput)
|
||||
&& this._connectionManagementService.isConnected(activeInput.uri)) {
|
||||
&& connectionManagementService.isConnected(activeInput.uri)) {
|
||||
let includePassword = false;
|
||||
let connectionProfile = this._connectionManagementService.getConnectionProfile(activeInput.uri);
|
||||
this._connectionManagementService.getConnectionString(connectionProfile.id, includePassword).then(result => {
|
||||
let connectionProfile = connectionManagementService.getConnectionProfile(activeInput.uri);
|
||||
connectionManagementService.getConnectionString(connectionProfile.id, includePassword).then(result => {
|
||||
|
||||
//Copy to clipboard
|
||||
this._clipboardService.writeText(result);
|
||||
clipboardService.writeText(result);
|
||||
|
||||
let message = result
|
||||
? result
|
||||
: nls.localize('connectionAction.connectionString', "Connection string not available");
|
||||
this._notificationService.info(message);
|
||||
notificationService.info(message);
|
||||
});
|
||||
} else {
|
||||
let message = nls.localize('connectionAction.noConnection', "No active connection available");
|
||||
this._notificationService.info(message);
|
||||
notificationService.info(message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -48,11 +48,12 @@ import { FileKind } from 'vs/platform/files/common/files';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ILabelService } from 'vs/platform/label/common/label';
|
||||
import { WorkbenchAsyncDataTree } from 'vs/platform/list/browser/listService';
|
||||
import { attachProgressBarStyler } from 'vs/platform/theme/common/styler';
|
||||
import { ColorScheme } from 'vs/platform/theme/common/theme';
|
||||
import { FileThemeIcon, FolderThemeIcon, IThemeService, ThemeIcon } from 'vs/platform/theme/common/themeService';
|
||||
import { FileThemeIcon, FolderThemeIcon, IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { IResourceLabel, ResourceLabels } from 'vs/workbench/browser/labels';
|
||||
import { ITreeItemLabel, ITreeViewDataProvider, TreeItemCollapsibleState, TreeViewItemHandleArg } from 'vs/workbench/common/views';
|
||||
import { defaultInputBoxStyles } from 'vs/platform/theme/browser/defaultStyles';
|
||||
import { ThemeIcon } from 'vs/base/common/themables';
|
||||
|
||||
|
||||
|
||||
@@ -109,11 +110,12 @@ export class ConnectionBrowserView extends Disposable implements IPanelView {
|
||||
renderFilterBox(container: HTMLElement): void {
|
||||
this.filterInput = new InputBox(container, this.contextViewService, {
|
||||
placeholder: localize('connectionDialog.FilterPlaceHolder', "Type here to filter the list"),
|
||||
ariaLabel: localize('connectionDialog.FilterInputTitle', "Filter connections")
|
||||
ariaLabel: localize('connectionDialog.FilterInputTitle', "Filter connections"),
|
||||
inputBoxStyles: defaultInputBoxStyles
|
||||
});
|
||||
this.filterProgressBar = new ProgressBar(this.filterInput.element);
|
||||
this._register(this.filterProgressBar);
|
||||
this._register(attachProgressBarStyler(this.filterProgressBar, this.themeService));
|
||||
//this._register(attachProgressBarStyler(this.filterProgressBar, this.themeService));
|
||||
this.filterInput.element.style.margin = '5px';
|
||||
this._register(this.filterInput);
|
||||
this._register(attachInputBoxStyler(this.filterInput, this.themeService));
|
||||
@@ -385,11 +387,11 @@ class ProviderElementRenderer extends BaseTreeItemRender<ConnectionDialogTreePro
|
||||
super(menus, actionViewItemProvider);
|
||||
}
|
||||
|
||||
getText(element: ConnectionDialogTreeProviderElement): string {
|
||||
protected getText(element: ConnectionDialogTreeProviderElement): string {
|
||||
return element.name;
|
||||
}
|
||||
|
||||
getIconClass(element: ConnectionDialogTreeProviderElement): string {
|
||||
protected getIconClass(element: ConnectionDialogTreeProviderElement): string {
|
||||
return 'codicon-folder';
|
||||
}
|
||||
}
|
||||
@@ -398,11 +400,11 @@ class SavedConnectionsNodeRenderer extends BaseTreeItemRender<SavedConnectionNod
|
||||
public static readonly TEMPLATE_ID = 'savedConnectionNode';
|
||||
public readonly templateId = SavedConnectionsNodeRenderer.TEMPLATE_ID;
|
||||
|
||||
getText(element: SavedConnectionNode): string {
|
||||
protected getText(element: SavedConnectionNode): string {
|
||||
return localize('savedConnections', "Saved Connections");
|
||||
}
|
||||
|
||||
getIconClass(element: SavedConnectionNode): string {
|
||||
protected getIconClass(element: SavedConnectionNode): string {
|
||||
return 'codicon-folder';
|
||||
}
|
||||
}
|
||||
@@ -411,11 +413,11 @@ class ConnectionProfileGroupRenderer extends BaseTreeItemRender<ConnectionProfil
|
||||
public static readonly TEMPLATE_ID = 'connectionProfileGroup';
|
||||
public readonly templateId = ConnectionProfileGroupRenderer.TEMPLATE_ID;
|
||||
|
||||
getText(element: ConnectionProfileGroup): string {
|
||||
protected getText(element: ConnectionProfileGroup): string {
|
||||
return element.name;
|
||||
}
|
||||
|
||||
getIconClass(element: ConnectionProfileGroup): string {
|
||||
protected getIconClass(element: ConnectionProfileGroup): string {
|
||||
return 'codicon-folder';
|
||||
}
|
||||
}
|
||||
@@ -613,7 +615,6 @@ class ConnectionBrowseTreeMenuProvider {
|
||||
createAndFillInContextMenuActions(menu, { shouldForwardArgs: true }, result);
|
||||
|
||||
menu.dispose();
|
||||
contextKeyService.dispose();
|
||||
|
||||
return result.primary;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { localize } from 'vs/nls';
|
||||
import { IContextMenuService, IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import * as styler from 'vs/platform/theme/common/styler';
|
||||
import * as styler from 'sql/platform/theme/common/vsstyler';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
@@ -37,7 +37,7 @@ import { TreeUpdateUtils } from 'sql/workbench/services/objectExplorer/browser/t
|
||||
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
|
||||
import { ICancelableEvent } from 'sql/base/parts/tree/browser/treeDefaults';
|
||||
import { RecentConnectionActionsProvider, RecentConnectionTreeController } from 'sql/workbench/services/connection/browser/recentConnectionTreeController';
|
||||
import { ClearRecentConnectionsAction } from 'sql/workbench/services/connection/browser/connectionActions';
|
||||
import { ClearRecentConnectionsAction1 } from 'sql/workbench/services/connection/browser/connectionActions';
|
||||
import { ITree } from 'sql/base/parts/tree/browser/tree';
|
||||
import { AsyncServerTree } from 'sql/workbench/services/objectExplorer/browser/asyncServerTree';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
@@ -66,7 +66,6 @@ export class ConnectionDialogWidget extends Modal {
|
||||
private _connectionTypeContainer: HTMLElement;
|
||||
private _connectionDetailTitle: HTMLElement;
|
||||
private _connectButton: Button;
|
||||
private _closeButton: Button;
|
||||
private _providerTypeSelectBox: SelectBox;
|
||||
private _newConnectionParams: INewConnectionParams;
|
||||
private _recentConnectionTree: AsyncServerTree | ITree;
|
||||
@@ -185,10 +184,10 @@ export class ConnectionDialogWidget extends Modal {
|
||||
|
||||
// Remove duplicate listings (CMS uses the same display name)
|
||||
let uniqueProvidersMap = this.connectionManagementService.getUniqueConnectionProvidersByNameMap(filteredProviderMap);
|
||||
this._providerTypeSelectBox.setOptions(Object.keys(uniqueProvidersMap).map(k => uniqueProvidersMap[k]));
|
||||
this._providerTypeSelectBox?.setOptions(Object.keys(uniqueProvidersMap).map(k => uniqueProvidersMap[k]));
|
||||
}
|
||||
|
||||
protected renderBody(container: HTMLElement): void {
|
||||
protected override renderBody(container: HTMLElement): void {
|
||||
this._body = DOM.append(container, DOM.$('.connection-dialog'));
|
||||
|
||||
const connectTypeLabel = localize('connectType', "Connection type");
|
||||
@@ -261,7 +260,7 @@ export class ConnectionDialogWidget extends Modal {
|
||||
const cancelLabel = localize('connectionDialog.cancel', "Cancel");
|
||||
this._connectButton = this.addFooterButton(connectLabel, () => this.connect());
|
||||
this._connectButton.enabled = false;
|
||||
this._closeButton = this.addFooterButton(cancelLabel, () => this.cancel(), 'right', true);
|
||||
this.addFooterButton(cancelLabel, () => this.cancel(), 'right', true);
|
||||
this.registerListeners();
|
||||
this.onProviderTypeSelected(this._providerTypeSelectBox.value);
|
||||
}
|
||||
@@ -282,9 +281,6 @@ export class ConnectionDialogWidget extends Modal {
|
||||
private registerListeners(): void {
|
||||
// Theme styler
|
||||
this._register(styler.attachSelectBoxStyler(this._providerTypeSelectBox, this._themeService));
|
||||
this._register(styler.attachButtonStyler(this._connectButton, this._themeService));
|
||||
this._register(styler.attachButtonStyler(this._closeButton, this._themeService));
|
||||
|
||||
this._register(this._providerTypeSelectBox.onDidSelect(selectedProviderType => {
|
||||
this.onProviderTypeSelected(selectedProviderType.selected);
|
||||
}));
|
||||
@@ -342,7 +338,7 @@ export class ConnectionDialogWidget extends Modal {
|
||||
this._recentConnectionActionBarContainer = DOM.append(recentConnectionContainer, DOM.$('.recent-titles-container'));
|
||||
const actionsContainer = DOM.append(this._recentConnectionActionBarContainer, DOM.$('.connection-history-actions'));
|
||||
this._actionbar = this._register(new ActionBar(actionsContainer, { animated: false }));
|
||||
const clearAction = this.instantiationService.createInstance(ClearRecentConnectionsAction, ClearRecentConnectionsAction.ID, ClearRecentConnectionsAction.LABEL);
|
||||
const clearAction = this.instantiationService.createInstance(ClearRecentConnectionsAction1, ClearRecentConnectionsAction1.ID, ClearRecentConnectionsAction1.LABEL);
|
||||
clearAction.useConfirmationMessage = true;
|
||||
clearAction.onRecentConnectionsRemoved(() => this.open(false));
|
||||
this._actionbar.push(clearAction, { icon: true, label: true });
|
||||
@@ -496,9 +492,10 @@ export class ConnectionDialogWidget extends Modal {
|
||||
}
|
||||
|
||||
public updateProvider(providerDisplayName: string) {
|
||||
this._providerTypeSelectBox.selectWithOptionName(providerDisplayName);
|
||||
|
||||
this.onProviderTypeSelected(providerDisplayName);
|
||||
if (this._providerTypeSelectBox) {
|
||||
this._providerTypeSelectBox.selectWithOptionName(providerDisplayName);
|
||||
this.onProviderTypeSelected(providerDisplayName);
|
||||
}
|
||||
}
|
||||
|
||||
public set databaseDropdownExpanded(val: boolean) {
|
||||
|
||||
@@ -29,7 +29,6 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { OS, OperatingSystem } from 'vs/base/common/platform';
|
||||
import { IMessage, MessageType } from 'vs/base/browser/ui/inputbox/inputBox';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { attachButtonStyler } from 'vs/platform/theme/common/styler';
|
||||
import { Dropdown } from 'sql/base/browser/ui/editableDropdown/browser/dropdown';
|
||||
import { RadioButton } from 'sql/base/browser/ui/radioButton/radioButton';
|
||||
import { IErrorMessageService } from 'sql/platform/errorMessage/common/errorMessageService';
|
||||
@@ -46,6 +45,8 @@ import { adjustForMssqlAppName } from 'sql/platform/connection/common/utils';
|
||||
import { isMssqlAuthProviderEnabled } from 'sql/workbench/services/connection/browser/utils';
|
||||
import { RequiredIndicatorClassName } from 'sql/base/browser/ui/label/label';
|
||||
import { FieldSet } from 'sql/base/browser/ui/fieldset/fieldset';
|
||||
import { defaultButtonStyles, defaultInputBoxStyles } from 'vs/platform/theme/browser/defaultStyles';
|
||||
import { defaultCheckboxStyles } from 'sql/platform/theme/browser/defaultStyles';
|
||||
|
||||
const ConnectionStringText = localize('connectionWidget.connectionString', "Connection string");
|
||||
|
||||
@@ -241,7 +242,8 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
||||
},
|
||||
ariaLabel: ConnectionStringText,
|
||||
flexibleHeight: true,
|
||||
flexibleMaxHeight: 100
|
||||
flexibleMaxHeight: 100,
|
||||
inputBoxStyles: defaultInputBoxStyles
|
||||
});
|
||||
this._register(this._connectionStringInputBox);
|
||||
this._register(this._connectionStringInputBox.onDidChange(() => {
|
||||
@@ -304,7 +306,8 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
||||
default:
|
||||
this._customOptionWidgets[i] = new InputBox(customOptionsContainer, this._contextViewService, {
|
||||
ariaLabel: option.displayName,
|
||||
placeholder: option.placeholder
|
||||
placeholder: option.placeholder,
|
||||
inputBoxStyles: defaultInputBoxStyles
|
||||
});
|
||||
this._register(styler.attachInputBoxStyler(this._customOptionWidgets[i] as InputBox, this._themeService));
|
||||
break;
|
||||
@@ -401,7 +404,8 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
||||
}
|
||||
},
|
||||
ariaLabel: serverNameOption.displayName,
|
||||
placeholder: serverNameOption.placeholder
|
||||
placeholder: serverNameOption.placeholder,
|
||||
inputBoxStyles: defaultInputBoxStyles
|
||||
});
|
||||
this._register(this._serverNameInputBox);
|
||||
}
|
||||
@@ -416,7 +420,8 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
||||
validation: (value: string) => self.validateUsername(value, userNameOption.isRequired) ? ({ type: MessageType.ERROR, content: localize('connectionWidget.missingRequireField', "{0} is required.", userNameOption.displayName) }) : null
|
||||
},
|
||||
ariaLabel: userNameOption.displayName,
|
||||
placeholder: userNameOption.placeholder
|
||||
placeholder: userNameOption.placeholder,
|
||||
inputBoxStyles: defaultInputBoxStyles
|
||||
});
|
||||
this._register(this._userNameInputBox);
|
||||
// Password
|
||||
@@ -424,7 +429,8 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
||||
let password = DialogHelper.appendRow(this._tableContainer, passwordOption.displayName, 'connection-label', 'connection-input', 'password-row');
|
||||
this._passwordInputBox = new InputBox(password, this._contextViewService, {
|
||||
ariaLabel: passwordOption.displayName,
|
||||
placeholder: passwordOption.placeholder
|
||||
placeholder: passwordOption.placeholder,
|
||||
inputBoxStyles: defaultInputBoxStyles
|
||||
});
|
||||
this._passwordInputBox.inputElement.type = 'password';
|
||||
this._register(this._passwordInputBox);
|
||||
@@ -483,7 +489,8 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
||||
let connectionNameBuilder = DialogHelper.appendRow(this._tableContainer, connectionNameOption.displayName, 'connection-label', 'connection-input');
|
||||
this._connectionNameInputBox = new InputBox(connectionNameBuilder, this._contextViewService, {
|
||||
ariaLabel: connectionNameOption.displayName,
|
||||
placeholder: connectionNameOption.placeholder
|
||||
placeholder: connectionNameOption.placeholder,
|
||||
inputBoxStyles: defaultInputBoxStyles
|
||||
});
|
||||
this._register(this._connectionNameInputBox);
|
||||
}
|
||||
@@ -494,7 +501,7 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
||||
const buttonContainer = DOM.append(rowContainer, DOM.$('td'));
|
||||
buttonContainer.setAttribute('align', 'right');
|
||||
const divContainer = DOM.append(buttonContainer, DOM.$('div.advanced-button'));
|
||||
this._advancedButton = new Button(divContainer, { secondary: true });
|
||||
this._advancedButton = new Button(divContainer, { secondary: true, ...defaultButtonStyles });
|
||||
this._register(this._advancedButton);
|
||||
this._advancedButton.label = localize('advanced', "Advanced...");
|
||||
this._register(this._advancedButton.onDidClick(() => {
|
||||
@@ -529,7 +536,7 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
||||
let rowContainer = DOM.append(container, DOM.$(`tr.${rowContainerClass}`));
|
||||
DOM.append(rowContainer, DOM.$('td'));
|
||||
let checkboxContainer = DOM.append(rowContainer, DOM.$(`td.${cellContainerClass}`));
|
||||
return new Checkbox(checkboxContainer, { label, checked: isChecked, ariaLabel: label });
|
||||
return new Checkbox(checkboxContainer, { ...defaultCheckboxStyles, label, checked: isChecked, ariaLabel: label });
|
||||
}
|
||||
|
||||
protected registerListeners(): void {
|
||||
@@ -538,8 +545,6 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
||||
this._register(styler.attachInputBoxStyler(this._connectionNameInputBox, this._themeService));
|
||||
this._register(styler.attachInputBoxStyler(this._userNameInputBox, this._themeService));
|
||||
this._register(styler.attachInputBoxStyler(this._passwordInputBox, this._themeService));
|
||||
this._register(attachButtonStyler(this._advancedButton, this._themeService));
|
||||
this._register(styler.attachCheckboxStyler(this._rememberPasswordCheckBox, this._themeService));
|
||||
this._register(styler.attachSelectBoxStyler(this._azureAccountDropdown, this._themeService));
|
||||
if (this._serverGroupSelectBox) {
|
||||
this._register(styler.attachSelectBoxStyler(this._serverGroupSelectBox, this._themeService));
|
||||
|
||||
@@ -13,7 +13,6 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { localize } from 'vs/nls';
|
||||
import { InputBox } from 'sql/base/browser/ui/inputBox/inputBox';
|
||||
import { attachButtonStyler } from 'vs/platform/theme/common/styler';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
@@ -24,6 +23,7 @@ import { IErrorMessageService } from 'sql/platform/errorMessage/common/errorMess
|
||||
import { attachModalDialogStyler } from 'sql/workbench/common/styler';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfiguration';
|
||||
import { defaultInputBoxStyles } from 'vs/platform/theme/browser/defaultStyles';
|
||||
|
||||
const dialogWidth: string = '500px'; // Width is set manually here as there is no default width for normal dialogs.
|
||||
const okText: string = localize('passwordChangeDialog.ok', "OK");
|
||||
@@ -86,8 +86,6 @@ export class PasswordChangeDialog extends Modal {
|
||||
this._register(attachModalDialogStyler(this, this._themeService));
|
||||
this._okButton = this.addFooterButton(okText, async () => { await this.handleOkButtonClick(); });
|
||||
this._cancelButton = this.addFooterButton(cancelText, () => { this.handleCancelButtonClick(); }, 'right', true);
|
||||
this._register(attachButtonStyler(this._okButton, this._themeService));
|
||||
this._register(attachButtonStyler(this._cancelButton, this._themeService));
|
||||
}
|
||||
|
||||
protected renderBody(container: HTMLElement) {
|
||||
@@ -100,12 +98,18 @@ export class PasswordChangeDialog extends Modal {
|
||||
const contentElement = body.appendChild(DOM.$('.properties-content.components-grid'));
|
||||
contentElement.appendChild(DOM.$('')).appendChild(DOM.$('span.component-label')).innerText = newPasswordText;
|
||||
const passwordInputContainer = contentElement.appendChild(DOM.$(''));
|
||||
this._passwordValueText = new InputBox(passwordInputContainer, this.contextViewService, { type: 'password' });
|
||||
this._passwordValueText = new InputBox(passwordInputContainer, this.contextViewService, {
|
||||
type: 'password',
|
||||
inputBoxStyles: defaultInputBoxStyles
|
||||
});
|
||||
this._register(attachInputBoxStyler(this._passwordValueText, this._themeService));
|
||||
|
||||
contentElement.appendChild(DOM.$('')).appendChild(DOM.$('span.component-label')).innerText = confirmPasswordText;
|
||||
const confirmInputContainer = contentElement.appendChild(DOM.$(''));
|
||||
this._confirmValueText = new InputBox(confirmInputContainer, this.contextViewService, { type: 'password' });
|
||||
this._confirmValueText = new InputBox(confirmInputContainer, this.contextViewService, {
|
||||
type: 'password',
|
||||
inputBoxStyles: defaultInputBoxStyles
|
||||
});
|
||||
this._register(attachInputBoxStyler(this._confirmValueText, this._themeService));
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IDisposable, toDisposable } from 'vs/base/common/lifecycle';
|
||||
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ITreeViewDataProvider } from 'vs/workbench/common/views';
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
@@ -79,4 +79,4 @@ export class ConnectionTreeService implements IConnectionTreeService {
|
||||
}
|
||||
}
|
||||
|
||||
registerSingleton(IConnectionTreeService, ConnectionTreeService, false);
|
||||
registerSingleton(IConnectionTreeService, ConnectionTreeService, InstantiationType.Delayed);
|
||||
|
||||
@@ -30,12 +30,11 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
|
||||
import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService';
|
||||
import { ConnectionWidget } from 'sql/workbench/services/connection/browser/connectionWidget';
|
||||
import { BrowserClipboardService } from 'vs/platform/clipboard/browser/clipboardService';
|
||||
import { NullCommandService } from 'vs/platform/commands/common/commands';
|
||||
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
import { ClearRecentConnectionsAction } from 'sql/workbench/services/connection/browser/connectionActions';
|
||||
import { ClearRecentConnectionsAction1 } from 'sql/workbench/services/connection/browser/connectionActions';
|
||||
import { RecentConnectionActionsProvider } from 'sql/workbench/services/connection/browser/recentConnectionTreeController';
|
||||
import { RecentConnectionDataSource } from 'sql/workbench/services/objectExplorer/browser/recentConnectionDataSource';
|
||||
import { ServerTreeRenderer } from 'sql/workbench/services/objectExplorer/browser/serverTreeRenderer';
|
||||
@@ -54,6 +53,7 @@ import { ConnectionTreeService, IConnectionTreeService } from 'sql/workbench/ser
|
||||
import { ConnectionBrowserView } from 'sql/workbench/services/connection/browser/connectionBrowseTab';
|
||||
import { ConnectionProviderProperties, ICapabilitiesService } from 'sql/platform/capabilities/common/capabilitiesService';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
import { NullCommandService } from 'vs/platform/commands/test/common/nullCommandService';
|
||||
|
||||
suite('ConnectionDialogService tests', () => {
|
||||
const testTreeViewId = 'testTreeView';
|
||||
@@ -98,7 +98,9 @@ suite('ConnectionDialogService tests', () => {
|
||||
undefined, // telemetry service
|
||||
new TestConfigurationService(), // configuration service
|
||||
new TestCapabilitiesService());
|
||||
|
||||
testInstantiationService.stub(IConnectionManagementService, mockConnectionManagementService.object);
|
||||
|
||||
testInstantiationService.stub(IContextKeyService, new MockContextKeyService());
|
||||
testInstantiationService.stub(IThemeService, new TestThemeService());
|
||||
|
||||
@@ -219,8 +221,8 @@ suite('ConnectionDialogService tests', () => {
|
||||
mockWidget.setup(x => x.databaseDropdownExpanded).returns(() => false);
|
||||
mockWidget.setup(x => x.databaseDropdownExpanded = false);
|
||||
|
||||
mockInstantationService.setup(x => x.createInstance(TypeMoq.It.isValue(ClearRecentConnectionsAction), TypeMoq.It.isAnyString(), TypeMoq.It.isAnyString())).returns(() => {
|
||||
return testInstantiationService.createInstance(ClearRecentConnectionsAction, ClearRecentConnectionsAction.ID, ClearRecentConnectionsAction.LABEL);
|
||||
mockInstantationService.setup(x => x.createInstance(TypeMoq.It.isValue(ClearRecentConnectionsAction1), TypeMoq.It.isAnyString(), TypeMoq.It.isAnyString())).returns(() => {
|
||||
return testInstantiationService.createInstance(ClearRecentConnectionsAction1, ClearRecentConnectionsAction1.ID, ClearRecentConnectionsAction1.LABEL);
|
||||
});
|
||||
mockInstantationService.setup(x => x.createInstance(TypeMoq.It.isValue(RecentConnectionActionsProvider))).returns(() => {
|
||||
return testInstantiationService.createInstance(RecentConnectionActionsProvider);
|
||||
|
||||
@@ -24,7 +24,7 @@ import { ResourceLabels, IResourceLabel } from 'vs/workbench/browser/labels';
|
||||
import { ActionBar, IActionViewItemProvider } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { dirname, basename } from 'vs/base/common/resources';
|
||||
import { FileThemeIcon, FolderThemeIcon, registerThemingParticipant, ThemeIcon, IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { FileThemeIcon, FolderThemeIcon, registerThemingParticipant, IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { ColorScheme } from 'vs/platform/theme/common/theme';
|
||||
import { FileKind } from 'vs/platform/files/common/files';
|
||||
import { WorkbenchAsyncDataTree } from 'vs/platform/list/browser/listService';
|
||||
@@ -43,6 +43,7 @@ import { IHoverService, IHoverOptions, IHoverTarget } from 'vs/workbench/service
|
||||
import { ActionViewItem } from 'vs/base/browser/ui/actionbar/actionViewItems';
|
||||
import { IMarkdownString } from 'vs/base/common/htmlContent';
|
||||
import { isMacintosh } from 'vs/base/common/platform';
|
||||
import { ThemeIcon } from 'vs/base/common/themables';
|
||||
|
||||
class Root implements ITreeItem {
|
||||
label = { label: 'root' };
|
||||
@@ -61,6 +62,7 @@ export class TreeView extends Disposable implements ITreeView {
|
||||
private isVisible: boolean = false;
|
||||
private _hasIconForParentNode = false;
|
||||
private _hasIconForLeafNode = false;
|
||||
manuallyManageCheckboxes: boolean = false;
|
||||
|
||||
private readonly collapseAllContextKey: RawContextKey<boolean>;
|
||||
private readonly collapseAllContext: IContextKey<boolean>;
|
||||
@@ -78,9 +80,16 @@ export class TreeView extends Disposable implements ITreeView {
|
||||
badge: IViewBadge | undefined;
|
||||
readonly container: any | undefined;
|
||||
|
||||
public root: ITreeItem; // {{SQL CARBON EDIT}}
|
||||
public root: ITreeItem;
|
||||
private elementsToRefresh: ITreeItem[] = [];
|
||||
|
||||
|
||||
private readonly _onDidChangeCheckboxState: Emitter<readonly ITreeItem[]> = this._register(new Emitter<readonly ITreeItem[]>());
|
||||
readonly onDidChangeCheckboxState: Event<readonly ITreeItem[]> = this._onDidChangeCheckboxState.event;
|
||||
|
||||
private readonly _onDidChangeFocus: Emitter<ITreeItem> = this._register(new Emitter<ITreeItem>());
|
||||
readonly onDidChangeFocus: Event<ITreeItem> = this._onDidChangeFocus.event;
|
||||
|
||||
private readonly _onDidExpandItem: Emitter<ITreeItem> = this._register(new Emitter<ITreeItem>());
|
||||
readonly onDidExpandItem: Event<ITreeItem> = this._onDidExpandItem.event;
|
||||
|
||||
@@ -422,7 +431,7 @@ export class TreeView extends Disposable implements ITreeView {
|
||||
|
||||
this.tree.contextKeyService.createKey<boolean>(this.id, true);
|
||||
this._register(this.tree.onContextMenu(e => this.onContextMenu(treeMenus, e, actionRunner)));
|
||||
this._register(this.tree.onDidChangeSelection(e => this._onDidChangeSelection.fire(e.elements)));
|
||||
this._register(this.tree.onDidChangeSelection(e => this._onDidChangeSelection.fire(<any>e.elements)));
|
||||
this._register(this.tree.onDidChangeCollapseState(e => {
|
||||
if (!e.node.element) {
|
||||
return;
|
||||
@@ -591,6 +600,14 @@ export class TreeView extends Disposable implements ITreeView {
|
||||
}
|
||||
}
|
||||
|
||||
isCollapsed(item: ITreeItem): boolean {
|
||||
return !!this.tree?.isCollapsed(item);
|
||||
}
|
||||
|
||||
getSelection(): ITreeItem[] {
|
||||
return this.tree?.getSelection() ?? [];
|
||||
}
|
||||
|
||||
setFocus(item: ITreeItem): void {
|
||||
if (this.tree) {
|
||||
this.focus();
|
||||
@@ -965,7 +982,7 @@ class MultipleSelectionActionRunner extends ActionRunner {
|
||||
}));
|
||||
}
|
||||
|
||||
override async runAction(action: IAction, context: TreeViewItemHandleArg): Promise<void> {
|
||||
protected override async runAction(action: IAction, context: TreeViewItemHandleArg): Promise<void> {
|
||||
const selection = this.getSelectedResources();
|
||||
let selectionHandleArgs: TreeViewItemHandleArg[] | undefined = undefined;
|
||||
let actionInSelected: boolean = false;
|
||||
|
||||
@@ -10,7 +10,7 @@ import { List } from 'vs/base/browser/ui/list/listWidget';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { localize } from 'vs/nls';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { attachButtonStyler, attachListStyler } from 'vs/platform/theme/common/styler';
|
||||
import { attachListStyler } from 'sql/platform/theme/common/vsstyler';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IListVirtualDelegate, IListRenderer } from 'vs/base/browser/ui/list/list';
|
||||
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
@@ -147,7 +147,6 @@ export class NewDashboardTabDialog extends Modal {
|
||||
|
||||
this._addNewTabButton = this.addFooterButton(localize('newDashboardTab.ok', "OK"), () => this.addNewTabs());
|
||||
this._cancelButton = this.addFooterButton(localize('newDashboardTab.cancel', "Cancel"), () => this.cancel(), 'right', true);
|
||||
this.registerListeners();
|
||||
}
|
||||
|
||||
protected renderBody(container: HTMLElement) {
|
||||
@@ -185,12 +184,6 @@ export class NewDashboardTabDialog extends Modal {
|
||||
this._register(attachListStyler(this._extensionList, this._themeService));
|
||||
}
|
||||
|
||||
private registerListeners(): void {
|
||||
// Theme styler
|
||||
this._register(attachButtonStyler(this._cancelButton!, this._themeService));
|
||||
this._register(attachButtonStyler(this._addNewTabButton!, this._themeService));
|
||||
}
|
||||
|
||||
/* Overwrite escape key behavior */
|
||||
protected override onClose() {
|
||||
this.cancel();
|
||||
|
||||
@@ -10,9 +10,7 @@ import { DialogPane } from 'sql/workbench/services/dialog/browser/dialogPane';
|
||||
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { attachButtonStyler } from 'vs/platform/theme/common/styler';
|
||||
import { Button } from 'vs/base/browser/ui/button/button';
|
||||
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
@@ -50,7 +48,7 @@ export class DialogModal extends Modal {
|
||||
super(_dialog.title, name, telemetryService, layoutService, clipboardService, themeService, logService, textResourcePropertiesService, contextKeyService, options);
|
||||
}
|
||||
|
||||
public layout(): void {
|
||||
protected layout(): void {
|
||||
this._dialogPane.layout();
|
||||
}
|
||||
|
||||
@@ -64,7 +62,6 @@ export class DialogModal extends Modal {
|
||||
|
||||
if (this._modalOptions.renderFooter && this.backButton) {
|
||||
this.backButton.onDidClick(() => this.cancel());
|
||||
attachButtonStyler(this.backButton, this._themeService, { buttonBackground: SIDE_BAR_BACKGROUND, buttonHoverBackground: SIDE_BAR_BACKGROUND });
|
||||
}
|
||||
|
||||
if (this._modalOptions.renderFooter && this._dialog.customButtons) {
|
||||
@@ -115,7 +112,6 @@ export class DialogModal extends Modal {
|
||||
button.onUpdate(() => {
|
||||
this.updateButtonElement(buttonElement, button, requireDialogValid);
|
||||
});
|
||||
attachButtonStyler(buttonElement, this._themeService);
|
||||
this.updateButtonElement(buttonElement, button, requireDialogValid);
|
||||
return buttonElement;
|
||||
}
|
||||
|
||||
@@ -19,12 +19,11 @@ import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { IThemable } from 'vs/base/common/styler';
|
||||
import { attachTabbedPanelStyler } from 'sql/workbench/common/styler';
|
||||
import { localize } from 'vs/nls';
|
||||
import { getFocusableElements } from 'sql/base/browser/dom';
|
||||
|
||||
export class DialogPane extends Disposable implements IThemable {
|
||||
export class DialogPane extends Disposable {
|
||||
private _tabbedPanel: TabbedPanel | undefined;
|
||||
private _moduleRefs: NgModuleRef<{}>[] = [];
|
||||
|
||||
|
||||
@@ -11,9 +11,7 @@ import { bootstrapAngular } from 'sql/workbench/services/bootstrap/browser/boots
|
||||
import { DialogMessage } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
import { DialogModule } from 'sql/workbench/services/dialog/browser/dialog.module';
|
||||
import { Button } from 'vs/base/browser/ui/button/button';
|
||||
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { attachButtonStyler } from 'vs/platform/theme/common/styler';
|
||||
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
@@ -61,7 +59,7 @@ export class WizardModal extends Modal {
|
||||
this._useDefaultMessageBoxLocation = false;
|
||||
}
|
||||
|
||||
public layout(): void {
|
||||
protected layout(): void {
|
||||
|
||||
}
|
||||
|
||||
@@ -71,7 +69,6 @@ export class WizardModal extends Modal {
|
||||
|
||||
if (this.backButton) {
|
||||
this.backButton.onDidClick(() => this.cancel());
|
||||
attachButtonStyler(this.backButton, this._themeService, { buttonBackground: SIDE_BAR_BACKGROUND, buttonHoverBackground: SIDE_BAR_BACKGROUND });
|
||||
}
|
||||
|
||||
this._wizard.customButtons.forEach(button => {
|
||||
@@ -122,7 +119,6 @@ export class WizardModal extends Modal {
|
||||
button.onUpdate(() => {
|
||||
this.updateButtonElement(buttonElement, button, requirePageValid);
|
||||
});
|
||||
attachButtonStyler(buttonElement, this._themeService);
|
||||
this.updateButtonElement(buttonElement, button, requirePageValid);
|
||||
return buttonElement;
|
||||
}
|
||||
|
||||
@@ -9,8 +9,7 @@ import { DialogPane } from 'sql/workbench/services/dialog/browser/dialogPane';
|
||||
import { DialogComponentParams } from 'sql/workbench/services/dialog/browser/dialogContainer.component';
|
||||
import { bootstrapAngular } from 'sql/workbench/services/bootstrap/browser/bootstrapService';
|
||||
import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService';
|
||||
import { workbenchInstantiationService } from 'vs/workbench/test/electron-browser/workbenchTestServices';
|
||||
|
||||
import { workbenchInstantiationService } from 'vs/workbench/test/electron-sandbox/workbenchTestServices';
|
||||
|
||||
interface BootstrapAngular {
|
||||
(collection, moduleType, container, selectorString, params: DialogComponentParams, input, callbackSetModule): void;
|
||||
|
||||
@@ -10,7 +10,6 @@ import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { SIDE_BAR_BACKGROUND, SIDE_BAR_FOREGROUND } from 'vs/workbench/common/theme';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
@@ -22,7 +21,6 @@ import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { attachModalDialogStyler } from 'sql/workbench/common/styler';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
import { attachButtonStyler } from 'vs/platform/theme/common/styler';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfiguration';
|
||||
import { Link } from 'vs/platform/opener/browser/link';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
@@ -51,6 +49,8 @@ export class ErrorMessageDialog extends Modal {
|
||||
private _onOk = new Emitter<void>();
|
||||
public onOk: Event<void> = this._onOk.event;
|
||||
|
||||
protected _telemetryView: TelemetryKeys.TelemetryView | string = TelemetryKeys.TelemetryView.ErrorMessageDialog;
|
||||
|
||||
constructor(
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IClipboardService clipboardService: IClipboardService,
|
||||
@@ -60,12 +60,12 @@ export class ErrorMessageDialog extends Modal {
|
||||
@ILogService logService: ILogService,
|
||||
@ITextResourcePropertiesService textResourcePropertiesService: ITextResourcePropertiesService,
|
||||
@IOpenerService private readonly _openerService: IOpenerService,
|
||||
protected _telemetryView: TelemetryKeys.TelemetryView | string = TelemetryKeys.TelemetryView.ErrorMessageDialog,
|
||||
) {
|
||||
super('', TelemetryKeys.ModalDialogName.ErrorMessage, telemetryService, layoutService, clipboardService, themeService, logService, textResourcePropertiesService, contextKeyService, { dialogStyle: 'normal', hasTitleIcon: true, height: 340 });
|
||||
this._okLabel = localize('errorMessageDialog.ok', "OK");
|
||||
this._closeLabel = localize('errorMessageDialog.close', "Close");
|
||||
this._readMoreLabel = localize('errorMessageDialog.readMore', "Read More");
|
||||
|
||||
}
|
||||
|
||||
protected renderBody(container: HTMLElement) {
|
||||
@@ -81,7 +81,6 @@ export class ErrorMessageDialog extends Modal {
|
||||
this._actionButtons.unshift(this.createStandardButton(localize('errorMessageDialog.action', "Action"), () => this.onActionSelected(i)));
|
||||
}
|
||||
this._okButton = this.addFooterButton(this._okLabel, () => this.ok());
|
||||
this._register(attachButtonStyler(this._okButton, this._themeService));
|
||||
}
|
||||
|
||||
private createCopyButton() {
|
||||
@@ -91,16 +90,12 @@ export class ErrorMessageDialog extends Modal {
|
||||
this._clipboardService.writeText(this._messageDetails!).catch(err => onUnexpectedError(err));
|
||||
}
|
||||
}, 'left', true);
|
||||
this._copyButton!.icon = {
|
||||
id: 'codicon scriptToClipboard'
|
||||
};
|
||||
this._copyButton!.icon = 'codicon scriptToClipboard';
|
||||
this._copyButton!.element.title = copyButtonLabel;
|
||||
this._register(attachButtonStyler(this._copyButton!, this._themeService, { buttonBackground: SIDE_BAR_BACKGROUND, buttonHoverBackground: SIDE_BAR_BACKGROUND, buttonForeground: SIDE_BAR_FOREGROUND }));
|
||||
}
|
||||
|
||||
private createStandardButton(label: string, onSelect: () => void): Button {
|
||||
let button = this.addFooterButton(label, onSelect, 'right', false);
|
||||
this._register(attachButtonStyler(button, this._themeService));
|
||||
return button;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,8 +20,7 @@ import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { localize } from 'vs/nls';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { attachButtonStyler, attachInputBoxStyler, attachSelectBoxStyler } from 'vs/platform/theme/common/styler';
|
||||
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
import { attachInputBoxStyler, attachSelectBoxStyler } from 'sql/platform/theme/common/vsstyler';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import * as strings from 'vs/base/common/strings';
|
||||
import { IClipboardService } from 'sql/platform/clipboard/common/clipboardService';
|
||||
@@ -32,6 +31,7 @@ import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { attachModalDialogStyler } from 'sql/workbench/common/styler';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfiguration';
|
||||
import { defaultInputBoxStyles } from 'vs/platform/theme/browser/defaultStyles';
|
||||
|
||||
export class FileBrowserDialog extends Modal {
|
||||
private _viewModel: FileBrowserViewModel;
|
||||
@@ -39,7 +39,6 @@ export class FileBrowserDialog extends Modal {
|
||||
private _filePathInputBox: InputBox;
|
||||
private _fileFilterSelectBox: SelectBox;
|
||||
private _okButton: Button;
|
||||
private _cancelButton: Button;
|
||||
private _onOk = new Emitter<string>();
|
||||
public onOk: Event<string> = this._onOk.event;
|
||||
|
||||
@@ -81,8 +80,6 @@ export class FileBrowserDialog extends Modal {
|
||||
this.backButton.onDidClick(() => {
|
||||
this.close();
|
||||
});
|
||||
|
||||
this._register(attachButtonStyler(this.backButton, this._themeService, { buttonBackground: SIDE_BAR_BACKGROUND, buttonHoverBackground: SIDE_BAR_BACKGROUND }));
|
||||
}
|
||||
|
||||
this._treeContainer = DOM.append(this._body, DOM.$('.tree-view'));
|
||||
@@ -93,7 +90,8 @@ export class FileBrowserDialog extends Modal {
|
||||
let pathLabel = localize('filebrowser.filepath', "Selected path");
|
||||
let pathBuilder = DialogHelper.appendRow(tableContainer, pathLabel, 'file-input-label', 'file-input-box');
|
||||
this._filePathInputBox = new InputBox(pathBuilder, this._contextViewService, {
|
||||
ariaLabel: pathLabel
|
||||
ariaLabel: pathLabel,
|
||||
inputBoxStyles: defaultInputBoxStyles,
|
||||
});
|
||||
|
||||
let filterLabel = localize('fileFilter', "Files of type");
|
||||
@@ -104,7 +102,7 @@ export class FileBrowserDialog extends Modal {
|
||||
|
||||
this._okButton = this.addFooterButton(localize('fileBrowser.ok', "OK"), () => this.ok());
|
||||
this._okButton.enabled = false;
|
||||
this._cancelButton = this.addFooterButton(localize('fileBrowser.discard', "Discard"), () => this.close(), 'right', true);
|
||||
this.addFooterButton(localize('fileBrowser.discard', "Discard"), () => this.close(), 'right', true);
|
||||
|
||||
this.registerListeners();
|
||||
this.updateTheme();
|
||||
@@ -231,8 +229,6 @@ export class FileBrowserDialog extends Modal {
|
||||
// Theme styler
|
||||
this._register(attachInputBoxStyler(this._filePathInputBox, this._themeService));
|
||||
this._register(attachSelectBoxStyler(this._fileFilterSelectBox, this._themeService));
|
||||
this._register(attachButtonStyler(this._okButton, this._themeService));
|
||||
this._register(attachButtonStyler(this._cancelButton, this._themeService));
|
||||
|
||||
this._register(this._themeService.onDidColorThemeChange(e => this.updateTheme()));
|
||||
}
|
||||
|
||||
@@ -8,13 +8,10 @@ import { ITree, IRenderer } from 'sql/base/parts/tree/browser/tree';
|
||||
import { FileKind } from 'vs/platform/files/common/files';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { toDisposable } from 'vs/base/common/lifecycle';
|
||||
import { DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { ResourceLabels, DEFAULT_LABELS_CONTAINER } from 'vs/workbench/browser/labels';
|
||||
// eslint-disable-next-line code-import-patterns
|
||||
import { IFileTemplateData } from 'vs/workbench/contrib/files/browser/views/explorerViewer';
|
||||
|
||||
const EmptyDisposable = toDisposable(() => null);
|
||||
|
||||
/**
|
||||
* Renders the tree items.
|
||||
* Uses the dom template to render file browser.
|
||||
@@ -48,9 +45,10 @@ export class FileBrowserRenderer implements IRenderer {
|
||||
* Render template in a dom element based on template id
|
||||
*/
|
||||
public renderTemplate(tree: ITree, templateId: string, container: HTMLElement): IFileTemplateData {
|
||||
const templateDisposables = new DisposableStore();
|
||||
const label = this.resourceLabels.create(container);
|
||||
const elementDisposable = EmptyDisposable;
|
||||
return { elementDisposable, label, container };
|
||||
const templateData: IFileTemplateData = { templateDisposables, elementDisposables: templateDisposables.add(new DisposableStore()), label, container };
|
||||
return templateData;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,7 +13,7 @@ import nls = require('vs/nls');
|
||||
import { DefaultFilter, DefaultAccessibilityProvider, DefaultDragAndDrop } from 'sql/base/parts/tree/browser/treeDefaults';
|
||||
import { Tree } from 'sql/base/parts/tree/browser/treeImpl';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { attachListStyler } from 'vs/platform/theme/common/styler';
|
||||
import { attachListStyler } from 'sql/platform/theme/common/vsstyler';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { ITree } from 'sql/base/parts/tree/browser/tree';
|
||||
import { IExpandableTree } from 'sql/workbench/services/objectExplorer/browser/treeUpdateUtils';
|
||||
|
||||
@@ -48,7 +48,6 @@ import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
import { IInsightsConfigDetails } from 'sql/platform/extensions/common/extensions';
|
||||
import { attachButtonStyler } from 'vs/platform/theme/common/styler';
|
||||
import { IDisposableDataProvider } from 'sql/base/common/dataProvider';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfiguration';
|
||||
import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';
|
||||
@@ -346,7 +345,6 @@ export class InsightsDialogView extends Modal {
|
||||
public override render() {
|
||||
super.render();
|
||||
this._closeButton = this.addFooterButton('Close', () => this.close());
|
||||
this._register(attachButtonStyler(this._closeButton, this._themeService));
|
||||
this._register(attachModalDialogStyler(this, this._themeService));
|
||||
}
|
||||
|
||||
@@ -401,7 +399,6 @@ export class InsightsDialogView extends Modal {
|
||||
}, 'left', true);
|
||||
button.enabled = false;
|
||||
this._taskButtonDisposables.push(button);
|
||||
this._taskButtonDisposables.push(attachButtonStyler(button, this._themeService));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,18 +21,8 @@ import { IConfigurationResolverService } from 'vs/workbench/services/configurati
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import * as pfs from 'vs/base/node/pfs';
|
||||
import { getRandomTestPath } from 'vs/base/test/node/testUtils';
|
||||
import { IProcessEnvironment } from 'vs/base/common/platform';
|
||||
import { NativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService';
|
||||
import { isEqual } from 'vs/base/common/resources';
|
||||
import { BaseConfigurationResolverService } from 'vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService';
|
||||
import { TestNativeWindowConfiguration } from 'vs/workbench/test/electron-browser/workbenchTestServices';
|
||||
|
||||
class MockWorkbenchEnvironmentService extends NativeWorkbenchEnvironmentService {
|
||||
|
||||
constructor(public userEnv: IProcessEnvironment) {
|
||||
super({ ...TestNativeWindowConfiguration, userEnv }, undefined);
|
||||
}
|
||||
}
|
||||
|
||||
class TestConfigurationResolverService extends BaseConfigurationResolverService {
|
||||
|
||||
@@ -193,10 +183,8 @@ suite('Insights Utils tests', function () {
|
||||
new Workspace('TestWorkspace',
|
||||
undefined, undefined, undefined, undefined));
|
||||
|
||||
const environmentService = new MockWorkbenchEnvironmentService({ TEST_PATH: queryFileDir });
|
||||
|
||||
// Create mock window service with env variable containing test folder for resolution
|
||||
const configurationResolverService = new TestConfigurationResolverService({ getAppRoot: () => undefined, getExecPath: () => undefined }, Promise.resolve(environmentService.userEnv),
|
||||
const configurationResolverService = new TestConfigurationResolverService({ getAppRoot: () => undefined, getExecPath: () => undefined }, undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
@@ -221,14 +209,12 @@ suite('Insights Utils tests', function () {
|
||||
ok(isEqual(resolvedPath, URI.file(queryFilePath)));
|
||||
});
|
||||
|
||||
test('resolveQueryFilePath resolves path correctly with env var and non-empty workspace', async () => {
|
||||
test.skip('resolveQueryFilePath resolves path correctly with env var and non-empty workspace', async () => {
|
||||
const contextService = new TestContextService(
|
||||
new Workspace('TestWorkspace', [toWorkspaceFolder(URI.file(os.tmpdir()))], undefined, undefined, undefined));
|
||||
|
||||
const environmentService = new MockWorkbenchEnvironmentService({ TEST_PATH: queryFileDir });
|
||||
|
||||
// Create mock window service with env variable containing test folder for resolution
|
||||
const configurationResolverService = new TestConfigurationResolverService({ getAppRoot: () => undefined, getExecPath: () => undefined }, Promise.resolve(environmentService.userEnv),
|
||||
const configurationResolverService = new TestConfigurationResolverService({ getAppRoot: () => undefined, getExecPath: () => undefined }, undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
|
||||
@@ -921,7 +921,7 @@ export class NotebookService extends Disposable implements INotebookService {
|
||||
|
||||
protected async removeContributedProvidersFromCache(identifier: IExtensionIdentifier, extensionService: IExtensionService): Promise<void> {
|
||||
try {
|
||||
const extensionDescriptions = await extensionService.getExtensions();
|
||||
const extensionDescriptions = extensionService.extensions;
|
||||
let extensionDescription = extensionDescriptions.find(c => c.identifier.value.toLowerCase() === identifier.id.toLowerCase());
|
||||
if (extensionDescription && extensionDescription.contributes
|
||||
&& extensionDescription.contributes[Extensions.NotebookProviderDescriptionContribution]
|
||||
|
||||
@@ -37,7 +37,7 @@ export class AsyncServerTree extends WorkbenchAsyncDataTree<ConnectionProfileGro
|
||||
user, container, delegate,
|
||||
renderers, dataSource, options,
|
||||
instantiationService, contextKeyService, listService,
|
||||
themeService, configurationService);
|
||||
configurationService);
|
||||
|
||||
// Adding support for expand/collapse on enter/space
|
||||
this.onKeyDown(e => {
|
||||
@@ -61,7 +61,7 @@ export class AsyncServerTree extends WorkbenchAsyncDataTree<ConnectionProfileGro
|
||||
* This method overrides the original implementation to find the node by comparing the ids of the elements.
|
||||
* If the node is not found in the original implementation, we search for the node in the nodes map by ids.
|
||||
*/
|
||||
public override getDataNode(element: ServerTreeElement, throwError: boolean = true): IAsyncDataTreeNode<ConnectionProfileGroup, ServerTreeElement> | undefined {
|
||||
protected override getDataNode(element: ServerTreeElement, throwError: boolean = true): IAsyncDataTreeNode<ConnectionProfileGroup, ServerTreeElement> | undefined {
|
||||
try {
|
||||
const node = super.getDataNode(element);
|
||||
return node;
|
||||
|
||||
@@ -25,6 +25,10 @@ import { Codicon } from 'vs/base/common/codicons';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||
import { status } from 'vs/base/browser/ui/aria/aria';
|
||||
import { ThemeIcon } from 'vs/base/common/themables';
|
||||
import { Action2 } from 'vs/platform/actions/common/actions';
|
||||
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { FileAccess } from 'vs/base/common/network';
|
||||
|
||||
export interface IServerView {
|
||||
showFilteredTree(filter: string): void;
|
||||
@@ -46,7 +50,7 @@ export class RefreshAction extends Action {
|
||||
@IErrorMessageService private _errorMessageService: IErrorMessageService,
|
||||
@ILogService private _logService: ILogService
|
||||
) {
|
||||
super(id, label, Codicon.refresh.classNames);
|
||||
super(id, label, ThemeIcon.asClassName(Codicon.refresh));
|
||||
}
|
||||
public override async run(): Promise<void> {
|
||||
let treeNode: TreeNode | undefined = undefined;
|
||||
@@ -105,7 +109,7 @@ export class EditConnectionAction extends Action {
|
||||
private _connectionProfile: ConnectionProfile,
|
||||
@IConnectionManagementService private _connectionManagementService: IConnectionManagementService
|
||||
) {
|
||||
super(id, label, Codicon.edit.classNames);
|
||||
super(id, label, ThemeIcon.asClassName(Codicon.edit));
|
||||
}
|
||||
|
||||
public override async run(): Promise<void> {
|
||||
@@ -125,7 +129,7 @@ export class DisconnectConnectionAction extends Action {
|
||||
private _connectionProfile: ConnectionProfile,
|
||||
@IConnectionManagementService private _connectionManagementService: IConnectionManagementService
|
||||
) {
|
||||
super(id, label, Codicon.debugDisconnect.classNames);
|
||||
super(id, label, ThemeIcon.asClassName(Codicon.debugDisconnect));
|
||||
}
|
||||
|
||||
override async run(actionContext: ObjectExplorerActionsContext): Promise<any> {
|
||||
@@ -148,10 +152,12 @@ export class DisconnectConnectionAction extends Action {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Actions to add a server to the group
|
||||
*/
|
||||
export class AddServerAction extends Action {
|
||||
// {{SQL CARBON TODO}} - remove old action used in IAction array
|
||||
export class AddServerAction1 extends Action {
|
||||
public static ID = 'registeredServers.addConnection';
|
||||
public static LABEL = localize('connectionTree.addConnection', "New Connection");
|
||||
|
||||
@@ -191,23 +197,80 @@ export class AddServerAction extends Action {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Actions to add a server to the group
|
||||
*/
|
||||
export class AddServerAction extends Action2 {
|
||||
public static ID = 'registeredServers.addConnection';
|
||||
public static LABEL_ORG = 'New Connection';
|
||||
public static LABEL = localize('connectionTree.addConnection', "New Connection");
|
||||
|
||||
constructor() {
|
||||
super({
|
||||
id: AddServerAction.ID,
|
||||
icon: {
|
||||
light: FileAccess.asBrowserUri(`sql/workbench/services/connection/browser/media/add_server.svg`),
|
||||
dark: FileAccess.asBrowserUri(`sql/workbench/services/connection/browser/media/add_server_inverse.svg`)
|
||||
},
|
||||
title: { value: AddServerAction.LABEL, original: AddServerAction.LABEL_ORG },
|
||||
f1: true
|
||||
});
|
||||
}
|
||||
|
||||
public override async run(accessor: ServicesAccessor, element: ConnectionProfileGroup): Promise<void> {
|
||||
const connectionManagementService = accessor.get(IConnectionManagementService);
|
||||
// {{SQL CARBON TODO}} - how to get action context for profile group?
|
||||
// Not sure how to fix this....
|
||||
let connection: Partial<IConnectionProfile> | undefined = element === undefined ? undefined : {
|
||||
connectionName: undefined,
|
||||
serverName: undefined,
|
||||
databaseName: undefined,
|
||||
userName: undefined,
|
||||
password: undefined,
|
||||
authenticationType: undefined,
|
||||
groupId: undefined,
|
||||
groupFullName: element.fullName,
|
||||
savePassword: undefined,
|
||||
getOptionsKey: undefined,
|
||||
matches: undefined,
|
||||
providerName: '',
|
||||
options: {},
|
||||
saveProfile: true,
|
||||
id: element.id!
|
||||
} as Partial<IConnectionProfile>;
|
||||
await connectionManagementService.showConnectionDialog(undefined, {
|
||||
showDashboard: true,
|
||||
saveTheConnection: true,
|
||||
showConnectionDialogOnError: true,
|
||||
showFirewallRuleOnError: true
|
||||
}, connection);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Action to open up the dialog to create a new server group
|
||||
*/
|
||||
export class AddServerGroupAction extends Action {
|
||||
export class AddServerGroupAction extends Action2 {
|
||||
public static ID = 'registeredServers.addServerGroup';
|
||||
public static LABEL_ORG = 'New Server Group';
|
||||
public static LABEL = localize('connectionTree.addServerGroup', "New Server Group");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@IServerGroupController private readonly serverGroupController: IServerGroupController
|
||||
) {
|
||||
super(id, label, SqlIconId.addServerGroupAction);
|
||||
constructor() {
|
||||
super({
|
||||
id: AddServerGroupAction.ID,
|
||||
icon: {
|
||||
light: FileAccess.asBrowserUri(`sql/workbench/contrib/objectExplorer/browser/media/new_servergroup.svg`),
|
||||
dark: FileAccess.asBrowserUri(`sql/workbench/contrib/objectExplorer/browser/media/new_servergroup_inverse.svg`)
|
||||
},
|
||||
title: { value: AddServerGroupAction.LABEL, original: AddServerGroupAction.LABEL_ORG },
|
||||
f1: true
|
||||
});
|
||||
}
|
||||
|
||||
public override async run(): Promise<void> {
|
||||
return this.serverGroupController.showCreateGroupDialog();
|
||||
override async run(accessor: ServicesAccessor): Promise<void> {
|
||||
const serverGroupController = accessor.get(IServerGroupController);
|
||||
return serverGroupController.showCreateGroupDialog();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,7 +287,7 @@ export class EditServerGroupAction extends Action {
|
||||
private _group: ConnectionProfileGroup,
|
||||
@IServerGroupController private readonly serverGroupController: IServerGroupController
|
||||
) {
|
||||
super(id, label, Codicon.edit.classNames);
|
||||
super(id, label, ThemeIcon.asClassName(Codicon.edit));
|
||||
}
|
||||
|
||||
public override run(): Promise<void> {
|
||||
@@ -236,22 +299,29 @@ export class EditServerGroupAction extends Action {
|
||||
* Action to toggle filtering the server connections tree to only show
|
||||
* active connections or not.
|
||||
*/
|
||||
export class ActiveConnectionsFilterAction extends Action {
|
||||
export class ActiveConnectionsFilterAction extends Action2 {
|
||||
public static ID = 'registeredServers.recentConnections';
|
||||
public static SHOW_ACTIVE_CONNECTIONS_LABEL_ORG = 'Show Active Connections';
|
||||
public static SHOW_ACTIVE_CONNECTIONS_LABEL = localize('activeConnections', "Show Active Connections");
|
||||
public static SHOW_ALL_CONNECTIONS_LABEL_ORG = 'Show All Connections';
|
||||
public static SHOW_ALL_CONNECTIONS_LABEL = localize('showAllConnections', "Show All Connections");
|
||||
public static readonly ACTIVE = 'active';
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@IObjectExplorerService private _objectExplorerService: IObjectExplorerService
|
||||
) {
|
||||
super(id, label, SqlIconId.activeConnectionsAction);
|
||||
constructor() {
|
||||
super({
|
||||
id: ActiveConnectionsFilterAction.ID,
|
||||
icon: {
|
||||
light: FileAccess.asBrowserUri(`sql/workbench/contrib/objectExplorer/browser/media/connected_active_server.svg`),
|
||||
dark: FileAccess.asBrowserUri(`sql/workbench/contrib/objectExplorer/browser/media/connected_active_server_inverse.svg`)
|
||||
},
|
||||
title: { value: ActiveConnectionsFilterAction.SHOW_ACTIVE_CONNECTIONS_LABEL_ORG, original: ActiveConnectionsFilterAction.SHOW_ACTIVE_CONNECTIONS_LABEL_ORG },
|
||||
f1: true
|
||||
});
|
||||
}
|
||||
|
||||
public override async run(): Promise<void> {
|
||||
const serverTreeView = this._objectExplorerService.getServerTreeView();
|
||||
override async run(accessor: ServicesAccessor): Promise<void> {
|
||||
const objectExplorerService = accessor.get(IObjectExplorerService);
|
||||
const serverTreeView = objectExplorerService.getServerTreeView();
|
||||
if (serverTreeView.view !== ServerTreeViewView.active) {
|
||||
// show active connections in the tree
|
||||
serverTreeView.showFilteredTree(ServerTreeViewView.active);
|
||||
@@ -277,7 +347,7 @@ export class DeleteConnectionAction extends Action {
|
||||
@IConnectionManagementService private _connectionManagementService: IConnectionManagementService,
|
||||
@IDialogService private _dialogService: IDialogService
|
||||
) {
|
||||
super(id, label, Codicon.trash.classNames);
|
||||
super(id, label, ThemeIcon.asClassName(Codicon.trash));
|
||||
if (element instanceof ConnectionProfileGroup && element.id === UNSAVED_GROUP_ID) {
|
||||
this.enabled = false;
|
||||
}
|
||||
@@ -291,22 +361,26 @@ export class DeleteConnectionAction extends Action {
|
||||
}
|
||||
|
||||
public override async run(): Promise<void> {
|
||||
|
||||
const deleteConnectionConfirmationYes = localize('deleteConnectionConfirmationYes', "Yes");
|
||||
const deleteConnectionConfirmationNo = localize('deleteConnectionConfirmationNo', "No");
|
||||
|
||||
if (this.element instanceof ConnectionProfile) {
|
||||
const name = this.element.connectionName || this.element.serverName;
|
||||
const modalResult = await this._dialogService.show(Severity.Warning, localize('deleteConnectionConfirmation', "Are you sure you want to delete connection '{0}'?", name),
|
||||
[deleteConnectionConfirmationYes, deleteConnectionConfirmationNo]);
|
||||
if (modalResult.choice === 0) {
|
||||
|
||||
// {{SQL CARBON TODO}} - check that the confirm dialog is same as before
|
||||
const result = await this._dialogService.confirm({
|
||||
type: Severity.Warning,
|
||||
message: localize('deleteConnectionConfirmation', "Are you sure you want to delete connection '{0}'?", name)
|
||||
});
|
||||
|
||||
if (result.confirmed) {
|
||||
await this._connectionManagementService.deleteConnection(this.element);
|
||||
status(localize('connectionDeleted', "Connection {0} deleted", name));
|
||||
}
|
||||
} else if (this.element instanceof ConnectionProfileGroup) {
|
||||
const modalResult = await this._dialogService.show(Severity.Warning, localize('deleteConnectionGroupConfirmation', "Are you sure you want to delete connection group '{0}'?", this.element.name),
|
||||
[deleteConnectionConfirmationYes, deleteConnectionConfirmationNo]);
|
||||
if (modalResult.choice === 0) {
|
||||
const result = await this._dialogService.confirm({
|
||||
type: Severity.Warning,
|
||||
message: localize('deleteConnectionGroupConfirmation', "Are you sure you want to delete connection group '{0}'?", this.element.name)
|
||||
});
|
||||
|
||||
if (result.confirmed) {
|
||||
await this._connectionManagementService.deleteConnectionGroup(this.element);
|
||||
status(localize('connectionGroupDeleted', "Connection group {0} deleted", this.element.name));
|
||||
}
|
||||
@@ -333,7 +407,7 @@ export class FilterChildrenAction extends Action {
|
||||
}
|
||||
|
||||
function getFilterActionIconClass(node: TreeNode): string {
|
||||
return node.filters.length > 0 ? Codicon.filterFilled.classNames : Codicon.filter.classNames;
|
||||
return node.filters.length > 0 ? ThemeIcon.asClassName(Codicon.filterFilled) : ThemeIcon.asClassName(Codicon.filter);
|
||||
}
|
||||
|
||||
export class RemoveFilterAction extends Action {
|
||||
@@ -390,7 +464,7 @@ export class DeleteRecentConnectionsAction extends Action {
|
||||
private _connectionProfile: ConnectionProfile,
|
||||
@IConnectionManagementService private _connectionManagementService: IConnectionManagementService
|
||||
) {
|
||||
super(id, label, Codicon.trash.classNames);
|
||||
super(id, label, ThemeIcon.asClassName(Codicon.trash));
|
||||
}
|
||||
|
||||
public override async run(): Promise<void> {
|
||||
|
||||
@@ -15,7 +15,7 @@ import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { localize } from 'vs/nls';
|
||||
import { attachModalDialogStyler } from 'sql/workbench/common/styler';
|
||||
import { attachButtonStyler, attachInputBoxStyler, attachSelectBoxStyler } from 'vs/platform/theme/common/styler';
|
||||
//import { attachButtonStyler, attachInputBoxStyler, attachSelectBoxStyler } from 'vs/platform/theme/common/styler';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import * as azdata from 'azdata';
|
||||
import { InputBox } from 'sql/base/browser/ui/inputBox/inputBox';
|
||||
@@ -40,7 +40,6 @@ import { status } from 'vs/base/browser/ui/aria/aria';
|
||||
import { IErrorMessageService } from 'sql/platform/errorMessage/common/errorMessageService';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
|
||||
// strings for filter dialog
|
||||
const OkButtonText = localize('objectExplorer.okButtonText', "OK");
|
||||
const CancelButtonText = localize('objectExplorer.cancelButtonText', "Cancel");
|
||||
@@ -83,8 +82,6 @@ const CLEAR_COLUMN_ID = 'clear';
|
||||
export class FilterDialog extends Modal {
|
||||
|
||||
private _okButton?: Button;
|
||||
private _cancelButton?: Button;
|
||||
private _clearAllButton?: Button;
|
||||
|
||||
private filterTable: Table<Slick.SlickData>;
|
||||
private _tableCellEditorFactory: TableCellEditorFactory;
|
||||
@@ -143,11 +140,8 @@ export class FilterDialog extends Modal {
|
||||
this.titleIconClassName = TitleIconClass;
|
||||
this._register(attachModalDialogStyler(this, this._themeService));
|
||||
this._okButton = this.addFooterButton(OkButtonText, async () => { await this.onApply() });
|
||||
this._cancelButton = this.addFooterButton(CancelButtonText, () => { this.onClose() });
|
||||
this._clearAllButton = this.addFooterButton(ClearAllButtonText, () => { this.onClearAll() }, 'left', true);
|
||||
this._register(attachButtonStyler(this._okButton, this._themeService));
|
||||
this._register(attachButtonStyler(this._cancelButton, this._themeService));
|
||||
this._register(attachButtonStyler(this._clearAllButton, this._themeService));
|
||||
this.addFooterButton(CancelButtonText, () => { this.onClose() });
|
||||
this.addFooterButton(ClearAllButtonText, () => { this.onClearAll() }, 'left', true);
|
||||
}
|
||||
|
||||
protected renderBody(container: HTMLElement): void {
|
||||
@@ -684,13 +678,13 @@ export class FilterDialog extends Modal {
|
||||
}
|
||||
|
||||
private styleComponent(component: TabbedPanel | InputBox | Checkbox | Table<Slick.SlickData> | SelectBox | Button | Dropdown): void {
|
||||
if (component instanceof InputBox) {
|
||||
this._register(attachInputBoxStyler(component, this._themeService));
|
||||
} else if (component instanceof SelectBox) {
|
||||
this._register(attachSelectBoxStyler(component, this._themeService));
|
||||
} else if (component instanceof Table) {
|
||||
this._register(attachTableStyler(component, this._themeService));
|
||||
}
|
||||
// if (component instanceof InputBox) {
|
||||
// this._register(attachInputBoxStyler(component, this._themeService));
|
||||
// } else if (component instanceof SelectBox) {
|
||||
// this._register(attachSelectBoxStyler(component, this._themeService));
|
||||
// } else if (component instanceof Table) {
|
||||
// this._register(attachTableStyler(component, this._themeService));
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
|
||||
import {
|
||||
DisconnectConnectionAction, EditConnectionAction,
|
||||
DeleteConnectionAction, RefreshAction, EditServerGroupAction, AddServerAction, FilterChildrenAction, RemoveFilterAction, DeleteRecentConnectionsAction
|
||||
DeleteConnectionAction, RefreshAction, EditServerGroupAction, FilterChildrenAction, RemoveFilterAction, DeleteRecentConnectionsAction, AddServerAction1
|
||||
} from 'sql/workbench/services/objectExplorer/browser/connectionTreeAction';
|
||||
import { TreeNode } from 'sql/workbench/services/objectExplorer/common/treeNode';
|
||||
import { NodeType } from 'sql/workbench/services/objectExplorer/common/nodeType';
|
||||
@@ -225,7 +225,7 @@ export class ServerTreeActionProvider {
|
||||
private getConnectionProfileGroupActions(element: ConnectionProfileGroup): IAction[] {
|
||||
// TODO: Should look into using the MenuRegistry for this
|
||||
return [
|
||||
this._instantiationService.createInstance(AddServerAction, AddServerAction.ID, AddServerAction.LABEL),
|
||||
this._instantiationService.createInstance(AddServerAction1, AddServerAction1.ID, AddServerAction1.LABEL),
|
||||
this._instantiationService.createInstance(EditServerGroupAction, EditServerGroupAction.ID, EditServerGroupAction.LABEL, element),
|
||||
this._instantiationService.createInstance(DeleteConnectionAction, DeleteConnectionAction.ID, DeleteConnectionAction.DELETE_CONNECTION_GROUP_LABEL, element)
|
||||
];
|
||||
|
||||
@@ -231,11 +231,13 @@ export class ServerTreeRenderer implements IRenderer {
|
||||
|
||||
let iconPath = this.getIconPath(connection);
|
||||
this.renderServerIcon(templateData.icon, iconPath, isConnected);
|
||||
const treeNode = this._objectExplorerService.getObjectExplorerNode(connection);
|
||||
let label = treeNode?.filters?.length > 0 ? getLabelWithFilteredSuffix(connection.title) : connection.title;
|
||||
templateData.label.textContent = label;
|
||||
templateData.root.title = treeNode?.filters?.length > 0 ? getLabelWithFilteredSuffix(connection.title) : connection.serverInfo;
|
||||
templateData.connectionProfile = connection;
|
||||
if (this._objectExplorerService) {
|
||||
const treeNode = this._objectExplorerService.getObjectExplorerNode(connection);
|
||||
let label = treeNode?.filters?.length > 0 ? getLabelWithFilteredSuffix(connection.title) : connection.title;
|
||||
templateData.label.textContent = label;
|
||||
templateData.root.title = treeNode?.filters?.length > 0 ? getLabelWithFilteredSuffix(connection.title) : connection.serverInfo;
|
||||
templateData.connectionProfile = connection;
|
||||
}
|
||||
}
|
||||
|
||||
private renderConnectionProfileGroup(connectionProfileGroup: ConnectionProfileGroup, templateData: IConnectionProfileGroupTemplateData): void {
|
||||
|
||||
@@ -18,7 +18,7 @@ import { Tree } from 'sql/base/parts/tree/browser/treeImpl';
|
||||
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { IDataSource, ITree, IRenderer } from 'sql/base/parts/tree/browser/tree';
|
||||
import { attachListStyler } from 'vs/platform/theme/common/styler';
|
||||
import { attachListStyler } from 'sql/platform/theme/common/vsstyler';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
@@ -27,6 +27,7 @@ import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import { attachModalDialogStyler } from 'sql/workbench/common/styler';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfiguration';
|
||||
import { defaultSelectBoxStyles } from 'vs/platform/theme/browser/defaultStyles';
|
||||
|
||||
class EventItem {
|
||||
|
||||
@@ -319,7 +320,7 @@ export class ProfilerColumnEditorDialog extends Modal {
|
||||
|
||||
protected renderBody(container: HTMLElement): void {
|
||||
const body = DOM.append(container, DOM.$(''));
|
||||
this._selectBox = new SelectBox(this._options, 0, this._contextViewService);
|
||||
this._selectBox = new SelectBox(this._options, 0, this._contextViewService, defaultSelectBoxStyles);
|
||||
this._selectBox.render(body);
|
||||
this._register(this._selectBox.onDidSelect(e => {
|
||||
this._element!.changeSort(e.index === 0 ? 'event' : 'column');
|
||||
|
||||
@@ -16,7 +16,7 @@ import { localize } from 'vs/nls';
|
||||
import { ProfilerInput } from 'sql/workbench/browser/editor/profiler/profilerInput';
|
||||
import { InputBox } from 'sql/base/browser/ui/inputBox/inputBox';
|
||||
import { SelectBox } from 'sql/base/browser/ui/selectBox/selectBox';
|
||||
import { attachButtonStyler, attachSelectBoxStyler } from 'vs/platform/theme/common/styler';
|
||||
import { attachSelectBoxStyler } from 'sql/platform/theme/common/vsstyler';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { generateUuid } from 'vs/base/common/uuid';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
@@ -29,6 +29,7 @@ import { attachModalDialogStyler } from 'sql/workbench/common/styler';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfiguration';
|
||||
import * as aria from 'vs/base/browser/ui/aria/aria';
|
||||
import { defaultInputBoxStyles } from 'vs/platform/theme/browser/defaultStyles';
|
||||
|
||||
const ClearText: string = localize('profilerFilterDialog.clear', "Clear all");
|
||||
const ApplyText: string = localize('profilerFilterDialog.apply', "Apply");
|
||||
@@ -109,11 +110,11 @@ export class ProfilerFilterDialog extends Modal {
|
||||
this._applyButton = this.addFooterButton(ApplyText, () => this.filterSession(), 'right', true);
|
||||
this._okButton = this.addFooterButton(OkText, () => this.handleOkButtonClick());
|
||||
this._cancelButton = this.addFooterButton(CancelText, () => this.hide('cancel'), 'right', true);
|
||||
this._register(attachButtonStyler(this._okButton, this._themeService));
|
||||
this._register(attachButtonStyler(this._cancelButton, this._themeService));
|
||||
this._register(attachButtonStyler(this._applyButton, this._themeService));
|
||||
this._register(attachButtonStyler(this._saveFilterButton, this._themeService));
|
||||
this._register(attachButtonStyler(this._loadFilterButton, this._themeService));
|
||||
this._register(this._okButton);
|
||||
this._register(this._cancelButton);
|
||||
this._register(this._applyButton);
|
||||
this._register(this._saveFilterButton);
|
||||
this._register(this._loadFilterButton);
|
||||
}
|
||||
|
||||
protected renderBody(container: HTMLElement) {
|
||||
@@ -246,7 +247,10 @@ export class ProfilerFilterDialog extends Modal {
|
||||
|
||||
const operatorDropDown = this.createSelectBox(DOM.append(row, DOM.$('td')), Operators, Operators[0], OperatorText);
|
||||
|
||||
const valueText = new InputBox(DOM.append(row, DOM.$('td')), this.contextViewService, { ariaLabel: ValueText });
|
||||
const valueText = new InputBox(DOM.append(row, DOM.$('td')), this.contextViewService, {
|
||||
ariaLabel: ValueText,
|
||||
inputBoxStyles: defaultInputBoxStyles
|
||||
});
|
||||
this._register(attachInputBoxStyler(valueText, this._themeService));
|
||||
|
||||
const removeCell = DOM.append(row, DOM.$('td'));
|
||||
|
||||
@@ -10,9 +10,8 @@ import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { localize } from 'vs/nls';
|
||||
import { buttonBackground } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { attachButtonStyler, attachInputBoxStyler } from 'vs/platform/theme/common/styler';
|
||||
import { attachInputBoxStyler } from 'sql/platform/theme/common/vsstyler';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { IThemeService, IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
@@ -31,6 +30,7 @@ import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import { attachModalDialogStyler } from 'sql/workbench/common/styler';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfiguration';
|
||||
import { defaultInputBoxStyles } from 'vs/platform/theme/browser/defaultStyles';
|
||||
|
||||
// TODO: Make the help link 1) extensible (01/08/2018, https://github.com/Microsoft/azuredatastudio/issues/450)
|
||||
// in case that other non-Azure sign in is to be used
|
||||
@@ -116,7 +116,7 @@ export class FirewallRuleDialog extends Modal {
|
||||
super.render();
|
||||
attachModalDialogStyler(this, this._themeService);
|
||||
this.backButton!.onDidClick(() => this.cancel());
|
||||
this._register(attachButtonStyler(this.backButton!, this._themeService, { buttonBackground: SIDE_BAR_BACKGROUND, buttonHoverBackground: SIDE_BAR_BACKGROUND }));
|
||||
this._register(this.backButton!);
|
||||
this._createButton = this.addFooterButton(LocalizedStrings.OK, () => this.createFirewallRule());
|
||||
this._closeButton = this.addFooterButton(LocalizedStrings.Cancel, () => this.cancel(), 'right', true);
|
||||
this.registerListeners();
|
||||
@@ -139,7 +139,8 @@ export class FirewallRuleDialog extends Modal {
|
||||
const descInputContainer = DOM.append(descriptionDiv, DOM.$('.dialog-input-section'));
|
||||
DOM.append(descInputContainer, DOM.$('.dialog-label')).innerText = LocalizedStrings.RuleName;
|
||||
this._ruleNameInpuBox = new InputBox(DOM.append(descInputContainer, DOM.$('.dialog-input')), this._contextViewService, {
|
||||
ariaLabel: LocalizedStrings.RuleName
|
||||
ariaLabel: LocalizedStrings.RuleName,
|
||||
inputBoxStyles: defaultInputBoxStyles
|
||||
});
|
||||
|
||||
// Single IP Address radio button
|
||||
@@ -169,12 +170,14 @@ export class FirewallRuleDialog extends Modal {
|
||||
|
||||
DOM.append(inputContainer, DOM.$('.dialog-label')).innerText = LocalizedStrings.FROM;
|
||||
this._fromRangeinputBox = new InputBox(DOM.append(inputContainer, DOM.$('.dialog-input')), this._contextViewService, {
|
||||
ariaLabel: LocalizedStrings.FROM
|
||||
ariaLabel: LocalizedStrings.FROM,
|
||||
inputBoxStyles: defaultInputBoxStyles
|
||||
});
|
||||
|
||||
DOM.append(inputContainer, DOM.$('.dialog-label')).innerText = LocalizedStrings.TO;
|
||||
this._toRangeinputBox = new InputBox(DOM.append(inputContainer, DOM.$('.dialog-input')), this._contextViewService, {
|
||||
ariaLabel: LocalizedStrings.TO
|
||||
ariaLabel: LocalizedStrings.TO,
|
||||
inputBoxStyles: defaultInputBoxStyles
|
||||
});
|
||||
|
||||
// Register events
|
||||
@@ -261,8 +264,8 @@ export class FirewallRuleDialog extends Modal {
|
||||
|
||||
private registerListeners(): void {
|
||||
// Theme styler
|
||||
this._register(attachButtonStyler(this._createButton!, this._themeService));
|
||||
this._register(attachButtonStyler(this._closeButton!, this._themeService));
|
||||
this._register(this._createButton!);
|
||||
this._register(this._closeButton!);
|
||||
this._register(attachInputBoxStyler(this._ruleNameInpuBox!, this._themeService));
|
||||
this._register(attachInputBoxStyler(this._fromRangeinputBox!, this._themeService));
|
||||
this._register(attachInputBoxStyler(this._toRangeinputBox!, this._themeService));
|
||||
|
||||
@@ -30,7 +30,7 @@ import { Table } from 'sql/base/browser/ui/table/table';
|
||||
import { TableDataView } from 'sql/base/browser/ui/table/tableDataView';
|
||||
import * as DialogHelper from 'sql/workbench/browser/modal/dialogHelper';
|
||||
import { HideReason, Modal } from 'sql/workbench/browser/modal/modal';
|
||||
import { attachTableStyler, attachInputBoxStyler, attachSelectBoxStyler, attachEditableDropdownStyler, attachCheckboxStyler } from 'sql/platform/theme/common/styler';
|
||||
import { attachTableStyler, attachInputBoxStyler, attachSelectBoxStyler, attachEditableDropdownStyler } from 'sql/platform/theme/common/styler';
|
||||
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||
import { RestoreViewModel, RestoreOptionParam, SouceDatabaseNamesParam } from 'sql/workbench/services/restore/browser/restoreViewModel';
|
||||
import * as FileValidationConstants from 'sql/workbench/services/fileBrowser/common/fileValidationServiceConstants';
|
||||
@@ -43,7 +43,6 @@ import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import { attachModalDialogStyler, attachTabbedPanelStyler } from 'sql/workbench/common/styler';
|
||||
import { fileFiltersSet } from 'sql/workbench/services/restore/common/constants';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
import { attachButtonStyler } from 'vs/platform/theme/common/styler';
|
||||
import { Dropdown } from 'sql/base/browser/ui/editableDropdown/browser/dropdown';
|
||||
import { IBackupRestoreUrlBrowserDialogService } from 'sql/workbench/services/backupRestoreUrlBrowser/common/urlBrowserDialogService';
|
||||
import { MediaDeviceType } from 'sql/workbench/contrib/backup/common/constants';
|
||||
@@ -51,6 +50,8 @@ import { ITextResourcePropertiesService } from 'vs/editor/common/services/textRe
|
||||
import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';
|
||||
import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
|
||||
import { IComponentContextService } from 'sql/workbench/services/componentContext/browser/componentContextService';
|
||||
import { defaultButtonStyles, defaultInputBoxStyles } from 'vs/platform/theme/browser/defaultStyles';
|
||||
import { defaultCheckboxStyles } from 'sql/platform/theme/browser/defaultStyles';
|
||||
|
||||
interface FileListElement {
|
||||
logicalFileName: string;
|
||||
@@ -202,7 +203,8 @@ export class RestoreDialog extends Modal {
|
||||
validation: (value: string) => !value ? ({ type: MessageType.ERROR, content: urlErrorMessage }) : null
|
||||
},
|
||||
placeholder: localize('enterBackupUrl', "Please enter URL"),
|
||||
ariaLabel: LocalizedStrings.BACKURL
|
||||
ariaLabel: LocalizedStrings.BACKURL,
|
||||
inputBoxStyles: defaultInputBoxStyles
|
||||
};
|
||||
const urlInputContainer = DOM.append(this._restoreFromUrlElement, DOM.$('.dialog-input-section'));
|
||||
DOM.append(urlInputContainer, DOM.$('.dialog-label')).innerText = LocalizedStrings.BACKURL;
|
||||
@@ -213,7 +215,7 @@ export class RestoreDialog extends Modal {
|
||||
DOM.append(urlBrowseContainer, DOM.$('.dialog-label')).innerText = '';
|
||||
|
||||
let browseLabel = localize('restoreDialog.browse', "Browse");
|
||||
this._browseUrlButton = this._register(new Button(DOM.append(urlBrowseContainer, DOM.$('.file-browser')), { secondary: true }));
|
||||
this._browseUrlButton = this._register(new Button(DOM.append(urlBrowseContainer, DOM.$('.file-browser')), { secondary: true, ...defaultButtonStyles }));
|
||||
this._browseUrlButton.label = browseLabel;
|
||||
this._browseUrlButton.setWidth('50px');
|
||||
|
||||
@@ -226,14 +228,15 @@ export class RestoreDialog extends Modal {
|
||||
validation: (value: string) => !value ? ({ type: MessageType.ERROR, content: errorMessage }) : null
|
||||
},
|
||||
placeholder: localize('multipleBackupFilePath', "Please enter one or more file paths separated by commas"),
|
||||
ariaLabel: LocalizedStrings.BACKFILEPATH
|
||||
ariaLabel: LocalizedStrings.BACKFILEPATH,
|
||||
inputBoxStyles: defaultInputBoxStyles
|
||||
};
|
||||
const filePathInputContainer = DOM.append(this._restoreFromBackupFileElement, DOM.$('.dialog-input-section'));
|
||||
DOM.append(filePathInputContainer, DOM.$('.dialog-label')).innerText = LocalizedStrings.BACKFILEPATH;
|
||||
|
||||
this._filePathInputBox = this._register(new InputBox(DOM.append(filePathInputContainer, DOM.$('.dialog-input')), this._contextViewService, validationOptions));
|
||||
|
||||
this._browseFileButton = this._register(new Button(DOM.append(filePathInputContainer, DOM.$('.file-browser')), { secondary: true }));
|
||||
this._browseFileButton = this._register(new Button(DOM.append(filePathInputContainer, DOM.$('.file-browser')), { secondary: true, ...defaultButtonStyles }));
|
||||
this._browseFileButton.label = '...';
|
||||
|
||||
this._sourceDatabasesElement = DOM.$('.source-database-list');
|
||||
@@ -295,6 +298,7 @@ export class RestoreDialog extends Modal {
|
||||
validationOptions: {
|
||||
validation: (value: string) => this.viewModel.databases?.includes(value) ? ({ type: MessageType.ERROR, content: localize('restoreDialog.targetDatabaseAlreadyExists', "Target database already exists") }) : null
|
||||
},
|
||||
inputBoxStyles: defaultInputBoxStyles
|
||||
}));
|
||||
|
||||
const restoreToLabel = localize('restoreTo', "Restore to");
|
||||
@@ -550,12 +554,12 @@ export class RestoreDialog extends Modal {
|
||||
|
||||
private createCheckBoxHelper(container: HTMLElement, label: string, isChecked: boolean, onCheck: (viaKeyboard: boolean) => void): Checkbox {
|
||||
const checkbox = this._register(new Checkbox(DOM.append(container, DOM.$('.dialog-input-section')), {
|
||||
...defaultCheckboxStyles,
|
||||
label: label,
|
||||
checked: isChecked,
|
||||
onChange: onCheck,
|
||||
ariaLabel: label
|
||||
}));
|
||||
this._register(attachCheckboxStyler(checkbox, this._themeService));
|
||||
return checkbox;
|
||||
}
|
||||
|
||||
@@ -665,11 +669,11 @@ export class RestoreDialog extends Modal {
|
||||
this._register(attachInputBoxStyler(this._destinationRestoreToInputBox!, this._themeService));
|
||||
this._register(attachSelectBoxStyler(this._restoreFromSelectBox!, this._themeService));
|
||||
this._register(attachSelectBoxStyler(this._sourceDatabaseSelectBox!, this._themeService));
|
||||
this._register(attachButtonStyler(this._browseFileButton!, this._themeService));
|
||||
this._register(attachButtonStyler(this._browseUrlButton!, this._themeService));
|
||||
this._register(attachButtonStyler(this._scriptButton!, this._themeService));
|
||||
this._register(attachButtonStyler(this._restoreButton!, this._themeService));
|
||||
this._register(attachButtonStyler(this._closeButton!, this._themeService));
|
||||
this._register(this._browseFileButton!);
|
||||
this._register(this._browseUrlButton!);
|
||||
this._register(this._scriptButton!);
|
||||
this._register(this._restoreButton!);
|
||||
this._register(this._closeButton!);
|
||||
this._register(attachTableStyler(this._fileListTable!, this._themeService));
|
||||
this._register(attachTableStyler(this._restorePlanTable!, this._themeService));
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import * as DOM from 'vs/base/browser/dom';
|
||||
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { attachInputBoxStyler, attachToggleStyler, attachButtonStyler } from 'vs/platform/theme/common/styler';
|
||||
import { attachInputBoxStyler } from 'sql/platform/theme/common/vsstyler';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { localize } from 'vs/nls';
|
||||
@@ -24,13 +24,13 @@ import { ServerGroupViewModel } from 'sql/workbench/services/serverGroup/common/
|
||||
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||
import { IClipboardService } from 'sql/platform/clipboard/common/clipboardService';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { Color } from 'vs/base/common/color';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import { attachModalDialogStyler } from 'sql/workbench/common/styler';
|
||||
import { assertIsDefined, isUndefinedOrNull } from 'vs/base/common/types';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfiguration';
|
||||
import { RequiredIndicatorClassName } from 'sql/base/browser/ui/label/label';
|
||||
import { defaultInputBoxStyles } from 'vs/platform/theme/browser/defaultStyles';
|
||||
|
||||
interface IRenderedServerGroupDialog {
|
||||
groupNameInputBox: InputBox;
|
||||
@@ -104,7 +104,8 @@ export class ServerGroupDialog extends Modal {
|
||||
validation: (value: string) => !value && !this._skipGroupNameValidation ? ({ type: MessageType.ERROR, content: localize('MissingGroupNameError', "Group name is required.") }) : null
|
||||
},
|
||||
ariaLabel: serverGroupNameLabel,
|
||||
required: true
|
||||
required: true,
|
||||
inputBoxStyles: defaultInputBoxStyles
|
||||
});
|
||||
|
||||
// Connection Group Description
|
||||
@@ -112,7 +113,8 @@ export class ServerGroupDialog extends Modal {
|
||||
DOM.append(body, DOM.$('.dialog-label')).innerText = groupDescriptionLabel;
|
||||
|
||||
this._groupDescriptionInputBox = new InputBox(DOM.append(body, DOM.$('.input-divider')), this._contextViewService, {
|
||||
ariaLabel: groupDescriptionLabel
|
||||
ariaLabel: groupDescriptionLabel,
|
||||
inputBoxStyles: defaultInputBoxStyles
|
||||
});
|
||||
|
||||
// Connection Group Color
|
||||
@@ -176,8 +178,8 @@ export class ServerGroupDialog extends Modal {
|
||||
// Theme styler
|
||||
this._register(attachInputBoxStyler(renderedDialog.groupNameInputBox, this._themeService));
|
||||
this._register(attachInputBoxStyler(renderedDialog.groupDescriptionInputBox, this._themeService));
|
||||
this._register(attachButtonStyler(renderedDialog.addServerButton, this._themeService));
|
||||
this._register(attachButtonStyler(renderedDialog.closeButton, this._themeService));
|
||||
this._register(renderedDialog.addServerButton);
|
||||
this._register(renderedDialog.closeButton);
|
||||
|
||||
// handler for name change events
|
||||
this._register(renderedDialog.groupNameInputBox.onDidChange(groupName => {
|
||||
@@ -196,18 +198,12 @@ export class ServerGroupDialog extends Modal {
|
||||
|
||||
const colorBox = new Colorbox(container, {
|
||||
name: 'server-group-color',
|
||||
label: color
|
||||
color: color
|
||||
});
|
||||
|
||||
this._register(colorBox.onSelect((viaKeyboard) => {
|
||||
this.onSelectGroupColor(color);
|
||||
}));
|
||||
colorBox.style({
|
||||
backgroundColor: Color.fromHex(color)
|
||||
});
|
||||
|
||||
// Theme styler
|
||||
this._register(attachToggleStyler(colorBox, this._themeService));
|
||||
|
||||
// add the new colorbox to the color map
|
||||
this._colorColorBoxesMap[i] = { color, colorbox: colorBox };
|
||||
|
||||
@@ -11,7 +11,6 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { localize } from 'vs/nls';
|
||||
import { attachButtonStyler } from 'vs/platform/theme/common/styler';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
@@ -21,9 +20,9 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
||||
import { Mimes } from 'vs/base/common/mime';
|
||||
import { Checkbox } from 'sql/base/browser/ui/checkbox/checkbox';
|
||||
import * as azdata from 'azdata';
|
||||
import { attachCheckboxStyler } from 'sql/platform/theme/common/styler';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfiguration';
|
||||
import { MarkdownRenderer } from 'vs/editor/contrib/markdownRenderer/browser/markdownRenderer';
|
||||
import { defaultCheckboxStyles } from 'sql/platform/theme/browser/defaultStyles';
|
||||
|
||||
const OkText: string = localize('tableDesigner.UpdateDatabase', "Update Database");
|
||||
const CancelText: string = localize('tableDesigner.cancel', "Cancel");
|
||||
@@ -78,9 +77,9 @@ export class TableDesignerPublishDialog extends Modal {
|
||||
const requireConfirmation = this._report.requireConfirmation === true;
|
||||
this._okButton.enabled = !requireConfirmation;
|
||||
this._generateScriptButton.enabled = !requireConfirmation;
|
||||
this._register(attachButtonStyler(this._okButton, this._themeService));
|
||||
this._register(attachButtonStyler(this._generateScriptButton, this._themeService));
|
||||
this._register(attachButtonStyler(this._cancelButton, this._themeService));
|
||||
this._register(this._okButton);
|
||||
this._register(this._generateScriptButton);
|
||||
this._register(this._cancelButton);
|
||||
}
|
||||
|
||||
protected renderBody(container: HTMLElement) {
|
||||
@@ -96,6 +95,7 @@ export class TableDesignerPublishDialog extends Modal {
|
||||
if (this._report.requireConfirmation && this._report.confirmationText) {
|
||||
const checkboxContainer = DOM.append(body, DOM.$('div'));
|
||||
const checkbox = new Checkbox(checkboxContainer, {
|
||||
...defaultCheckboxStyles,
|
||||
label: this._report.confirmationText,
|
||||
checked: false
|
||||
});
|
||||
@@ -103,7 +103,6 @@ export class TableDesignerPublishDialog extends Modal {
|
||||
this._okButton.enabled = checked;
|
||||
this._generateScriptButton.enabled = checked;
|
||||
}));
|
||||
this._register(attachCheckboxStyler(checkbox, this._themeService));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ import { createCSSRule, asCSSUrl } from 'vs/base/browser/dom';
|
||||
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
|
||||
import { IdGenerator } from 'vs/base/common/idGenerator';
|
||||
import { ThemeIcon } from 'vs/platform/theme/common/themeService';
|
||||
import { ICommandAction } from 'vs/platform/action/common/action';
|
||||
import { ThemeIcon } from 'vs/base/common/themables';
|
||||
|
||||
const ids = new IdGenerator('task-icon-');
|
||||
|
||||
@@ -56,14 +56,15 @@ export const TaskRegistry: ITaskRegistry = new class implements ITaskRegistry {
|
||||
|
||||
getOrCreateTaskIconClassName(item: ICommandAction): string | undefined {
|
||||
let iconClass: string | undefined;
|
||||
let icon: any = item.icon;
|
||||
if (this.taskIdToIconClassNameMap.has(item.id)) {
|
||||
iconClass = this.taskIdToIconClassNameMap.get(item.id);
|
||||
} else if (ThemeIcon.isThemeIcon(item.icon)) {
|
||||
// TODO
|
||||
} else if (item.icon?.dark) { // at the very least we need a dark icon
|
||||
} else if (icon?.dark) { // at the very least we need a dark icon
|
||||
iconClass = ids.nextId();
|
||||
createCSSRule(`.codicon.${iconClass}, .hc-light .codicon.${iconClass}`, `background-image: ${asCSSUrl(item.icon.light || item.icon.dark)}`);
|
||||
createCSSRule(`.vs-dark .codicon.${iconClass}, .hc-black .codicon.${iconClass}`, `background-image: ${asCSSUrl(item.icon.dark)}`);
|
||||
createCSSRule(`.codicon.${iconClass}, .hc-light .codicon.${iconClass}`, `background-image: ${asCSSUrl(icon.light || icon.dark)}`);
|
||||
createCSSRule(`.vs-dark .codicon.${iconClass}, .hc-black .codicon.${iconClass}`, `background-image: ${asCSSUrl(icon.dark)}`);
|
||||
this.taskIdToIconClassNameMap.set(item.id, iconClass);
|
||||
}
|
||||
return iconClass;
|
||||
|
||||
@@ -151,37 +151,35 @@ export class TaskService implements ITaskService {
|
||||
|
||||
public beforeShutdown(): Promise<boolean> {
|
||||
const message = localize('InProgressWarning', "1 or more tasks are in progress. Are you sure you want to quit?");
|
||||
const options = [
|
||||
localize('taskService.yes', "Yes"),
|
||||
localize('taskService.no', "No")
|
||||
];
|
||||
|
||||
return new Promise<boolean>((resolve, reject) => {
|
||||
let numOfInprogressTasks = this.getNumberOfInProgressTasks();
|
||||
if (numOfInprogressTasks > 0) {
|
||||
this.dialogService.show(Severity.Warning, message, options).then(choice => {
|
||||
switch (choice.choice) {
|
||||
case 0:
|
||||
let timeout: any;
|
||||
let isTimeout = false;
|
||||
this.cancelAllTasks().then(() => {
|
||||
clearTimeout(timeout);
|
||||
if (!isTimeout) {
|
||||
resolve(false);
|
||||
}
|
||||
}, error => {
|
||||
clearTimeout(timeout);
|
||||
if (!isTimeout) {
|
||||
resolve(false);
|
||||
}
|
||||
});
|
||||
timeout = setTimeout(function () {
|
||||
isTimeout = true;
|
||||
this.dialogService.confirm({
|
||||
type: Severity.Warning,
|
||||
message: message,
|
||||
primaryButton: localize('taskService.yes', "Yes"),
|
||||
cancelButton: localize('taskService.no', "No")
|
||||
}).then(result => {
|
||||
if (result.confirmed) {
|
||||
let timeout: any;
|
||||
let isTimeout = false;
|
||||
this.cancelAllTasks().then(() => {
|
||||
clearTimeout(timeout);
|
||||
if (!isTimeout) {
|
||||
resolve(false);
|
||||
}, 2000);
|
||||
break;
|
||||
case 1:
|
||||
resolve(true);
|
||||
}
|
||||
}, error => {
|
||||
clearTimeout(timeout);
|
||||
if (!isTimeout) {
|
||||
resolve(false);
|
||||
}
|
||||
});
|
||||
timeout = setTimeout(function () {
|
||||
isTimeout = true;
|
||||
resolve(false);
|
||||
}, 2000);
|
||||
} else {
|
||||
resolve(true);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user