mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-03 11:01:38 -05:00
ok button targetted fix (#9095)
This commit is contained in:
@@ -71,13 +71,26 @@ 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);
|
||||||
if (selectedSubscriptionQuickPickItems && selectedSubscriptionQuickPickItems.length > 0) {
|
|
||||||
await tree.refresh(node, false);
|
|
||||||
|
|
||||||
selectedSubscriptions = selectedSubscriptionQuickPickItems.map((subscriptionItem) => subscriptionItem.subscription);
|
const quickPick = window.createQuickPick<AzureResourceSubscriptionQuickPickItem>();
|
||||||
await subscriptionFilterService.saveSelectedSubscriptions(accountNode.account, selectedSubscriptions);
|
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));
|
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}`));
|
filters.push(...selectedSubscriptionsCache[accountId].map((subcription) => `${accountId}/${subcription.id}/${subcription.name}`));
|
||||||
}
|
}
|
||||||
|
|
||||||
const resourceFilterConfig = this._config.inspect<string[]>(AzureResourceSubscriptionFilterService.filterConfigName);
|
if (this._config) {
|
||||||
let configTarget = ConfigurationTarget.Global;
|
const resourceFilterConfig = this._config.inspect<string[]>(AzureResourceSubscriptionFilterService.filterConfigName);
|
||||||
if (resourceFilterConfig) {
|
let configTarget = ConfigurationTarget.Global;
|
||||||
if (resourceFilterConfig.workspaceFolderValue) {
|
if (resourceFilterConfig) {
|
||||||
configTarget = ConfigurationTarget.WorkspaceFolder;
|
if (resourceFilterConfig.workspaceFolderValue) {
|
||||||
} else if (resourceFilterConfig.workspaceValue) {
|
configTarget = ConfigurationTarget.WorkspaceFolder;
|
||||||
configTarget = ConfigurationTarget.Workspace;
|
} else if (resourceFilterConfig.workspaceValue) {
|
||||||
} else if (resourceFilterConfig.globalValue) {
|
configTarget = ConfigurationTarget.Workspace;
|
||||||
configTarget = ConfigurationTarget.Global;
|
} 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;
|
private _config: WorkspaceConfiguration = undefined;
|
||||||
|
|||||||
3
src/vs/vscode.d.ts
vendored
3
src/vs/vscode.d.ts
vendored
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user