Adding filtering to group by schema and switching to using name from displayName in oe filters. (#23123)

This commit is contained in:
Aasim Khan
2023-05-13 09:25:07 -07:00
committed by GitHub
parent 2beba9ac08
commit 787a66922f
5 changed files with 19 additions and 11 deletions

View File

@@ -290,11 +290,12 @@ export class FilterDialog extends Modal {
this._appliedFilters = [];
}
this._properties.forEach((f, i) => {
const appliedFilter = this._appliedFilters.find(filter => filter.displayName === f.displayName);
const appliedFilter = this._appliedFilters.find(filter => filter.name === f.name);
const filterOperators = this.getOperatorsForType(f.type);
const row: Slick.SlickData = {
property: {
value: f.displayName
value: f.displayName,
id: f.name
},
operator: {
value: appliedFilter ? this.getFilterOperatorString(appliedFilter.operator) : filterOperators[0],
@@ -312,7 +313,8 @@ export class FilterDialog extends Modal {
row.value.value = this.getStringValueForFilter(f, appliedFilter.value[0]);
const andRow: Slick.SlickData = {
property: {
value: ''
value: '',
id: ''
},
operator: {
value: AND_SELECT_BOX,
@@ -436,7 +438,7 @@ export class FilterDialog extends Modal {
const row = tableData[i];
let filterProperty = this._properties[row.filterPropertyIndex]
let filter: azdata.NodeFilter = {
displayName: row.property.value,
name: row.property.id,
operator: this.getFilterOperatorEnum(row.operator.value),
value: this.getFilterValue(filterProperty.type, row.value.value, filterProperty),
};

View File

@@ -749,7 +749,7 @@ export class ObjectExplorerService implements IObjectExplorerService {
}
}
const children = expandResult.nodes.map(node => {
let treeNode;
let treeNode: TreeNode | undefined;
const cacheKey = this.getTreeNodeCacheKey(node);
// In case of refresh, we want to update the existing node in the cache
if (!refresh && sessionTreeNodeCache.has(cacheKey)) {
@@ -761,10 +761,16 @@ export class ObjectExplorerService implements IObjectExplorerService {
const filterCacheKey = this.getTreeNodeCacheKey(treeNode);
const sessionFilterCache = this._nodeFilterCache.get(session.sessionId!);
// Making sure we retain the filters for the node.
if (sessionFilterCache?.has(filterCacheKey)) {
treeNode.filters = sessionFilterCache.get(filterCacheKey) ?? [];
// If we get the node without any filter properties, we want to clear the filters for the node.
if (treeNode?.filterProperties?.length > 0) {
// Making sure we retain the filters for the node.
if (sessionFilterCache?.has(filterCacheKey)) {
treeNode.filters = sessionFilterCache.get(filterCacheKey) ?? [];
} else {
treeNode.filters = [];
}
} else {
sessionFilterCache.delete(filterCacheKey);
treeNode.filters = [];
}
return treeNode;