ok button targetted fix (#9095)

This commit is contained in:
Amir Omidi
2020-02-07 17:17:58 -08:00
committed by GitHub
parent ba66305bb5
commit 6770bf877e
4 changed files with 48 additions and 17 deletions

View File

@@ -71,7 +71,19 @@ export function registerAzureResourceCommands(appContext: AppContext, tree: Azur
}; };
}).sort((a, b) => a.label.localeCompare(b.label)); }).sort((a, b) => a.label.localeCompare(b.label));
const selectedSubscriptionQuickPickItems = await window.showQuickPick(subscriptionQuickPickItems, { canPickMany: true }); const selectedQuickPickItems = subscriptionQuickPickItems.filter(s => s.picked);
const quickPick = window.createQuickPick<AzureResourceSubscriptionQuickPickItem>();
quickPick.ok = true;
quickPick.items = subscriptionQuickPickItems;
quickPick.canSelectMany = true;
quickPick.selectedItems = selectedQuickPickItems;
quickPick.show();
quickPick.onDidAccept(async event => {
quickPick.hide();
const selectedSubscriptionQuickPickItems = quickPick.selectedItems;
if (selectedSubscriptionQuickPickItems && selectedSubscriptionQuickPickItems.length > 0) { if (selectedSubscriptionQuickPickItems && selectedSubscriptionQuickPickItems.length > 0) {
await tree.refresh(node, false); await tree.refresh(node, false);
@@ -79,6 +91,7 @@ export function registerAzureResourceCommands(appContext: AppContext, tree: Azur
await subscriptionFilterService.saveSelectedSubscriptions(accountNode.account, selectedSubscriptions); await subscriptionFilterService.saveSelectedSubscriptions(accountNode.account, selectedSubscriptions);
} }
}); });
});
appContext.apiWrapper.registerCommand('azure.resource.refreshall', () => tree.notifyNodeChanged(undefined)); appContext.apiWrapper.registerCommand('azure.resource.refreshall', () => tree.notifyNodeChanged(undefined));

View File

@@ -54,6 +54,7 @@ export class AzureResourceSubscriptionFilterService implements IAzureResourceSub
filters.push(...selectedSubscriptionsCache[accountId].map((subcription) => `${accountId}/${subcription.id}/${subcription.name}`)); filters.push(...selectedSubscriptionsCache[accountId].map((subcription) => `${accountId}/${subcription.id}/${subcription.name}`));
} }
if (this._config) {
const resourceFilterConfig = this._config.inspect<string[]>(AzureResourceSubscriptionFilterService.filterConfigName); const resourceFilterConfig = this._config.inspect<string[]>(AzureResourceSubscriptionFilterService.filterConfigName);
let configTarget = ConfigurationTarget.Global; let configTarget = ConfigurationTarget.Global;
if (resourceFilterConfig) { if (resourceFilterConfig) {
@@ -68,6 +69,7 @@ export class AzureResourceSubscriptionFilterService implements IAzureResourceSub
await this._config.update(AzureResourceSubscriptionFilterService.filterConfigName, filters, configTarget); await this._config.update(AzureResourceSubscriptionFilterService.filterConfigName, filters, configTarget);
} }
}
private _config: WorkspaceConfiguration = undefined; private _config: WorkspaceConfiguration = undefined;
private _cacheService: IAzureResourceCacheService = undefined; private _cacheService: IAzureResourceCacheService = undefined;

3
src/vs/vscode.d.ts vendored
View File

@@ -7940,6 +7940,9 @@ declare module 'vscode' {
* An event signaling when the selected items have changed. * An event signaling when the selected items have changed.
*/ */
readonly onDidChangeSelection: Event<T[]>; readonly onDidChangeSelection: Event<T[]>;
// {SQL CARBON EDIT} Temporary change to allow setting the behavior of the QuickPick
ok: boolean;
} }
/** /**

View File

@@ -261,9 +261,22 @@ class ExtHostQuickInput implements QuickInput {
this._onDidChangeValueEmitter this._onDidChangeValueEmitter
]; ];
constructor(protected _proxy: MainThreadQuickOpenShape, protected _extensionId: ExtensionIdentifier, private _onDidDispose: () => void) { constructor(protected _proxy: MainThreadQuickOpenShape, protected _extensionId: ExtensionIdentifier, private _onDidDispose: () => void) {
} }
// {SQL CARBON EDIT} START Temporary change for ok button visibility
private _ok = false;
get ok() {
return this._ok;
}
set ok(ok: boolean) {
this._ok = ok;
this.update({ ok });
}
// {SQL CARBON EDIT} END Temporary change for ok button visibility
get title() { get title() {
return this._title; return this._title;
} }