mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-26 09:35:38 -05:00
Adding filtering dialog and action to OE (#22937)
* Adding init change * Adding filter cache in OE * Adding more filtering changes * Fixed stuff with dialog * Fixing filter * Adding support for connecitons * Fixed stuff * filtering * Fixing date * Filters * Removing is filtering supported * Removing contracts * Fixing filters * Fixing cache * Adding some accessibility changes * Reverting some more changes to pull in changes from the main * Adding comments * Fixing boolean operators * Fixing stuff * Fixing stuff * Fixing error handling and making dialog generic * Fixing more stuff * Making filter a generic dialog * adding erase icon * removing floating promises * Fixing compile issue * Adding support for choice filter with different and actual value. * Adding null checks * Adding durability type fix * Fixing filtering for providers that do not play well with empty filter properties
This commit is contained in:
@@ -47,6 +47,7 @@ import { ActionRunner } from 'vs/base/common/actions';
|
||||
import { IHostService } from 'vs/workbench/services/host/browser/host';
|
||||
import { USE_ASYNC_SERVER_TREE_CONFIG } from 'sql/workbench/contrib/objectExplorer/common/serverGroup.contribution';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { FilterDialog } from 'sql/workbench/services/objectExplorer/browser/filterDialog/filterDialog';
|
||||
|
||||
export const CONTEXT_SERVER_TREE_VIEW = new RawContextKey<ServerTreeViewView>('serverTreeView.view', ServerTreeViewView.all);
|
||||
export const CONTEXT_SERVER_TREE_HAS_CONNECTIONS = new RawContextKey<boolean>('serverTreeView.hasConnections', false);
|
||||
@@ -588,6 +589,43 @@ export class ServerTreeView extends Disposable implements IServerTreeView {
|
||||
}
|
||||
}
|
||||
|
||||
public async filterElementChildren(node: TreeNode): Promise<void> {
|
||||
await FilterDialog.getFiltersForProperties(
|
||||
node.filterProperties,
|
||||
localize('objectExplorer.filterDialogTitle', "(Preview) Filter Settings: {0}", node.getConnectionProfile().title),
|
||||
localize('objectExplorer.nodePath', "Node Path: {0}", node.nodePath),
|
||||
node.filters,
|
||||
async (filters) => {
|
||||
let errorListener;
|
||||
try {
|
||||
let expansionError = undefined;
|
||||
errorListener = this._objectExplorerService.onUpdateObjectExplorerNodes(e => {
|
||||
if (e.errorMessage) {
|
||||
expansionError = e.errorMessage;
|
||||
}
|
||||
errorListener.dispose();
|
||||
});
|
||||
node.forceRefresh = true;
|
||||
node.filters = filters || [];
|
||||
if (this._tree instanceof AsyncServerTree) {
|
||||
await this._tree.rerender(node);
|
||||
}
|
||||
await this.refreshElement(node);
|
||||
await this._tree.expand(node);
|
||||
if (expansionError) {
|
||||
throw new Error(expansionError);
|
||||
}
|
||||
} finally {
|
||||
if (errorListener) {
|
||||
errorListener.dispose();
|
||||
}
|
||||
}
|
||||
return;
|
||||
},
|
||||
this._instantiationService
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter connections based on view (recent/active)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user