mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Adding filtering to group by schema and switching to using name from displayName in oe filters. (#23123)
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"downloadUrl": "https://github.com/Microsoft/sqltoolsservice/releases/download/{#version#}/microsoft.sqltools.servicelayer-{#fileName#}",
|
"downloadUrl": "https://github.com/Microsoft/sqltoolsservice/releases/download/{#version#}/microsoft.sqltools.servicelayer-{#fileName#}",
|
||||||
"version": "4.8.0.1",
|
"version": "4.8.0.5",
|
||||||
"downloadFileNames": {
|
"downloadFileNames": {
|
||||||
"Windows_86": "win-x86-net7.0.zip",
|
"Windows_86": "win-x86-net7.0.zip",
|
||||||
"Windows_64": "win-x64-net7.0.zip",
|
"Windows_64": "win-x64-net7.0.zip",
|
||||||
|
|||||||
2
src/sql/azdata.proposed.d.ts
vendored
2
src/sql/azdata.proposed.d.ts
vendored
@@ -1842,7 +1842,7 @@ declare module 'azdata' {
|
|||||||
/**
|
/**
|
||||||
* The name of the filter property
|
* The name of the filter property
|
||||||
*/
|
*/
|
||||||
displayName: string;
|
name: string;
|
||||||
/**
|
/**
|
||||||
* The operator of the filter property
|
* The operator of the filter property
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -625,7 +625,7 @@ export class ServerTreeView extends Disposable implements IServerTreeView {
|
|||||||
|
|
||||||
this._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.ObjectExplorer, TelemetryKeys.TelemetryAction.ObjectExplorerFilter)
|
this._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.ObjectExplorer, TelemetryKeys.TelemetryAction.ObjectExplorerFilter)
|
||||||
.withAdditionalProperties({
|
.withAdditionalProperties({
|
||||||
filterPropertyNames: JSON.stringify(filters.map(f => node.filterProperties.find(p => f.displayName === p.displayName)?.name)),
|
filterPropertyNames: JSON.stringify(filters.map(f => f.name)),
|
||||||
filterCount: filters.length,
|
filterCount: filters.length,
|
||||||
objectType: node.objectType
|
objectType: node.objectType
|
||||||
}).send();
|
}).send();
|
||||||
|
|||||||
@@ -290,11 +290,12 @@ export class FilterDialog extends Modal {
|
|||||||
this._appliedFilters = [];
|
this._appliedFilters = [];
|
||||||
}
|
}
|
||||||
this._properties.forEach((f, i) => {
|
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 filterOperators = this.getOperatorsForType(f.type);
|
||||||
const row: Slick.SlickData = {
|
const row: Slick.SlickData = {
|
||||||
property: {
|
property: {
|
||||||
value: f.displayName
|
value: f.displayName,
|
||||||
|
id: f.name
|
||||||
},
|
},
|
||||||
operator: {
|
operator: {
|
||||||
value: appliedFilter ? this.getFilterOperatorString(appliedFilter.operator) : filterOperators[0],
|
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]);
|
row.value.value = this.getStringValueForFilter(f, appliedFilter.value[0]);
|
||||||
const andRow: Slick.SlickData = {
|
const andRow: Slick.SlickData = {
|
||||||
property: {
|
property: {
|
||||||
value: ''
|
value: '',
|
||||||
|
id: ''
|
||||||
},
|
},
|
||||||
operator: {
|
operator: {
|
||||||
value: AND_SELECT_BOX,
|
value: AND_SELECT_BOX,
|
||||||
@@ -436,7 +438,7 @@ export class FilterDialog extends Modal {
|
|||||||
const row = tableData[i];
|
const row = tableData[i];
|
||||||
let filterProperty = this._properties[row.filterPropertyIndex]
|
let filterProperty = this._properties[row.filterPropertyIndex]
|
||||||
let filter: azdata.NodeFilter = {
|
let filter: azdata.NodeFilter = {
|
||||||
displayName: row.property.value,
|
name: row.property.id,
|
||||||
operator: this.getFilterOperatorEnum(row.operator.value),
|
operator: this.getFilterOperatorEnum(row.operator.value),
|
||||||
value: this.getFilterValue(filterProperty.type, row.value.value, filterProperty),
|
value: this.getFilterValue(filterProperty.type, row.value.value, filterProperty),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -749,7 +749,7 @@ export class ObjectExplorerService implements IObjectExplorerService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const children = expandResult.nodes.map(node => {
|
const children = expandResult.nodes.map(node => {
|
||||||
let treeNode;
|
let treeNode: TreeNode | undefined;
|
||||||
const cacheKey = this.getTreeNodeCacheKey(node);
|
const cacheKey = this.getTreeNodeCacheKey(node);
|
||||||
// In case of refresh, we want to update the existing node in the cache
|
// In case of refresh, we want to update the existing node in the cache
|
||||||
if (!refresh && sessionTreeNodeCache.has(cacheKey)) {
|
if (!refresh && sessionTreeNodeCache.has(cacheKey)) {
|
||||||
@@ -761,10 +761,16 @@ export class ObjectExplorerService implements IObjectExplorerService {
|
|||||||
|
|
||||||
const filterCacheKey = this.getTreeNodeCacheKey(treeNode);
|
const filterCacheKey = this.getTreeNodeCacheKey(treeNode);
|
||||||
const sessionFilterCache = this._nodeFilterCache.get(session.sessionId!);
|
const sessionFilterCache = this._nodeFilterCache.get(session.sessionId!);
|
||||||
// Making sure we retain the filters for the node.
|
// If we get the node without any filter properties, we want to clear the filters for the node.
|
||||||
if (sessionFilterCache?.has(filterCacheKey)) {
|
if (treeNode?.filterProperties?.length > 0) {
|
||||||
treeNode.filters = sessionFilterCache.get(filterCacheKey) ?? [];
|
// Making sure we retain the filters for the node.
|
||||||
|
if (sessionFilterCache?.has(filterCacheKey)) {
|
||||||
|
treeNode.filters = sessionFilterCache.get(filterCacheKey) ?? [];
|
||||||
|
} else {
|
||||||
|
treeNode.filters = [];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
sessionFilterCache.delete(filterCacheKey);
|
||||||
treeNode.filters = [];
|
treeNode.filters = [];
|
||||||
}
|
}
|
||||||
return treeNode;
|
return treeNode;
|
||||||
|
|||||||
Reference in New Issue
Block a user