mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-18 18:46:47 -05:00
ok button target fix (#9561)
This commit is contained in:
@@ -149,13 +149,26 @@ export function registerAzureResourceCommands(appContext: AppContext, tree: Azur
|
||||
};
|
||||
}).sort((a, b) => a.label.localeCompare(b.label));
|
||||
|
||||
const selectedSubscriptionQuickPickItems = await window.showQuickPick(subscriptionQuickPickItems, { canPickMany: true });
|
||||
if (selectedSubscriptionQuickPickItems && selectedSubscriptionQuickPickItems.length > 0) {
|
||||
await tree.refresh(node, false);
|
||||
const selectedQuickPickItems = subscriptionQuickPickItems.filter(s => s.picked);
|
||||
|
||||
selectedSubscriptions = selectedSubscriptionQuickPickItems.map((subscriptionItem) => subscriptionItem.subscription);
|
||||
await subscriptionFilterService.saveSelectedSubscriptions(accountNode.account, selectedSubscriptions);
|
||||
}
|
||||
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) {
|
||||
await tree.refresh(node, false);
|
||||
|
||||
selectedSubscriptions = selectedSubscriptionQuickPickItems.map((subscriptionItem) => subscriptionItem.subscription);
|
||||
await subscriptionFilterService.saveSelectedSubscriptions(accountNode.account, selectedSubscriptions);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
appContext.apiWrapper.registerCommand('azure.resource.refreshall', () => tree.notifyNodeChanged(undefined));
|
||||
|
||||
@@ -54,19 +54,21 @@ export class AzureResourceSubscriptionFilterService implements IAzureResourceSub
|
||||
filters.push(...selectedSubscriptionsCache[accountId].map((subcription) => `${accountId}/${subcription.id}/${subcription.name}`));
|
||||
}
|
||||
|
||||
const resourceFilterConfig = this._config.inspect<string[]>(AzureResourceSubscriptionFilterService.filterConfigName);
|
||||
let configTarget = ConfigurationTarget.Global;
|
||||
if (resourceFilterConfig) {
|
||||
if (resourceFilterConfig.workspaceFolderValue) {
|
||||
configTarget = ConfigurationTarget.WorkspaceFolder;
|
||||
} else if (resourceFilterConfig.workspaceValue) {
|
||||
configTarget = ConfigurationTarget.Workspace;
|
||||
} else if (resourceFilterConfig.globalValue) {
|
||||
configTarget = ConfigurationTarget.Global;
|
||||
if (this._config) {
|
||||
const resourceFilterConfig = this._config.inspect<string[]>(AzureResourceSubscriptionFilterService.filterConfigName);
|
||||
let configTarget = ConfigurationTarget.Global;
|
||||
if (resourceFilterConfig) {
|
||||
if (resourceFilterConfig.workspaceFolderValue) {
|
||||
configTarget = ConfigurationTarget.WorkspaceFolder;
|
||||
} else if (resourceFilterConfig.workspaceValue) {
|
||||
configTarget = ConfigurationTarget.Workspace;
|
||||
} else if (resourceFilterConfig.globalValue) {
|
||||
configTarget = ConfigurationTarget.Global;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
await this._config.update(AzureResourceSubscriptionFilterService.filterConfigName, filters, configTarget);
|
||||
await this._config.update(AzureResourceSubscriptionFilterService.filterConfigName, filters, configTarget);
|
||||
}
|
||||
}
|
||||
|
||||
private _config: WorkspaceConfiguration = undefined;
|
||||
|
||||
3
src/vs/vscode.d.ts
vendored
3
src/vs/vscode.d.ts
vendored
@@ -8096,6 +8096,9 @@ declare module 'vscode' {
|
||||
* An event signaling when the selected items have changed.
|
||||
*/
|
||||
readonly onDidChangeSelection: Event<T[]>;
|
||||
|
||||
// {SQL CARBON EDIT} Allow setting the behavior of the QuickPick
|
||||
ok: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -261,9 +261,22 @@ class ExtHostQuickInput implements QuickInput {
|
||||
this._onDidChangeValueEmitter
|
||||
];
|
||||
|
||||
|
||||
constructor(protected _proxy: MainThreadQuickOpenShape, protected _extensionId: ExtensionIdentifier, private _onDidDispose: () => void) {
|
||||
}
|
||||
|
||||
// {SQL CARBON EDIT} START 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 ok button visibility
|
||||
|
||||
get title() {
|
||||
return this._title;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user