Adding OE filtering interfaces. (#22738)

* Adding interfaces for tree filtering

* fixing type

* Adding enums in sqlhost

* Fixing comment

* Fixed filters lol

* Fixing some contract definitions

* Removing flag

* Update src/sql/azdata.proposed.d.ts

Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>

* Removing filters

* Removing filters2

* Fixing enum

* Fixing interface and enum names

* Fixing interface name

* Update src/sql/azdata.proposed.d.ts

Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>

* Removing type from filter

* Adding is null and is not null operators

* Fixing enums

* Update src/sql/azdata.proposed.d.ts

Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>

* Update src/sql/azdata.proposed.d.ts

Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>

* Update src/sql/azdata.proposed.d.ts

Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>

---------

Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>
This commit is contained in:
Aasim Khan
2023-04-27 13:15:11 -04:00
committed by GitHub
parent c4b19597b6
commit 9c68043137
3 changed files with 97 additions and 0 deletions

View File

@@ -605,6 +605,11 @@ declare module 'azdata' {
* Authentication token for the current session.
*/
securityToken?: accounts.AccountSecurityToken | undefined;
/**
* Filters to apply to the child nodes being returned
*/
filters?: NodeFilter[];
}
// End Object Explorer interfaces ----------------------------
@@ -1793,6 +1798,73 @@ declare module 'azdata' {
* The path of the parent node.
*/
parentNodePath: string;
/**
* Filterable properties that this node supports
*/
filterableProperties?: NodeFilterProperty[];
}
export interface NodeFilterProperty {
/**
* The name of the filter property displayed to the user
*/
displayName: string;
/**
* The type of the filter property
*/
type: NodeFilterPropertyDataType;
/**
* The description of the filter property
*/
description: string;
}
/**
* NodeFilterChoiceProperty is used to define the choices for the filter property if the type is choice
*/
export interface NodeFilterChoiceProperty extends NodeFilterProperty {
/**
* The list of choices for the filter property if the type is choice
*/
choices: string[];
}
export interface NodeFilter {
/**
* The name of the filter property
*/
name: string;
/**
* The operator of the filter property
*/
operator: NodeFilterOperator;
/**
* The applied values of the filter property
*/
value: string | string[] | number | boolean | undefined;
}
export enum NodeFilterPropertyDataType {
String = 0,
Number = 1,
Boolean = 2,
Date = 3,
Choice = 4
}
export enum NodeFilterOperator {
Equals = 0,
NotEquals = 1,
LessThan = 2,
LessThanOrEquals = 3,
GreaterThan = 4,
GreaterThanOrEquals = 5,
Between = 6,
NotBetween = 7,
Contains = 8,
NotContains = 9,
IsNull = 10,
IsNotNull = 11
}
export namespace window {

View File

@@ -657,6 +657,8 @@ export function createAdsApiFactory(accessor: ServicesAccessor): IAdsExtensionAp
FrequencyTypes: sqlExtHostTypes.FrequencyTypes,
FrequencySubDayTypes: sqlExtHostTypes.FrequencySubDayTypes,
FrequencyRelativeIntervals: sqlExtHostTypes.FrequencyRelativeIntervals,
NodeFilterPropertyDataType: sqlExtHostTypes.NodeFilterPropertyDataType,
NodeFilterOperator: sqlExtHostTypes.NodeFilterOperator,
window,
tasks,
dashboard,

View File

@@ -478,6 +478,29 @@ export enum AzureResource {
Custom = 12 // Handles custom resource URIs as received from server endpoint.
}
export enum NodeFilterPropertyDataType {
String = 0,
Number = 1,
Boolean = 2,
Date = 3,
Choice = 4
}
export enum NodeFilterOperator {
Equals = 0,
NotEquals = 1,
LessThan = 2,
LessThanOrEquals = 3,
GreaterThan = 4,
GreaterThanOrEquals = 5,
Between = 6,
NotBetween = 7,
Contains = 8,
NotContains = 9,
IsNull = 10,
IsNotNull = 11
}
export class TreeItem extends vsExtTypes.TreeItem {
payload?: azdata.IConnectionProfile;
providerHandle?: string;